in src/azure-cli/azure/cli/command_modules/rdbms/aaz/latest/network/vnet/_create.py [0:0]
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType,
typ_kwargs={"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("extendedLocation", AAZObjectType, ".extended_location")
_builder.set_prop("location", AAZStrType, ".location")
_builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
_builder.set_prop("tags", AAZDictType, ".tags")
extended_location = _builder.get(".extendedLocation")
if extended_location is not None:
extended_location.set_prop("name", AAZStrType, ".name")
extended_location.set_prop("type", AAZStrType, ".type")
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("addressSpace", AAZObjectType)
properties.set_prop("bgpCommunities", AAZObjectType)
properties.set_prop("ddosProtectionPlan", AAZObjectType)
properties.set_prop("dhcpOptions", AAZObjectType)
properties.set_prop("enableDdosProtection", AAZBoolType, ".ddos_protection")
properties.set_prop("enableVmProtection", AAZBoolType, ".vm_protection")
properties.set_prop("encryption", AAZObjectType)
properties.set_prop("flowTimeoutInMinutes", AAZIntType, ".flowtimeout")
properties.set_prop("subnets", AAZListType, ".subnets")
address_space = _builder.get(".properties.addressSpace")
if address_space is not None:
address_space.set_prop("addressPrefixes", AAZListType, ".address_prefixes")
address_prefixes = _builder.get(".properties.addressSpace.addressPrefixes")
if address_prefixes is not None:
address_prefixes.set_elements(AAZStrType, ".")
bgp_communities = _builder.get(".properties.bgpCommunities")
if bgp_communities is not None:
bgp_communities.set_prop("virtualNetworkCommunity", AAZStrType, ".bgp_community", typ_kwargs={"flags": {"required": True}})
ddos_protection_plan = _builder.get(".properties.ddosProtectionPlan")
if ddos_protection_plan is not None:
ddos_protection_plan.set_prop("id", AAZStrType, ".ddos_protection_plan")
dhcp_options = _builder.get(".properties.dhcpOptions")
if dhcp_options is not None:
dhcp_options.set_prop("dnsServers", AAZListType, ".dns_servers")
dns_servers = _builder.get(".properties.dhcpOptions.dnsServers")
if dns_servers is not None:
dns_servers.set_elements(AAZStrType, ".")
encryption = _builder.get(".properties.encryption")
if encryption is not None:
encryption.set_prop("enabled", AAZBoolType, ".enable_encryption", typ_kwargs={"flags": {"required": True}})
encryption.set_prop("enforcement", AAZStrType, ".encryption_enforcement_policy")
subnets = _builder.get(".properties.subnets")
if subnets is not None:
subnets.set_elements(AAZObjectType, ".")
_elements = _builder.get(".properties.subnets[]")
if _elements is not None:
_elements.set_prop("name", AAZStrType, ".name")
_elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
properties = _builder.get(".properties.subnets[].properties")
if properties is not None:
properties.set_prop("addressPrefix", AAZStrType, ".address_prefix")
properties.set_prop("addressPrefixes", AAZListType, ".address_prefixes")
properties.set_prop("delegations", AAZListType, ".delegations")
_CreateHelper._build_schema_sub_resource_create(properties.set_prop("natGateway", AAZObjectType, ".nat_gateway"))
properties.set_prop("networkSecurityGroup", AAZObjectType)
properties.set_prop("privateEndpointNetworkPolicies", AAZStrType, ".disable_private_endpoint_network_policies")
properties.set_prop("privateLinkServiceNetworkPolicies", AAZStrType, ".disable_private_link_service_network_policies")
properties.set_prop("routeTable", AAZObjectType, ".route_table")
properties.set_prop("serviceEndpointPolicies", AAZListType, ".service_endpoint_policy")
properties.set_prop("serviceEndpoints", AAZListType, ".service_endpoints")
address_prefixes = _builder.get(".properties.subnets[].properties.addressPrefixes")
if address_prefixes is not None:
address_prefixes.set_elements(AAZStrType, ".")
delegations = _builder.get(".properties.subnets[].properties.delegations")
if delegations is not None:
delegations.set_elements(AAZObjectType, ".")
_elements = _builder.get(".properties.subnets[].properties.delegations[]")
if _elements is not None:
_elements.set_prop("id", AAZStrType, ".id")
_elements.set_prop("name", AAZStrType, ".name")
_elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
_elements.set_prop("type", AAZStrType, ".type")
properties = _builder.get(".properties.subnets[].properties.delegations[].properties")
if properties is not None:
properties.set_prop("serviceName", AAZStrType, ".service_name")
network_security_group = _builder.get(".properties.subnets[].properties.networkSecurityGroup")
if network_security_group is not None:
network_security_group.set_prop("id", AAZStrType, ".network_security_group.id")
network_security_group.set_prop("location", AAZStrType, ".network_security_group.location")
network_security_group.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
network_security_group.set_prop("tags", AAZDictType, ".network_security_group.tags")
properties = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties")
if properties is not None:
properties.set_prop("flushConnection", AAZBoolType, ".network_security_group.flush_connection")
properties.set_prop("securityRules", AAZListType, ".network_security_group.security_rules")
security_rules = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules")
if security_rules is not None:
security_rules.set_elements(AAZObjectType, ".")
_elements = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[]")
if _elements is not None:
_elements.set_prop("id", AAZStrType, ".id")
_elements.set_prop("name", AAZStrType, ".name")
_elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
_elements.set_prop("type", AAZStrType, ".type")
properties = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties")
if properties is not None:
properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}})
properties.set_prop("description", AAZStrType, ".description")
properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix")
properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes")
properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups")
properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range")
properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges")
properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}})
properties.set_prop("priority", AAZIntType, ".priority")
properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}})
properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix")
properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes")
properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups")
properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range")
properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges")
destination_address_prefixes = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties.destinationAddressPrefixes")
if destination_address_prefixes is not None:
destination_address_prefixes.set_elements(AAZStrType, ".")
destination_application_security_groups = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties.destinationApplicationSecurityGroups")
if destination_application_security_groups is not None:
_CreateHelper._build_schema_application_security_group_create(destination_application_security_groups.set_elements(AAZObjectType, "."))
destination_port_ranges = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties.destinationPortRanges")
if destination_port_ranges is not None:
destination_port_ranges.set_elements(AAZStrType, ".")
source_address_prefixes = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties.sourceAddressPrefixes")
if source_address_prefixes is not None:
source_address_prefixes.set_elements(AAZStrType, ".")
source_application_security_groups = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties.sourceApplicationSecurityGroups")
if source_application_security_groups is not None:
_CreateHelper._build_schema_application_security_group_create(source_application_security_groups.set_elements(AAZObjectType, "."))
source_port_ranges = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties.sourcePortRanges")
if source_port_ranges is not None:
source_port_ranges.set_elements(AAZStrType, ".")
tags = _builder.get(".properties.subnets[].properties.networkSecurityGroup.tags")
if tags is not None:
tags.set_elements(AAZStrType, ".")
route_table = _builder.get(".properties.subnets[].properties.routeTable")
if route_table is not None:
route_table.set_prop("id", AAZStrType, ".id")
route_table.set_prop("location", AAZStrType, ".location")
route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
route_table.set_prop("tags", AAZDictType, ".tags")
properties = _builder.get(".properties.subnets[].properties.routeTable.properties")
if properties is not None:
properties.set_prop("disableBgpRoutePropagation", AAZBoolType, ".disable_bgp_route_propagation")
properties.set_prop("routes", AAZListType, ".routes")
routes = _builder.get(".properties.subnets[].properties.routeTable.properties.routes")
if routes is not None:
routes.set_elements(AAZObjectType, ".")
_elements = _builder.get(".properties.subnets[].properties.routeTable.properties.routes[]")
if _elements is not None:
_elements.set_prop("id", AAZStrType, ".id")
_elements.set_prop("name", AAZStrType, ".name")
_elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
_elements.set_prop("type", AAZStrType, ".type")
properties = _builder.get(".properties.subnets[].properties.routeTable.properties.routes[].properties")
if properties is not None:
properties.set_prop("addressPrefix", AAZStrType, ".address_prefix")
properties.set_prop("hasBgpOverride", AAZBoolType, ".has_bgp_override")
properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address")
properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}})
tags = _builder.get(".properties.subnets[].properties.routeTable.tags")
if tags is not None:
tags.set_elements(AAZStrType, ".")
service_endpoint_policies = _builder.get(".properties.subnets[].properties.serviceEndpointPolicies")
if service_endpoint_policies is not None:
service_endpoint_policies.set_elements(AAZObjectType, ".")
_elements = _builder.get(".properties.subnets[].properties.serviceEndpointPolicies[]")
if _elements is not None:
_elements.set_prop("id", AAZStrType, ".id")
_elements.set_prop("location", AAZStrType, ".location")
_elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
_elements.set_prop("tags", AAZDictType, ".tags")
properties = _builder.get(".properties.subnets[].properties.serviceEndpointPolicies[].properties")
if properties is not None:
properties.set_prop("contextualServiceEndpointPolicies", AAZListType, ".contextual_service_endpoint_policies")
properties.set_prop("serviceAlias", AAZStrType, ".service_alias")
properties.set_prop("serviceEndpointPolicyDefinitions", AAZListType, ".service_endpoint_policy_definitions")
contextual_service_endpoint_policies = _builder.get(".properties.subnets[].properties.serviceEndpointPolicies[].properties.contextualServiceEndpointPolicies")
if contextual_service_endpoint_policies is not None:
contextual_service_endpoint_policies.set_elements(AAZStrType, ".")
service_endpoint_policy_definitions = _builder.get(".properties.subnets[].properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions")
if service_endpoint_policy_definitions is not None:
service_endpoint_policy_definitions.set_elements(AAZObjectType, ".")
_elements = _builder.get(".properties.subnets[].properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[]")
if _elements is not None:
_elements.set_prop("id", AAZStrType, ".id")
_elements.set_prop("name", AAZStrType, ".name")
_elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
_elements.set_prop("type", AAZStrType, ".type")
properties = _builder.get(".properties.subnets[].properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[].properties")
if properties is not None:
properties.set_prop("description", AAZStrType, ".description")
properties.set_prop("service", AAZStrType, ".service")
properties.set_prop("serviceResources", AAZListType, ".service_resources")
service_resources = _builder.get(".properties.subnets[].properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[].properties.serviceResources")
if service_resources is not None:
service_resources.set_elements(AAZStrType, ".")
tags = _builder.get(".properties.subnets[].properties.serviceEndpointPolicies[].tags")
if tags is not None:
tags.set_elements(AAZStrType, ".")
service_endpoints = _builder.get(".properties.subnets[].properties.serviceEndpoints")
if service_endpoints is not None:
service_endpoints.set_elements(AAZObjectType, ".")
_elements = _builder.get(".properties.subnets[].properties.serviceEndpoints[]")
if _elements is not None:
_elements.set_prop("locations", AAZListType, ".locations")
_elements.set_prop("service", AAZStrType, ".service")
locations = _builder.get(".properties.subnets[].properties.serviceEndpoints[].locations")
if locations is not None:
locations.set_elements(AAZStrType, ".")
tags = _builder.get(".tags")
if tags is not None:
tags.set_elements(AAZStrType, ".")
return self.serialize_content(_content_value)