v1beta
Double column
curl
API
CLI

Services /

Create deployment service

Creates a new deployment service.

URL parameters

    • project

      string required

      ID of the project

Request attributes

  • object

    • name

      string required

      The name of the service.

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

      string

      A description of the service.

      pattern
      ^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$
      max length
      200
    • billing

      object required

      • deploymentPlan

        string required

        The ID of the deployment plan to use.

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

      (multiple options) required

      Deployment type

      • object

        Internal deployment

        • instances

          integer required

          The number of instances to run the service on.

        • internal

          object

          • internalId

            string required

            Internal ID of the build service to deploy

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

            string

            Branch to deploy

          • buildSHA

            string

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

        OR

      • object

        External deployment

        • instances

          integer required

          The number of instances to run the service on.

        • external

          object

          • registryProvider

            string required

            Registry provider hosting the external image

            one of
            dockerhub, gcr-eu, gcr-us, gitlab, github
          • privateImage

            boolean

            Does the image require authentication

          • imagePath

            string required

            Path of the external image excluding the hostname

          • credentials

            object

            Authentication credentials for the private image. Required if privateImage is `true`.

          OR

        • object

          Choose later

          • instances

            integer required

            The number of instances to run the service on.

      • ports

        array

        • object

          • name

            string required

            The name used to identify the port.

            pattern
            ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$
          • internalPort

            integer required

            The port number.

            min
            1
            max
            65535
          • public

            boolean

            If true, the port will be exposed publicly.

          • protocol

            string required

            The protocol to use for the port.

            one of
            HTTP, TCP, UDP
      • environment

        object

        An object containing the environment variables to set for the service

      Response attributes

      • object

        • serviceType

          string required

          The type of the service created

        • serviceId

          string required

          The internal ID of the newly created service

        • name

          string required

          The name of the newly created service.

        • description

          string

          The description of the newly created service.

      API
      CLI

      POST /v1beta/projects/{project}/services/deployment

      Example request

      request body

      curl

      curl --header "Content-Type: application/json" \
        --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
        --request POST \
        --data '{"name":"Example Service","description":"A service description","billing":{"deploymentPlan":"micro"},"deployment":{"instances":1,"internal":{"internalId":"example-build-service","branch":"master","buildSHA":"latest"}},"ports":[{"name":"port-1","internalPort":8080,"public":true,"protocol":"HTTP"}],"environment":{"VARIABLE_1":"abcdef","VARIABLE_2":"12345"}}' \
        https://api.northflank.com/v1beta/projects/{project}/services/deployment

      Example response

      200 OK

      Details about the newly created service.

      JSON

      {
        "serviceType": "deployment",
        "serviceId": "new-service",
        "name": "New Service",
        "description": "This is a new service."
      }

      Example response

      400 Bad Request

      Unable to verify external image

      Example response

      409 Conflict

      There is already a service with the same derived identifier

      © 2021 Northflank Ltd. All rights reserved.

      TermsPrivacy

      contact@northflank.com