Update the egress policy of a running machine
import requests
url = "https://api.13-215-85-171.sslip.io/v1/machines/{id}/egress"
payload = { "egress": {
"allow_cidrs": ["<string>"],
"deny_cidrs": ["<string>"],
"rate_limit": {
"kbit_per_sec": 2,
"pps": 2,
"burst": 2
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)curl --request PATCH \
--url https://api.13-215-85-171.sslip.io/v1/machines/{id}/egress \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"egress": {
"allow_cidrs": [
"<string>"
],
"deny_cidrs": [
"<string>"
],
"rate_limit": {
"kbit_per_sec": 2,
"pps": 2,
"burst": 2
}
}
}
'{
"machine_id": "mch_a1b2c3d4",
"egress": {
"mode": "allow_all",
"allow_cidrs": [
"<string>"
],
"deny_cidrs": [
"<string>"
],
"rate_limit": {
"kbit_per_sec": 2,
"pps": 2,
"burst": 2
}
}
}{
"error": "<string>",
"code": "invalid_request",
"error_detail": {
"code": "unauthorized",
"message": "<string>",
"phase": "auth",
"retryable": true,
"suggested_action": "<string>",
"step_index": 123,
"attempt": 123,
"max_attempts": 123,
"cache_subject": "<string>",
"build_id": "<string>",
"request_id": "<string>",
"details": {}
},
"request_id": "<string>",
"build_id": "<string>"
}{
"error": "<string>",
"code": "invalid_request",
"error_detail": {
"code": "unauthorized",
"message": "<string>",
"phase": "auth",
"retryable": true,
"suggested_action": "<string>",
"step_index": 123,
"attempt": 123,
"max_attempts": 123,
"cache_subject": "<string>",
"build_id": "<string>",
"request_id": "<string>",
"details": {}
},
"request_id": "<string>",
"build_id": "<string>"
}Machines
Update the egress policy of a running machine
Replace the per-machine egress policy on a running machine without recreate. The host rebuilds the machine’s egress firewall chain atomically; tightening (e.g. to deny_all) fails closed, and broadening only reports success after the new rules apply. The policy survives hibernate/resume.
PATCH
/
v1
/
machines
/
{id}
/
egress
Update the egress policy of a running machine
import requests
url = "https://api.13-215-85-171.sslip.io/v1/machines/{id}/egress"
payload = { "egress": {
"allow_cidrs": ["<string>"],
"deny_cidrs": ["<string>"],
"rate_limit": {
"kbit_per_sec": 2,
"pps": 2,
"burst": 2
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)curl --request PATCH \
--url https://api.13-215-85-171.sslip.io/v1/machines/{id}/egress \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"egress": {
"allow_cidrs": [
"<string>"
],
"deny_cidrs": [
"<string>"
],
"rate_limit": {
"kbit_per_sec": 2,
"pps": 2,
"burst": 2
}
}
}
'{
"machine_id": "mch_a1b2c3d4",
"egress": {
"mode": "allow_all",
"allow_cidrs": [
"<string>"
],
"deny_cidrs": [
"<string>"
],
"rate_limit": {
"kbit_per_sec": 2,
"pps": 2,
"burst": 2
}
}
}{
"error": "<string>",
"code": "invalid_request",
"error_detail": {
"code": "unauthorized",
"message": "<string>",
"phase": "auth",
"retryable": true,
"suggested_action": "<string>",
"step_index": 123,
"attempt": 123,
"max_attempts": 123,
"cache_subject": "<string>",
"build_id": "<string>",
"request_id": "<string>",
"details": {}
},
"request_id": "<string>",
"build_id": "<string>"
}{
"error": "<string>",
"code": "invalid_request",
"error_detail": {
"code": "unauthorized",
"message": "<string>",
"phase": "auth",
"retryable": true,
"suggested_action": "<string>",
"step_index": 123,
"attempt": 123,
"max_attempts": 123,
"cache_subject": "<string>",
"build_id": "<string>",
"request_id": "<string>",
"details": {}
},
"request_id": "<string>",
"build_id": "<string>"
}Authorizations
API key passed as Bearer token
Path Parameters
Machine ID (e.g. mch_a1b2c3d4)
Body
application/json
Typed per-machine egress policy. IPv4 only; no domain/DNS filtering. deny_all is fail-closed and cannot be weakened by other fields.
Show child attributes
Show child attributes