v1
Double column
API
CLI
JS Client

Volumes /

Create volume

Creates a volume with the specified payload

Required permission

Project > Volumes > General > Create

Path parameters

    • projectId

      string required

      ID of the project

Request body

  • {object}
    • name

      string required

      The name of the volume.

      min length
      3
      max length
      20
      pattern
      ^[a-zA-Z](-?[a-zA-Z0-9]+((-|\s)[a-zA-Z0-9]+)*)?$
    • mounts

      [array] required

      Array of mounts, containerMountPaths must be unique

      • {object}
        • volumeMountPath

          string

          Optionally specify the path inside this volume that should be mounted

          pattern
          ^((?!\.\.).)*$
        • containerMountPath

          string required

          Specify the path into which the volume should be mounted

          pattern
          ^((?!:).)*$
    • spec

      {object} required

      Information about the desired size and type of the volume.

      • storageSize

        integer required

        The desired size of the volume in MB.

        min
        5120
        max
        40960
      • storageClassName

        string
        one of
        ssd
    • owningObject

      {object}

      The object to attach this volume to.

      • id

        string required

        The internal id of object to attach this volume to.

        pattern
        ^[A-Za-z0-9-]+$
      • type

        string required

        The type of the object to attach this volume to.

        one of
        service

Response body

  • {object}

    Response object.

    • data

      {object} required

      Result data.

      • id

        string required

        Identifier for the volume

      • name

        string required

        Volume name

      • spec

        {object} required

        Information about the desired size and type of the volume.

        • storageSize

          integer required

          The desired size of the volume in MB.

          min
          5120
          max
          40960
        • storageClassName

          string
          one of
          ssd
      • owningObject

        {object}

        The object to attach this volume to.

        • id

          string required

          The internal id of object to attach this volume to.

          pattern
          ^[A-Za-z0-9-]+$
        • type

          string required

          The type of the object to attach this volume to.

          one of
          service
      • status

        string required

        Status the volume is in on the cluster

      • createdAt

        string required

        The timestamp the volume was created at

      • updatedAt

        string required

        The 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":{"storageSize":5120},"owningObject":{"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": {
      "storageSize": 5120
    },
    "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

There is already a volume with the same derived identifier

© 2021 Northflank Ltd. All rights reserved.