v1
Double column
API
CLI
JS Client

Services /

Scale service

Modifies the scaling settings for the given service.

Required permission

Project > Services > Deployment > Scale Service

Path parameters

    • projectId

      string required
      ID of the project
    • serviceId

      string required
      ID of the service

Request body

  • {object}
    • instances

      integer
      The number of instances to scale the service to
    • deploymentPlan

      string
      ID of the deployment plan to switch to.
      min length
      3
      max length
      20
      pattern
      ^[a-z]-?[a-z0-9]+(-[a-z0-9]+)*$
    • storage

      {object}
      • ephemeralStorage

        {object}
        • storageSize

          integer
          Ephemeral storage per container in MB
          one of
          1024, 2048, 5120, 10240, 20480, 30720, 40960, 51200, 61440, 81920, 102400, 122880, 153600, 204800
          min
          1024
          max
          204800
      • shmSize

        integer
        Configures the amount of available memory-backed disk space available to /dev/shm
        one of
        64, 128, 256, 512, 1024, 2048, 5120, 10240
        min
        64
        max
        10240
    • gracePeriodSeconds

      integer
      The maximum amount of time the process has to shut down after receiving a SIGTERM signal before it is forcefully shut down SIGKILL by the system.
      min
      15
      max
      600

Response body

  • {object}
    Response object.
    • data

      {object} required
      Result data.
    API
    CLI
    JS Client

    POST /v1/projects/{projectId}/services/{serviceId}/scale

    Example request

    Request body
    curl
    curl --header "Content-Type: application/json" \
      --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
      --request POST \
      --data '{"instances":1,"deploymentPlan":"nf-compute-20","storage":{"ephemeralStorage":{"storageSize":1024}}}' \
      https://api.northflank.com/v1/projects/{projectId}/services/{serviceId}/scale

    Example response

    200 OK

    The operation was performed successfully.

    JSON

    {
      "data": {}
    }

    © 2024 Northflank Ltd. All rights reserved.