Double column
curl
API
CLI

Services /

Create build service

Creates a new build 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: 28

    • 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-]

    • vcsData

      object required

      • projectUrl

        string required

        URL of the Git repo to build.

      • projectType

        string required

        The VCS provider to use.

        one of: bitbucket, gitlab, github, self-hosted

      • dockerFilePath

        string required

        The file path of the Dockerfile.

        pattern: ^\/([a-zA-Z0-9-.]+\/)*[a-zA-Z0-9-.]+$

      • dockerWorkDir

        string required

        The working directory of the Dockerfile.

        pattern: ^\/([a-zA-Z0-9-.]+\/)*[a-zA-Z0-9-.]*$

    • buildConfiguration

      object

      • branchRestrictions

        array

        • string

          pattern: ^[a-zA-Z/*0-9-]*$

      • prRestrictions

        array

        • string

          pattern: ^[a-zA-Z/*0-9-]*$

Response attributes

  • object

    • serviceType

      string required

      The type of the service created

    • serviceId

      string required

      The internal ID of the newly created service

API
CLI

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

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"},"vcsData":{"projectUrl":"https://github.com/northflank/gatsby-with-northflank","projectType":"github","dockerFilePath":"/Dockerfile","dockerWorkDir":"/"},"buildConfiguration":{"branchRestrictions":[null],"prRestrictions":[null]}}' \
  https://api.northflank.com/v1beta/projects/{project}/services/build

Example response

200 OK

Details about the newly created service.

JSON

{
  "serviceType": "build",
  "serviceId": "new-service"
}

Example response

409 Conflict

There is already a service with the same derived identifier

© 2020 Northflank Ltd. All rights reserved.

TermsPrivacy

contact@northflank.com