def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.load_balancer_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'resourceGroup', 'resource') self.copy_location(xml) self.lb_resid = ResId("", subscription = self.get_subscription_id(), group = self.resource_group, provider = 'Microsoft.Network', type = 'loadBalancers', resource = self.load_balancer_name) self.copy_option(xml, 'backendAddressPools', 'strlist') self.frontend_interfaces = { _if.get("name"): self._parse_frontend_interface(_if) for _if in xml.findall("attrs/attr[@name='frontendInterfaces']/attrs/attr") } self.probes = { _p.get("name"): self._parse_probe(_p) for _p in xml.findall("attrs/attr[@name='probes']/attrs/attr") } self.load_balancing_rules = { _lbr.get("name"): self._parse_lb_rule(_lbr) for _lbr in xml.findall("attrs/attr[@name='loadBalancingRules']/attrs/attr") } self.inbound_nat_rules = { _inr.get("name"): self._parse_nat_rule(_inr) for _inr in xml.findall("attrs/attr[@name='inboundNatRules']/attrs/attr") } self.copy_tags(xml)
def __init__(self, xml, config): ResourceDefinition.__init__(self, xml) self.dns_record_set_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'dnsZone', 'res-id') self.copy_option(xml, 'recordType', str, empty = False) self.copy_tags(xml) self.properties = config['properties']
def __init__(self, xml, config): ResourceDefinition.__init__(self, xml) self.dns_record_set_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'dnsZone', 'res-id') self.copy_option(xml, 'recordType', str, empty = False) self.copy_tags(xml) self.properties = config['properties']
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.availability_set_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'resourceGroup', 'resource') self.copy_location(xml) self.copy_tags(xml) self.copy_option(xml, 'platformUpdateDomainCount', int) self.copy_option(xml, 'platformFaultDomainCount', int)
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.availability_set_name = self.get_option_value(xml, "name", str) self.copy_option(xml, "resourceGroup", "resource") self.copy_location(xml) self.copy_tags(xml) self.copy_option(xml, "platformUpdateDomainCount", int) self.copy_option(xml, "platformFaultDomainCount", int)
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.reserved_ip_address_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'resourceGroup', 'resource') self.copy_location(xml) self.copy_tags(xml) self.copy_option(xml, 'idleTimeout', int) self.copy_option(xml, 'domainNameLabel', str, optional = True) self.copy_option(xml, 'reverseFqdn', str, optional = True) self.allocation_method = 'Static'
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.gateway_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'resourceGroup', 'resource') self.copy_location(xml) self.copy_option(xml, 'ipAddress', str, empty = False) self.copy_option(xml, 'addressSpace', 'strlist') if len(self.address_space) == 0: raise Exception("local network gateway {0}: must specify at least one address space" .format(self.gateway_name)) self.copy_tags(xml)
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.nsg_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'resourceGroup', 'resource') self.copy_location(xml) self.copy_tags(xml) self.security_rules = { _r.get("name"): self._parse_security_rule(_r) for _r in xml.findall("attrs/attr[@name='securityRules']/attrs/attr") }
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.gateway_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'resourceGroup', 'resource') self.copy_location(xml) self.copy_option(xml, 'ipAddress', str, empty=False) self.copy_option(xml, 'addressSpace', 'strlist') if len(self.address_space) == 0: raise Exception( "local network gateway {0}: must specify at least one address space" .format(self.gateway_name)) self.copy_tags(xml)
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.nsg_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'resourceGroup', 'resource') self.copy_location(xml) self.copy_tags(xml) self.security_rules = { _r.get("name"): self._parse_security_rule(_r) for _r in xml.findall( "attrs/attr[@name='securityRules']/attrs/attr") }
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.connection_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'resourceGroup', 'resource') self.copy_location(xml) self.copy_tags(xml) self.copy_option(xml, 'virtualNetworkGateway1', 'res-id', optional = True) self.copy_option(xml, 'virtualNetworkGateway2', 'res-id', optional = True) self.copy_option(xml, 'localNetworkGateway2', 'res-id', optional = True) self.copy_option(xml, 'connectionType', str) self.copy_option(xml, 'routingWeight', int) self.copy_option(xml, 'sharedKey', str, optional = True)
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.gateway_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'resourceGroup', 'resource') self.copy_location(xml) self.copy_tags(xml) self.copy_option(xml, 'gatewaySize', str, empty = False) self.copy_option(xml, 'gatewayType', str, empty = False) self.copy_option(xml, 'bgpEnabled', bool) subnet_xml = xml.find("attrs/attr[@name='subnet']") self.subnet = ResId(self.get_option_value(subnet_xml, 'network', 'res-id'), subresource = self.get_option_value(subnet_xml, 'name', str), subtype = 'subnets').id
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.gateway_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'resourceGroup', 'resource') self.copy_location(xml) self.copy_tags(xml) self.copy_option(xml, 'gatewaySize', str, empty=False) self.copy_option(xml, 'gatewayType', str, empty=False) self.copy_option(xml, 'bgpEnabled', bool) subnet_xml = xml.find("attrs/attr[@name='subnet']") self.subnet = ResId(self.get_option_value(subnet_xml, 'network', 'res-id'), subresource=self.get_option_value( subnet_xml, 'name', str), subtype='subnets').id
def __init__(self, xml, config): ResourceDefinition.__init__(self, xml) self.circuit_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'resourceGroup', 'resource') self.copy_location(xml) self.copy_tags(xml) sku_xml = xml.find("attrs/attr[@name='sku']") self.copy_option(sku_xml, 'tier', str) self.copy_option(sku_xml, 'family', str) self.copy_option(xml, 'serviceProviderName', str, empty = False) self.copy_option(xml, 'peeringLocation', str, empty = False) self.copy_option(xml, 'bandwidth', int, positive = True) self.peerings = config['peerings']
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.network_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'addressSpace', 'strlist') if len(self.address_space) == 0: raise Exception("virtual network {0}: must specify at least one address space" .format(self.network_name)) self.copy_option(xml, 'dnsServers', 'strlist') self.copy_option(xml, 'resourceGroup', 'resource') self.copy_location(xml) self.copy_tags(xml) self.subnets = { _s.get("name"): self._parse_subnet(_s) for _s in xml.findall("attrs/attr[@name='subnets']/attrs/attr") }
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.network_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'addressSpace', 'strlist') if len(self.address_space) == 0: raise Exception( "virtual network {0}: must specify at least one address space". format(self.network_name)) self.copy_option(xml, 'dnsServers', 'strlist') self.copy_option(xml, 'resourceGroup', 'resource') self.copy_location(xml) self.copy_tags(xml) self.subnets = { _s.get("name"): self._parse_subnet(_s) for _s in xml.findall("attrs/attr[@name='subnets']/attrs/attr") }
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.storage_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'resourceGroup', 'resource') self.copy_option(xml, 'accountType', str, empty = False) self.copy_option(xml, 'activeKey', str, empty = False) if self.active_key not in ['primary', 'secondary']: raise Exception("Allowed activeKey values are: 'primary' and 'secondary'") self.copy_location(xml) self.copy_option(xml, 'customDomain', str) self.copy_tags(xml) self.blob_service_properties = self._parse_service_properties( xml.find("attrs/attr[@name='blobService']")) self.queue_service_properties = self._parse_service_properties( xml.find("attrs/attr[@name='queueService']")) self.table_service_properties = self._parse_service_properties( xml.find("attrs/attr[@name='tableService']"))
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.profile_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'resourceGroup', 'resource') self.copy_tags(xml) self.enable = "Enabled" if self.get_option_value(xml, 'enable', bool) else "Disabled" self.copy_option(xml, 'trafficRoutingMethod', str) dns_xml = xml.find("attrs/attr[@name='dns']") self.copy_option(dns_xml, 'relativeName', str) self.copy_option(dns_xml, 'ttl', int) mon_xml = xml.find("attrs/attr[@name='monitor']") self.copy_option(mon_xml, 'protocol', str) self.copy_option(mon_xml, 'port', int, positive = True) self.copy_option(mon_xml, 'path', str) self.endpoints = { _ep.get("name"): self._parse_endpoint(_ep) for _ep in xml.findall("attrs/attr[@name='endpoints']/attrs/attr") }
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.profile_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'resourceGroup', 'resource') self.copy_tags(xml) self.enable = "Enabled" if self.get_option_value(xml, 'enable', bool) else "Disabled" self.copy_option(xml, 'trafficRoutingMethod', str) dns_xml = xml.find("attrs/attr[@name='dns']") self.copy_option(dns_xml, 'relativeName', str) self.copy_option(dns_xml, 'ttl', int) mon_xml = xml.find("attrs/attr[@name='monitor']") self.copy_option(mon_xml, 'protocol', str) self.copy_option(mon_xml, 'port', int, positive = True) self.copy_option(mon_xml, 'path', str) self.endpoints = { _ep.get("name"): self._parse_endpoint(_ep) for _ep in xml.findall("attrs/attr[@name='endpoints']/attrs/attr") }
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.load_balancer_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'resourceGroup', 'resource') self.copy_location(xml) self.lb_resid = ResId("", subscription=self.get_subscription_id(), group=self.resource_group, provider='Microsoft.Network', type='loadBalancers', resource=self.load_balancer_name) self.copy_option(xml, 'backendAddressPools', 'strlist') self.frontend_interfaces = { _if.get("name"): self._parse_frontend_interface(_if) for _if in xml.findall( "attrs/attr[@name='frontendInterfaces']/attrs/attr") } self.probes = { _p.get("name"): self._parse_probe(_p) for _p in xml.findall("attrs/attr[@name='probes']/attrs/attr") } self.load_balancing_rules = { _lbr.get("name"): self._parse_lb_rule(_lbr) for _lbr in xml.findall( "attrs/attr[@name='loadBalancingRules']/attrs/attr") } self.inbound_nat_rules = { _inr.get("name"): self._parse_nat_rule(_inr) for _inr in xml.findall( "attrs/attr[@name='inboundNatRules']/attrs/attr") } self.copy_tags(xml)
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.dns_zone_name = self.get_option_value(xml, "name", str) self.copy_option(xml, "resourceGroup", "resource") self.copy_tags(xml)
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.resource_group_name = self.get_option_value(xml, 'name', str) self.copy_location(xml) self.copy_tags(xml)
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.dns_zone_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'resourceGroup', 'resource') self.copy_tags(xml)
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.dns_zone_name = self.get_option_value(xml, 'name', str) self.copy_option(xml, 'resourceGroup', 'resource') self.copy_tags(xml)
def __init__(self, xml): ResourceDefinition.__init__(self, xml) self.resource_group_name = self.get_option_value(xml, 'name', str) self.copy_location(xml) self.copy_tags(xml)