• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Nova
  5. Server Actions
  6. Adding a Security Group

Adding a Security Group

Function Description

This interface is used to add an ECS to a security group.

You are suggested to add an ECS to a maximum of five security groups.

URI

  • URI format

    POST /v2/{tenant_id}/servers/{server_id}/action

    POST /v2.1/{tenant_id}/servers/{server_id}/action

  • Parameter description

    Parameter

    Mandatory

    Description

    tenant_id

    Yes

    Specifies the tenant or project ID.

    server_id

    Yes

    Specifies the ECS ID.

Extension Description

N/A

Request

Table 1 Request parameter

Parameter

Type

Mandatory

Description

addSecurityGroup

Dict

Yes

Adds an ECS to a security group.

Table 2 addSecurityGroup parameter description

Parameter

Type

Mandatory

Description

name

String

Yes

Specifies the name of the security group to which the ECS is added. The name takes effect for the NICs on the ECS.

Response

N/A

Example Request

{ 
    "addSecurityGroup": { 
        "name": "sg-test"
    }
}

Returned Value

See General Request Returned Values.