Get service ports | Services | Northflank API docs
v1
Double column
API
CLI
JS Client

Services /

Get service ports

Lists the ports for 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.

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

API
CLI
JS Client

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

Example response

200 OK

Details about the ports for the service.

JSON

{
  "data": {
    "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
      }
    ]
  }
}

© 2024 Northflank Ltd. All rights reserved.