Description

Request URL

Network API v2.0

POST /v2.0/security-groups

Request Paramters

Parameter Value Style Description
X-Auth-Token User Token header
name name plain A symbolic name for the security group. The name cannot be repeated.
description (Optional) description plain Describes the security group.

Request Json

{
    "security_group": {
        "name": "new-webservers",
        "description": "security group for webservers"
    }
}

Normal response codes

201

Example

curl -i -X POST \
-H "Accept: application/json" \
-H "X-Auth-Token: 0925897a3d4543218ff0dcd2bb378a8e" \
-d '{"security_group": {"name": "test-01"}}' \
https://networking.tyo1.cloud.z.com/v2.0/security-groups
HTTP/1.1 201 Created
Server: openresty/1.7.10.1
Date: Fri, 08 May 2015 12:32:31 GMT
Content-Type: application/json
Content-Length: 768
Connection: keep-alive

{
    "security_group": {
        "tenant_id": "22394afc818d471ca2f0308c06ae7460",
        "description": "",
        "id": "d640f9e7-f329-4813-919e-0382799f6ce4",
        "security_group_rules": [
            {
                "remote_group_id": null,
                "direction": "egress",
                "remote_ip_prefix": null,
                "protocol": null,
                "ethertype": "IPv4",
                "tenant_id": "22394afc818d471ca2f0308c06ae7460",
                "port_range_max": null,
                "port_range_min": null,
                "id": "1bd0c423-e5dd-4313-a251-2211012d3dfa",
                "security_group_id": "d640f9e7-f329-4813-919e-0382799f6ce4"
            },
            {
                "remote_group_id": null,
                "direction": "egress",
                "remote_ip_prefix": null,
                "protocol": null,
                "ethertype": "IPv6",
                "tenant_id": "22394afc818d471ca2f0308c06ae7460",
                "port_range_max": null,
                "port_range_min": null,
                "id": "a8a9cfc5-8247-4f62-8ba5-2910c6ea8c30",
                "security_group_id": "d640f9e7-f329-4813-919e-0382799f6ce4"
            }
        ],
        "name": "test-01"
    }
}