port
port get
Print one port's address.
read onlyrepeatable
One port's address, printed on its own so it can be read straight into a variable or a health check.
A private port has no address, and this says so rather than printing an empty line.
Usage
outplane port get <PORT> [flags]Arguments
| Argument | Type | Description |
|---|---|---|
PORT | string | The port number. Required. |
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. |
The global flags apply as well.
Output
| Field | Type | Description |
|---|---|---|
port | int | |
portId | string | |
scheme | string | One of http, h2c, tcp. |
public | bool | |
url | string | The address. Text mode prints this alone. |
customDomains | array |
This command prints a bare value in every format, so it can be read straight into a variable. It has no JSON form.
Examples
Print one port's address
outplane port get 3000Call the application at it
curl "$(outplane port get 3000)/health"Read the whole record instead
outplane port get 3000 --app checkout --json{
"port": 3000,
"public": true,
"scheme": "http",
"url": "https://checkout-3000-acme.outplane.app"
}What to Know
- Text mode writes the address and a newline, with nothing else on standard output, which is what makes command substitution safe. Notes and errors go to standard error as everywhere else.
- Piped output stays text rather than becoming JSON, unlike most commands here. --json still gives the object for a caller that wants the record.
- A private port exits 5 with port.no_address. It is not a missing port, and
port listshows it. - A port that does not exist exits 5 with port.not_found and the error names the ports that do.
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, port.no_address, usage.bad_port, context.no_app, app.not_found. Branch on that, or on the exit status. The message is prose and changes.