Replace a sandbox network policy
curl --request PATCH \
--url https://api.thundercompute.com:8443/v1/sandboxes/{id}/network-policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"network_policy": {
"internet_access": "restricted",
"domain_allowlist": [
"pypi.org",
"files.pythonhosted.org"
]
}
}
'import requests
url = "https://api.thundercompute.com:8443/v1/sandboxes/{id}/network-policy"
payload = { "network_policy": {
"internet_access": "restricted",
"domain_allowlist": ["pypi.org", "files.pythonhosted.org"]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
network_policy: {
internet_access: 'restricted',
domain_allowlist: ['pypi.org', 'files.pythonhosted.org']
}
})
};
fetch('https://api.thundercompute.com:8443/v1/sandboxes/{id}/network-policy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "sbx-0123456789abcdef",
"network_policy": {
"internet_access": "closed",
"cidr_allowlist": [
"203.0.113.0/24"
],
"domain_allowlist": [
"*.example.com"
]
}
}{
"error": "invalid_request",
"message": "Invalid request body",
"code": 400
}{
"error": "invalid_request",
"message": "Invalid request body",
"code": 400
}{
"error": "invalid_request",
"message": "Invalid request body",
"code": 400
}{
"error": "invalid_request",
"message": "Invalid request body",
"code": 400
}{
"error": "invalid_request",
"message": "Invalid request body",
"code": 400
}{
"error": "invalid_request",
"message": "Invalid request body",
"code": 400
}{
"error": "invalid_request",
"message": "Invalid request body",
"code": 400
}{
"error": "invalid_request",
"message": "Invalid request body",
"code": 400
}API reference
Replace a sandbox network policy
Replaces the complete outbound network policy of a running sandbox. The response confirms the accepted policy; enforcement on the sandbox node converges asynchronously.
PATCH
/
sandboxes
/
{id}
/
network-policy
Replace a sandbox network policy
curl --request PATCH \
--url https://api.thundercompute.com:8443/v1/sandboxes/{id}/network-policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"network_policy": {
"internet_access": "restricted",
"domain_allowlist": [
"pypi.org",
"files.pythonhosted.org"
]
}
}
'import requests
url = "https://api.thundercompute.com:8443/v1/sandboxes/{id}/network-policy"
payload = { "network_policy": {
"internet_access": "restricted",
"domain_allowlist": ["pypi.org", "files.pythonhosted.org"]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
network_policy: {
internet_access: 'restricted',
domain_allowlist: ['pypi.org', 'files.pythonhosted.org']
}
})
};
fetch('https://api.thundercompute.com:8443/v1/sandboxes/{id}/network-policy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "sbx-0123456789abcdef",
"network_policy": {
"internet_access": "closed",
"cidr_allowlist": [
"203.0.113.0/24"
],
"domain_allowlist": [
"*.example.com"
]
}
}{
"error": "invalid_request",
"message": "Invalid request body",
"code": 400
}{
"error": "invalid_request",
"message": "Invalid request body",
"code": 400
}{
"error": "invalid_request",
"message": "Invalid request body",
"code": 400
}{
"error": "invalid_request",
"message": "Invalid request body",
"code": 400
}{
"error": "invalid_request",
"message": "Invalid request body",
"code": 400
}{
"error": "invalid_request",
"message": "Invalid request body",
"code": 400
}{
"error": "invalid_request",
"message": "Invalid request body",
"code": 400
}{
"error": "invalid_request",
"message": "Invalid request body",
"code": 400
}Authorizations
API token created in the Thunder console.
Path Parameters
Permanent API-assigned sandbox ID.
Pattern:
^sbx-[a-f0-9]{16}$Body
application/json
Show child attributes
Show child attributes