Skip to navigation

Update a NAT port-forwarding rule

Changes a NAT port-forwarding rule’s ports, target, protocol, or enabled state. Requires scope: network.write.

# Example request with curl (set IBEE_API_TOKEN to a platform API token and WORKSPACE_ID to the workspace first).
# VPC_ID: VPC ID
# NAT_GATEWAY_ID: NAT gateway ID
# PORT_FORWARDING_RULE_ID: NAT port-forwarding rule ID
curl -X PATCH "https://api.ibee.ai/v1/networking/vpcs/$VPC_ID/nat-gateways/$NAT_GATEWAY_ID/port-forwarding-rules/$PORT_FORWARDING_RULE_ID?workspace_id=$WORKSPACE_ID" \
-H "Authorization: Bearer $IBEE_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "<name>", "protocol": "tcp"}'

Authentication

AuthorizationBearer

IBEE platform API token. Production tokens start with ibee_prod_key_; development tokens start with ibee_dev_key_. Use a token only with its matching gateway environment.

Path parameters

vpc_idstringRequired
VPC ID.
nat_gateway_idstringRequired
NAT gateway ID.
port_forwarding_rule_idstringRequired

NAT port-forwarding rule ID.

Query parameters

workspace_idstringRequiredformat: "^[1-9][0-9]*$">=1 character

The positive numeric workspace ID to scope this request to. Zero, negative, and non-numeric values are rejected.

Request

This endpoint expects an object.
namestringOptional1-80 characters
Display name of the rule.
protocolenumOptional
  • tcp
  • udp
Allowed values:
external_portintegerOptional1-65535

Port on the gateway’s public address (1-65535).

internal_ipstringOptional
Private IPv4 address of the VM inside the VPC that receives the traffic.
internal_portintegerOptional1-65535

Port on the VM that receives the traffic (1-65535).

target_typeenumOptionalDefaults to vm

vm: forward to one VM’s private IP. vip: forward to a Virtual IP announced by the VMs in target_vm_ids.

Allowed values:
target_vm_idslist of stringsOptional

VMs that announce the Virtual IP. Required with vip, must be empty with vm.

notestringOptional<=500 characters

Free-text note stored with the rule.

enabledbooleanOptional
Whether the rule is applied.

Response

Port-forwarding rule updated successfully.

namestring1-80 characters
Display name of the rule.
external_portinteger1-65535

Port on the gateway’s public address (1-65535).

internal_ipstring
Private IPv4 address of the VM inside the VPC that receives the traffic.
internal_portinteger1-65535

Port on the VM that receives the traffic (1-65535).

port_forward_rule_idstring
Unique ID of the rule.
vpc_idstring
VPC the rule belongs to.
nat_gateway_idstring
NAT gateway the rule is configured on.
statusenum

Lifecycle status of a VPC, subnet, NAT gateway or port-forwarding rule.

  • provisioning: being created.
  • available: ready for use.
  • error: the last change failed; see error_message.
  • deleting: being removed.
Allowed values:
created_atdatetime

When the rule was created (ISO 8601).

updated_atdatetime

When the rule was last changed (ISO 8601).

protocolenumOptionalDefaults to tcp
  • tcp (default)
  • udp
Allowed values:
target_typeenumOptionalDefaults to vm

vm: forward to one VM’s private IP. vip: forward to a Virtual IP announced by the VMs in target_vm_ids.

Allowed values:
target_vm_idslist of stringsOptional

VMs that announce the Virtual IP. Required with vip, must be empty with vm.

notestringOptional<=500 charactersDefaults to

Free-text note stored with the rule. Default empty.

enabledbooleanOptionalDefaults to true
Whether the rule is applied. Default true.
organization_idstringOptional
ID of the owning organization.
workspace_idstringOptional
ID of the owning workspace.
site_idstringOptional
Site the gateway lives at.
error_messagestring or nullOptional

Error detail when status is error.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
413
Content Too Large Error
422
Unprocessable Entity Error
423
Locked Error
429
Too Many Requests Error
500
Internal Server Error
502
Bad Gateway Error
503
Service Unavailable Error
504
Gateway Timeout Error