Skip to main content

Tcp Edge Policy Module

Replace TCP Edge Policy Module

Request

PUT /edges/tcp/{id}/policy

Example Request

curl \
-X PUT \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-H "Ngrok-Version: 2" \
-d '{"enabled":true,"inbound":[{"actions":[{"type":"deny"}],"expressions":["conn.ClientIP == '192.0.2.0'"],"name":"Block IP"}]}' \
https://api.ngrok.com/edges/tcp/edgtcp_2fKmdH2ddFKBogdscMOnEwZlfbX/policy

Parameters

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
inboundEndpointRulethe inbound rules of the traffic policy.
outboundEndpointRulethe outbound rules on the traffic policy.

EndpointRule parameters

NameTypeDescription
expressionsList<string>cel expressions that filter traffic the policy rule applies to.
actionsEndpointActionthe set of actions on a policy rule.
namestringthe name of the rule that is part of the traffic policy.

EndpointAction parameters

NameTypeDescription
typestringthe type of action on the policy rule.
configobjectthe configuration for the action on the policy rule.

Response

Returns a 200 response on success

Example Response

{
"enabled": true,
"inbound": [
{
"actions": [
{
"config": null,
"type": "deny"
}
],
"expressions": ["conn.ClientIP == '192.0.2.0'"],
"name": "Block IP"
}
],
"outbound": null
}

Fields

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
inboundEndpointRulethe inbound rules of the traffic policy.
outboundEndpointRulethe outbound rules on the traffic policy.

EndpointRule fields

NameTypeDescription
expressionsList<string>cel expressions that filter traffic the policy rule applies to.
actionsEndpointActionthe set of actions on a policy rule.
namestringthe name of the rule that is part of the traffic policy.

EndpointAction fields

NameTypeDescription
typestringthe type of action on the policy rule.
configobjectthe configuration for the action on the policy rule.

Get TCP Edge Policy Module

Request

GET /edges/tcp/{id}/policy

Example Request

curl \
-X GET \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/edges/tcp/edgtcp_2fKmdH2ddFKBogdscMOnEwZlfbX/policy

Response

Returns a 200 response on success

Example Response

{
"enabled": true,
"inbound": [
{
"actions": [
{
"config": null,
"type": "deny"
}
],
"expressions": ["conn.ClientIP == '192.0.2.0'"],
"name": "Block IP"
}
],
"outbound": null
}

Fields

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
inboundEndpointRulethe inbound rules of the traffic policy.
outboundEndpointRulethe outbound rules on the traffic policy.

EndpointRule fields

NameTypeDescription
expressionsList<string>cel expressions that filter traffic the policy rule applies to.
actionsEndpointActionthe set of actions on a policy rule.
namestringthe name of the rule that is part of the traffic policy.

EndpointAction fields

NameTypeDescription
typestringthe type of action on the policy rule.
configobjectthe configuration for the action on the policy rule.

Delete TCP Edge Policy Module

Request

DELETE /edges/tcp/{id}/policy

Example Request

curl \
-X DELETE \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/edges/tcp/edgtcp_2fKmdH2ddFKBogdscMOnEwZlfbX/policy

Response

Returns a 204 response with no body on success