Tcp Edge Traffic Policy Module
Replace TCP Edge Traffic Policy Module
Request
PUT /edges/tcp/{id}/traffic_policy
Example Request
curl \
-X PUT \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-H "Ngrok-Version: 2" \
-d '{"enabled":true,"value":"{\"inbound\":[{\"name\":\"Block IP\",\"expressions\":[\"conn.client_ip == '192.0.2.0'\"],\"actions\":[{\"type\":\"deny\"}]}]}"}' \
https://api.ngrok.com/edges/tcp/edgtcp_2k5okvUUpBtMV9Ub298zNLwS81Y/traffic_policy
Parameters
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
value | string | the traffic policy that should be applied to the traffic on your endpoint. |
Response
Returns a 200 response on success
Example Response
{
"enabled": true,
"value": "{\"inbound\":[{\"expressions\":[\"conn.client_ip == '192.0.2.0'\"],\"name\":\"Block IP\",\"actions\":[{\"type\":\"deny\"}]}]}"
}
Fields
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
value | string | the traffic policy that should be applied to the traffic on your endpoint. |
Get TCP Edge Traffic Policy Module
Request
GET /edges/tcp/{id}/traffic_policy
Example Request
curl \
-X GET \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/edges/tcp/edgtcp_2k5okvUUpBtMV9Ub298zNLwS81Y/traffic_policy
Response
Returns a 200 response on success
Example Response
{
"enabled": true,
"value": "{\"inbound\":[{\"expressions\":[\"conn.client_ip == '192.0.2.0'\"],\"name\":\"Block IP\",\"actions\":[{\"type\":\"deny\"}]}]}"
}
Fields
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
value | string | the traffic policy that should be applied to the traffic on your endpoint. |
Delete TCP Edge Traffic Policy Module
Request
DELETE /edges/tcp/{id}/traffic_policy
Example Request
curl \
-X DELETE \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/edges/tcp/edgtcp_2k5okvUUpBtMV9Ub298zNLwS81Y/traffic_policy
Response
Returns a 204 response with no body on success