示例#1
0
    def associate_dhcp_options(self):
        dhcp_opt_id = self.querystring.get("DhcpOptionsId", [None])[0]
        vpc_id = self.querystring.get("VpcId", [None])[0]

        dhcp_opt = ec2_backend.describe_dhcp_options([dhcp_opt_id])[0]
        vpc = ec2_backend.get_vpc(vpc_id)

        ec2_backend.associate_dhcp_options(dhcp_opt, vpc)

        template = Template(ASSOCIATE_DHCP_OPTIONS_RESPONSE)
        return template.render()
示例#2
0
    def associate_dhcp_options(self):
        dhcp_opt_id = self.querystring.get("DhcpOptionsId", [None])[0]
        vpc_id = self.querystring.get("VpcId", [None])[0]

        dhcp_opt = ec2_backend.describe_dhcp_options([dhcp_opt_id])[0]
        vpc = ec2_backend.get_vpc(vpc_id)

        ec2_backend.associate_dhcp_options(dhcp_opt, vpc)

        template = Template(ASSOCIATE_DHCP_OPTIONS_RESPONSE)
        return template.render()
示例#3
0
 def create_vpc_peering_connection(self):
     vpc = ec2_backend.get_vpc(self.querystring.get('VpcId')[0])
     peer_vpc = ec2_backend.get_vpc(self.querystring.get('PeerVpcId')[0])
     vpc_pcx = ec2_backend.create_vpc_peering_connection(vpc, peer_vpc)
     template = Template(CREATE_VPC_PEERING_CONNECTION_RESPONSE)
     return template.render(vpc_pcx=vpc_pcx)