v1
Double column
API
CLI
JS Client

Services /

Get service

Gets information about the given service.

Required permission

Project > Services > General > Read

Path parameters

    • projectId

      string required

      ID of the project

    • serviceId

      string required

      ID of the service

Response body

  • {object}

    Response object.

    • data

      {object} required

      Result data.

      • id

        string required

        Identifier for the service

      • appId

        string required

        Full identifier used for service deployment

      • name

        string required

        Service name

      • description

        string

        A short description of the service

      • projectId

        string required

        ID of the project that the service belongs to

      • serviceType

        string required

        Type of the service (combined, build or deployment)

        one of
        combined, build, deployment
      • createdAt

        date required

        The time the service was created.

      • disabledCI

        boolean required

        Whether Continuous Integration is disabled

      • disabledCD

        boolean required

        Whether Continuous Deployment is disabled

      • billing

        {object} required
        • deploymentPlan

          string required

          ID of the billing plan used by this service

      • status

        {object} required

        Details about the current service status.

        • build

          {object}

          Details about the status of the most recent build.

          • status

            string required

            The current status of the build.

            one of
            PENDING, STARTING, CLONING, BUILDING, UPLOADING, ABORTED, FAILURE, SUCCESS, CRASHED
          • lastTransitionTime

            date

            The timestamp of when the build reached this status.

        • deployment

          {object}

          Details about the current deployment status.

          • status

            string required

            The current status of the deployment.

            one of
            IN_PROGRESS, COMPLETED
          • reason

            string required

            The reason the current deployment was started.

            one of
            SCALING, DEPLOYING
          • lastTransitionTime

            date

            The timestamp of when the deployment reached this status.

      • servicePaused

        boolean required

        Is the service paused?

      • vcsData

        {object}
        • projectUrl

          string required

          URL of the repository being built

        • projectType

          string required

          VCS provider for the repo being built

          one of
          bitbucket, gitlab, github, self-hosted
        • selfHostedVcsId

          string

          ID of the self-hosted VCS, if applicable.

        • projectBranch

          string

          Branch of the repo being built

        • publicRepo

          boolean

          Whether the repo is being accessed without authentication.

        • dockerWorkDir

          string required

          Working directory used by the dockerfile

        • dockerFilePath

          string required

          File path of the Dockerfile

      • deployment

        {object}
        • region

          string

          Region where this service is deployed and/or built

        • instances

          integer

          Number of instances/replicas running

        • external

          {object}

          Data about a deployment from an external registry.

          • imagePath

            string required

            Path of the external image excluding the hostname

          • registryProvider

            string required

            Registry provider hosting the external image

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

            boolean required

            Does the image require authentication

        • internal

          {object}
          • nfObjectId

            string required

            Database ID of deployed entity

          • nfObjectType

            string required

            Type of deployed entity

            one of
            service
          • repository

            string required

            URL of the repository being deployed

          • branch

            string required

            Branch of the repo being deployed

          • buildSHA

            string required

            Commit SHA to be deployed. 'latest' means the latest commit is automatically being deployed.

          • deployedSHA

            string required

            Currently deployed commit SHA. If buildSHA is set to 'latest', this will show the SHA of the latest commit.

        • docker

          {object}

          Details about the Docker overrides for this deployment.

          • cmd

            {object} required

            Details about the CMD override for this deployment.

            • enabled

              boolean required

              Whether the CMD override is enabled.

            • value

              string required

              The CMD to run instead of the default if CMD override is enabled.

          • entrypoint

            {object} required

            Details about the entrypoint override for this deployment.

            • enabled

              boolean required

              Whether the entrypoint override is enabled.

            • value

              string required

              The CMD to run instead of the default if entrypoint override is enabled.

        • storage

          {object}

          Details about storage settings for this deployment.

          • ephemeralStorage

            {object}

            Details about ephemeral storage settings for this deployment.

            • storageSize

              number required

              Ephemeral storage per container in MB

      • buildConfiguration

        {object}
        • branchRestrictions

          [array]
          • string
        • prRestrictions

          [array]
          • string
        • pathIgnoreRules

          [array] required
          • string
      • buildEngineConfiguration

        {object}
        • buildEngine

          string

          The build engine used.

          one of
          buildpack, kaniko, buildkit
        • buildpack

          {object}

          Details about Buildpack settings.

          • builder

            string

            The Buildpack stack used.

            one of
            HEROKU_20, HEROKU_18, GOOGLE_V1, CNB_ALPINE, CNB_BIONIC, PAKETO_TINY, PAKETO_BASE, PAKETO_FULL
          • buildpackLocators

            [array]

            Array of custom Buildpacks used.

            • string

              Url or registry identifier of custom Buildpack.

        • kaniko

          {object}

          Details about Kaniko settings.

          • useCache

            boolean

            Should intermediate image layers be cached?

      • ports

        [array] required

        An array of ports of the service.

        • {object}
          • id

            string required

            The id used to identify the port across requests.

            pattern
            ^[a-z]-?[a-z0-9]+(-[a-z0-9]+)*$
          • name

            string required

            The name of the port used in the public url and UI.

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

            integer required

            The port number.

          • protocol

            string required

            The protocol used by the port.

            one of
            HTTP, HTTP/2, TCP, UDP
          • public

            boolean required

            If true, the port is exposed publicly.

          • dns

            string

            DNS entry for this port.

          • domains

            [array] required

            An array of domains that redirect to this port.

            • {object}
              • name

                string required

                The custom domain redirecting to this port.

              • certificate

                {object} required

                Details about the TLS certificate generation for this domain.

                • inProgress

                  boolean

                  Is the certificate in the process of being generated?

                • expiryDate

                  date

                  The timestamp when the TLS certificate will expire.

                • refreshDate

                  date

                  The timestamp when a new TLS certificate will be generated.

          • security

            {object}

            Details about security settings for this port.

            • credentials

              [array]

              An array of credentials to access the service.

              • {object}
                • username

                  string required

                  The username to access the service

                  min length
                  3
                  max length
                  20
                  pattern
                  ^[a-zA-Z0-9]+$
                • password

                  string required

                  The password to access the service with this username.

                • type

                  string required

                  The type of authentication used

                  one of
                  basic-auth
            • policies

              [array]

              An array of IP address policies.

              • {object}
                • addresses

                  [array] required

                  An array of IP addresses used for this rule

                  • string

                    An IP address used by this rule

                • action

                  string required

                  The action for this rule.

                  one of
                  ALLOW, DENY
          • disableNfDomain

            boolean

            Disable routing on the default code.run domain for public HTTP ports with custom domains.

API
CLI
JS Client

GET /v1/projects/{projectId}/services/{serviceId}

Example response

200 OK

Details about the service.

JSON

{
  "data": {
    "id": "example-service",
    "appId": "/example-user/default-project/example-service",
    "name": "Example Service",
    "description": "This is the service description",
    "projectId": "default-project",
    "serviceType": "combined",
    "createdAt": "2021-01-20T11:19:53.175Z",
    "disabledCI": false,
    "disabledCD": false,
    "billing": {
      "deploymentPlan": "nf-compute-20"
    },
    "status": {
      "build": {
        "status": "SUCCESS",
        "lastTransitionTime": "2021-11-29T11:47:16.624Z"
      },
      "deployment": {
        "status": "COMPLETED",
        "reason": "DEPLOYING",
        "lastTransitionTime": "2021-11-29T11:47:16.624Z"
      }
    },
    "vcsData": {
      "projectUrl": "https://github.com/northflank/gatsby-with-northflank",
      "projectType": "github",
      "selfHostedVcsId": "example-team/self-hosted-vcs",
      "projectBranch": "master",
      "publicRepo": false,
      "dockerWorkDir": "/",
      "dockerFilePath": "/Dockerfile"
    },
    "deployment": {
      "region": "europe-west",
      "instances": 1,
      "external": {},
      "internal": {
        "nfObjectId": "5f3bd676b84798d54472d1cc",
        "nfObjectType": "service",
        "repository": "https://github.com/northflank/gatsby-with-northflank",
        "branch": "master",
        "buildSHA": "latest",
        "deployedSHA": "262ed9817b3cad5142fbceabe0c9e371e390d616"
      },
      "docker": {
        "cmd": {
          "enabled": true,
          "value": "nginx -g"
        },
        "entrypoint": {
          "enabled": true,
          "value": "/docker-entrypoint.sh"
        }
      },
      "storage": {
        "ephemeralStorage": {
          "storageSize": 1024
        }
      }
    },
    "buildConfiguration": {
      "branchRestrictions": [
        "feature/*"
      ],
      "prRestrictions": [
        "feature/*"
      ],
      "pathIgnoreRules": [
        "README.md"
      ]
    },
    "buildEngineConfiguration": {
      "buildEngine": "buildpack",
      "buildpack": {
        "builder": "HEROKU_20",
        "buildpackLocators": [
          "https://buildpack-registry.heroku.com/cnb/mars/create-react-app"
        ]
      },
      "kaniko": {}
    },
    "ports": [
      {
        "id": "eonyui",
        "name": "port-1",
        "internalPort": 8080,
        "protocol": "HTTP",
        "public": true,
        "dns": "port-1--example-service--default-service--user-abc1.salvo.code.run",
        "domains": [
          {
            "name": "app.example.com",
            "certificate": {
              "inProgress": false,
              "expiryDate": "2022-04-26T09:25:02.000Z",
              "refreshDate": "2022-03-27T09:25:02.000Z"
            }
          }
        ],
        "security": {
          "credentials": [
            {
              "username": "admin",
              "password": "password123",
              "type": "basic-auth"
            }
          ],
          "policies": [
            {
              "addresses": [
                "127.0.0.1"
              ],
              "action": "DENY"
            }
          ]
        },
        "disableNfDomain": false
      }
    ]
  }
}

© 2022 Northflank Ltd. All rights reserved.