Security group rules
1. create_security_group_rule(**attr)
Create security group rule.
Parameters: attr(Dict)
| Name | Type | Description |
|---|---|---|
| parent_group_id | string | Security group ID. |
| ip_protocol | string | The IP protocol. A valid value is ICMP, TCP, or UDP. |
| from_port | integer | The port at start of range. |
| to_port | integer | The port at end of range. |
| cidr (Optional) | string | The CIDR for address range. |
| group_id (Optional) | string | The source security group ID. |
refer to openstack API: http://developer.openstack.org/api-ref/compute/?expanded=create-server-detail
Parameters example:
attr = {'to_port': '449', 'cidr': '0.0.0.0/0', 'from_port': '442', 'parent_group_id': '60520924-ec84-457a-b4f1-b9531eea6933', 'ip_protocol': 'tcp'}
Return value: SecurityGroupRule Object
Return value example:
from_port : 445
group : {}
ip_protocol : tcp
to_port : 446
parent_group_id : 60520924-ec84-457a-b4f1-b9531eea6933
ip_range : {u'cidr': u'0.0.0.0/0'}
cidr : 0.0.0.0/0
id : 60aa0a46-bc43-4142-bd8c-53b730f38b55
2. delete_security_group_rule(rule)
Delete security group rule.
Parameters: rule(string): rule id or SecurityGroupRule Object
Return value: None on success