v1
Double column
API
CLI
JS Client

Services /

Update service deployment

Updates the deployment settings of the given service.

Required permission

Project > Services > Deployment > Update Deployment

Path parameters

    • projectId

      string required

      ID of the project

    • serviceId

      string required

      ID of the service

Request body

  • {object}

    An external deployment

    • external

      {object} required
      • imagePath

        string required

        Image to be deployed. When not deploying from Dockerhub the URL must be specified.

        pattern
        ^(?:(?:https?:\/\/)?([a-zA-Z0-9\-]+\.[a-zA-Z0-9\.\-]+)(\/v1)?)?(?:\/)?([a-zA-Z/-9\.\-_]+)(?:\:([a-zA-Z/-9\.\-_\:]+)|\@([a-zA-Z/-9\.\-_\:]+))$
      • credentials

        string

        ID of the saved credentials to use to access this external image.

        pattern
        ^[A-Za-z0-9-]+$
OR
  • {object}

    An internal deployment

    • internal

      {object} required
      • id

        string

        ID of the build service to deploy

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

        string

        Branch to deploy

      • buildSHA

        Commit SHA to deploy, or 'latest' to deploy the most recent commit

      • buildId

        string

        ID of the build that should be deployed

Response body

  • {object}

    Response object.

    • data

      {object} required

      Result data.

    API
    CLI
    JS Client

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

    Example request

    Request body
    An external deployment
    curl
    curl --header "Content-Type: application/json" \
      --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
      --request POST \
      --data '{"external":{"imagePath":"nginx:latest","credentials":"example-credentials"}}' \
      http://api.northflank.com/v1/projects/{projectId}/services/{serviceId}/deployment
    OR
    An internal deployment
    curl
    curl --header "Content-Type: application/json" \
      --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
      --request POST \
      --data '{"internal":{"id":"example-build-service","branch":"master","buildSHA":"latest","buildId":"premium-guide-6393"}}' \
      http://api.northflank.com/v1/projects/{projectId}/services/{serviceId}/deployment

    Example response

    200 OK

    The operation was performed successfully.

    JSON

    {
      "data": {}
    }

    © 2022 Northflank Ltd. All rights reserved.