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.client_ip == '192.0.2.0'"],"name":"Block IP"}]}' \
https://api.ngrok.com/edges/tcp/edgtcp_2gsqMsbz6yXWQcWJXGKCgR0jopu/policy
Parameters
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
inbound | EndpointRule | the inbound rules of the traffic policy. |
outbound | EndpointRule | the outbound rules on the traffic policy. |
EndpointRule parameters
Name | Type | Description |
---|---|---|
expressions | List<string> | cel expressions that filter traffic the policy rule applies to. |
actions | EndpointAction | the set of actions on a policy rule. |
name | string | the name of the rule that is part of the traffic policy. |
EndpointAction parameters
Name | Type | Description |
---|---|---|
type | string | the type of action on the policy rule. |
config | object | the 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.client_ip == '192.0.2.0'"],
"name": "Block IP"
}
],
"outbound": null
}
Fields
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
inbound | EndpointRule | the inbound rules of the traffic policy. |
outbound | EndpointRule | the outbound rules on the traffic policy. |
EndpointRule fields
Name | Type | Description |
---|---|---|
expressions | List<string> | cel expressions that filter traffic the policy rule applies to. |
actions | EndpointAction | the set of actions on a policy rule. |
name | string | the name of the rule that is part of the traffic policy. |
EndpointAction fields
Name | Type | Description |
---|---|---|
type | string | the type of action on the policy rule. |
config | object | the 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_2gsqMsbz6yXWQcWJXGKCgR0jopu/policy
Response
Returns a 200 response on success
Example Response
{
"enabled": true,
"inbound": [
{
"actions": [
{
"config": null,
"type": "deny"
}
],
"expressions": ["conn.client_ip == '192.0.2.0'"],
"name": "Block IP"
}
],
"outbound": null
}
Fields
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
inbound | EndpointRule | the inbound rules of the traffic policy. |
outbound | EndpointRule | the outbound rules on the traffic policy. |
EndpointRule fields
Name | Type | Description |
---|---|---|
expressions | List<string> | cel expressions that filter traffic the policy rule applies to. |
actions | EndpointAction | the set of actions on a policy rule. |
name | string | the name of the rule that is part of the traffic policy. |
EndpointAction fields
Name | Type | Description |
---|---|---|
type | string | the type of action on the policy rule. |
config | object | the 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_2gsqMsbz6yXWQcWJXGKCgR0jopu/policy
Response
Returns a 204 response with no body on success