Changes the storage capacity of the project.
PATCH /project/:id/storage/size
| Parameter | Type | Description |
|---|
id | string | Project ID (ObjectId) |
| Header | Required | Description |
|---|
x-api-key | Yes | Project API Key |
x-organization-id | Yes | Active project organization |
Content-Type: application/json | Yes | Required when updating storage size |
| Field | Type | Required | Description |
|---|
size | number | Yes | Storage size in GB (minimum 1, maximum 250) |
{
"status": "success",
"message": "storage size updated with success"
}
| Status | Code | When it happens |
|---|
409 | STORAGE_UPDATE_NOT_ALLOWED_FOR_CONTRACT | The current payment model does not allow storage changes at this time |
409 | STORAGE_SIZE_CANNOT_DECREASE | The new capacity is lower than or equal to the current capacity |
Returns information about the current storage usage of the project.
GET /project/:id/storage/usage
| Parameter | Type | Description |
|---|
id | string | Project ID (ObjectId) |
{
"status": "success",
"message": "get volume usage with success",
"data": {
"used": "5Gi",
"capacity": "10Gi",
"replica_count": 1
}
}
curl -X PATCH "https://api.zenifra.com/v1/project/507f1f77bcf86cd799439011/storage/size" \
-H "x-api-key: your-api-key" \
-H "x-organization-id: your-organization-id" \
-H "Content-Type: application/json" \
-d '{"size": 20}'
curl -X GET "https://api.zenifra.com/v1/project/507f1f77bcf86cd799439011/storage/usage" \
-H "x-api-key: your-api-key" \
-H "x-organization-id: your-organization-id"
import requests
API_KEY = "your-api-key"
ORGANIZATION_ID = "your-organization-id"
PROJECT_ID = "507f1f77bcf86cd799439011"
headers = {"x-api-key": API_KEY, "x-organization-id": ORGANIZATION_ID}
# Update storage size
requests.patch(
f"https://api.zenifra.com/v1/project/{PROJECT_ID}/storage/size",
headers=headers,
json={"size": 20}
)
# Get storage usage
usage = requests.get(
f"https://api.zenifra.com/v1/project/{PROJECT_ID}/storage/usage",
headers=headers
).json()
print(usage)
- Minimum: 1 GB
- Maximum: 250 GB
- For hourly payment models, storage can be increased at any time
- Storage cannot be reduced
- Additional cost will be calculated proportionally
- For monthly or yearly contracts, there may be restrictions on changes