Volumes /
Create volume
Creates a volume with the specified payload
Required permission
Project > Volumes > General > Create
Path parameters
projectId
string requiredID of the project
Request body
- {object}
name
string requiredThe name of the volume.min length3max length39pattern^[a-zA-Z]((-|\s)?[a-zA-Z0-9]+((-|\s)[a-zA-Z0-9]+)*)?$mounts
[array] requiredArray of mounts, containerMountPaths must be unique- {object}
volumeMountPath
stringOptionally specify the path inside this volume that should be mountedpattern^((?!\.\.).)*$containerMountPath
string requiredSpecify the path into which the volume should be mountedpattern^((?!:).)*$spec
{object} requiredExample storage schemasource
{object}type
string requiredone ofvolume, backupsourceId
string requiredThe ID of the source objectmin length3max length100pattern^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$owningObject
{object}DEPRECATED: The object to attach this volume to.id
string requiredThe id of object to attach this volume to.pattern^[A-Za-z0-9-]+$type
string requiredThe type of the object to attach this volume to.one ofservice, jobattachedObjects
[array]Array of objects this volume is attached to.- {object}The object to attach this volume to.
id
string requiredThe id of object to attach this volume to.pattern^[A-Za-z0-9-]+$type
string requiredThe type of the object to attach this volume to.one ofservice, job
Response body
- {object}Response object.
data
{object} requiredResult data.id
string requiredIdentifier for the volumename
string requiredVolume namespec
{object} requiredExample storage schemaattachedObjects
[array]List of objects this volume is attached to.- {object}The object to attach this volume to.
id
string requiredThe id of object to attach this volume to.pattern^[A-Za-z0-9-]+$type
string requiredThe type of the object to attach this volume to.one ofservice, jobstatus
string requiredStatus the volume is in on the clustercreatedAt
string requiredThe timestamp the volume was created atupdatedAt
string requiredThe timestamp the volume was last updated at
API
CLI
JS Client
POST /v1/projects/{projectId}/volumes
Example request
Request body
curl
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"name":"Example Volume","mounts":[{"volumeMountPath":"","containerMountPath":"/container"}],"spec":{"storageClassName":"ssd","storageSize":6144},"attachedObjects":[{"id":"example-service","type":"service"}]}' \
https://api.northflank.com/v1/projects/{projectId}/volumes
Example response
200 OK
Details about the newly created volume.
JSON
{
"data": {
"id": "example-volume",
"name": "Example Volume",
"spec": {
"storageClassName": "ssd",
"storageSize": 6144
},
"attachedObjects": [
{
"id": "example-service",
"type": "service"
}
],
"status": "BOUND",
"createdAt": "2021-01-01 12:00:00.000Z",
"updatedAt": "2021-01-01 12:00:00.000Z"
}
}
Example response
409 Conflict
There is already a volume with the same derived identifier