Out Plane
port

port set

Open a port, or change one that is already open.

writesrepeatable--dry-run

Opens a port, or changes the scheme or the visibility of one that is already open. A part you leave out keeps whatever the port already had.

The platform stores an application's ports as one set, so this command reads them and sends them back with your change applied. Two callers changing different ports at the same moment can overwrite one another.

Usage

outplane port set <PORT...> [flags]

Arguments

ArgumentTypeDescription
PORTstringPORT[:SCHEME[:public|private]], repeatable. A part left out keeps what the port already had. Required. Takes the rest of the line.

Flags

FlagTypeDescription
--appstringApplication name or id. Defaults to the linked app. A flag rather than an argument, so that port numbers cannot be mistaken for it.
--deployboolDeploy afterwards, so the change reaches the running app.

The global flags apply as well.

Output

FieldTypeDescription
actionstringOne of set, unset.
numbersarrayThe ports named on the command line.
appstring
appIdstring
servingintHow many ports the application serves afterwards.
portsarrayEvery port that was sent, {port, scheme, public}. This is the whole set, not the part that changed, because the request replaces.
changedboolFalse for a dry run.
deploymentIdint | nullThe deployment --deploy started, or null when it was not given.

Examples

Open a public HTTP port

outplane port set 3000:http:public

Open several at once

outplane port set 3000:http:public 5432:tcp:public 9000

Make an open port public without touching its scheme

outplane port set 3000::public --deploy

See the whole set that would be sent

outplane port set 8080 --dry-run --json
{
  "action": "set",
  "changed": false,
  "numbers": [
    8080
  ],
  "ports": [
    {
      "port": 3000,
      "public": true,
      "scheme": "http"
    },
    {
      "port": 5432,
      "public": false,
      "scheme": "tcp"
    },
    {
      "port": 8080,
      "public": false,
      "scheme": "http"
    }
  ],
  "serving": 3
}

What to Know

  • A part left out keeps what the port already had. port set 3000 does not make a public port private; 3000::private does. On a port that is not open yet, an omitted part takes the create-time default of private HTTP.
  • The API replaces the whole set rather than merging, so this command reads the current ports and sends them back with the change applied. Two callers changing different ports at the same time can therefore lose one of the changes, which is not possible with env set.
  • ports in the result is everything that was sent, not the part that changed. That is the honest report for a replacing request and it is what --dry-run prints.
  • Saving does not restart anything. Without --deploy the running application keeps the ports it started with.
  • Making a TCP port public allocates an outside port number, which is not the one the application listens on. port list reports the address afterwards.
  • deploymentId is null unless --deploy was given. A queued deployment is not a finished one; follow it with outplane deploy logs.

Errors

Beyond 0 for success, this command exits with:

ExitKindMeaning
2usageInvalid arguments, unknown flag, or client-side validation failure.
3authNot authenticated, token revoked or expired, or forbidden for this team.
5not_foundThe named resource does not exist, or is not visible to this credential.
8upstreamThe Out Plane API returned a server error.

The code on the error object is one of app.port_invalid, app.scheme_invalid, app.port_duplicate, usage.bad_port, usage.missing_argument, context.no_app, app.not_found. Branch on that, or on the exit status. The message is prose and changes.

On this page