Double column
curl
API
CLI

Services /

Update ports

Updates the list of ports for the given service.

URL parameters

    • project

      string required

      ID of the project

    • service

      string required

      ID of the service

Request attributes

  • object

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

        • domains

          array

          An array of domains to redirect to this port. Each domain must first be verified and registered to your account.

          • string

            A domain to redirect to this port.

        • protocol

          string required

          The protocol to use for the port. Public ports only support HTTP.

          one of: HTTP, TCP, UDP

API
CLI

POST /v1beta/projects/{project}/services/{service}/ports

Example request

request body

curl

curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"ports":[{"name":"port-1","internalPort":12345,"public":true,"domains":[["app.example.com"]],"protocol":"HTTP"}]}' \
  https://api.northflank.com/v1beta/projects/{project}/services/{service}/ports

Example response

200 OK

success

© 2020 Northflank Ltd. All rights reserved.

TermsPrivacy

contact@northflank.com