Skip to main content

Update Volume

Update a volume's configuration, including size and mount path.

Endpoint

PUT /{envId}/volume/{id}

Authentication

Required: Yes (Session or Bearer Token with 2FA)

Path Parameters

ParameterTypeRequiredDescription
envIdstring (UUID)YesEnvironment ID containing the volume
idstring (UUID)YesVolume ID to update

Request Body

{
"name": "postgres-data-updated",
"resourceRequests": {
"storage": "20GB"
},
"attachedAppsRefs": []
}

Request Fields

FieldTypeRequiredDescription
namestringYesVolume name (must be unique in environment)
resourceRequests.storagestringYesStorage size (can only increase, not decrease)
attachedAppsRefsarrayNoArray of application IDs to attach volume to

Response

Success Response (200 OK)

{
"id": "vol-550e8400-e29b-41d4-a716-446655440000",
"name": "postgres-data-updated",
"envIdRef": "660e8400-e29b-41d4-a716-446655440001",
"companyIdRef": "770e8400-e29b-41d4-a716-446655440002",
"size": 20480,
"mountPath": "/var/lib/postgresql/data",
"isDeleted": false,
"createdBy": "user-123",
"modifiedBy": "user-456",
"version": 2
}

Error Responses

Status CodeDescription
400Bad Request - Invalid configuration or attempting to decrease size
401Unauthorized - Invalid or missing authentication
403Forbidden - User doesn't have access to this volume
404Not Found - Volume or environment doesn't exist
500Internal Server Error

Examples

cURL

curl -X PUT "https://api.thevenin.cloud/environments/{envId}/volume/{volumeId}" \
-H "Authorization: Bearer tvn_your_api_token_here" \
-H "Content-Type: application/json" \
-d '{
"name": "postgres-data-updated",
"resourceRequests": {
"storage": "20GB"
},
"attachedAppsRefs": []
}'

Notes

  • Storage size can only be increased, not decreased
  • Use attachedAppsRefs to attach/detach the volume from applications

Use Cases

  • Capacity Expansion: Increase storage when running low on space
  • Rename: Update volume name for better organization
  • Path Correction: Fix incorrect mount paths

Best Practices

  1. Monitor Usage: Check current usage before expanding
  2. Plan Ahead: Allocate sufficient space to avoid frequent resizing
  3. Coordinate Changes: Communicate mount path changes to team
  4. Test First: Test path changes in development before production