Skip to content

Security groups

Firewall rules for instances and load balancers.

Paths are relative to your API address. See Authentication and Operations. Changes that answer 202 Accepted return an operation to follow.

Request and response examples are generated from the schema; the tables under Schemas are the reference.

Create a security group

POST /v1/orgs/{org_id}/projects/{project_id}/security-groups

Creates a security group, with optional rules, in one location. Its name must be unused by the organization's other security groups in every project and location, ignoring case and surrounding spaces (409 security_group_name_taken). Accepted at once: follow the returned operation until it finishes.

Input parameters

Parameter In Type Default Nullable Description
Authorization header string N/A No Bearer followed by a service account's API key. The console uses your signed-in session instead.
idempotency-key header string Yes
org_id path string No
project_id path string No

Request body

{
    "display_name": "string",
    "execute_before": "2022-04-13T15:42:05.901Z",
    "location": "string",
    "template": "ssh"
}

Responses

{
    "operation": {
        "href": "string",
        "id": "string",
        "state": "string"
    }
}
{
    "detail": [
        {
            "ctx": {},
            "input": null,
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}

Delete a security group

DELETE /v1/orgs/{org_id}/projects/{project_id}/security-groups/{group_id}

Deletes the group. Refused while an instance or load balancer still uses it. Accepted at once: follow the returned operation until it finishes.

Input parameters

Parameter In Type Default Nullable Description
Authorization header string N/A No Bearer followed by a service account's API key. The console uses your signed-in session instead.
group_id path string No
idempotency-key header string Yes
org_id path string No
project_id path string No

Responses

{
    "operation": {
        "href": "string",
        "id": "string",
        "state": "string"
    }
}
{
    "detail": [
        {
            "ctx": {},
            "input": null,
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}

Rename a security group

PATCH /v1/orgs/{org_id}/projects/{project_id}/security-groups/{group_id}

Changes the group's name or description. A new name must be unused by the organization's other security groups, as for a create (409 security_group_name_taken). Accepted at once: follow the returned operation until it finishes.

Input parameters

Parameter In Type Default Nullable Description
Authorization header string N/A No Bearer followed by a service account's API key. The console uses your signed-in session instead.
group_id path string No
idempotency-key header string Yes
org_id path string No
project_id path string No

Request body

{
    "display_name": "string",
    "execute_before": "2022-04-13T15:42:05.901Z"
}

Responses

{
    "operation": {
        "href": "string",
        "id": "string",
        "state": "string"
    }
}
{
    "detail": [
        {
            "ctx": {},
            "input": null,
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}

Add a security group rule

POST /v1/orgs/{org_id}/projects/{project_id}/security-groups/{group_id}:add-rule

Adds one rule to the group. Accepted at once: follow the returned operation until it finishes.

Input parameters

Parameter In Type Default Nullable Description
Authorization header string N/A No Bearer followed by a service account's API key. The console uses your signed-in session instead.
group_id path string No
idempotency-key header string Yes
org_id path string No
project_id path string No

Request body

{
    "direction": "ingress",
    "ethertype": "IPv4",
    "execute_before": "2022-04-13T15:42:05.901Z",
    "icmp_code": 0,
    "icmp_type": 0,
    "port_max": 0,
    "port_min": 0,
    "protocol": "tcp",
    "remote_group_id": "string",
    "remote_ip_prefix": "string"
}

Responses

{
    "operation": {
        "href": "string",
        "id": "string",
        "state": "string"
    }
}
{
    "detail": [
        {
            "ctx": {},
            "input": null,
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}

Remove a security group rule

POST /v1/orgs/{org_id}/projects/{project_id}/security-groups/{group_id}:remove-rule

Removes one rule from the group. Accepted at once: follow the returned operation until it finishes.

Input parameters

Parameter In Type Default Nullable Description
Authorization header string N/A No Bearer followed by a service account's API key. The console uses your signed-in session instead.
group_id path string No
idempotency-key header string Yes
org_id path string No
project_id path string No

Request body

{
    "direction": "ingress",
    "ethertype": "IPv4",
    "execute_before": "2022-04-13T15:42:05.901Z",
    "icmp_code": 0,
    "icmp_type": 0,
    "port_max": 0,
    "port_min": 0,
    "protocol": "tcp",
    "remote_group_id": "string",
    "remote_ip_prefix": "string"
}

Responses

{
    "operation": {
        "href": "string",
        "id": "string",
        "state": "string"
    }
}
{
    "detail": [
        {
            "ctx": {},
            "input": null,
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}

Schemas

Accepted

Name Type Description
operation OperationLink

GroupCreateBody

Name Type Description
display_name string
execute_before string(date-time) | null
location string
template string | null

GroupRenameBody

Name Type Description
display_name string
execute_before string(date-time) | null

HTTPValidationError

Name Type Description
detail Array<ValidationError>
Name Type Description
href string Where to read the operation; also the Location header.
id string The operation's ID (op_…).
state string | null Its state when accepted, normally queued.

RuleBody

Name Type Description
direction string
ethertype string
execute_before string(date-time) | null
icmp_code integer | null
icmp_type integer | null
port_max integer | null
port_min integer | null
protocol string | null
remote_group_id string | null
remote_ip_prefix string | null

ValidationError

Name Type Description
ctx
input
loc Array<>
msg string
type string