Endpoint
Assign a firewall to a tunnel
Assign a firewall to a tunnel, or remove the firewall from a tunnel.
POST
https://api.playit.gg/tunnels/firewall/assignRequired scope: /tunnels/firewall/assign
Request body#
-
tunnel_idstring (UUID)RequiredThe tunnel to change.
-
firewall_idstring (UUID) or nullThe firewall to assign. To remove the firewall from the tunnel, set this field to
nullor leave it out.
Response#
If the request succeeds, the API returns HTTP 200.
data is null.
Retries#
You can send the same request again safely. If someone else changed the assignment in the meantime, your request replaces their change.
curl --silent --show-error --fail-with-body \
--request POST \
--url "${PLAYIT_API_BASE}/tunnels/firewall/assign" \
--header "Authorization: Api-Key ${PLAYIT_API_KEY}" \
--header 'Content-Type: application/json' \
--data-binary '{
"tunnel_id": "22222222-2222-4222-8222-222222222222",
"firewall_id": "11111111-1111-4111-8111-111111111111"
}'
curl --silent --show-error --fail-with-body \
--request POST \
--url "${PLAYIT_API_BASE}/tunnels/firewall/assign" \
--header "Authorization: Api-Key ${PLAYIT_API_KEY}" \
--header 'Content-Type: application/json' \
--data-binary '{
"tunnel_id": "22222222-2222-4222-8222-222222222222",
"firewall_id": null
}'
{"status": "success", "data": null}
Errors#
If the request fails, the API returns HTTP 400.
data is a string.
data | Meaning |
|---|---|
TunnelNotFound | Your account does not have a tunnel with this ID. |
InvalidFirewallId | The firewall ID is not valid. |
If the firewall does not exist, the API can return HTTP 500 instead.
{"status": "fail", "data": "TunnelNotFound"}