Skip to content

Create a listener.

POST
/v1/projects/{projectId}/lb/load-balancers/{loadBalancerId}/listeners
Code sample: Shell / cURL
curl --request POST \
--url https://stratum.example.com/v1/projects/example/lb/load-balancers/example/listeners \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "port": 1, "protocol": "HTTP", "defaultAction": { "type": "forward", "targetGroupId": "example", "statusCode": 1, "contentType": "example", "messageBody": "example" }, "enableHttp3": true }'

Listener ports are unique per load balancer; creating a second listener on an in-use port returns 409 code: PORT_IN_USE (listeners have no name, so this is deliberately not the name-conflict shape). A forward default action names a target group (targetGroupId, tg-…) that exists in the project and shares the load balancer’s VPC; anything else is 400 INVALID_INPUT naming the id — the reference is resolved at write time, never stored as received.

projectId
required
string
/^p-[a-z0-9-]+$/
loadBalancerId
required
string
/^lb-[a-z0-9]+$/
Media typeapplication/json
object
port
required
integer
>= 1 <= 65535
protocol
required
string
Allowed values: HTTP HTTPS
defaultAction
required

A listener’s default action. The fields below are the ones the control plane checks and the data plane reads; any other property is stored verbatim.

  • forward (also when type is omitted): targetGroupId names a target group in the project, resolved against the load balancer’s VPC at write time.
  • fixed-response: answers every request with statusCode, contentType and messageBody, and must not carry a targetGroupId.
  • redirect: accepted and stored; the data plane does not serve it yet.

type is compared case-insensitively.

object
type

forward (the default when omitted), redirect or fixed-response.

string

Example

forward
targetGroupId

The target group a forward action routes to.

string
/^tg-[a-z0-9]+$/
statusCode

fixed-response only: the HTTP status. Outside 100-599 the data plane answers 503.

integer
contentType

fixed-response only: the Content-Type, text/plain; charset=utf-8 when omitted.

string
messageBody

fixed-response only: the response body.

string
key
additional properties
any
enableHttp3
boolean

Created.

Media typeapplication/json
object
ownedBy

Set when a platform resource manages this row; absent on a tenant’s own.

object
kind
required
string
Allowed values: auto-scaling-group platform
id
required

The owner: the Auto Scaling group id, or for platform the component (front-door, pack:platform-health, default-network, operator-recipe).

string
id
required
string
/^lis-[a-z0-9]+$/
loadBalancerId
required
string
port
required
integer
>= 1 <= 65535
protocol
required
string
Allowed values: HTTP HTTPS http https
defaultAction
required
object
key
additional properties
any
sslPolicy
string
nullable
enableHttp3
boolean
bindAddress
string
nullable
state
required
string
createdAt
string format: date-time
updatedAt
string format: date-time

Example

{
"ownedBy": {
"kind": "auto-scaling-group"
},
"protocol": "HTTP"
}

Bad request.

Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
>= 400 <= 599
detail
string
instance
string format: uri-reference
requestId
required
string
code
required
string
issues

The findings of a rejected IAM policy document (custom and resource policies).

Array<object>

One finding of a rejected IAM policy document. A rejection lists every finding, so the author fixes the document in one round trip.

object
code
required

The finding, e.g. INVALID_DOCUMENT, UNKNOWN_ACTION, ACTION_NOT_APPLICABLE.

string
statement
required

Index of the statement at fault; -1 for the document as a whole.

integer
>= -1
detail
required
string
action

The offending action, where one is at fault (ACTION_NOT_APPLICABLE).

string
errors

Field errors, for codes that carry them: each problem at its field (see FieldError). Documented on the responses that set it, e.g. approveNodeJoin’s INVALID_INPUT and JOIN_APPROVAL_REFUSED. Absent otherwise.

Array<object>

One field’s problem, the stage-2 installer API’s shape. field is the field’s path, message what is wrong with it.

object
field
required

The field’s path, e.g. links[0].interface, disks[1].confirm, mgmt.address or role; empty for the whole request.

string
message
required
string
details

Structured facts about the refusal, for codes that carry them. The shape is fixed per code and documented on the response that answers it, e.g. IMAGE_POOL_MISMATCH (see ImagePoolMismatchDetails) and IMAGE_IN_USE. Absent for codes that carry none.

object
key
additional properties
any

Example

{
"issues": [
{
"code": "ACTION_NOT_APPLICABLE",
"action": "compute:CreateVpc"
}
]
}

Authenticated but not authorized.

Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
>= 400 <= 599
detail
string
instance
string format: uri-reference
requestId
required
string
code
required
string
issues

The findings of a rejected IAM policy document (custom and resource policies).

Array<object>

One finding of a rejected IAM policy document. A rejection lists every finding, so the author fixes the document in one round trip.

object
code
required

The finding, e.g. INVALID_DOCUMENT, UNKNOWN_ACTION, ACTION_NOT_APPLICABLE.

string
statement
required

Index of the statement at fault; -1 for the document as a whole.

integer
>= -1
detail
required
string
action

The offending action, where one is at fault (ACTION_NOT_APPLICABLE).

string
errors

Field errors, for codes that carry them: each problem at its field (see FieldError). Documented on the responses that set it, e.g. approveNodeJoin’s INVALID_INPUT and JOIN_APPROVAL_REFUSED. Absent otherwise.

Array<object>

One field’s problem, the stage-2 installer API’s shape. field is the field’s path, message what is wrong with it.

object
field
required

The field’s path, e.g. links[0].interface, disks[1].confirm, mgmt.address or role; empty for the whole request.

string
message
required
string
details

Structured facts about the refusal, for codes that carry them. The shape is fixed per code and documented on the response that answers it, e.g. IMAGE_POOL_MISMATCH (see ImagePoolMismatchDetails) and IMAGE_IN_USE. Absent for codes that carry none.

object
key
additional properties
any

Example

{
"issues": [
{
"code": "ACTION_NOT_APPLICABLE",
"action": "compute:CreateVpc"
}
]
}

Conflicting state.

Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
>= 400 <= 599
detail
string
instance
string format: uri-reference
requestId
required
string
code
required
string
issues

The findings of a rejected IAM policy document (custom and resource policies).

Array<object>

One finding of a rejected IAM policy document. A rejection lists every finding, so the author fixes the document in one round trip.

object
code
required

The finding, e.g. INVALID_DOCUMENT, UNKNOWN_ACTION, ACTION_NOT_APPLICABLE.

string
statement
required

Index of the statement at fault; -1 for the document as a whole.

integer
>= -1
detail
required
string
action

The offending action, where one is at fault (ACTION_NOT_APPLICABLE).

string
errors

Field errors, for codes that carry them: each problem at its field (see FieldError). Documented on the responses that set it, e.g. approveNodeJoin’s INVALID_INPUT and JOIN_APPROVAL_REFUSED. Absent otherwise.

Array<object>

One field’s problem, the stage-2 installer API’s shape. field is the field’s path, message what is wrong with it.

object
field
required

The field’s path, e.g. links[0].interface, disks[1].confirm, mgmt.address or role; empty for the whole request.

string
message
required
string
details

Structured facts about the refusal, for codes that carry them. The shape is fixed per code and documented on the response that answers it, e.g. IMAGE_POOL_MISMATCH (see ImagePoolMismatchDetails) and IMAGE_IN_USE. Absent for codes that carry none.

object
key
additional properties
any

Example

{
"issues": [
{
"code": "ACTION_NOT_APPLICABLE",
"action": "compute:CreateVpc"
}
]
}