TLS Edge Traffic Policy Module
Replace TLS Edge Traffic Policy Module
Request
PUT /edges/tls/{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":"{\n\t\"on_tcp_connect\": [\n\t\t{\n\t\t\t\"name\": \"Block requests from certain countries\",\n\t\t\t\"expressions\":[\"conn.geo.country_code in ['BR', 'CN', 'CU', 'IR', 'NG', 'RO', 'RU', 'SD', 'SY', 'UA']\"],\n\t\t\t\"actions\":[\n\t\t\t\t{\n\t\t\t\t\t\"type\":\"log\",\n\t\t\t\t\t\"config\":{\n\t\t\t\t\t\t\"metadata\":{\n\t\t\t\t\t\t\t\"blockedCountry\":\"${conn.geo.country_code}\",\n\t\t\t\t\t\t\t\"edgeId\": \"edgtls_2rwwljidtvuwIM543GgGTAQmCsO\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\":\"deny\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}"}' \
https://api.ngrok.com/edges/tls/edgtls_2rwwljidtvuwIM543GgGTAQmCsO/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": "{\n\t\"on_tcp_connect\": [\n\t\t{\n\t\t\t\"name\": \"Block requests from certain countries\",\n\t\t\t\"expressions\":[\"conn.geo.country_code in ['BR', 'CN', 'CU', 'IR', 'NG', 'RO', 'RU', 'SD', 'SY', 'UA']\"],\n\t\t\t\"actions\":[\n\t\t\t\t{\n\t\t\t\t\t\"type\":\"log\",\n\t\t\t\t\t\"config\":{\n\t\t\t\t\t\t\"metadata\":{\n\t\t\t\t\t\t\t\"blockedCountry\":\"${conn.geo.country_code}\",\n\t\t\t\t\t\t\t\"edgeId\": \"edgtls_2rwwljidtvuwIM543GgGTAQmCsO\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\":\"deny\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}"
}
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 TLS Edge Traffic Policy Module
Request
GET /edges/tls/{id}/traffic_policy
Example Request
curl \
-X GET \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/edges/tls/edgtls_2rwwljidtvuwIM543GgGTAQmCsO/traffic_policy
Response
Returns a 200 response on success
Example Response
{
"enabled": true,
"value": "{\n\t\"on_tcp_connect\": [\n\t\t{\n\t\t\t\"name\": \"Block requests from certain countries\",\n\t\t\t\"expressions\":[\"conn.geo.country_code in ['BR', 'CN', 'CU', 'IR', 'NG', 'RO', 'RU', 'SD', 'SY', 'UA']\"],\n\t\t\t\"actions\":[\n\t\t\t\t{\n\t\t\t\t\t\"type\":\"log\",\n\t\t\t\t\t\"config\":{\n\t\t\t\t\t\t\"metadata\":{\n\t\t\t\t\t\t\t\"blockedCountry\":\"${conn.geo.country_code}\",\n\t\t\t\t\t\t\t\"edgeId\": \"edgtls_2rwwljidtvuwIM543GgGTAQmCsO\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\":\"deny\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}"
}
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 TLS Edge Traffic Policy Module
Request
DELETE /edges/tls/{id}/traffic_policy
Example Request
curl \
-X DELETE \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/edges/tls/edgtls_2rwwljidtvuwIM543GgGTAQmCsO/traffic_policy
Response
Returns a 204 response with no body on success