Cloud Management API 1.5

SecurityGroupRules

Actions

index

Lists SecurityGroupRules.

URLs
GET /api/clouds/:cloud_id/security_groups/:security_group_id/security_group_rules
GET /api/security_group_rules
HTTP response code
200 OK
Content-type
application/vnd.rightscale.security_group_rule;type=collection

Required roles

Parameters

name required type values regexp blank? description
view no String default * no Specifies how many attributes and/or expanded nested relationships to include.

Example Responses

Click on a format below to see an example response:

JSON XML
[{
  "links": [
    {"rel":"self","href":"/api/security_group_rules/1"},
    {"rel":"security_group","href":"/api/clouds/888/security_groups/RESOURCE_2841144858;RAND"}
  ],
  "actions": [

  ],
  "description": "some description",
  "cidr_ips": "10.0.0.0/32",
  "direction": "egress",
  "protocol": "tcp",
  "start_port": "10",
  "end_port": "20",
  "action": "allow",
  "source_type": "cidr"
},{
  "links": [
    {"rel":"self","href":"/api/security_group_rules/2"},
    {"rel":"security_group","href":"/api/clouds/888/security_groups/RESOURCE_3226297142;RAND"}
  ],
  "actions": [

  ],
  "description": "some description",
  "cidr_ips": "10.0.0.0/32",
  "direction": "egress",
  "protocol": "tcp",
  "start_port": "10",
  "end_port": "20",
  "action": "allow",
  "source_type": "cidr"
}]
<?xml version="1.0" encoding="UTF-8"?>
<security_group_rules>
  <security_group_rule>
    <links>
      <link rel="self" href="/api/security_group_rules/1"/>
      <link rel="security_group" href="/api/clouds/888/security_groups/RESOURCE_2841144858;RAND"/>
    </links>
    <actions/>
    <description>some description</description>
    <cidr_ips>10.0.0.0/32</cidr_ips>
    <direction>egress</direction>
    <protocol>tcp</protocol>
    <start_port>10</start_port>
    <end_port>20</end_port>
    <action>allow</action>
    <source_type>cidr</source_type>
  </security_group_rule>
  <security_group_rule>
    <links>
      <link rel="self" href="/api/security_group_rules/2"/>
      <link rel="security_group" href="/api/clouds/888/security_groups/RESOURCE_3226297142;RAND"/>
    </links>
    <actions/>
    <description>some description</description>
    <cidr_ips>10.0.0.0/32</cidr_ips>
    <direction>egress</direction>
    <protocol>tcp</protocol>
    <start_port>10</start_port>
    <end_port>20</end_port>
    <action>allow</action>
    <source_type>cidr</source_type>
  </security_group_rule>
</security_group_rules>

show

Displays information about a single SecurityGroupRule.

URLs
GET /api/clouds/:cloud_id/security_groups/:security_group_id/security_group_rules/:id
GET /api/security_group_rules/:id
HTTP response code
200 OK
Content-type
application/vnd.rightscale.security_group_rule

Required roles

Parameters

name required type values regexp blank? description
view no String default * no Specifies how many attributes and/or expanded nested relationships to include.

Example Responses

Click on a format below to see an example response:

JSON XML
{
  "links": [
    {"rel":"self","href":"/api/security_group_rules/1"},
    {"rel":"security_group","href":"/api/clouds/888/security_groups/RESOURCE_2841144858;RAND"}
  ],
  "actions": [

  ],
  "description": "some description",
  "cidr_ips": "10.0.0.0/32",
  "direction": "egress",
  "protocol": "tcp",
  "start_port": "10",
  "end_port": "20",
  "action": "allow",
  "source_type": "cidr"
}
<?xml version="1.0" encoding="UTF-8"?>
<security_group_rule>
  <links>
    <link rel="self" href="/api/security_group_rules/1"/>
    <link rel="security_group" href="/api/clouds/888/security_groups/RESOURCE_2841144858;RAND"/>
  </links>
  <actions/>
  <description>some description</description>
  <cidr_ips>10.0.0.0/32</cidr_ips>
  <direction>egress</direction>
  <protocol>tcp</protocol>
  <start_port>10</start_port>
  <end_port>20</end_port>
  <action>allow</action>
  <source_type>cidr</source_type>
</security_group_rule>

create

Create a security group rule for a security group. The following flavors are supported: 1. group-based TCP/UDP 2. group-based ICMP 3. CIDR-based TCP/UDP 4. CIDR-based ICMP

URLs
POST /api/clouds/:cloud_id/security_groups/:security_group_id/security_group_rules
POST /api/security_group_rules
HTTP response code
201 Created
Location
Href of created SecurityGroup.

Required roles

Parameters

name required type values regexp blank? description
security_group_rule yes Hash * * no
security_group_rule[action] no String allow, deny * no Allow or deny rule. Defaults to allow. Supported by AzureRM cloud only.
security_group_rule[cidr_ips] no String * * no An IP address range in CIDR notation. Required if source_type is 'cidr_ips'.
security_group_rule[direction] no String ingress, egress * no Direction of traffic.
security_group_rule[group_name] no String * * no Name of source Security Group. Required if source_type is 'group'.
security_group_rule[group_owner] no String * * no Owner of source Security Group. Required if source_type is 'group'.
security_group_rule[priority] no Integer * * no Lower takes precedence. Supported by AzureRM cloud only.
security_group_rule[protocol] yes String tcp, udp, icmp, all * no Protocol to filter on.
security_group_rule[protocol_details] no Hash * * no
security_group_rule[protocol_details][end_port] no String * * no End of port range (inclusive). Required if protocol is 'tcp' or 'udp'.
security_group_rule[protocol_details][icmp_code] no String * * no ICMP code. Required if protocol is 'icmp'.
security_group_rule[protocol_details][icmp_type] no String * * no ICMP type. Required if protocol is 'icmp'.
security_group_rule[protocol_details][start_port] no String * * no Start of port range (inclusive). Required if protocol is 'tcp' or 'udp'.
security_group_rule[security_group_href] no String * * no Security Group to add rule to.
security_group_rule[source_type] yes String cidr_ips, group * no Source type. May be a CIDR block or another Security Group.

update

URLs
PUT /api/clouds/:cloud_id/security_groups/:security_group_id/security_group_rules/:id
PUT /api/security_group_rules/:id
HTTP response code
204 No Content

Required roles

Parameters

name required type values regexp blank? description
security_group_rule yes Hash * * no
security_group_rule[description] no String * * no

destroy

Delete security group rule(s)

URLs
DELETE /api/clouds/:cloud_id/security_groups/:security_group_id/security_group_rules/:id
DELETE /api/security_group_rules/:id
HTTP response code
204 No Content

Required roles