Skip to main content
POST
/
cloud
/
v1
/
instances
/
{project_id}
/
{region_id}
/
{instance_id}
/
addsecuritygroup
Assign security group
curl --request POST \
  --url https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/{instance_id}/addsecuritygroup \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "some_name",
  "ports_security_group_names": [
    {
      "port_id": null,
      "security_group_names": [
        "some_name"
      ]
    },
    {
      "port_id": "ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
      "security_group_names": [
        "name1",
        "name2"
      ]
    }
  ]
}
'

Documentation Index

Fetch the complete documentation index at: https://gcore.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Path Parameters

project_id
integer
required

Project ID

region_id
integer
required

Region ID

instance_id
string
required

Instance ID

Body

application/json

Instance ports security groups

name
string

Security group name, applies to all ports

Pattern: ^[a-zA-Z0-9][a-zA-Z 0-9._\-]{1,61}[a-zA-Z0-9._]$
ports_security_group_names
object[]

Port security groups mapping

Response

204

Everything is OK