3.35.2. Create security group

 
MethodURIDescription
POST/v2/{tenant_id}/os-security-groups

Creates a security group.

Normal response codes: 200

 3.35.2.1. Request

This table shows the URI parameters for the create security group request:

NameTypeDescription

{tenant_id}

​String

The unique identifier of the tenant or account.

 

Example 3.301. Create security group: JSON request

{
    "addSecurityGroup" : {
        "name" : "test"
    }
}

 

Example 3.302. Create security group: XML request

<?xml version="1.0" encoding="UTF-8"?>
<addSecurityGroup>
  <name>test</name>
</addSecurityGroup>

This operation does not require a request body.

 3.35.2.2. Response

 

Example 3.303. Create security group: JSON response

{
    "security_group": {
        "description": "description",
        "id": 2,
        "name": "test",
        "rules": [],
        "tenant_id": "openstack"
    }
}

 

Example 3.304. Create security group: XML response

<?xml version='1.0' encoding='UTF-8'?>
<security_group xmlns="http://docs.openstack.org/compute/api/v1.1" tenant_id="openstack" id="2" name="test">
  <description>
        description
    </description>
  <rules/>
</security_group>

This operation does not return a response body.

Questions? Discuss on ask.openstack.org
Found an error? Report a bug against this page


loading table of contents...