Show the security group rules for a single, specific security group.
Table of Contents
Prerequisite: Example assumes you have previously authenticated, and your valid session cookie is in 'mycookie'.
#!/bin/sh -e CLOUD="2112" SG="4ISBSPCJCG3CS" # Reminder, must obtain the Security Group ID via the API, not the Dashboard curl -i -H X_API_VERSION:1.5 -b mycookie -X GET \ https://my.rightscale.com/api/clouds/$CLOUD/security_groups/$SG/security_group_rules.xml
Note: Headers not shown.
XML output below reveals:
<?xml version="1.0" encoding="UTF-8"?> <security_group_rules> <security_group_rule> <group_owner>test</group_owner> <group_name>GD SG for API Sandbox</group_name> <protocol>tcp</protocol> <start_port>80</start_port> <actions></actions> <end_port>80</end_port> <links> <link href="/api/security_group_rules/358914001" rel="self"/> <link href="/api/clouds/2112/security_groups/4ISBSPCJCG3CS" rel="security_group"/> </links> </security_group_rule> <security_group_rule> <protocol>tcp</protocol> <start_port>22</start_port> <cidr_ips>0.0.0.0/0</cidr_ips> <actions></actions> <end_port>22</end_port> <links> <link href="/api/security_group_rules/358925001" rel="self"/> <link href="/api/clouds/2112/security_groups/4ISBSPCJCG3CS" rel="security_group"/> </links> </security_group_rule> <security_group_rule> <protocol>tcp</protocol> <start_port>80</start_port> <cidr_ips>0.0.0.0/0</cidr_ips> <actions></actions> <end_port>80</end_port> <links> <link href="/api/security_group_rules/358926001" rel="self"/> <link href="/api/clouds/2112/security_groups/4ISBSPCJCG3CS" rel="security_group"/> </links> </security_group_rule> </security_group_rules>
© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.