Create a Compute instance
Body Required
-
anti-affinity-groups array[object]
Instance Anti-affinity Groups
-
public-ip-assignment string
Instance public IP assignment
Values are
inet4
,dual
, ornone
. -
labels object
Resource labels
-
auto-start boolean
Start Instance on creation (default: true)
-
security-groups array[object]
Instance Security Groups
-
name string
Instance name
Minimum length is
1
, maximum length is255
. -
Instance Type
Additional properties are allowed.
-
Instance Template
Additional properties are allowed.
-
ssh-key object
Instance SSH Key
Additional properties are allowed.
-
user-data string
Instance Cloud-init user-data (base64 encoded)
Minimum length is
1
, maximum length is32768
. -
deploy-target object
Instance Deploy Target
Additional properties are allowed.
-
ipv6-enabled boolean
Enable IPv6. DEPRECATED: use
public-ip-assignments
. -
Instance disk size in GiB
Minimum value is
10
, maximum value is51200
. -
ssh-keys array[object]
Instance SSH Keys
POST /instance
curl \
-X POST https://api-ch-gva-2.exoscale.com/v2/instance \
-H "Content-Type: application/json" \
-d '{"anti-affinity-groups":[{"name":"string","description":"string"}],"public-ip-assignment":"inet4","labels":{"additionalProperty1":"string","additionalProperty2":"string"},"auto-start":true,"security-groups":[{"name":"string","description":"string","external-sources":["string"],"rules":[{"description":"string","start-port":42,"protocol":"tcp","icmp":{"code":42,"type":42},"end-port":42,"security-group":{"name":"string","visibility":"private"},"network":"string","flow-direction":"ingress"}]}],"name":"string","instance-type":{},"template":{"description":"string","ssh-key-enabled":true,"name":"string","default-user":"string","size":42,"password-enabled":true,"checksum":"string","boot-mode":"legacy","zones":["ch-dk-2"],"url":"string"},"ssh-key":{"name":"string"},"user-data":"string","deploy-target":{"id":"string","name":"string","type":"edge","description":"string"},"ipv6-enabled":true,"disk-size":42,"ssh-keys":[{"name":"string"}]}'
Request examples
{
"anti-affinity-groups": [
{
"name": "string",
"description": "string"
}
],
"public-ip-assignment": "inet4",
"labels": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"auto-start": true,
"security-groups": [
{
"name": "string",
"description": "string",
"external-sources": [
"string"
],
"rules": [
{
"description": "string",
"start-port": 42,
"protocol": "tcp",
"icmp": {
"code": 42,
"type": 42
},
"end-port": 42,
"security-group": {
"name": "string",
"visibility": "private"
},
"network": "string",
"flow-direction": "ingress"
}
]
}
],
"name": "string",
"instance-type": {},
"template": {
"description": "string",
"ssh-key-enabled": true,
"name": "string",
"default-user": "string",
"size": 42,
"password-enabled": true,
"checksum": "string",
"boot-mode": "legacy",
"zones": [
"ch-dk-2"
],
"url": "string"
},
"ssh-key": {
"name": "string"
},
"user-data": "string",
"deploy-target": {
"id": "string",
"name": "string",
"type": "edge",
"description": "string"
},
"ipv6-enabled": true,
"disk-size": 42,
"ssh-keys": [
{
"name": "string"
}
]
}
Response examples (200)
{
"id": "string",
"reason": "incorrect",
"reference": {
"id": "string",
"link": "string",
"command": "string"
},
"message": "string",
"state": "failure"
}