• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Nova
  5. Security Group Management
  6. Creating a Security Group (Discarded)

Creating a Security Group (Discarded)

Function

This API is used to create a security group.

Constraints

This API will be discarded.

You are advised to use the desired network API. For details, see "Security Group (Native OpenStack API) > Creating a Security Group" in Virtual Private Network API Reference.

URI

POST /v2.1/{project_id}/os-security-groups

Table 1 describes the parameters in the URI.
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

Request

Request parameters

Table 2 describes the request parameters.

Table 2 Request parameters

Parameter

Type

Mandatory

Description

security_group

Dict

Yes

Specifies the security group, which is configured in the message body. For details, see Table 3.

Table 3 Objects of request parameter security_group

Parameter

Type

Mandatory

Description

name

String

No

Specifies the security group name. It is a string of 0 to 255 characters.

description

String

No

Specifies information about a security group. It is a string of 0 to 255 characters.

Response

Response parameters

Table 4 describes the response parameters.

Table 4 Response parameters

Parameter

Type

Description

security_group

Dict

Specifies the security group. For details, see Table 5.

Table 5 Objects of response parameter security_group

Parameter

Type

Description

description

String(255)

Provides supplementary information about the security group.

id

String

Specifies the security group ID in UUID format.

name

String(255)

Specifies the security group name.

rules

List(security_group_rule)

Specifies the rules of the security group. The list is empty.

tenant_id

String(255)

Specifies the tenant or project ID.

Examples

  • Example request
    POST /v2/bb1118612ba64af3a6ea63a1bdcaa5ae/os-security-groups
    POST /v2.1/bb1118612ba64af3a6ea63a1bdcaa5ae/os-security-groups
    {
        "security_group": {
            "name": "test",
            "description": "description"
        }
    }
  • Example response
    {
        "security_group": {
            "rules": [],
            "tenant_id": "bb1118612ba64af3a6ea63a1bdcaa5ae",
            "description": "desc-sg",
            "id": "81f1d23b-b1e2-42cd-bdee-359b4a065a42",
            "name": "test-sg"
        }
    }

Returned Values

See General Request Returned Values.