Volumes /
Create volume
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 length20pattern^[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 mounted
pattern^((?!\.\.).)*$containerMountPath
string requiredSpecify the path into which the volume should be mounted
pattern^((?!:).)*$spec
{object} requiredInformation about the desired size and type of the volume. Storage class is only configurable with the relevant feature flag enabled for your account,
storageClassName
stringone ofssd, hddstorageSize
(multiple options) required- integerone of5120, 10240, 20480, 40960min4096max204800
- integerone of40960min40960max204800
owningObject
{object}The object to attach this volume to.
id
string requiredThe internal 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
OR
Response body
- {object}
Response object.
data
{object} requiredResult data.
id
string requiredIdentifier for the volume
name
string requiredVolume name
spec
{object} requiredInformation about the desired size and type of the volume. Storage class is only configurable with the relevant feature flag enabled for your account,
storageClassName
stringone ofssd, hddstorageSize
(multiple options) required- integerone of5120, 10240, 20480, 40960min4096max204800
- integerone of40960min40960max204800
owningObject
{object}The object to attach this volume to.
id
string requiredThe internal 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 ofservicestatus
string requiredStatus the volume is in on the cluster
createdAt
string requiredThe timestamp the volume was created at
updatedAt
string requiredThe timestamp the volume was last updated at
OR
POST /v1/projects/{projectId}/volumes
Example request
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"name":"Example Volume","mounts":[{"volumeMountPath":"","containerMountPath":"/container"}],"spec":{},"owningObject":{"id":"example-service","type":"service"}}' \
http://api.northflank.com/v1/projects/{projectId}/volumes
Example response
200 OK
JSON
{
"data": {
"id": "example-volume",
"name": "Example Volume",
"spec": {},
"owningObject": {
"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