3.34.2. Create default security group rule

 
MethodURIDescription
POST/v2/{tenant_id}/os-security-group-rules

Creates a default security group rule.

Normal response codes: 200

 3.34.2.1. Request

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

NameTypeDescription

{tenant_id}

​String

The unique identifier of the tenant or account.

 

Example 3.293. Create default security group rule: JSON request

{
    "security_group_default_rule": {
        "ip_protocol": "TCP",
        "from_port": "80",
        "to_port": "80",
        "cidr": "10.10.12.0/24"
    }
}

 

Example 3.294. Create default security group rule: XML request

<?xml version='1.0' encoding='UTF-8'?>
<security_group_default_rule>
  <ip_protocol>TCP</ip_protocol>
  <from_port>80</from_port>
  <to_port>80</to_port>
  <cidr>10.10.12.0/24</cidr>
</security_group_default_rule>

This operation does not require a request body.

 3.34.2.2. Response

 

Example 3.295. Create default security group rule: JSON response

{
    "security_group_default_rule": {
        "from_port": 80,
        "id": 1,
        "ip_protocol": "TCP",
        "ip_range":{
            "cidr": "10.10.10.0/24"
        },
        "to_port": 80
    }
}

 

Example 3.296. Create default security group rule: XML response

<?xml version='1.0' encoding='UTF-8'?>
<security_group_default_rule xmlns="http://docs.openstack.org/compute/api/v1.1"  id="1">
  <ip_protocol>TCP</ip_protocol>
  <from_port>80</from_port>
  <to_port>80</to_port>
  <ip_range>
    <cidr>10.10.10.0/24</cidr>
  </ip_range>
</security_group_default_rule>

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...