curl --request POST \
--url https://api.compute.anonalabs.com/v3/templates \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"tags": [
"<string>"
],
"alias": "<string>",
"teamID": "<string>",
"cpuCount": 2,
"memoryMB": 129,
"minFreeDiskMb": 1
}
'import requests
url = "https://api.compute.anonalabs.com/v3/templates"
payload = {
"name": "<string>",
"tags": ["<string>"],
"alias": "<string>",
"teamID": "<string>",
"cpuCount": 2,
"memoryMB": 129,
"minFreeDiskMb": 1
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
tags: ['<string>'],
alias: '<string>',
teamID: '<string>',
cpuCount: 2,
memoryMB: 129,
minFreeDiskMb: 1
})
};
fetch('https://api.compute.anonalabs.com/v3/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"templateID": "<string>",
"buildID": "<string>",
"public": true,
"names": [
"<string>"
],
"tags": [
"<string>"
],
"aliases": [
"<string>"
]
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}Create template (v3)
Create a new template
Anona builds the image with BuildKit in an isolated builder, adds the Anona runtime layer (envd), pushes it and registers it. Every FROM is pinned by digest, and EXPOSE 49983 (envd) is refused.
curl --request POST \
--url https://api.compute.anonalabs.com/v3/templates \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"tags": [
"<string>"
],
"alias": "<string>",
"teamID": "<string>",
"cpuCount": 2,
"memoryMB": 129,
"minFreeDiskMb": 1
}
'import requests
url = "https://api.compute.anonalabs.com/v3/templates"
payload = {
"name": "<string>",
"tags": ["<string>"],
"alias": "<string>",
"teamID": "<string>",
"cpuCount": 2,
"memoryMB": 129,
"minFreeDiskMb": 1
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
tags: ['<string>'],
alias: '<string>',
teamID: '<string>',
cpuCount: 2,
memoryMB: 129,
minFreeDiskMb: 1
})
};
fetch('https://api.compute.anonalabs.com/v3/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"templateID": "<string>",
"buildID": "<string>",
"public": true,
"names": [
"<string>"
],
"tags": [
"<string>"
],
"aliases": [
"<string>"
]
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}Authorizations
Body
Name of the template. Can include a tag with colon separator (e.g. "my-template" or "my-template:v1"). If tag is included, it will be treated as if the tag was provided in the tags array.
128Tags to assign to the template build
Alias of the template. Deprecated, use name instead.
128Identifier of the team, as its UUID or its public project ID (prj_)
CPU cores for the sandbox
x >= 1Memory for the sandbox in MiB
x >= 128Requested minimum free space after the template's build steps, in MiB. Omit to use the team's default. Set to 0 to request no minimum free-disk growth. The filesystem is never shrunk, including inherited or already-larger filesystems. Growth is best effort, so filesystem metadata can leave the available space slightly below the requested minimum.
x >= 0Response
The build was requested successfully
Identifier of the template
Identifier of the last successful build for given template
Whether the template is public or only accessible by the team
Names of the template
Tags assigned to the template build
Aliases of the template