port set
Open a port, or change one that is already open.
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
| Argument | Type | Description |
|---|---|---|
PORT | string | PORT[:SCHEME[:public|private]], repeatable. A part left out keeps what the port already had. 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}. This is the whole set, not the part that changed, because the request replaces. |
changed | bool | False for a dry run. |
deploymentId | int | null | The deployment --deploy started, or null when it was not given. |
Examples
Open a public HTTP port
outplane port set 3000:http:publicOpen several at once
outplane port set 3000:http:public 5432:tcp:public 9000Make an open port public without touching its scheme
outplane port set 3000::public --deploySee 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 3000does not make a public port private;3000::privatedoes. 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 listreports 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:
| 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 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.