Skip to content

Security Group

Security Groups are groups of firewall rules that regulate network traffic to and from your Compute instances.

Read more

create-security-group

Create a Security Group

POST /security-group

Request body

Content-Type: application/json

PropertyTypeRequiredDescription
namestringyesSecurity Group name

Min length: 1. Max length: 255.
descriptionstringnoSecurity Group description

Max length: 255.
Example
{
  "description": "string",
  "name": "string"
}

Responses

Status: 200 - 200

Content-Type: application/json

PropertyTypeDescription
idstringOperation ID

Must be a valid UUID.
messagestringOperation message
reasonstringOperation failure reason

Allowed values: incorrect, unknown, unavailable, forbidden, busy, fault, partial, not-found, interrupted, unsupported, conflict.
referenceReferenceRelated resource reference
statestringOperation status

Allowed values: failure, pending, success, timeout.
Example output
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}

SDK reference for create-security-group: golang | Python | Java

CLI: exo api create-security-group

get-security-group

Retrieve Security Group details

GET /security-group/{id}

Path parameters

NameInDescription
idpathMust be a valid UUID.

Responses

Status: 200 - 200

Content-Type: application/json

PropertyTypeDescription
descriptionstringSecurity Group description

Max length: 255.
external-sourcesarray[string]Security Group external sources
idstringSecurity Group ID

Must be a valid UUID.
namestringSecurity Group name

Min length: 1. Max length: 255.
rulesarray of Security Group ruleSecurity Group rules
Example output
{
  "description": "string",
  "external-sources": [
    "string"
  ],
  "id": "string",
  "name": "string",
  "rules": [
    {
      "description": "string",
      "end-port": 0,
      "flow-direction": "ingress",
      "icmp": {
        "code": 0,
        "type": 0
      },
      "id": "string",
      "network": "string",
      "protocol": "tcp",
      "security-group": {
        "id": "string",
        "name": "string",
        "visibility": "private"
      },
      "start-port": 0
    }
  ]
}

SDK reference for get-security-group: golang | Python | Java

CLI: exo api get-security-group

delete-security-group

Delete a Security Group

DELETE /security-group/{id}

Path parameters

NameInDescription
idpathMust be a valid UUID.

Responses

Status: 200 - 200

Content-Type: application/json

PropertyTypeDescription
idstringOperation ID

Must be a valid UUID.
messagestringOperation message
reasonstringOperation failure reason

Allowed values: incorrect, unknown, unavailable, forbidden, busy, fault, partial, not-found, interrupted, unsupported, conflict.
referenceReferenceRelated resource reference
statestringOperation status

Allowed values: failure, pending, success, timeout.
Example output
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}

SDK reference for delete-security-group: golang | Python | Java

CLI: exo api delete-security-group


Other Operations

remove-external-source-from-security-group

Remove an external source from a Security Group

PUT /security-group/{id}:remove-source

Path parameters

NameInDescription
idpathMust be a valid UUID.

Request body

Content-Type: application/json

PropertyTypeRequiredDescription
cidrstringyesCIDR-formatted network to remove
Example
{
  "cidr": "string"
}

Responses

Status: 200 - 200

Content-Type: application/json

PropertyTypeDescription
idstringOperation ID

Must be a valid UUID.
messagestringOperation message
reasonstringOperation failure reason

Allowed values: incorrect, unknown, unavailable, forbidden, busy, fault, partial, not-found, interrupted, unsupported, conflict.
referenceReferenceRelated resource reference
statestringOperation status

Allowed values: failure, pending, success, timeout.
Example output
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}

SDK reference for remove-external-source-from-security-group: golang | Python | Java

CLI: exo api remove-external-source-from-security-group

add-external-source-to-security-group

Add an external source as a member of a Security Group

PUT /security-group/{id}:add-source

Path parameters

NameInDescription
idpathMust be a valid UUID.

Request body

Content-Type: application/json

PropertyTypeRequiredDescription
cidrstringyesCIDR-formatted network to add
Example
{
  "cidr": "string"
}

Responses

Status: 200 - 200

Content-Type: application/json

PropertyTypeDescription
idstringOperation ID

Must be a valid UUID.
messagestringOperation message
reasonstringOperation failure reason

Allowed values: incorrect, unknown, unavailable, forbidden, busy, fault, partial, not-found, interrupted, unsupported, conflict.
referenceReferenceRelated resource reference
statestringOperation status

Allowed values: failure, pending, success, timeout.
Example output
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}

SDK reference for add-external-source-to-security-group: golang | Python | Java

CLI: exo api add-external-source-to-security-group

detach-instance-from-security-group

Detach a Compute instance from a Security Group

PUT /security-group/{id}:detach

Path parameters

NameInDescription
idpathMust be a valid UUID.

Request body

Content-Type: application/json

PropertyTypeRequiredDescription
instanceInstanceyesCompute instance
Example
{
  "instance": {
    "anti-affinity-groups": [
      {
        "id": "string"
      }
    ],
    "application-consistent-snapshot-enabled": true,
    "created-at": "2024-01-01T12:00:00Z",
    "deploy-target": {
      "id": "string"
    },
    "disk-encrypted": true,
    "disk-size": 0,
    "elastic-ips": [
      {
        "id": "string"
      }
    ],
    "id": "string",
    "instance-type": {
      "authorized": true,
      "cpus": 0,
      "family": "gpu3",
      "gpus": 0,
      "id": "string",
      "memory": 0,
      "size": "large",
      "zones": [
        "ch-dk-2"
      ]
    },
    "ipv6-address": "string",
    "labels": {},
    "mac-address": "string",
    "manager": {
      "id": "string",
      "type": "sks-nodepool"
    },
    "name": "string",
    "private-networks": [
      {
        "id": "string",
        "mac-address": "string"
      }
    ],
    "public-ip": "string",
    "public-ip-assignment": "inet4",
    "secureboot-enabled": true,
    "security-groups": [
      {
        "id": "string"
      }
    ],
    "snapshots": [
      {
        "id": "string"
      }
    ],
    "ssh-key": {
      "fingerprint": "string",
      "name": "string"
    },
    "ssh-keys": [
      {
        "fingerprint": "string",
        "name": "string"
      }
    ],
    "state": "expunging",
    "template": {
      "application-consistent-snapshot-enabled": true,
      "boot-mode": "legacy",
      "build": "string",
      "checksum": "string",
      "created-at": "2024-01-01T12:00:00Z",
      "default-user": "string",
      "description": "string",
      "family": "string",
      "id": "string",
      "maintainer": "string",
      "name": "string",
      "password-enabled": true,
      "size": 0,
      "ssh-key-enabled": true,
      "url": "string",
      "version": "string",
      "visibility": "private",
      "zones": [
        "ch-dk-2"
      ]
    },
    "tpm-enabled": true,
    "user-data": "string"
  }
}

Responses

Status: 200 - 200

Content-Type: application/json

PropertyTypeDescription
idstringOperation ID

Must be a valid UUID.
messagestringOperation message
reasonstringOperation failure reason

Allowed values: incorrect, unknown, unavailable, forbidden, busy, fault, partial, not-found, interrupted, unsupported, conflict.
referenceReferenceRelated resource reference
statestringOperation status

Allowed values: failure, pending, success, timeout.
Example output
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}

SDK reference for detach-instance-from-security-group: golang | Python | Java

CLI: exo api detach-instance-from-security-group

attach-instance-to-security-group

Attach a Compute instance to a Security Group

PUT /security-group/{id}:attach

Path parameters

NameInDescription
idpathMust be a valid UUID.

Request body

Content-Type: application/json

PropertyTypeRequiredDescription
instanceInstanceyesCompute instance
Example
{
  "instance": {
    "anti-affinity-groups": [
      {
        "id": "string"
      }
    ],
    "application-consistent-snapshot-enabled": true,
    "created-at": "2024-01-01T12:00:00Z",
    "deploy-target": {
      "id": "string"
    },
    "disk-encrypted": true,
    "disk-size": 0,
    "elastic-ips": [
      {
        "id": "string"
      }
    ],
    "id": "string",
    "instance-type": {
      "authorized": true,
      "cpus": 0,
      "family": "gpu3",
      "gpus": 0,
      "id": "string",
      "memory": 0,
      "size": "large",
      "zones": [
        "ch-dk-2"
      ]
    },
    "ipv6-address": "string",
    "labels": {},
    "mac-address": "string",
    "manager": {
      "id": "string",
      "type": "sks-nodepool"
    },
    "name": "string",
    "private-networks": [
      {
        "id": "string",
        "mac-address": "string"
      }
    ],
    "public-ip": "string",
    "public-ip-assignment": "inet4",
    "secureboot-enabled": true,
    "security-groups": [
      {
        "id": "string"
      }
    ],
    "snapshots": [
      {
        "id": "string"
      }
    ],
    "ssh-key": {
      "fingerprint": "string",
      "name": "string"
    },
    "ssh-keys": [
      {
        "fingerprint": "string",
        "name": "string"
      }
    ],
    "state": "expunging",
    "template": {
      "application-consistent-snapshot-enabled": true,
      "boot-mode": "legacy",
      "build": "string",
      "checksum": "string",
      "created-at": "2024-01-01T12:00:00Z",
      "default-user": "string",
      "description": "string",
      "family": "string",
      "id": "string",
      "maintainer": "string",
      "name": "string",
      "password-enabled": true,
      "size": 0,
      "ssh-key-enabled": true,
      "url": "string",
      "version": "string",
      "visibility": "private",
      "zones": [
        "ch-dk-2"
      ]
    },
    "tpm-enabled": true,
    "user-data": "string"
  }
}

Responses

Status: 200 - 200

Content-Type: application/json

PropertyTypeDescription
idstringOperation ID

Must be a valid UUID.
messagestringOperation message
reasonstringOperation failure reason

Allowed values: incorrect, unknown, unavailable, forbidden, busy, fault, partial, not-found, interrupted, unsupported, conflict.
referenceReferenceRelated resource reference
statestringOperation status

Allowed values: failure, pending, success, timeout.
Example output
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}

SDK reference for attach-instance-to-security-group: golang | Python | Java

CLI: exo api attach-instance-to-security-group

delete-rule-from-security-group

Delete a Security Group rule

DELETE /security-group/{id}/rules/{rule-id}

Path parameters

NameInDescription
idpathMust be a valid UUID.
rule-idpathMust be a valid UUID.

Responses

Status: 200 - 200

Content-Type: application/json

PropertyTypeDescription
idstringOperation ID

Must be a valid UUID.
messagestringOperation message
reasonstringOperation failure reason

Allowed values: incorrect, unknown, unavailable, forbidden, busy, fault, partial, not-found, interrupted, unsupported, conflict.
referenceReferenceRelated resource reference
statestringOperation status

Allowed values: failure, pending, success, timeout.
Example output
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}

SDK reference for delete-rule-from-security-group: golang | Python | Java

CLI: exo api delete-rule-from-security-group

add-rule-to-security-group

Create a Security Group rule

POST /security-group/{id}/rules

Path parameters

NameInDescription
idpathMust be a valid UUID.

Request body

Content-Type: application/json

PropertyTypeRequiredDescription
flow-directionstringyesNetwork flow direction to match

Allowed values: ingress, egress.
protocolstringyesNetwork protocol

Allowed values: tcp, esp, icmp, udp, gre, ah, ipip, icmpv6.
descriptionstringnoSecurity Group rule description

Max length: 255.
end-portintegernoEnd port of the range

Min: 1. Max: 65535.
icmpICMPnoICMP details (default: -1 (ANY))
networkstringnoCIDR-formatted network allowed
security-groupSecurity GroupnoSecurity Group allowed
start-portintegernoStart port of the range

Min: 1. Max: 65535.
Example
{
  "description": "string",
  "end-port": 0,
  "flow-direction": "ingress",
  "icmp": {
    "code": 0,
    "type": 0
  },
  "network": "string",
  "protocol": "tcp",
  "security-group": {
    "id": "string",
    "name": "string",
    "visibility": "private"
  },
  "start-port": 0
}

ICMP

ICMP details (default: -1 (ANY))

PropertyTypeRequiredDescription
codeintegernoMin: -1. Max: 254.
typeintegernoMin: -1. Max: 254.

Responses

Status: 200 - 200

Content-Type: application/json

PropertyTypeDescription
idstringOperation ID

Must be a valid UUID.
messagestringOperation message
reasonstringOperation failure reason

Allowed values: incorrect, unknown, unavailable, forbidden, busy, fault, partial, not-found, interrupted, unsupported, conflict.
referenceReferenceRelated resource reference
statestringOperation status

Allowed values: failure, pending, success, timeout.
Example output
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}

SDK reference for add-rule-to-security-group: golang | Python | Java

CLI: exo api add-rule-to-security-group

list-security-groups

List Security Groups.

GET /security-group

Lists security groups. When visibility is set to public, lists public security groups. Public security groups are objects maintained by Exoscale which contain source addresses for relevant services hosted by Exoscale. They can be used a source in ingress rules and as a destination in egress rules.

Query parameters

NameInRequiredDescription
visibilityqueryno

Responses

Status: 200 - 200

Content-Type: application/json

PropertyTypeDescription
security-groupsarray of Security Group
Example output
{
  "security-groups": [
    {
      "description": "string",
      "external-sources": [
        "string"
      ],
      "id": "string",
      "name": "string",
      "rules": [
        {
          "description": "string",
          "end-port": 0,
          "flow-direction": "ingress",
          "icmp": {
            "code": null,
            "type": null
          },
          "id": "string",
          "network": "string",
          "protocol": "tcp",
          "security-group": {
            "id": null,
            "name": null,
            "visibility": null
          },
          "start-port": 0
        }
      ]
    }
  ]
}

SDK reference for list-security-groups: golang | Python | Java

CLI: exo api list-security-groups

Last updated on