port
port unset
Stop an application serving a port.
writesrepeatable--dry-run
Closes a port, so the application stops serving it.
A custom domain pointing at that port stays behind and resolves to nothing, so
domain list is worth reading afterwards.
Usage
outplane port unset <PORT...> [flags]Arguments
| Argument | Type | Description |
|---|---|---|
PORT | string | The port number, repeatable. Required. Takes the rest of the line. |
Flags
| Flag | Type | Description |
|---|---|---|
--app | string | Application name or id. Defaults to the linked app. A flag rather than an argument, so that port numbers cannot be mistaken for it. |
--deploy | bool | Deploy afterwards, so the change reaches the running app. |
The global flags apply as well.
Output
| Field | Type | Description |
|---|---|---|
action | string | One of set, unset. |
numbers | array | The ports named on the command line. |
app | string | |
appId | string | |
serving | int | How many ports the application serves afterwards. |
ports | array | Every port that was sent, {port, scheme, public}. |
changed | bool | False for a dry run. |
deploymentId | int | null |
Examples
See what would be left
outplane port unset 8080 --dry-runClose a port
outplane port unset 8080Close several on another application, and apply it
outplane port unset 8080 9000 --app checkout --deployRead the result in a pipeline
outplane port unset 8080 --json --fields numbers,serving,changedWhat to Know
- A number the application does not serve is an error, exit 5 with port.not_found, and nothing is sent. The error names the ports it does serve.
- A custom domain attached to a closed port stays, and points nowhere. The platform does not delete it and neither does this command;
outplane domain listshows a route with no application. - Closing every port leaves an application nothing can reach, and that is allowed. The request is not refused.
- The API replaces the whole set rather than merging, so this command sends every remaining port. ports in the result is that set.
- Saving does not restart anything. Without --deploy the running application keeps serving the port until its next deployment.
Errors
Beyond 0 for success, this command exits with:
| Exit | Kind | Meaning |
|---|---|---|
2 | usage | Invalid arguments, unknown flag, or client-side validation failure. |
3 | auth | Not authenticated, token revoked or expired, or forbidden for this team. |
5 | not_found | The named resource does not exist, or is not visible to this credential. |
8 | upstream | The Out Plane API returned a server error. |
The code on the error object is one of port.not_found, 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.