Set a template's egress policy
curl --request PUT \
--url https://api.compute.anonalabs.com/v1/templates/{templateID}/network \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"allow_internet_access": true,
"allowOut": [
"<string>"
],
"denyOut": [
"<string>"
],
"dnsServers": [
"<string>"
],
"rules": {},
"allowPublicTraffic": true
}
'import requests
url = "https://api.compute.anonalabs.com/v1/templates/{templateID}/network"
payload = {
"allow_internet_access": True,
"allowOut": ["<string>"],
"denyOut": ["<string>"],
"dnsServers": ["<string>"],
"rules": {},
"allowPublicTraffic": True
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
allow_internet_access: true,
allowOut: ['<string>'],
denyOut: ['<string>'],
dnsServers: ['<string>'],
rules: {},
allowPublicTraffic: true
})
};
fetch('https://api.compute.anonalabs.com/v1/templates/{templateID}/network', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"scope": "tenant_default",
"scopeID": "<string>",
"revision": 123,
"compiled": {
"allow_internet_access": true,
"allowOut": [
"<string>"
],
"denyOut": [
"<string>"
]
},
"warnings": [
"<string>"
]
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}Network
Set a template's egress policy
The default policy of sandboxes created from one of your own templates. The built-in templates are read-only (403); custom templates are coming soon.
PUT
/
v1
/
templates
/
{templateID}
/
network
Set a template's egress policy
curl --request PUT \
--url https://api.compute.anonalabs.com/v1/templates/{templateID}/network \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"allow_internet_access": true,
"allowOut": [
"<string>"
],
"denyOut": [
"<string>"
],
"dnsServers": [
"<string>"
],
"rules": {},
"allowPublicTraffic": true
}
'import requests
url = "https://api.compute.anonalabs.com/v1/templates/{templateID}/network"
payload = {
"allow_internet_access": True,
"allowOut": ["<string>"],
"denyOut": ["<string>"],
"dnsServers": ["<string>"],
"rules": {},
"allowPublicTraffic": True
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
allow_internet_access: true,
allowOut: ['<string>'],
denyOut: ['<string>'],
dnsServers: ['<string>'],
rules: {},
allowPublicTraffic: true
})
};
fetch('https://api.compute.anonalabs.com/v1/templates/{templateID}/network', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"scope": "tenant_default",
"scopeID": "<string>",
"revision": 123,
"compiled": {
"allow_internet_access": true,
"allowOut": [
"<string>"
],
"denyOut": [
"<string>"
]
},
"warnings": [
"<string>"
]
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}Authorizations
ApiKeyAuthBearerAuth
An Anona Compute API key (e2b_ followed by lowercase hex).
Path Parameters
Body
application/json
An egress policy in the E2B wire shape. Unknown keys are refused.
IPs, CIDRs or host names to allow
IPv4 addresses or CIDRs to block; 0.0.0.0/0 blocks all public egress
Per-host header transforms: {host: [{transform: {headers: {Name: "Bearer ${vault.name}"}}}]}
Show child attributes
Show child attributes