Attach a Compute instance to a Security Group
PUT /security-group/{id}:attach
curl \
-X PUT https://api-ch-gva-2.exoscale.com/v2/security-group/{id}:attach \
-H "Content-Type: application/json" \
-d '{"instance":{"anti-affinity-groups":[{}],"public-ip-assignment":"inet4","labels":{"additionalProperty1":"string","additionalProperty2":"string"},"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"}]}],"elastic-ips":[{"description":"string","healthcheck":{"strikes-ok":42,"tls-skip-verify":true,"tls-sni":"string","strikes-fail":42,"mode":"tcp","port":42,"uri":"string","interval":42,"timeout":42},"labels":{"additionalProperty1":"string","additionalProperty2":"string"}}],"name":"string","instance-type":{},"private-networks":[{"id":"string","mac-address":"string"}],"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"},"snapshots":[{"name":"string","state":"snapshotting","export":{"presigned-url":"string","md5sum":"string"},"instance":{}}],"disk-size":42,"ssh-keys":[{"name":"string"}]}}'
Request examples
{
"instance": {
"anti-affinity-groups": [
{}
],
"public-ip-assignment": "inet4",
"labels": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"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"
}
]
}
],
"elastic-ips": [
{
"description": "string",
"healthcheck": {
"strikes-ok": 42,
"tls-skip-verify": true,
"tls-sni": "string",
"strikes-fail": 42,
"mode": "tcp",
"port": 42,
"uri": "string",
"interval": 42,
"timeout": 42
},
"labels": {
"additionalProperty1": "string",
"additionalProperty2": "string"
}
}
],
"name": "string",
"instance-type": {},
"private-networks": [
{
"id": "string",
"mac-address": "string"
}
],
"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"
},
"snapshots": [
{
"name": "string",
"state": "snapshotting",
"export": {
"presigned-url": "string",
"md5sum": "string"
},
"instance": {}
}
],
"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"
}