• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Neutron
  5. Security Group
  6. Updating a Security Group

Updating a Security Group

Function

This interface is used to update a security group.

URI

PUT /v2.0/security-groups/{security_group_id}

Request Message

Table 1 Request parameter

Parameter

Type

Mandatory

Description

security_group

Dict

Yes

Specifies the security group list. For details, see Table 1.

This parameter has no mandatory fields. You must specify at least one attribute when updating the security group.

Response Message

Table 2 Response parameter

Parameter

Type

Description

security_group

Dict

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

Example:

Example request

PUT /v2.0/security-groups/d29ae17d-f355-4992-8747-1fb66cc9afd2  
{
    "security_group": {
           "name": "sg-test02"
    }
}

Example response

{
    "security_group": {
        "id": "d29ae17d-f355-4992-8747-1fb66cc9afd2",
        "name": "sg-test02",
        "description": "",
        "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
        "project_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
        "security_group_rules": [
            {
                "id": "6332de3e-98fb-4f8c-b44a-fcb8ff09881e",
                "direction": "egress",
                "protocol": null,
                "ethertype": "IPv6",
                "description": null,
                "remote_group_id": null,
                "remote_ip_prefix": null,
                "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
                "port_range_max": null,
                "port_range_min": null,
                "security_group_id": "d29ae17d-f355-4992-8747-1fb66cc9afd2"
            },
            {
                "id": "3f51e52c-0e85-40f7-a137-85927392e436",
                "direction": "egress",
                "protocol": null,
                "ethertype": "IPv4",
                "description": null,
                "remote_group_id": null,
                "remote_ip_prefix": null,
                "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
                "port_range_max": null,
                "port_range_min": null,
                "security_group_id": "d29ae17d-f355-4992-8747-1fb66cc9afd2"
            }
        ],
        "created_at": "2018-09-20T02:15:34",
        "updated_at": "2018-09-20T02:16:31"
    }
}

Status Codes

For details, see section Status Codes.