예제 #1
0
 def setUpClass(cls):
     cls.sec_group_rule_json = ('{"security_group_rule":'
                                ' {"from_port": 80,'
                                '"group": {},'
                                '"ip_protocol": "tcp",'
                                '"to_port": 8080,'
                                '"parent_group_id":'
                                ' "b32c047d-5efc-42ab-8476-3ac9f3681af2",'
                                '"ip_range": {"cidr": "0.0.0.0/0"},'
                                '"id":'
                                ' "bf57c853-cdf2-4c99-9f9a-79b3e9dc13a8"}}')
     cls.sec_group_rule = (SecurityGroupRule.deserialize(
         cls.sec_group_rule_json, "json"))
예제 #2
0
 def setUpClass(cls):
     cls.sec_group_rule_xml = ('<?xml version="1.0" encoding="UTF-8"?>'
                               '<security_group_rule'
                               ' xmlns='
                               '"http://docs.openstack.org/'
                               'compute/api/v1.1"'
                               ' parent_group_id='
                               '"b32c047d-5efc-42ab-8476-3ac9f3681af2"'
                               ' id="bf57c853-cdf2-4c99-9f9a-79b3e9dc13a8">'
                               '<ip_protocol>tcp</ip_protocol>'
                               '<from_port>80</from_port>'
                               '<to_port>8080</to_port>'
                               '<group>'
                               '<name>None</name>'
                               '<tenant_id>None</tenant_id>'
                               '</group>'
                               '<ip_range>'
                               '<cidr>0.0.0.0/0</cidr>'
                               '</ip_range>'
                               '</security_group_rule>')
     cls.sec_group_rule = (SecurityGroupRule.deserialize(
         cls.sec_group_rule_xml, "xml"))