Get service | Services | Northflank API docs
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

      • tags

        [array] required

        An array of previously defined tags to help identify and group the resource.

        • string
          min length
          3
          max length
          39
          pattern
          ^[a-zA-Z](-?[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)?$
      • 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

        string 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
            QUEUED, PENDING, STARTING, CLONING, BUILDING, UPLOADING, ABORTED, FAILURE, SUBMISSION_FAILURE, SUCCESS, CRASHED
          • lastTransitionTime

            string

            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
            PENDING, IN_PROGRESS, COMPLETED, FAILED
          • reason

            string required

            The reason the current deployment was started.

            one of
            SCALING, DEPLOYING
          • lastTransitionTime

            string

            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

            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.

          • configType

            string required

            Override configuration which is used at runtime.

            one of
            default, customEntrypoint, customCommand, customEntrypointCustomCommand
          • customEntrypoint

            string

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

          • customCommand

            string

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

        • buildpack

          {object}

          Details about the Buildpack overrides for this deployment.

          • configType

            string required

            Type of buildpack run configuration.

            one of
            default, customProcess, customCommand, customEntrypointCustomCommand, originalEntrypointCustomCommand
          • customProcess

            string

            Custom process which should be run.

          • customEntrypoint

            string

            Custom entrypoint which should be run.

          • customCommand

            string

            Custom command which should be run.

        • 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

        • imageUrl

          string

          URL at which the service's deployed image is located

      • buildConfiguration

        {object}
        • branchRestrictions

          [array]
          • string
        • prRestrictions

          [array]
          • string
        • pathIgnoreRules

          [array] required
          • string
        • dockerCredentials

          [array]
          • 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_22, HEROKU_22_CLASSIC, 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.

          • useCache

            boolean

            Should build dependencies be cached?

        • buildkit

          {object}

          Details about Buildkit settings.

          • useCache

            boolean

            Should intermediate image layers be cached?

        • kaniko

          {object}

          Details about Kaniko settings.

          • useCache

            boolean

            Should intermediate image layers be cached?

      • autoscaling

        {object}

        Describes all autoscaling configurations

        • horizontal

          {object}

          Describes the horizontal autoscaling configuration

          • enabled

            boolean required

            Whether horizontal autoscaling should be enabled

          • minReplicas

            number required

            Minimum number of replicas which should be running at any time

            min
            1
          • maxReplicas

            number required

            Maximum number of replicas which can be running at any time

          • cpu

            {object}
            • enabled

              boolean required

              Whether autoscaling should take into account cpu usage

            • thresholdPercentage

              integer required

              Threshold CPU usage percentage at which the workload will be scaled

              min
              10
              max
              100
          • memory

            {object}
            • enabled

              boolean required

              Whether autoscaling should take into account memory usage

            • thresholdPercentage

              integer required

              Threshold memory usage percentage at which the workload will be scaled

              min
              10
              max
              100
          • rps

            {object}
            • enabled

              boolean required

              Whether autoscaling should take into requests-per-second

            • thresholdValue

              integer required

              Threshold rps value on which the workload will be scaled

              min
              1
      • 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

                  string

                  The timestamp when the TLS certificate will expire.

                • refreshDate

                  string

                  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
                  39
                  pattern
                  ^[a-zA-Z](-?[a-zA-Z0-9]+(-[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.

      • cluster

        {object} required

        Cluster information

        • id

          string required

          The id of the cluster associated with this project.

        • name

          string required

          The name of the cluster associated with this project.

        • namespace

          string

          Namespace this resource is located within on the cluster.

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",
    "tags": [
      "my-tag"
    ],
    "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,
      "internal": {
        "nfObjectId": "example-service",
        "nfObjectType": "service",
        "repository": "https://github.com/northflank/gatsby-with-northflank",
        "branch": "master",
        "buildSHA": "latest",
        "deployedSHA": "262ed9817b3cad5142fbceabe0c9e371e390d616"
      },
      "docker": {
        "configType": "default"
      },
      "buildpack": {
        "configType": "default"
      },
      "storage": {
        "ephemeralStorage": {
          "storageSize": 1024
        }
      }
    },
    "buildConfiguration": {
      "branchRestrictions": [
        "feature/*"
      ],
      "prRestrictions": [
        "feature/*"
      ],
      "pathIgnoreRules": [
        "README.md"
      ],
      "dockerCredentials": [
        "example-docker-credential"
      ]
    },
    "buildEngineConfiguration": {
      "buildEngine": "buildpack",
      "buildpack": {
        "builder": "HEROKU_22",
        "buildpackLocators": [
          "https://buildpack-registry.heroku.com/cnb/mars/create-react-app"
        ]
      }
    },
    "ports": [
      {
        "id": "eonyui",
        "name": "p01",
        "internalPort": 8080,
        "protocol": "HTTP",
        "public": true,
        "dns": "p01--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
      }
    ],
    "cluster": {
      "id": "nf-europe-west",
      "name": "nf-europe-west",
      "namespace": "ns-8zy2mcjh9zn2"
    }
  }
}

© 2024 Northflank Ltd. All rights reserved.