[Network] Convert Load Balancer and App Gateway Create to Dynamic Templates (#2668)

* Group params.

* Import VMSS implementation of template builder.

* Update template builders.

* Add custom command logic.

* Update LB params.

* Update load balancer create.

* AppGateway progress

* App gateway progress.

* Re-record tests.

* Code review feedback.
This commit is contained in:
Travis Prescott 2017-03-30 11:00:40 -07:00 коммит произвёл GitHub
Родитель 52720b9e60
Коммит 2f0cb9daf5
64 изменённых файлов: 20205 добавлений и 23251 удалений

Просмотреть файл

@ -278,24 +278,6 @@
<Compile Include="command_modules\azure-cli-batch\setup.py" />
<Compile Include="command_modules\azure-cli-keyvault\tests\test_keyvault_commands.py" />
<Compile Include="command_modules\azure-cli-keyvault\tests\__init__.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\app_gateway_creation_client.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\credentials.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\exceptions.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\models\app_gateway_creation_client_enums.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\models\basic_dependency.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\models\dependency.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\models\deployment_app_gateway.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\models\deployment_extended.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\models\deployment_properties_extended.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\models\parameters_link.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\models\provider.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\models\provider_resource_type.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\models\template_link.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\models\__init__.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\operations\app_gateway_operations.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\operations\__init__.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\version.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\__init__.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\zone_file\configs.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\zone_file\exceptions.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\zone_file\make_zone_file.py" />
@ -383,24 +365,6 @@
<Compile Include="command_modules\azure-cli-component\azure\cli\command_modules\component\_params.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\custom.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\commands.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\credentials.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\exceptions.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\lb_creation_client.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\models\basic_dependency.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\models\dependency.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\models\deployment_extended.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\models\deployment_lb.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\models\deployment_properties_extended.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\models\lb_creation_client_enums.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\models\parameters_link.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\models\provider.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\models\provider_resource_type.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\models\template_link.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\models\__init__.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\operations\lb_operations.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\operations\__init__.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\version.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\__init__.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\_params.py">
<SubType>Code</SubType>
</Compile>
@ -592,12 +556,6 @@
<Folder Include="command_modules\azure-cli-batch\azure\cli\command_modules\" />
<Folder Include="command_modules\azure-cli-batch\azure\cli\command_modules\batch\" />
<Folder Include="command_modules\azure-cli-keyvault\tests\" />
<Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\" />
<Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\" />
<Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\models\" />
<Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\lib\operations\" />
<Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\tests\" />
<Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\tests\zone_files\" />
<Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\zone_file\" />
<Folder Include="command_modules\azure-cli-network\tests\" />
<Folder Include="command_modules\azure-cli-network\tests\zone_files\" />
@ -623,10 +581,6 @@
<Folder Include="command_modules\azure-cli-network\azure\cli\" />
<Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\" />
<Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\" />
<Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\" />
<Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\" />
<Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\models\" />
<Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\lib\operations\" />
<Folder Include="command_modules\azure-cli-profile\" />
<Folder Include="command_modules\azure-cli-profile\azure\" />
<Folder Include="command_modules\azure-cli-profile\azure\cli\" />
@ -707,15 +661,6 @@
<Content Include="command_modules\azure-cli-keyvault\tests\policy_import_pfx.json" />
<Content Include="command_modules\azure-cli-keyvault\tests\policy_pending.json" />
<Content Include="command_modules\azure-cli-keyvault\tests\test_secret.txt" />
<Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\azuredeploy.json" />
<Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\azuredeploy_tests.md">
<SubType>Code</SubType>
</Content>
<Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_app_gateway\swagger_create_app_gateway.json" />
<Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\azuredeploy_empty.json" />
<Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\azuredeploy_test.md" />
<Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\swagger_create_lb.json" />
<Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\azuredeploy.json" />
<Content Include="command_modules\azure-cli-network\tests\zone_files\fail1.txt" />
<Content Include="command_modules\azure-cli-network\tests\zone_files\fail2.txt" />
<Content Include="command_modules\azure-cli-network\tests\zone_files\fail3.txt" />

Просмотреть файл

@ -21,12 +21,6 @@ def cf_application_gateways(_):
return _network_client_factory().application_gateways
def cf_application_gateway_create(_):
from azure.cli.command_modules.network.mgmt_app_gateway.lib import AppGatewayCreationClient
from azure.cli.core.commands.client_factory import get_mgmt_service_client
return get_mgmt_service_client(AppGatewayCreationClient).app_gateway
def cf_express_route_circuit_authorizations(_):
return _network_client_factory().express_route_circuit_authorizations
@ -47,12 +41,6 @@ def cf_load_balancers(_):
return _network_client_factory().load_balancers
def cf_load_balancer_create(_):
from azure.cli.command_modules.network.mgmt_lb.lib import LbCreationClient
from azure.cli.core.commands.client_factory import get_mgmt_service_client
return get_mgmt_service_client(LbCreationClient).lb
def cf_local_network_gateways(_):
return _network_client_factory().local_network_gateways

Просмотреть файл

@ -130,29 +130,36 @@ register_cli_argument('network', 'private_ip_address', private_ip_address_type)
register_cli_argument('network', 'private_ip_address_version', **enum_choice_list(IPVersion))
register_cli_argument('network', 'tags', tags_type)
register_cli_argument('network application-gateway', 'application_gateway_name', name_arg_type, completer=get_resource_name_completion_list('Microsoft.Network/applicationGateways'), id_part='name')
register_cli_argument('network application-gateway', 'sku_name', options_list=('--sku',), **enum_choice_list(ApplicationGatewaySkuName))
register_cli_argument('network application-gateway', 'sku_tier', ignore_type)
register_cli_argument('network application-gateway', 'virtual_network_name', virtual_network_name_type)
register_cli_argument('network application-gateway', 'servers', nargs='+', help='Space separated list of IP addresses or DNS names corresponding to backend servers.', validator=validate_servers)
register_cli_argument('network application-gateway', 'http_settings_cookie_based_affinity', cookie_based_affinity_type)
register_cli_argument('network application-gateway', 'http_settings_protocol', http_protocol_type)
register_cli_argument('network application-gateway', 'subnet_address_prefix', action=MarkSpecifiedAction)
register_cli_argument('network application-gateway', 'vnet_address_prefix', action=MarkSpecifiedAction)
register_cli_argument('network application-gateway', 'virtual_network_type', ignore_type)
register_cli_argument('network application-gateway', 'private_ip_address_allocation', ignore_type)
register_cli_argument('network application-gateway', 'application_gateway_name', name_arg_type, help='The name of the application gateway.', completer=get_resource_name_completion_list('Microsoft.Network/applicationGateways'), id_part='name')
register_cli_argument('network application-gateway', 'sku', arg_group='Gateway', help='The name of the SKU.', **enum_choice_list(ApplicationGatewaySkuName))
register_cli_argument('network application-gateway', 'virtual_network_name', virtual_network_name_type, arg_group='Network')
register_cli_argument('network application-gateway', 'private_ip_address', arg_group='Network')
register_cli_argument('network application-gateway', 'private_ip_address_allocation', ignore_type, arg_group='Network')
register_cli_argument('network application-gateway', 'public_ip_address_allocation', help='The kind of IP allocation to use when creating a new public IP.', arg_group='Network')
register_cli_argument('network application-gateway', 'servers', nargs='+', help='Space separated list of IP addresses or DNS names corresponding to backend servers.', validator=validate_servers, arg_group='Gateway')
register_cli_argument('network application-gateway', 'http_settings_cookie_based_affinity', cookie_based_affinity_type, help='Enable or disable HTTP settings cookie-based affinity.', arg_group='Gateway')
register_cli_argument('network application-gateway', 'http_settings_protocol', http_protocol_type, help='The HTTP settings protocol.', arg_group='Gateway')
register_cli_argument('network application-gateway', 'subnet_address_prefix', help='The CIDR prefix to use when creating a new subnet.', action=MarkSpecifiedAction, arg_group='Network')
register_cli_argument('network application-gateway', 'vnet_address_prefix', help='The CIDR prefix to use when creating a new VNet.', action=MarkSpecifiedAction, arg_group='Network')
register_cli_argument('network application-gateway', 'virtual_network_type', ignore_type, arg_group='Network')
register_cli_argument('network application-gateway create', 'routing_rule_type', validator=process_ag_create_namespace, **enum_choice_list(ApplicationGatewayRequestRoutingRuleType))
register_cli_argument('network application-gateway create', 'cert_data', options_list=('--cert-file',), type=file_type, completer=FilesCompleter(), help='The path to the PFX certificate file.')
register_cli_argument('network application-gateway create', 'frontend_type', ignore_type)
register_cli_argument('network application-gateway create', 'http_listener_protocol', ignore_type)
register_cli_argument('network application-gateway create', 'validate', help='Generate and validate the ARM template without creating any resources.', action='store_true', validator=process_ag_create_namespace)
register_cli_argument('network application-gateway create', 'routing_rule_type', arg_group='Gateway', help='The request routing rule type.', **enum_choice_list(ApplicationGatewayRequestRoutingRuleType))
register_cli_argument('network application-gateway create', 'cert_data', options_list=('--cert-file',), type=file_type, completer=FilesCompleter(), help='The path to the PFX certificate file.', arg_group='Gateway')
register_cli_argument('network application-gateway create', 'frontend_type', ignore_type, arg_group='Gateway')
register_cli_argument('network application-gateway create', 'frontend_port', help='The front end port number.', arg_group='Gateway')
register_cli_argument('network application-gateway create', 'capacity', help='The number of instances to use with the application gateway.', arg_group='Gateway')
register_cli_argument('network application-gateway create', 'cert_password', help='The certificate password', arg_group='Gateway')
register_cli_argument('network application-gateway create', 'http_settings_port', help='The HTTP settings port.', arg_group='Gateway')
register_cli_argument('network application-gateway update', 'sku', arg_group=None)
public_ip_help = get_folded_parameter_help_string('public IP address', allow_none=True, allow_new=True, default_none=True)
register_cli_argument('network application-gateway create', 'public_ip_address', help=public_ip_help, completer=get_resource_name_completion_list('Microsoft.Network/publicIPAddresses'))
register_cli_argument('network application-gateway create', 'public_ip_address', help=public_ip_help, completer=get_resource_name_completion_list('Microsoft.Network/publicIPAddresses'), arg_group='Network')
register_cli_argument('network application-gateway create', 'public_ip_address_type', ignore_type)
subnet_help = get_folded_parameter_help_string('subnet', other_required_option='--vnet-name', allow_new=True)
register_cli_argument('network application-gateway create', 'subnet', help=subnet_help, completer=get_subnet_completion_list())
register_cli_argument('network application-gateway create', 'subnet', help=subnet_help, completer=get_subnet_completion_list(), arg_group='Network')
register_cli_argument('network application-gateway create', 'subnet_type', ignore_type)
ag_subresources = [
@ -192,7 +199,7 @@ register_cli_argument('network application-gateway http-listener', 'ssl_cert', h
register_cli_argument('network application-gateway http-listener', 'protocol', ignore_type)
register_cli_argument('network application-gateway http-listener', 'host_name', help='Host name to use for multisite gateways.')
register_cli_argument('network application-gateway http-settings', 'cookie_based_affinity', cookie_based_affinity_type, help='Enable or disable cookie based affinity.')
register_cli_argument('network application-gateway http-settings', 'cookie_based_affinity', cookie_based_affinity_type, help='Enable or disable cookie-based affinity.')
register_cli_argument('network application-gateway http-settings', 'timeout', help='Request timeout in seconds.')
register_cli_argument('network application-gateway http-settings', 'probe', help='Name or ID of the probe to associate with the HTTP settings.', validator=process_ag_http_settings_create_namespace, completer=get_ag_subresource_completion_list('probes'))
@ -423,24 +430,28 @@ register_cli_argument('network lb', 'frontend_port', help='Port number')
register_cli_argument('network lb', 'frontend_port_range_start', help='Port number')
register_cli_argument('network lb', 'frontend_port_range_end', help='Port number')
register_cli_argument('network lb', 'backend_port', help='Port number')
register_cli_argument('network lb', 'backend_address_pool_name', options_list=('--backend-pool-name',), help='The name of the backend address pool.', completer=get_lb_subresource_completion_list('backend_address_pools'))
register_cli_argument('network lb', 'frontend_ip_name', help='The name of the frontend IP configuration.', completer=get_lb_subresource_completion_list('frontend_ip_configurations'))
register_cli_argument('network lb', 'floating_ip', help='Enable floating IP.', **enum_choice_list(['true', 'false']))
register_cli_argument('network lb', 'idle_timeout', help='Idle timeout in minutes.')
register_cli_argument('network lb', 'protocol', help='', **enum_choice_list(TransportProtocol))
register_cli_argument('network lb create', 'public_ip_dns_name', validator=process_lb_create_namespace)
register_cli_argument('network lb create', 'public_ip_address_allocation', default='dynamic', **enum_choice_list(IPAllocationMethod))
register_cli_argument('network lb create', 'private_ip_address_allocation', ignore_type)
register_cli_argument('network lb create', 'dns_name_type', ignore_type)
for item in ['backend_pool_name', 'backend_address_pool_name']:
register_cli_argument('network lb', item, options_list=('--backend-pool-name',), help='The name of the backend address pool.', completer=get_lb_subresource_completion_list('backend_address_pools'))
register_cli_argument('network lb create', 'validate', help='Generate and validate the ARM template without creating any resources.', action='store_true', validator=process_lb_create_namespace)
register_cli_argument('network lb create', 'public_ip_address_allocation', **enum_choice_list(IPAllocationMethod))
register_cli_argument('network lb create', 'public_ip_dns_name', help='Globally unique DNS name for a new public IP.')
public_ip_help = get_folded_parameter_help_string('public IP address', allow_none=True, allow_new=True)
register_cli_argument('network lb create', 'public_ip_address', help=public_ip_help, completer=get_resource_name_completion_list('Microsoft.Network/publicIPAddresses'))
register_cli_argument('network lb create', 'public_ip_address_type', ignore_type)
register_cli_argument('network lb create', 'public_ip_type', ignore_type)
subnet_help = get_folded_parameter_help_string('subnet', other_required_option='--vnet-name', allow_new=True, allow_none=True, default_none=True)
register_cli_argument('network lb create', 'subnet', help=subnet_help, completer=get_subnet_completion_list())
register_cli_argument('network lb create', 'subnet_type', ignore_type)
register_cli_argument('network lb create', 'subnet_address_prefix', help='The CIDR address prefix to use when creating a new subnet.')
register_cli_argument('network lb create', 'vnet_name', virtual_network_name_type)
register_cli_argument('network lb create', 'vnet_address_prefix', help='The CIDR address prefix to use when creating a new VNet.')
register_cli_argument('network lb create', 'vnet_type', ignore_type)
for item in ['create', 'update']:
register_cli_argument('network lb frontend-ip {}'.format(item), 'public_ip_address', help='Name or ID of the existing public IP to associate with the configuration.', validator=process_lb_frontend_ip_namespace)

Просмотреть файл

@ -62,6 +62,222 @@ class ArmTemplateBuilder(object):
return json.loads(json.dumps(self.template))
def _build_frontend_ip_config(name, public_ip_id=None, subnet_id=None, private_ip_address=None,
private_ip_allocation=None):
frontend_ip_config = {
'name': name
}
if public_ip_id:
frontend_ip_config.update({
'properties': {
'publicIPAddress': {'id': public_ip_id}
}
})
else:
frontend_ip_config.update({
'properties': {
'privateIPAllocationMethod': private_ip_allocation,
'privateIPAddress': private_ip_address,
'subnet': {'id': subnet_id}
}
})
return frontend_ip_config
# pylint: disable=too-many-locals
def build_application_gateway_resource(name, location, tags, sku_name, sku_tier, capacity,
servers, frontend_port,
private_ip_address, private_ip_allocation,
cert_data, cert_password,
cookie_based_affinity,
http_settings_protocol, http_settings_port,
http_listener_protocol, routing_rule_type, public_ip_id,
subnet_id):
# set the default names
frontend_ip_name = 'appGatewayFrontendIP'
backend_pool_name = 'appGatewayBackendPool'
frontend_port_name = 'appGatewayFrontendPort'
http_listener_name = 'appGatewayHttpListener'
http_settings_name = 'appGatewayBackendHttpSettings'
routing_rule_name = 'rule1'
ssl_cert_name = '{}SslCert'.format(name)
ssl_cert = None
frontend_ip_config = _build_frontend_ip_config(frontend_ip_name, public_ip_id, subnet_id,
private_ip_address, private_ip_allocation)
backend_address_pool = {'name': backend_pool_name}
if servers:
backend_address_pool['properties'] = {'BackendAddresses': servers}
def _ag_subresource_id(_type, name):
return "[concat(variables('appGwID'), '/{}/{}')]".format(_type, name)
frontend_ip_config_id = _ag_subresource_id('frontendIPConfigurations', frontend_ip_name)
frontend_port_id = _ag_subresource_id('frontendPorts', frontend_port_name)
http_listener_id = _ag_subresource_id('httpListeners', http_listener_name)
backend_address_pool_id = _ag_subresource_id('backendAddressPools', backend_pool_name)
backend_http_settings_id = _ag_subresource_id('backendHttpSettingsCollection',
http_settings_name)
ssl_cert_id = _ag_subresource_id('sslCertificates', ssl_cert_name)
http_listener = {
'name': http_listener_name,
'properties': {
'FrontendIpConfiguration': {'Id': frontend_ip_config_id},
'FrontendPort': {'Id': frontend_port_id},
'Protocol': http_listener_protocol,
'SslCertificate': None
}
}
if cert_data:
http_listener['properties'].update({'SslCertificate': {'id': ssl_cert_id}})
ssl_cert = {
'name': ssl_cert_name,
'properties': {
'data': cert_data,
'password': cert_password
}
}
ag_properties = {
'backendAddressPools': [backend_address_pool],
'backendHttpSettingsCollection': [
{
'name': http_settings_name,
'properties': {
'Port': http_settings_port,
'Protocol': http_settings_protocol,
'CookieBasedAffinity': cookie_based_affinity
}
}
],
'frontendIPConfigurations': [frontend_ip_config],
'frontendPorts': [
{
'name': frontend_port_name,
'properties': {
'Port': frontend_port
}
}
],
'gatewayIPConfigurations': [
{
'name': frontend_ip_name,
'properties': {
'subnet': {'id': subnet_id}
}
}
],
'httpListeners': [http_listener],
'sku': {
'name': sku_name,
'tier': sku_tier,
'capacity': capacity
},
'requestRoutingRules': [
{
'Name': routing_rule_name,
'properties': {
'RuleType': routing_rule_type,
'httpListener': {'id': http_listener_id},
'backendAddressPool': {'id': backend_address_pool_id},
'backendHttpSettings': {'id': backend_http_settings_id}
}
}
]
}
if ssl_cert:
ag_properties.update({'sslCertificates': [ssl_cert]})
ag = {
'type': 'Microsoft.Network/applicationGateways',
'name': name,
'location': location,
'tags': tags,
'apiVersion': '2015-06-15',
'dependsOn': [],
'properties': ag_properties
}
return ag
def build_load_balancer_resource(name, location, tags, backend_pool_name,
frontend_ip_name, public_ip_id, subnet_id,
private_ip_address, private_ip_allocation):
frontend_ip_config = _build_frontend_ip_config(frontend_ip_name, public_ip_id, subnet_id,
private_ip_address, private_ip_allocation)
lb_properties = {
'backendAddressPools': [
{
'name': backend_pool_name
}
],
'frontendIPConfigurations': [frontend_ip_config]
}
lb = {
'type': 'Microsoft.Network/loadBalancers',
'name': name,
'location': location,
'tags': tags,
'apiVersion': '2015-06-15',
'dependsOn': [],
'properties': lb_properties
}
return lb
def build_public_ip_resource(name, location, tags, address_allocation, dns_name=None):
public_ip_properties = {'publicIPAllocationMethod': address_allocation}
if dns_name:
public_ip_properties['dnsSettings'] = {'domainNameLabel': dns_name}
public_ip = {
'apiVersion': '2015-06-15',
'type': 'Microsoft.Network/publicIPAddresses',
'name': name,
'location': location,
'tags': tags,
'dependsOn': [],
'properties': public_ip_properties
}
return public_ip
def build_vnet_resource(name, location, tags, vnet_prefix=None, subnet=None,
subnet_prefix=None, dns_servers=None):
vnet = {
'name': name,
'type': 'Microsoft.Network/virtualNetworks',
'location': location,
'apiVersion': '2015-06-15',
'dependsOn': [],
'tags': tags,
'properties': {
'addressSpace': {'addressPrefixes': [vnet_prefix]},
}
}
if dns_servers:
vnet['properties']['dhcpOptions'] = {
'dnsServers': dns_servers
}
if subnet:
vnet['properties']['subnets'] = [{
'name': subnet,
'properties': {
'addressPrefix': subnet_prefix
}
}]
return vnet
def build_vpn_connection_resource(name, location, tags, gateway1, gateway2, vpn_type,
authorization_key, enable_bgp, routing_weight, shared_key):
vpn_properties = {
@ -98,3 +314,4 @@ def build_vpn_connection_resource(name, location, tags, gateway1, gateway2, vpn_
'properties': vpn_properties if vpn_type != 'VpnClient' else {}
}
return vpn_connection

Просмотреть файл

@ -106,7 +106,6 @@ def validate_cert(namespace):
params = [namespace.cert_data, namespace.cert_password]
if all([not x for x in params]):
# no cert supplied -- use HTTP
namespace.http_listener_protocol = 'http'
if not namespace.frontend_port:
namespace.frontend_port = 80
else:
@ -122,7 +121,6 @@ def validate_cert(namespace):
# change default to frontend port 443 for https
if not namespace.frontend_port:
namespace.frontend_port = 443
namespace.http_listener_protocol = 'https'
except AttributeError:
# app-gateway ssl-cert create does not have these fields and that is okay
pass
@ -226,6 +224,7 @@ def get_subnet_validator(has_type_field=False, allow_none=False, allow_new=False
child_name=namespace.subnet)
def complex_validator_with_type(namespace):
get_folded_parameter_validator(
'subnet', 'subnets', '--subnet',
'virtual_network_name', 'Microsoft.Network/virtualNetworks', '--vnet-name',
@ -260,9 +259,9 @@ def validate_servers(namespace):
for item in namespace.servers if namespace.servers else []:
try:
socket.inet_aton(item) #pylint:disable=no-member
servers.append(ApplicationGatewayBackendAddress(ip_address=item))
servers.append({'ipAddress':item})
except socket.error: #pylint:disable=no-member
servers.append(ApplicationGatewayBackendAddress(fqdn=item))
servers.append({'fqdn':item})
namespace.servers = servers
def get_virtual_network_validator(has_type_field=False, allow_none=False, allow_new=False,
@ -350,6 +349,8 @@ def process_ag_url_path_map_rule_create_namespace(namespace): # pylint: disable=
def process_ag_create_namespace(namespace):
get_default_location_from_resource_group(namespace)
# process folded parameters
if namespace.subnet or namespace.virtual_network_name:
get_subnet_validator(has_type_field=True, allow_new=True)(namespace)
@ -371,13 +372,6 @@ def process_ag_create_namespace(namespace):
if namespace.public_ip_address:
get_public_ip_validator(
has_type_field=True, allow_none=True, allow_new=True, default_none=True)(namespace)
namespace.frontend_type = 'publicIp'
else:
namespace.frontend_type = 'privateIp'
namespace.private_ip_address_allocation = 'Static' if namespace.private_ip_address \
else 'Dynamic'
namespace.sku_tier = namespace.sku_name.split('_', 1)[0]
validate_cert(namespace)
@ -387,6 +381,8 @@ def process_auth_create_namespace(namespace):
def process_lb_create_namespace(namespace):
get_default_location_from_resource_group(namespace)
if namespace.subnet and namespace.public_ip_address:
raise ValueError(
'incorrect usage: --subnet NAME --vnet-name NAME | '
@ -397,23 +393,18 @@ def process_lb_create_namespace(namespace):
get_subnet_validator(
has_type_field=True, allow_new=True, allow_none=True, default_none=True)(namespace)
validate_private_ip_address(namespace)
namespace.public_ip_address_type = 'none'
namespace.public_ip_address_type = None
namespace.public_ip_address = None
else:
# validation for internet facing load balancer
get_public_ip_validator(has_type_field=True, allow_none=True, allow_new=True)(namespace)
if namespace.public_ip_dns_name:
if namespace.public_ip_address_type != 'new':
raise CLIError(
'specify --public-ip-dns-name only if creating a new public IP address.')
else:
namespace.dns_name_type = 'new'
if namespace.public_ip_dns_name and namespace.public_ip_address_type != 'new':
raise CLIError(
'specify --public-ip-dns-name only if creating a new public IP address.')
namespace.subnet_type = 'none'
namespace.subnet_type = None
namespace.subnet = None
namespace.virtual_network_name = None

Просмотреть файл

@ -23,6 +23,7 @@ from ._format import \
custom_path = 'azure.cli.command_modules.network.custom#{}'
# Application gateways
cli_command(__name__, 'network application-gateway create', custom_path.format('create_application_gateway'), transform=DeploymentOutputLongRunningOperation('Starting network application-gateway create'), no_wait_param='no_wait')
cli_command(__name__, 'network application-gateway delete', 'azure.mgmt.network.operations.application_gateways_operations#ApplicationGatewaysOperations.delete', cf_application_gateways, no_wait_param='raw')
cli_command(__name__, 'network application-gateway show', 'azure.mgmt.network.operations.application_gateways_operations#ApplicationGatewaysOperations.get', cf_application_gateways, exception_handler=empty_on_404)
cli_command(__name__, 'network application-gateway list', custom_path.format('list_application_gateways'))
@ -37,11 +38,6 @@ cli_generic_update_command(__name__, 'network application-gateway update',
cli_generic_wait_command(__name__, 'network application-gateway wait',
'azure.mgmt.network.operations.application_gateways_operations#ApplicationGatewaysOperations.get', cf_application_gateways)
cli_command(__name__, 'network application-gateway create',
'azure.cli.command_modules.network.mgmt_app_gateway.lib.operations.app_gateway_operations#AppGatewayOperations.create_or_update',
cf_application_gateway_create,
transform=DeploymentOutputLongRunningOperation('Starting network application-gateway create'),
no_wait_param='raw')
property_map = {
'authentication_certificates': 'auth-cert',
@ -119,6 +115,7 @@ cli_generic_wait_command(__name__, 'network express-route wait', 'azure.mgmt.net
cli_command(__name__, 'network express-route list-service-providers', 'azure.mgmt.network.operations.express_route_service_providers_operations#ExpressRouteServiceProvidersOperations.list', cf_express_route_service_providers)
# LoadBalancersOperations
cli_command(__name__, 'network lb create', custom_path.format('create_load_balancer'), transform=DeploymentOutputLongRunningOperation('Starting network lb create'), no_wait_param='no_wait')
cli_command(__name__, 'network lb delete', 'azure.mgmt.network.operations.load_balancers_operations#LoadBalancersOperations.delete', cf_load_balancers)
cli_command(__name__, 'network lb show', 'azure.mgmt.network.operations.load_balancers_operations#LoadBalancersOperations.get', cf_load_balancers, exception_handler=empty_on_404)
cli_command(__name__, 'network lb list', custom_path.format('list_lbs'))
@ -126,10 +123,6 @@ cli_generic_update_command(__name__, 'network lb update',
'azure.mgmt.network.operations.load_balancers_operations#LoadBalancersOperations.get',
'azure.mgmt.network.operations.load_balancers_operations#LoadBalancersOperations.create_or_update', cf_load_balancers)
cli_command(__name__, 'network lb create',
'azure.cli.command_modules.network.mgmt_lb.lib.operations.lb_operations#LbOperations.create_or_update',
cf_load_balancer_create,
transform=DeploymentOutputLongRunningOperation('Starting network lb create'))
property_map = {
'frontend_ip_configurations': 'frontend-ip',

Просмотреть файл

@ -16,16 +16,15 @@ from azure.mgmt.network.models import \
ApplicationGatewayFirewallMode, SecurityRuleAccess, SecurityRuleDirection,
SecurityRuleProtocol, IPAllocationMethod, IPVersion,
ExpressRouteCircuitSkuTier, ExpressRouteCircuitSkuFamily,
VirtualNetworkGatewayType, VirtualNetworkGatewaySkuName, VpnType)
VirtualNetworkGatewayType, VirtualNetworkGatewaySkuName, VpnType, ApplicationGatewaySkuName)
import azure.cli.core.azlogging as azlogging
from azure.cli.core.commands import LongRunningOperation
from azure.cli.core.commands.arm import parse_resource_id, is_valid_resource_id, resource_id
from azure.cli.core.commands.client_factory import get_subscription_id
from azure.cli.core._util import CLIError
from azure.cli.command_modules.network._client_factory import _network_client_factory
from azure.cli.command_modules.network._util import _get_property, _set_param
from azure.cli.command_modules.network.mgmt_app_gateway.lib.operations.app_gateway_operations \
import AppGatewayOperations
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.mgmt.dns import DnsManagementClient
@ -38,6 +37,13 @@ from azure.cli.command_modules.network.zone_file.make_zone_file import make_zone
logger = azlogging.get_az_logger(__name__)
def _log_pprint_template(template):
import json
logger.info('==== BEGIN TEMPLATE ====')
logger.info(json.dumps(template, indent=2))
logger.info('==== END TEMPLATE ====')
def _upsert(parent, collection_name, obj_to_add, key_name):
if not getattr(parent, collection_name, None):
@ -92,17 +98,98 @@ def list_application_gateways(resource_group_name=None):
#region Application Gateway commands
def update_application_gateway(instance, sku_name=None, sku_tier=None, capacity=None, tags=None):
if sku_name is not None:
instance.sku.name = sku_name
if sku_tier is not None:
instance.sku.tier = sku_tier
# pylint: disable=too-many-locals
def create_application_gateway(application_gateway_name, resource_group_name, location=None,
tags=None, no_wait=False, capacity=2,
cert_data=None, cert_password=None,
frontend_port=None, http_settings_cookie_based_affinity='disabled',
http_settings_port=80, http_settings_protocol='Http',
routing_rule_type='Basic', servers=None,
sku=ApplicationGatewaySkuName.standard_medium.value,
private_ip_address='', public_ip_address=None,
public_ip_address_allocation=IPAllocationMethod.dynamic.value,
subnet='default', subnet_address_prefix='10.0.0.0/24',
virtual_network_name=None, vnet_address_prefix='10.0.0.0/16',
public_ip_address_type=None, subnet_type=None, validate=False):
from azure.mgmt.resource.resources import ResourceManagementClient
from azure.mgmt.resource.resources.models import DeploymentProperties, TemplateLink
from azure.cli.core._util import random_string
from azure.cli.command_modules.network._template_builder import \
(ArmTemplateBuilder, build_application_gateway_resource, build_public_ip_resource,
build_vnet_resource)
tags = tags or {}
sku_tier = sku.split('_', 1)[0]
http_listener_protocol = 'https' if cert_data else 'http'
private_ip_allocation = 'Static' if private_ip_address else 'Dynamic'
virtual_network_name = virtual_network_name or '{}Vnet'.format(application_gateway_name)
# Build up the ARM template
master_template = ArmTemplateBuilder()
ag_dependencies = []
public_ip_id = public_ip_address if is_valid_resource_id(public_ip_address) else None
subnet_id = subnet if is_valid_resource_id(subnet) else None
private_ip_allocation = IPAllocationMethod.static.value if private_ip_address \
else IPAllocationMethod.dynamic.value
network_id_template = resource_id(
subscription=get_subscription_id(), resource_group=resource_group_name,
namespace='Microsoft.Network')
if subnet_type == 'new':
ag_dependencies.append('Microsoft.Network/virtualNetworks/{}'.format(virtual_network_name))
vnet = build_vnet_resource(
virtual_network_name, location, tags, vnet_address_prefix, subnet,
subnet_address_prefix)
master_template.add_resource(vnet)
subnet_id = '{}/virtualNetworks/{}/subnets/{}'.format(network_id_template,
virtual_network_name, subnet)
if public_ip_address_type == 'new':
ag_dependencies.append('Microsoft.Network/publicIpAddresses/{}'.format(public_ip_address)) # pylint: disable=line-too-long
master_template.add_resource(build_public_ip_resource(public_ip_address, location,
tags,
public_ip_address_allocation,
None))
public_ip_id = '{}/publicIPAddresses/{}'.format(network_id_template,
public_ip_address)
app_gateway_resource = build_application_gateway_resource(
application_gateway_name, location, tags, sku, sku_tier, capacity, servers, frontend_port,
private_ip_address, private_ip_allocation, cert_data, cert_password,
http_settings_cookie_based_affinity, http_settings_protocol, http_settings_port,
http_listener_protocol, routing_rule_type, public_ip_id, subnet_id)
app_gateway_resource['dependsOn'] = ag_dependencies
master_template.add_variable(
'appGwID',
"[resourceId('Microsoft.Network/applicationGateways', '{}')]".format(
application_gateway_name))
master_template.add_resource(app_gateway_resource)
master_template.add_output('applicationGateway', application_gateway_name, output_type='object')
template = master_template.build()
# deploy ARM template
deployment_name = 'ag_deploy_' + random_string(32)
client = get_mgmt_service_client(ResourceManagementClient).deployments
properties = DeploymentProperties(template=template, parameters={}, mode='incremental')
if validate:
_log_pprint_template(template)
return client.validate(resource_group_name, deployment_name, properties)
return client.create_or_update(resource_group_name, deployment_name, properties, raw=no_wait)
def update_application_gateway(instance, sku=None, capacity=None, tags=None):
if sku is not None:
instance.sku.name = sku
instance.sku.tier = sku.split('_', 1)[0]
if capacity is not None:
instance.sku.capacity = capacity
if tags is not None:
instance.tags = tags
return instance
update_application_gateway.__doc__ = AppGatewayOperations.create_or_update.__doc__
def create_ag_authentication_certificate(resource_group_name, application_gateway_name, item_name,
cert_data, no_wait=False):
@ -126,7 +213,6 @@ def create_ag_backend_address_pool(resource_group_name, application_gateway_name
_upsert(ag, 'backend_address_pools', new_pool, 'name')
return ncf.application_gateways.create_or_update(
resource_group_name, application_gateway_name, ag, raw=no_wait)
create_ag_backend_address_pool.__doc__ = AppGatewayOperations.create_or_update.__doc__
def update_ag_backend_address_pool(instance, parent, item_name, servers=None): # pylint: disable=unused-argument
if servers is not None:
@ -153,7 +239,6 @@ def create_ag_frontend_ip_configuration(resource_group_name, application_gateway
_upsert(ag, 'frontend_ip_configurations', new_config, 'name')
return ncf.application_gateways.create_or_update(
resource_group_name, application_gateway_name, ag, raw=no_wait)
create_ag_frontend_ip_configuration.__doc__ = AppGatewayOperations.create_or_update.__doc__
def update_ag_frontend_ip_configuration(instance, parent, item_name, public_ip_address=None, # pylint: disable=unused-argument
subnet=None, virtual_network_name=None, # pylint: disable=unused-argument
@ -166,7 +251,6 @@ def update_ag_frontend_ip_configuration(instance, parent, item_name, public_ip_a
instance.private_ip_address = private_ip_address
instance.private_ip_allocation_method = 'Static'
return parent
update_ag_frontend_ip_configuration.__doc__ = AppGatewayOperations.create_or_update.__doc__
def create_ag_frontend_port(resource_group_name, application_gateway_name, item_name, port,
no_wait=False):
@ -328,7 +412,6 @@ def create_ag_ssl_certificate(resource_group_name, application_gateway_name, ite
_upsert(ag, 'ssl_certificates', new_cert, 'name')
return ncf.application_gateways.create_or_update(
resource_group_name, application_gateway_name, ag, raw=no_wait)
create_ag_ssl_certificate.__doc__ = AppGatewayOperations.create_or_update.__doc__
def update_ag_ssl_certificate(instance, parent, item_name, cert_data=None, cert_password=None): # pylint: disable=unused-argument
if cert_data is not None:
@ -336,7 +419,6 @@ def update_ag_ssl_certificate(instance, parent, item_name, cert_data=None, cert_
if cert_password is not None:
instance.password = cert_password
return parent
update_ag_ssl_certificate.__doc__ = AppGatewayOperations.create_or_update.__doc__
def set_ag_ssl_policy(resource_group_name, application_gateway_name, disabled_ssl_protocols=None,
clear=False, no_wait=False):
@ -429,6 +511,76 @@ def show_ag_waf_config(resource_group_name, application_gateway_name):
#region Load Balancer subresource commands
def create_load_balancer(load_balancer_name, resource_group_name, location=None, tags=None,
backend_pool_name=None, frontend_ip_name='LoadBalancerFrontEnd',
private_ip_address=None, public_ip_address=None,
public_ip_address_allocation=IPAllocationMethod.dynamic.value,
public_ip_dns_name=None, subnet=None, subnet_address_prefix='10.0.0.0/24',
virtual_network_name=None, vnet_address_prefix='10.0.0.0/16',
public_ip_address_type=None, subnet_type=None, validate=False,
no_wait=False):
from azure.mgmt.resource.resources import ResourceManagementClient
from azure.mgmt.resource.resources.models import DeploymentProperties, TemplateLink
from azure.cli.core._util import random_string
from azure.cli.command_modules.network._template_builder import \
(ArmTemplateBuilder, build_load_balancer_resource, build_public_ip_resource,
build_vnet_resource)
tags = tags or {}
public_ip_address = public_ip_address or 'PublicIP{}'.format(load_balancer_name)
backend_pool_name = backend_pool_name or '{}bepool'.format(load_balancer_name)
# Build up the ARM template
master_template = ArmTemplateBuilder()
lb_dependencies = []
public_ip_id = public_ip_address if is_valid_resource_id(public_ip_address) else None
subnet_id = subnet if is_valid_resource_id(subnet) else None
private_ip_allocation = IPAllocationMethod.static.value if private_ip_address \
else IPAllocationMethod.dynamic.value
network_id_template = resource_id(
subscription=get_subscription_id(), resource_group=resource_group_name,
namespace='Microsoft.Network')
if subnet_type == 'new':
lb_dependencies.append('Microsoft.Network/virtualNetworks/{}'.format(virtual_network_name))
vnet = build_vnet_resource(
virtual_network_name, location, tags, vnet_address_prefix, subnet,
subnet_address_prefix)
master_template.add_resource(vnet)
subnet_id = '{}/virtualNetworks/{}/subnets/{}'.format(
network_id_template, virtual_network_name, subnet)
if public_ip_address_type == 'new':
lb_dependencies.append('Microsoft.Network/publicIpAddresses/{}'.format(public_ip_address)) # pylint: disable=line-too-long
master_template.add_resource(build_public_ip_resource(public_ip_address, location,
tags,
public_ip_address_allocation,
public_ip_dns_name))
public_ip_id = '{}/publicIPAddresses/{}'.format(network_id_template,
public_ip_address)
load_balancer_resource = build_load_balancer_resource(
load_balancer_name, location, tags, backend_pool_name, frontend_ip_name,
public_ip_id, subnet_id, private_ip_address, private_ip_allocation)
load_balancer_resource['dependsOn'] = lb_dependencies
master_template.add_resource(load_balancer_resource)
master_template.add_output('loadBalancer', load_balancer_name, output_type='object')
template = master_template.build()
# deploy ARM template
deployment_name = 'lb_deploy_' + random_string(32)
client = get_mgmt_service_client(ResourceManagementClient).deployments
properties = DeploymentProperties(template=template, parameters={}, mode='incremental')
if validate:
_log_pprint_template(template)
return client.validate(resource_group_name, deployment_name, properties)
return client.create_or_update(resource_group_name, deployment_name, properties, raw=no_wait)
def create_lb_inbound_nat_rule(
resource_group_name, load_balancer_name, item_name, protocol, frontend_port,
frontend_ip_name, backend_port, floating_ip="false", idle_timeout=None):
@ -902,7 +1054,6 @@ def create_vnet_peering(resource_group_name, virtual_network_name, virtual_netwo
remote_virtual_network, allow_virtual_network_access=False,
allow_forwarded_traffic=False, allow_gateway_transit=False,
use_remote_gateways=False):
from azure.cli.core.commands.client_factory import get_subscription_id
peering = VirtualNetworkPeering(
id=resource_id(
subscription=get_subscription_id(),
@ -1044,8 +1195,7 @@ def create_vpn_connection(client, resource_group_name, connection_name, vnet_gat
client = get_mgmt_service_client(ResourceManagementClient).deployments
properties = DeploymentProperties(template=template, parameters={}, mode='incremental')
if validate:
from pprint import pprint
pprint(template)
_log_pprint_template(template)
return client.validate(resource_group_name, deployment_name, properties)
return LongRunningOperation()(client.create_or_update(

Просмотреть файл

@ -1,8 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
import pkg_resources
pkg_resources.declare_namespace(__name__)

Просмотреть файл

@ -1,483 +0,0 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"_artifactsLocation": {
"type": "string",
"metadata": {
"description": "URL of the template to deploy."
}
},
"applicationGatewayName": {
"type": "string",
"metadata": {
"description": "The name of the application gateway."
}
},
"capacity": {
"type": "int",
"defaultValue": 2,
"metadata": {
"description": "The number of instances to use with the application gateway."
}
},
"certData": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The contents of the PFX certificate file."
}
},
"certPassword": {
"type": "securestring",
"defaultValue": "",
"metadata": {
"description": "The certificate password."
}
},
"frontendPort": {
"type": "int",
"defaultValue": "",
"metadata": {
"description": "The front end port number."
}
},
"frontendType": {
"type": "string",
"defaultValue": "privateIp",
"allowedValues": [ "publicIp", "privateIp" ],
"metadata": {
"description": "Specify which kind of frontend configuration to create."
}
},
"httpListenerProtocol": {
"type": "string",
"defaultValue": "http",
"allowedValues": [ "http", "https" ],
"metadata": {
"description": "The HTTP listener protocol."
}
},
"httpSettingsCookieBasedAffinity": {
"type": "string",
"defaultValue": "disabled",
"allowedValues": [ "enabled", "disabled" ],
"metadata": {
"description": "Enable or disable HTTP settings cookie based affinity."
}
},
"httpSettingsPort": {
"type": "int",
"defaultValue": 80,
"metadata": {
"description": "The HTTP settings port."
}
},
"httpSettingsProtocol": {
"type": "string",
"defaultValue": "http",
"allowedValues": [ "http", "https" ],
"metadata": {
"description": "The HTTP settings protocol."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "The location in which to create the application gateway."
}
},
"privateIpAddress": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The static private IP address to associate with the application gateway frontend."
}
},
"privateIpAddressAllocation": {
"type": "string",
"defaultValue": "dynamic",
"allowedValues": [ "dynamic", "static" ],
"metadata": {
"description": "Specify the kind of private IP allocation."
}
},
"publicIpAddress": {
"type": "string",
"defaultValue": "[concat('PublicIP', parameters('applicationGatewayName'))]",
"metadata": {
"description": "The name or ID of the public IP address."
}
},
"publicIpAddressType": {
"type": "string",
"defaultValue": "none",
"allowedValues": [ "none", "new", "existingName", "existingId" ],
"metadata": {
"description": "Specify the type of public IP address."
}
},
"publicIpAddressAllocation": {
"type": "string",
"defaultValue": "dynamic",
"allowedValues": [ "dynamic", "static" ],
"metadata": {
"description": "Specify the kind of public IP allocation for new public IPs."
}
},
"routingRuleType": {
"type": "string",
"defaultValue": "Basic",
"allowedValues": [ "Basic", "PathBasedRouting" ],
"metadata": {
"description": "The request routing rule type."
}
},
"servers": {
"type": "array",
"defaultValue": [ ],
"metadata": {
"description": "The list of IP addresses or DNS names corresponding to backend servers."
}
},
"skuName": {
"type": "string",
"defaultValue": "Standard_Medium",
"metadata": {
"description": "The name of the SKU. (Standard_Small, Standard_Medium, Standard_Large)."
}
},
"skuTier": {
"type": "string",
"defaultValue": "Standard",
"metadata": {
"description": "The SKU tier."
}
},
"subnet": {
"type": "string",
"defaultValue": "default",
"metadata": {
"description": "The name or ID of the subnet."
}
},
"subnetAddressPrefix": {
"type": "string",
"defaultValue": "10.0.0.0/24",
"metadata": {
"description": "The subnet prefix in CIDR format."
}
},
"subnetType": {
"type": "string",
"allowedValues": [ "new", "existingId", "existingName" ],
"defaultValue": "new",
"metadata": {
"description": "Use a new or existing subnet."
}
},
"tags": {
"type": "object",
"defaultValue": { },
"metadata": {
"description": "Tags object."
}
},
"virtualNetworkName": {
"type": "string",
"defaultValue": "[concat(parameters('applicationGatewayName'),'Vnet')]",
"metadata": {
"description": "The name of the virtual network (VNet) associated with the subnet."
}
},
"vnetAddressPrefix": {
"type": "string",
"defaultValue": "10.0.0.0/16",
"metadata": {
"description": "The virtual network address range in CIDR format."
}
}
},
"variables": {
"applicationGatewayId": "[concat('/subscriptions/',subscription().subscriptionId,'/resourceGroups/',resourceGroup().name,'/providers/Microsoft.Network/applicationGateways/',parameters('applicationGatewayName'))]",
"applicationGatewayProperties": {
"http": {
"sku": {
"name": "[parameters('skuName')]",
"tier": "[parameters('skuTier')]",
"capacity": "[parameters('capacity')]"
},
"gatewayIPConfigurations": [
{
"name": "appGatewayIpConfig",
"properties": {
"subnet": {
"id": "[variables('subnetIds')[parameters('subnetType')]]"
}
}
}
],
"frontendIPConfigurations": [
{
"name": "appGatewayFrontendIP",
"properties": "[variables('frontendIpProperties')[parameters('frontendType')]]"
}
],
"frontendPorts": [
{
"name": "appGatewayFrontendPort",
"properties": {
"Port": "[parameters('frontendPort')]"
}
}
],
"backendAddressPools": [
{
"name": "appGatewayBackendPool",
"properties": {
"BackendAddresses": "[parameters('servers')]"
}
}
],
"backendHttpSettingsCollection": [
{
"name": "appGatewayBackendHttpSettings",
"properties": {
"Port": "[parameters('httpSettingsPort')]",
"Protocol": "[parameters('httpSettingsProtocol')]",
"CookieBasedAffinity": "[parameters('httpSettingsCookieBasedAffinity')]"
}
}
],
"httpListeners": [
{
"name": "appGatewayHttpListener",
"properties": {
"FrontendIpConfiguration": {
"Id": "[concat(resourceId('Microsoft.Network/applicationGateways',parameters('applicationGatewayName')),'/frontendIPConfigurations/appGatewayFrontendIP')]"
},
"FrontendPort": {
"Id": "[concat(resourceId('Microsoft.Network/applicationGateways',parameters('applicationGatewayName')),'/frontendPorts/appGatewayFrontendPort')]"
},
"Protocol": "http",
"SslCertificate": null
}
}
],
"requestRoutingRules": [
{
"Name": "rule1",
"properties": {
"RuleType": "[parameters('routingRuleType')]",
"httpListener": {
"id": "[concat(resourceId('Microsoft.Network/applicationGateways',parameters('applicationGatewayName')),'/httpListeners/appGatewayHttpListener')]"
},
"backendAddressPool": {
"id": "[concat(resourceId('Microsoft.Network/applicationGateways',parameters('applicationGatewayName')),'/backendAddressPools/appGatewayBackendPool')]"
},
"backendHttpSettings": {
"id": "[concat(resourceId('Microsoft.Network/applicationGateways',parameters('applicationGatewayName')),'/backendHttpSettingsCollection/appGatewayBackendHttpSettings')]"
}
}
}
]
},
"https": {
"sku": {
"name": "[parameters('skuName')]",
"tier": "[parameters('skuTier')]",
"capacity": "[parameters('capacity')]"
},
"gatewayIPConfigurations": [
{
"name": "appGatewayIpConfig",
"properties": {
"subnet": {
"id": "[variables('subnetIds')[parameters('subnetType')]]"
}
}
}
],
"frontendIPConfigurations": [
{
"name": "appGatewayFrontendIP",
"properties": "[variables('frontendIpProperties')[parameters('frontendType')]]"
}
],
"frontendPorts": [
{
"name": "appGatewayFrontendPort",
"properties": {
"Port": "[parameters('frontendPort')]"
}
}
],
"backendAddressPools": [
{
"name": "appGatewayBackendPool",
"properties": {
"BackendAddresses": "[parameters('servers')]"
}
}
],
"backendHttpSettingsCollection": [
{
"name": "appGatewayBackendHttpSettings",
"properties": {
"Port": "[parameters('httpSettingsPort')]",
"Protocol": "[parameters('httpSettingsProtocol')]",
"CookieBasedAffinity": "[parameters('httpSettingsCookieBasedAffinity')]"
}
}
],
"httpListeners": [
{
"name": "appGatewayHttpListener",
"properties": {
"FrontendIpConfiguration": {
"Id": "[concat(resourceId('Microsoft.Network/applicationGateways',parameters('applicationGatewayName')),'/frontendIPConfigurations/appGatewayFrontendIP')]"
},
"FrontendPort": {
"Id": "[concat(resourceId('Microsoft.Network/applicationGateways',parameters('applicationGatewayName')),'/frontendPorts/appGatewayFrontendPort')]"
},
"Protocol": "https",
"SslCertificate": {
"Id": "[concat(variables('applicationGatewayId'),'/sslCertificates/',variables('sslCertificateName'))]"
}
}
}
],
"requestRoutingRules": [
{
"Name": "rule1",
"properties": {
"RuleType": "[parameters('routingRuleType')]",
"httpListener": {
"id": "[concat(resourceId('Microsoft.Network/applicationGateways',parameters('applicationGatewayName')),'/httpListeners/appGatewayHttpListener')]"
},
"backendAddressPool": {
"id": "[concat(resourceId('Microsoft.Network/applicationGateways',parameters('applicationGatewayName')),'/backendAddressPools/appGatewayBackendPool')]"
},
"backendHttpSettings": {
"id": "[concat(resourceId('Microsoft.Network/applicationGateways',parameters('applicationGatewayName')),'/backendHttpSettingsCollection/appGatewayBackendHttpSettings')]"
}
}
}
],
"sslCertificates": [
{
"name": "[variables('sslCertificateName')]",
"properties": {
"data": "[parameters('certData')]",
"password": "[parameters('certPassword')]"
}
}
]
}
},
"frontendIpProperties": {
"publicIp": {
"publicIpAddress": {
"id": "[variables('publicIpIds')[parameters('publicIpAddressType')]]"
}
},
"privateIp": {
"privateIPAddress": "[parameters('privateIpAddress')]",
"privateIPAllocationMethod": "[parameters('privateIpAddressAllocation')]",
"subnet": {
"id": "[variables('subnetIds')[parameters('subnetType')]]"
}
}
},
"publicIpDeploymentName": "[concat('PublicIp',parameters('applicationGatewayName'))]",
"publicIpIds": {
"none": "[parameters('publicIpAddress')]",
"new": "[concat('/subscriptions/',subscription().subscriptionId,'/resourceGroups/',resourceGroup().name,'/providers/Microsoft.Network/publicIpAddresses/',parameters('publicIpAddress'))]",
"existingName": "[concat('/subscriptions/',subscription().subscriptionId,'/resourceGroups/',resourceGroup().name,'/providers/Microsoft.Network/publicIpAddresses/',parameters('publicIpAddress'))]",
"existingId": "[parameters('publicIpAddress')]"
},
"publicIpTemplateUri": "https://azuresdkci.blob.core.windows.net/templatehost/CreatePublicIp_2016-07-19/azuredeploy.json",
"publicIpTemplateUriEmpty": "https://azuresdkci.blob.core.windows.net/templatehost/CreatePublicIp_2016-07-19/azuredeploy_empty.json",
"publicIpTemplateFilePaths": {
"existingId": "[variables('publicIpTemplateUriEmpty')]",
"existingName": "[variables('publicIpTemplateUriEmpty')]",
"new": "[variables('publicIpTemplateUri')]",
"none": "[variables('publicIpTemplateUriEmpty')]"
},
"sslCertificateName": "[concat(parameters('applicationGatewayName'),'SslCert')]",
"subnetIds": {
"existingId": "[parameters('subnet')]",
"existingName": "[concat(variables('vnetId'),'/subnets/',parameters('subnet'))]",
"new": "[concat(variables('vnetId'),'/subnets/',parameters('subnet'))]"
},
"vnetDeploymentName": "[concat('VNET',parameters('applicationGatewayName'))]",
"vnetId": "[concat('/subscriptions/',subscription().subscriptionId,'/resourceGroups/',resourceGroup().name,'/providers/Microsoft.Network/virtualNetworks/',parameters('virtualNetworkName'))]",
"vnetTemplateUri": "https://azuresdkci.blob.core.windows.net/templatehost/CreateVnet_2016-07-18/azuredeploy.json",
"vnetTemplateUriEmpty": "https://azuresdkci.blob.core.windows.net/templatehost/CreateVnet_2016-07-18/azuredeploy_empty.json",
"vnetTemplateFilePaths": {
"existingId": "[variables('vnetTemplateUriEmpty')]",
"existingName": "[variables('vnetTemplateUriEmpty')]",
"new": "[variables('vnetTemplateUri')]"
}
},
"resources": [
{
"apiVersion": "2015-06-15",
"dependsOn": [
"[concat('Microsoft.Resources/deployments/', variables('vnetDeploymentName'))]",
"[concat('Microsoft.Resources/deployments/', variables('publicIpDeploymentName'))]"
],
"location": "[resourceGroup().location]",
"tags": "[parameters('tags')]",
"name": "[parameters('applicationGatewayName')]",
"properties": "[variables('applicationGatewayProperties')[parameters('httpListenerProtocol')]]",
"type": "Microsoft.Network/applicationGateways"
},
{
"name": "[variables('vnetDeploymentName')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2015-01-01",
"dependsOn": [ ],
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[variables('vnetTemplateFilePaths')[parameters('subnetType')]]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"subnetName": { "value": "[parameters('subnet')]" },
"subnetPrefix": { "value": "[parameters('subnetAddressPrefix')]" },
"virtualNetworkName": { "value": "[parameters('virtualNetworkName')]" },
"virtualNetworkPrefix": { "value": "[parameters('vnetAddressPrefix')]" },
"tags": { "value": "[parameters('tags')]" }
}
}
},
{
"name": "[variables('publicIpDeploymentName')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2015-01-01",
"dependsOn": [ ],
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[variables('publicIpTemplateFilePaths')[parameters('publicIpAddressType')]]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"location": { "value": "[parameters('location')]" },
"name": { "value": "[parameters('publicIpAddress')]" },
"allocationMethod": { "value": "[parameters('publicIpAddressAllocation')]" },
"tags": { "value": "[parameters('tags')]" }
}
}
}
],
"outputs": {
"applicationGateway": {
"type": "object",
"value": "[reference(parameters('applicationGatewayName'))]"
}
}
}

Просмотреть файл

@ -1,39 +0,0 @@
# NIC Create scenarios before merge #
## P0: BASIC ##
Execute P0s before any change is merged
**Automated Test**
- delete the following:
- test_network_app_gateway_with_defaults.yaml
- test_network_app_gateway_with_internal_load_balancer.yaml
- test_network_app_gateway_with_public_ip.yaml
- test_network_app_gateway_with_subnet.yaml
- Run the tests twice (first records, second verifies stability)
OR
Execute the follow scenarios manually:
**Create with minimum parameters (new vnet/subnet with dynamic private IP) **
- create new application gateway
- verify frontend IP configuration set to new subnet
**Create with Existing vnet/subnet**
- create new vnet and subnet
- create new application gateway with existing vnet/subnet
- verify frontend IP configuration set to existing subnet
**Create with Static Private IP Endpoint and SSL**
- create new application gateway specifying a private IP address and SSL credentials
- verify frontend IP configuration is a static private IP
- verify listner protocol is set to HTTPS
**Create with Public IP**
- create new application gateway with a new public IP
- verify frontend IP configuration set to public IP

Просмотреть файл

@ -1,20 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from .app_gateway_creation_client import AppGatewayCreationClient
from .version import VERSION
__all__ = ['AppGatewayCreationClient']
__version__ = VERSION

Просмотреть файл

@ -1,122 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.service_client import ServiceClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.app_gateway_operations import AppGatewayOperations
from . import models
class AppGatewayCreationClientConfiguration(AzureConfiguration):
"""Configuration for AppGatewayCreationClient
Note that all parameters used to create this instance are saved as instance
attributes.
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Gets subscription credentials which uniquely
identify Microsoft Azure subscription. The subscription ID forms part of
the URI for every service call.
:type subscription_id: str
:param api_version: Client Api Version.
:type api_version: str
:param accept_language: Gets or sets the preferred language for the
response.
:type accept_language: str
:param long_running_operation_retry_timeout: Gets or sets the retry
timeout in seconds for Long Running Operations. Default value is 30.
:type long_running_operation_retry_timeout: int
:param generate_client_request_id: When set to true a unique
x-ms-client-request-id value is generated and included in each request.
Default is true.
:type generate_client_request_id: bool
:param str base_url: Service URL
:param str filepath: Existing config
"""
def __init__(
self, credentials, subscription_id, api_version='2015-11-01', accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None):
if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not isinstance(subscription_id, str):
raise TypeError("Parameter 'subscription_id' must be str.")
if api_version is not None and not isinstance(api_version, str):
raise TypeError("Optional parameter 'api_version' must be str.")
if accept_language is not None and not isinstance(accept_language, str):
raise TypeError("Optional parameter 'accept_language' must be str.")
if not base_url:
base_url = 'https://management.azure.com'
super(AppGatewayCreationClientConfiguration, self).__init__(base_url, filepath)
self.add_user_agent('appgatewaycreationclient/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')
self.credentials = credentials
self.subscription_id = subscription_id
self.api_version = api_version
self.accept_language = accept_language
self.long_running_operation_retry_timeout = long_running_operation_retry_timeout
self.generate_client_request_id = generate_client_request_id
class AppGatewayCreationClient(object):
"""AppGatewayCreationClient
:ivar config: Configuration for client.
:vartype config: AppGatewayCreationClientConfiguration
:ivar app_gateway: AppGateway operations
:vartype app_gateway: .operations.AppGatewayOperations
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Gets subscription credentials which uniquely
identify Microsoft Azure subscription. The subscription ID forms part of
the URI for every service call.
:type subscription_id: str
:param api_version: Client Api Version.
:type api_version: str
:param accept_language: Gets or sets the preferred language for the
response.
:type accept_language: str
:param long_running_operation_retry_timeout: Gets or sets the retry
timeout in seconds for Long Running Operations. Default value is 30.
:type long_running_operation_retry_timeout: int
:param generate_client_request_id: When set to true a unique
x-ms-client-request-id value is generated and included in each request.
Default is true.
:type generate_client_request_id: bool
:param str base_url: Service URL
:param str filepath: Existing config
"""
def __init__(
self, credentials, subscription_id, api_version='2015-11-01', accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None):
self.config = AppGatewayCreationClientConfiguration(credentials, subscription_id, api_version, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath)
self._client = ServiceClient(self.config.credentials, self.config)
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self.app_gateway = AppGatewayOperations(
self._client, self.config, self._serialize, self._deserialize)

Просмотреть файл

@ -1,22 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.authentication import (
BasicAuthentication,
BasicTokenAuthentication,
OAuthTokenAuthentication)
from msrestazure.azure_active_directory import (
InteractiveCredentials,
ServicePrincipalCredentials,
UserPassCredentials)

Просмотреть файл

@ -1,25 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.exceptions import (
ClientException,
SerializationError,
DeserializationError,
TokenExpiredError,
ClientRequestError,
AuthenticationError,
HttpOperationError,
ValidationError,
)
from msrestazure.azure_exceptions import CloudError

Просмотреть файл

@ -1,56 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from .deployment_app_gateway import DeploymentAppGateway
from .template_link import TemplateLink
from .parameters_link import ParametersLink
from .provider_resource_type import ProviderResourceType
from .provider import Provider
from .basic_dependency import BasicDependency
from .dependency import Dependency
from .deployment_properties_extended import DeploymentPropertiesExtended
from .deployment_extended import DeploymentExtended
from .app_gateway_creation_client_enums import (
frontendType,
httpListenerProtocol,
httpSettingsCookieBasedAffinity,
httpSettingsProtocol,
privateIpAddressAllocation,
publicIpAddressAllocation,
publicIpAddressType,
routingRuleType,
subnetType,
DeploymentMode,
)
__all__ = [
'DeploymentAppGateway',
'TemplateLink',
'ParametersLink',
'ProviderResourceType',
'Provider',
'BasicDependency',
'Dependency',
'DeploymentPropertiesExtended',
'DeploymentExtended',
'frontendType',
'httpListenerProtocol',
'httpSettingsCookieBasedAffinity',
'httpSettingsProtocol',
'privateIpAddressAllocation',
'publicIpAddressAllocation',
'publicIpAddressType',
'routingRuleType',
'subnetType',
'DeploymentMode',
]

Просмотреть файл

@ -1,77 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from enum import Enum
class frontendType(Enum):
public_ip = "publicIp"
private_ip = "privateIp"
class httpListenerProtocol(Enum):
http = "http"
https = "https"
class httpSettingsCookieBasedAffinity(Enum):
enabled = "enabled"
disabled = "disabled"
class httpSettingsProtocol(Enum):
http = "http"
https = "https"
class privateIpAddressAllocation(Enum):
dynamic = "dynamic"
static = "static"
class publicIpAddressAllocation(Enum):
dynamic = "dynamic"
static = "static"
class publicIpAddressType(Enum):
none = "none"
new = "new"
existing_name = "existingName"
existing_id = "existingId"
class routingRuleType(Enum):
basic = "Basic"
path_based_routing = "PathBasedRouting"
class subnetType(Enum):
new = "new"
existing_id = "existingId"
existing_name = "existingName"
class DeploymentMode(Enum):
incremental = "Incremental"
complete = "Complete"

Просмотреть файл

@ -1,37 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class BasicDependency(Model):
"""Deployment dependency information.
:param id: Gets or sets the ID of the dependency.
:type id: str
:param resource_type: Gets or sets the dependency resource type.
:type resource_type: str
:param resource_name: Gets or sets the dependency resource name.
:type resource_name: str
"""
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'resource_type': {'key': 'resourceType', 'type': 'str'},
'resource_name': {'key': 'resourceName', 'type': 'str'},
}
def __init__(self, id=None, resource_type=None, resource_name=None):
self.id = id
self.resource_type = resource_type
self.resource_name = resource_name

Просмотреть файл

@ -1,42 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Dependency(Model):
"""Deployment dependency information.
:param depends_on: Gets the list of dependencies.
:type depends_on: list of :class:`BasicDependency
<Default.models.BasicDependency>`
:param id: Gets or sets the ID of the dependency.
:type id: str
:param resource_type: Gets or sets the dependency resource type.
:type resource_type: str
:param resource_name: Gets or sets the dependency resource name.
:type resource_name: str
"""
_attribute_map = {
'depends_on': {'key': 'dependsOn', 'type': '[BasicDependency]'},
'id': {'key': 'id', 'type': 'str'},
'resource_type': {'key': 'resourceType', 'type': 'str'},
'resource_name': {'key': 'resourceName', 'type': 'str'},
}
def __init__(self, depends_on=None, id=None, resource_type=None, resource_name=None):
self.depends_on = depends_on
self.id = id
self.resource_type = resource_type
self.resource_name = resource_name

Просмотреть файл

@ -1,197 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
from azure.mgmt.network.models import ApplicationGatewayBackendAddress
class DeploymentAppGateway(Model):
"""Deployment operation parameters.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar uri: URI referencing the template. Default value:
"https://azuresdkci.blob.core.windows.net/templatehost/CreateAppGateway_2016-11-16/azuredeploy.json"
.
:vartype uri: str
:param content_version: If included it must match the ContentVersion in
the template.
:type content_version: str
:ivar _artifacts_location: Container URI of of the template. Default
value:
"https://azuresdkci.blob.core.windows.net/templatehost/CreateAppGateway_2016-11-16"
.
:vartype _artifacts_location: str
:param application_gateway_name: The name of the application gateway.
:type application_gateway_name: str
:param capacity: The number of instances to use with the application
gateway. Default value: 2 .
:type capacity: int
:param cert_data: The contents of the PFX certificate file.
:type cert_data: str
:param cert_password: The certificate password.
:type cert_password: str
:param frontend_port: The front end port number.
:type frontend_port: int
:param frontend_type: Specify which kind of frontend configuration to
create. Possible values include: 'publicIp', 'privateIp'. Default value:
"privateIp" .
:type frontend_type: str or :class:`frontendType
<Default.models.frontendType>`
:param http_listener_protocol: The HTTP listener protocol. Possible
values include: 'http', 'https'. Default value: "http" .
:type http_listener_protocol: str or :class:`httpListenerProtocol
<Default.models.httpListenerProtocol>`
:param http_settings_cookie_based_affinity: Enable or disable HTTP
settings cookie based affinity. Possible values include: 'enabled',
'disabled'. Default value: "disabled" .
:type http_settings_cookie_based_affinity: str or
:class:`httpSettingsCookieBasedAffinity
<Default.models.httpSettingsCookieBasedAffinity>`
:param http_settings_port: The HTTP settings port. Default value: 80 .
:type http_settings_port: int
:param http_settings_protocol: The HTTP settings protocol. Possible
values include: 'http', 'https'. Default value: "http" .
:type http_settings_protocol: str or :class:`httpSettingsProtocol
<Default.models.httpSettingsProtocol>`
:param location: The location in which to create the application gateway.
:type location: str
:param private_ip_address: The static private IP address to associate
with the application gateway frontend.
:type private_ip_address: str
:param private_ip_address_allocation: Specify the kind of private IP
allocation. Possible values include: 'dynamic', 'static'. Default value:
"dynamic" .
:type private_ip_address_allocation: str or
:class:`privateIpAddressAllocation
<Default.models.privateIpAddressAllocation>`
:param public_ip_address: The name or ID of the public IP address.
:type public_ip_address: str
:param public_ip_address_allocation: Specify the kind of public IP
allocation for new public IPs. Possible values include: 'dynamic',
'static'. Default value: "dynamic" .
:type public_ip_address_allocation: str or
:class:`publicIpAddressAllocation
<Default.models.publicIpAddressAllocation>`
:param public_ip_address_type: Specify the type of public IP address.
Possible values include: 'none', 'new', 'existingName', 'existingId'.
Default value: "none" .
:type public_ip_address_type: str or :class:`publicIpAddressType
<Default.models.publicIpAddressType>`
:param routing_rule_type: The request routing rule type. Possible values
include: 'Basic', 'PathBasedRouting'. Default value: "Basic" .
:type routing_rule_type: str or :class:`routingRuleType
<Default.models.routingRuleType>`
:param servers: The list of IP addresses or DNS names corresponding to
backend servers.
:type servers: list of object
:param sku_name: The name of the SKU. (Standard_Small, Standard_Medium,
Standard_Large). Default value: "Standard_Medium" .
:type sku_name: str
:param sku_tier: The SKU tier. Default value: "Standard" .
:type sku_tier: str
:param subnet: The name or ID of the subnet. Default value: "default" .
:type subnet: str
:param subnet_address_prefix: The subnet prefix in CIDR format. Default
value: "10.0.0.0/24" .
:type subnet_address_prefix: str
:param subnet_type: Use a new or existing subnet. Possible values
include: 'new', 'existingId', 'existingName'. Default value: "new" .
:type subnet_type: str or :class:`subnetType <Default.models.subnetType>`
:param tags: Tags object.
:type tags: object
:param virtual_network_name: The name of the virtual network (VNet)
associated with the subnet.
:type virtual_network_name: str
:param vnet_address_prefix: The virtual network address range in CIDR
format. Default value: "10.0.0.0/16" .
:type vnet_address_prefix: str
:ivar mode: Gets or sets the deployment mode. Default value:
"Incremental" .
:vartype mode: str
"""
_validation = {
'uri': {'required': True, 'constant': True},
'_artifacts_location': {'required': True, 'constant': True},
'application_gateway_name': {'required': True},
'mode': {'required': True, 'constant': True},
}
_attribute_map = {
'uri': {'key': 'properties.templateLink.uri', 'type': 'str'},
'content_version': {'key': 'properties.templateLink.contentVersion', 'type': 'str'},
'_artifacts_location': {'key': 'properties.parameters._artifactsLocation.value', 'type': 'str'},
'application_gateway_name': {'key': 'properties.parameters.applicationGatewayName.value', 'type': 'str'},
'capacity': {'key': 'properties.parameters.capacity.value', 'type': 'int'},
'cert_data': {'key': 'properties.parameters.certData.value', 'type': 'str'},
'cert_password': {'key': 'properties.parameters.certPassword.value', 'type': 'str'},
'frontend_port': {'key': 'properties.parameters.frontendPort.value', 'type': 'int'},
'frontend_type': {'key': 'properties.parameters.frontendType.value', 'type': 'frontendType'},
'http_listener_protocol': {'key': 'properties.parameters.httpListenerProtocol.value', 'type': 'httpListenerProtocol'},
'http_settings_cookie_based_affinity': {'key': 'properties.parameters.httpSettingsCookieBasedAffinity.value', 'type': 'httpSettingsCookieBasedAffinity'},
'http_settings_port': {'key': 'properties.parameters.httpSettingsPort.value', 'type': 'int'},
'http_settings_protocol': {'key': 'properties.parameters.httpSettingsProtocol.value', 'type': 'httpSettingsProtocol'},
'location': {'key': 'properties.parameters.location.value', 'type': 'str'},
'private_ip_address': {'key': 'properties.parameters.privateIpAddress.value', 'type': 'str'},
'private_ip_address_allocation': {'key': 'properties.parameters.privateIpAddressAllocation.value', 'type': 'privateIpAddressAllocation'},
'public_ip_address': {'key': 'properties.parameters.publicIpAddress.value', 'type': 'str'},
'public_ip_address_allocation': {'key': 'properties.parameters.publicIpAddressAllocation.value', 'type': 'publicIpAddressAllocation'},
'public_ip_address_type': {'key': 'properties.parameters.publicIpAddressType.value', 'type': 'publicIpAddressType'},
'routing_rule_type': {'key': 'properties.parameters.routingRuleType.value', 'type': 'routingRuleType'},
'servers': {'key': 'properties.parameters.servers.value', 'type': '[ApplicationGatewayBackendAddress]'},
'sku_name': {'key': 'properties.parameters.skuName.value', 'type': 'str'},
'sku_tier': {'key': 'properties.parameters.skuTier.value', 'type': 'str'},
'subnet': {'key': 'properties.parameters.subnet.value', 'type': 'str'},
'subnet_address_prefix': {'key': 'properties.parameters.subnetAddressPrefix.value', 'type': 'str'},
'subnet_type': {'key': 'properties.parameters.subnetType.value', 'type': 'subnetType'},
'tags': {'key': 'properties.parameters.tags.value', 'type': 'object'},
'virtual_network_name': {'key': 'properties.parameters.virtualNetworkName.value', 'type': 'str'},
'vnet_address_prefix': {'key': 'properties.parameters.vnetAddressPrefix.value', 'type': 'str'},
'mode': {'key': 'properties.mode', 'type': 'str'},
}
uri = "https://azuresdkci.blob.core.windows.net/templatehost/CreateAppGateway_2016-11-16/azuredeploy.json"
_artifacts_location = "https://azuresdkci.blob.core.windows.net/templatehost/CreateAppGateway_2016-11-16"
mode = "Incremental"
def __init__(self, application_gateway_name, content_version=None, capacity=2, cert_data=None, cert_password=None, frontend_port=None, frontend_type="privateIp", http_listener_protocol="http", http_settings_cookie_based_affinity="disabled", http_settings_port=80, http_settings_protocol="http", location=None, private_ip_address=None, private_ip_address_allocation="dynamic", public_ip_address=None, public_ip_address_allocation="dynamic", public_ip_address_type="none", routing_rule_type="Basic", servers=None, sku_name="Standard_Medium", sku_tier="Standard", subnet="default", subnet_address_prefix="10.0.0.0/24", subnet_type="new", tags=None, virtual_network_name=None, vnet_address_prefix="10.0.0.0/16"):
self.content_version = content_version
self.application_gateway_name = application_gateway_name
self.capacity = capacity
self.cert_data = cert_data
self.cert_password = cert_password
self.frontend_port = frontend_port
self.frontend_type = frontend_type
self.http_listener_protocol = http_listener_protocol
self.http_settings_cookie_based_affinity = http_settings_cookie_based_affinity
self.http_settings_port = http_settings_port
self.http_settings_protocol = http_settings_protocol
self.location = location
self.private_ip_address = private_ip_address
self.private_ip_address_allocation = private_ip_address_allocation
self.public_ip_address = public_ip_address
self.public_ip_address_allocation = public_ip_address_allocation
self.public_ip_address_type = public_ip_address_type
self.routing_rule_type = routing_rule_type
self.servers = servers
self.sku_name = sku_name
self.sku_tier = sku_tier
self.subnet = subnet
self.subnet_address_prefix = subnet_address_prefix
self.subnet_type = subnet_type
self.tags = tags
self.virtual_network_name = virtual_network_name
self.vnet_address_prefix = vnet_address_prefix

Просмотреть файл

@ -1,42 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class DeploymentExtended(Model):
"""Deployment information.
:param id: Gets or sets the ID of the deployment.
:type id: str
:param name: Gets or sets the name of the deployment.
:type name: str
:param properties: Gets or sets deployment properties.
:type properties: :class:`DeploymentPropertiesExtended
<Default.models.DeploymentPropertiesExtended>`
"""
_validation = {
'name': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'},
}
def __init__(self, name, id=None, properties=None):
self.id = id
self.name = name
self.properties = properties

Просмотреть файл

@ -1,78 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class DeploymentPropertiesExtended(Model):
"""Deployment properties with additional details.
:param provisioning_state: Gets or sets the state of the provisioning.
:type provisioning_state: str
:param correlation_id: Gets or sets the correlation ID of the deployment.
:type correlation_id: str
:param timestamp: Gets or sets the timestamp of the template deployment.
:type timestamp: datetime
:param outputs: Gets or sets key/value pairs that represent
deploymentoutput.
:type outputs: object
:param providers: Gets the list of resource providers needed for the
deployment.
:type providers: list of :class:`Provider <Default.models.Provider>`
:param dependencies: Gets the list of deployment dependencies.
:type dependencies: list of :class:`Dependency
<Default.models.Dependency>`
:param template: Gets or sets the template content. Use only one of
Template or TemplateLink.
:type template: object
:param template_link: Gets or sets the URI referencing the template. Use
only one of Template or TemplateLink.
:type template_link: :class:`TemplateLink <Default.models.TemplateLink>`
:param parameters: Deployment parameters. Use only one of Parameters or
ParametersLink.
:type parameters: object
:param parameters_link: Gets or sets the URI referencing the parameters.
Use only one of Parameters or ParametersLink.
:type parameters_link: :class:`ParametersLink
<Default.models.ParametersLink>`
:param mode: Gets or sets the deployment mode. Possible values include:
'Incremental', 'Complete'
:type mode: str or :class:`DeploymentMode <Default.models.DeploymentMode>`
"""
_attribute_map = {
'provisioning_state': {'key': 'provisioningState', 'type': 'str'},
'correlation_id': {'key': 'correlationId', 'type': 'str'},
'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
'outputs': {'key': 'outputs', 'type': 'object'},
'providers': {'key': 'providers', 'type': '[Provider]'},
'dependencies': {'key': 'dependencies', 'type': '[Dependency]'},
'template': {'key': 'template', 'type': 'object'},
'template_link': {'key': 'TemplateLink', 'type': 'TemplateLink'},
'parameters': {'key': 'parameters', 'type': 'object'},
'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'},
'mode': {'key': 'mode', 'type': 'DeploymentMode'},
}
def __init__(self, provisioning_state=None, correlation_id=None, timestamp=None, outputs=None, providers=None, dependencies=None, template=None, template_link=None, parameters=None, parameters_link=None, mode=None):
self.provisioning_state = provisioning_state
self.correlation_id = correlation_id
self.timestamp = timestamp
self.outputs = outputs
self.providers = providers
self.dependencies = dependencies
self.template = template
self.template_link = template_link
self.parameters = parameters
self.parameters_link = parameters_link
self.mode = mode

Просмотреть файл

@ -1,38 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class ParametersLink(Model):
"""Entity representing the reference to the deployment parameters.
:param uri: URI referencing the template.
:type uri: str
:param content_version: If included it must match the ContentVersion in
the template.
:type content_version: str
"""
_validation = {
'uri': {'required': True},
}
_attribute_map = {
'uri': {'key': 'uri', 'type': 'str'},
'content_version': {'key': 'contentVersion', 'type': 'str'},
}
def __init__(self, uri, content_version=None):
self.uri = uri
self.content_version = content_version

Просмотреть файл

@ -1,44 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Provider(Model):
"""Resource provider information.
:param id: Gets or sets the provider id.
:type id: str
:param namespace: Gets or sets the namespace of the provider.
:type namespace: str
:param registration_state: Gets or sets the registration state of the
provider.
:type registration_state: str
:param resource_types: Gets or sets the collection of provider resource
types.
:type resource_types: list of :class:`ProviderResourceType
<Default.models.ProviderResourceType>`
"""
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'namespace': {'key': 'namespace', 'type': 'str'},
'registration_state': {'key': 'registrationState', 'type': 'str'},
'resource_types': {'key': 'resourceTypes', 'type': '[ProviderResourceType]'},
}
def __init__(self, id=None, namespace=None, registration_state=None, resource_types=None):
self.id = id
self.namespace = namespace
self.registration_state = registration_state
self.resource_types = resource_types

Просмотреть файл

@ -1,42 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class ProviderResourceType(Model):
"""Resource type managed by the resource provider.
:param resource_type: Gets or sets the resource type.
:type resource_type: str
:param locations: Gets or sets the collection of locations where this
resource type can be created in.
:type locations: list of str
:param api_versions: Gets or sets the api version.
:type api_versions: list of str
:param properties: Gets or sets the properties.
:type properties: dict
"""
_attribute_map = {
'resource_type': {'key': 'resourceType', 'type': 'str'},
'locations': {'key': 'locations', 'type': '[str]'},
'api_versions': {'key': 'apiVersions', 'type': '[str]'},
'properties': {'key': 'properties', 'type': '{str}'},
}
def __init__(self, resource_type=None, locations=None, api_versions=None, properties=None):
self.resource_type = resource_type
self.locations = locations
self.api_versions = api_versions
self.properties = properties

Просмотреть файл

@ -1,44 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class TemplateLink(Model):
"""Entity representing the reference to the template.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar uri: URI referencing the template. Default value:
"https://azuresdkci.blob.core.windows.net/templatehost/CreateAppGateway_2016-11-16/azuredeploy.json"
.
:vartype uri: str
:param content_version: If included it must match the ContentVersion in
the template.
:type content_version: str
"""
_validation = {
'uri': {'required': True, 'constant': True},
}
_attribute_map = {
'uri': {'key': 'uri', 'type': 'str'},
'content_version': {'key': 'contentVersion', 'type': 'str'},
}
uri = "https://azuresdkci.blob.core.windows.net/templatehost/CreateAppGateway_2016-11-16/azuredeploy.json"
def __init__(self, content_version=None):
self.content_version = content_version

Просмотреть файл

@ -1,18 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from .app_gateway_operations import AppGatewayOperations
__all__ = [
'AppGatewayOperations',
]

Просмотреть файл

@ -1,215 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrestazure.azure_operation import AzureOperationPoller
import uuid
from .. import models
class AppGatewayOperations(object):
"""AppGatewayOperations operations.
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An objec model deserializer.
"""
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.config = config
def create_or_update(
self, resource_group_name, deployment_name, application_gateway_name, content_version=None, capacity=2, cert_data=None, cert_password=None, frontend_port=None, frontend_type="privateIp", http_listener_protocol="http", http_settings_cookie_based_affinity="disabled", http_settings_port=80, http_settings_protocol="http", location=None, private_ip_address=None, private_ip_address_allocation="dynamic", public_ip_address=None, public_ip_address_allocation="dynamic", public_ip_address_type="none", routing_rule_type="Basic", servers=None, sku_name="Standard_Medium", sku_tier="Standard", subnet="default", subnet_address_prefix="10.0.0.0/24", subnet_type="new", tags=None, virtual_network_name=None, vnet_address_prefix="10.0.0.0/16", custom_headers=None, raw=False, **operation_config):
"""Create a new AppGateway.
:param resource_group_name: The name of the resource group. The name
is case insensitive.
:type resource_group_name: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param application_gateway_name: The name of the application gateway.
:type application_gateway_name: str
:param content_version: If included it must match the ContentVersion
in the template.
:type content_version: str
:param capacity: The number of instances to use with the application
gateway.
:type capacity: int
:param cert_data: The contents of the PFX certificate file.
:type cert_data: str
:param cert_password: The certificate password.
:type cert_password: str
:param frontend_port: The front end port number.
:type frontend_port: int
:param frontend_type: Specify which kind of frontend configuration to
create. Possible values include: 'publicIp', 'privateIp'
:type frontend_type: str or :class:`frontendType
<Default.models.frontendType>`
:param http_listener_protocol: The HTTP listener protocol. Possible
values include: 'http', 'https'
:type http_listener_protocol: str or :class:`httpListenerProtocol
<Default.models.httpListenerProtocol>`
:param http_settings_cookie_based_affinity: Enable or disable HTTP
settings cookie based affinity. Possible values include: 'enabled',
'disabled'
:type http_settings_cookie_based_affinity: str or
:class:`httpSettingsCookieBasedAffinity
<Default.models.httpSettingsCookieBasedAffinity>`
:param http_settings_port: The HTTP settings port.
:type http_settings_port: int
:param http_settings_protocol: The HTTP settings protocol. Possible
values include: 'http', 'https'
:type http_settings_protocol: str or :class:`httpSettingsProtocol
<Default.models.httpSettingsProtocol>`
:param location: The location in which to create the application
gateway.
:type location: str
:param private_ip_address: The static private IP address to associate
with the application gateway frontend.
:type private_ip_address: str
:param private_ip_address_allocation: Specify the kind of private IP
allocation. Possible values include: 'dynamic', 'static'
:type private_ip_address_allocation: str or
:class:`privateIpAddressAllocation
<Default.models.privateIpAddressAllocation>`
:param public_ip_address: The name or ID of the public IP address.
:type public_ip_address: str
:param public_ip_address_allocation: Specify the kind of public IP
allocation for new public IPs. Possible values include: 'dynamic',
'static'
:type public_ip_address_allocation: str or
:class:`publicIpAddressAllocation
<Default.models.publicIpAddressAllocation>`
:param public_ip_address_type: Specify the type of public IP address.
Possible values include: 'none', 'new', 'existingName', 'existingId'
:type public_ip_address_type: str or :class:`publicIpAddressType
<Default.models.publicIpAddressType>`
:param routing_rule_type: The request routing rule type. Possible
values include: 'Basic', 'PathBasedRouting'
:type routing_rule_type: str or :class:`routingRuleType
<Default.models.routingRuleType>`
:param servers: The list of IP addresses or DNS names corresponding
to backend servers.
:type servers: list of object
:param sku_name: The name of the SKU. (Standard_Small,
Standard_Medium, Standard_Large).
:type sku_name: str
:param sku_tier: The SKU tier.
:type sku_tier: str
:param subnet: The name or ID of the subnet.
:type subnet: str
:param subnet_address_prefix: The subnet prefix in CIDR format.
:type subnet_address_prefix: str
:param subnet_type: Use a new or existing subnet. Possible values
include: 'new', 'existingId', 'existingName'
:type subnet_type: str or :class:`subnetType
<Default.models.subnetType>`
:param tags: Tags object.
:type tags: object
:param virtual_network_name: The name of the virtual network (VNet)
associated with the subnet.
:type virtual_network_name: str
:param vnet_address_prefix: The virtual network address range in CIDR
format.
:type vnet_address_prefix: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:rtype:
:class:`AzureOperationPoller<msrestazure.azure_operation.AzureOperationPoller>`
instance that returns :class:`DeploymentExtended
<Default.models.DeploymentExtended>`
:rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
if raw=true
"""
parameters = models.DeploymentAppGateway(content_version=content_version, application_gateway_name=application_gateway_name, capacity=capacity, cert_data=cert_data, cert_password=cert_password, frontend_port=frontend_port, frontend_type=frontend_type, http_listener_protocol=http_listener_protocol, http_settings_cookie_based_affinity=http_settings_cookie_based_affinity, http_settings_port=http_settings_port, http_settings_protocol=http_settings_protocol, location=location, private_ip_address=private_ip_address, private_ip_address_allocation=private_ip_address_allocation, public_ip_address=public_ip_address, public_ip_address_allocation=public_ip_address_allocation, public_ip_address_type=public_ip_address_type, routing_rule_type=routing_rule_type, servers=servers, sku_name=sku_name, sku_tier=sku_tier, subnet=subnet, subnet_address_prefix=subnet_address_prefix, subnet_type=subnet_type, tags=tags, virtual_network_name=virtual_network_name, vnet_address_prefix=vnet_address_prefix)
# Construct URL
url = '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=64, min_length=1, pattern='^[-\w\._]+$'),
'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern='^[-\w\._]+$'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
# Construct body
body_content = self._serialize.body(parameters, 'DeploymentAppGateway')
# Construct and send request
def long_running_send():
request = self._client.put(url, query_parameters)
return self._client.send(
request, header_parameters, body_content, **operation_config)
def get_long_running_status(status_link, headers=None):
request = self._client.get(status_link)
if headers:
request.headers.update(headers)
return self._client.send(
request, header_parameters, **operation_config)
def get_long_running_output(response):
if response.status_code not in [200, 201]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('DeploymentExtended', response)
if response.status_code == 201:
deserialized = self._deserialize('DeploymentExtended', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
if raw:
response = long_running_send()
return get_long_running_output(response)
long_running_operation_timeout = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
return AzureOperationPoller(
long_running_send, get_long_running_output,
get_long_running_status, long_running_operation_timeout)

Просмотреть файл

@ -1,15 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
VERSION = "2015-11-01"

Просмотреть файл

@ -1,862 +0,0 @@
{
"swagger": "2.0",
"info": {
"title": "AppGatewayCreationClient",
"version": "2015-11-01"
},
"host": "management.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"security": [
{
"azure_auth": [
"user_impersonation"
]
}
],
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"flow": "implicit",
"description": "Azure Active Directory OAuth2 Flow",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
},
"paths": {
"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}": {
"put": {
"tags": [
"AppGateway"
],
"operationId": "AppGateway_CreateOrUpdate",
"description": "Create a new AppGateway.",
"parameters": [
{
"name": "resourceGroupName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the resource group. The name is case insensitive.",
"pattern": "^[-\\w\\._]+$",
"minLength": 1,
"maxLength": 64
},
{
"name": "deploymentName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the deployment.",
"pattern": "^[-\\w\\._]+$",
"minLength": 1,
"maxLength": 64
},
{
"name": "parameters",
"x-ms-client-flatten": true,
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/Deployment_AppGateway"
},
"description": "Additional parameters supplied to the operation."
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/DeploymentExtended"
}
},
"201": {
"description": "",
"schema": {
"$ref": "#/definitions/DeploymentExtended"
}
}
},
"x-ms-long-running-operation": true
}
}
},
"definitions": {
"Deployment_AppGateway": {
"properties": {
"properties": {
"$ref": "#/definitions/DeploymentProperties_AppGateway",
"description": "Gets or sets the deployment properties.",
"x-ms-client-flatten": true
}
},
"description": "Deployment operation parameters."
},
"DeploymentProperties_AppGateway": {
"properties": {
"templateLink": {
"$ref": "#/definitions/TemplateLink",
"description": "Gets or sets the URI referencing the template. Use only one of Template or TemplateLink.",
"x-ms-client-flatten": true
},
"parameters": {
"$ref": "#/definitions/AppGatewayParameters",
"type": "object",
"description": "Deployment parameters. Use only one of Parameters or ParametersLink.",
"x-ms-client-flatten": true
},
"mode": {
"type": "string",
"description": "Gets or sets the deployment mode.",
"enum": [
"Incremental"
],
"x-ms-enum": {
"name": "DeploymentMode",
"modelAsString": false
}
}
},
"required": [
"templateLink",
"parameters",
"mode"
],
"description": "Deployment properties."
},
"TemplateLink": {
"properties": {
"uri": {
"type": "string",
"description": "URI referencing the template.",
"enum": [
"https://azuresdkci.blob.core.windows.net/templatehost/CreateAppGateway_2016-11-16/azuredeploy.json"
]
},
"contentVersion": {
"type": "string",
"description": "If included it must match the ContentVersion in the template."
}
},
"required": [
"uri"
],
"description": "Entity representing the reference to the template."
},
"AppGatewayParameters": {
"properties": {
"_artifactsLocation": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter__artifactsLocation",
"x-ms-client-flatten": true
},
"applicationGatewayName": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_applicationGatewayName",
"x-ms-client-flatten": true
},
"capacity": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_capacity",
"x-ms-client-flatten": true
},
"certData": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_certData",
"x-ms-client-flatten": true
},
"certPassword": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_certPassword",
"x-ms-client-flatten": true
},
"frontendPort": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_frontendPort",
"x-ms-client-flatten": true
},
"frontendType": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_frontendType",
"x-ms-client-flatten": true
},
"httpListenerProtocol": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_httpListenerProtocol",
"x-ms-client-flatten": true
},
"httpSettingsCookieBasedAffinity": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_httpSettingsCookieBasedAffinity",
"x-ms-client-flatten": true
},
"httpSettingsPort": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_httpSettingsPort",
"x-ms-client-flatten": true
},
"httpSettingsProtocol": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_httpSettingsProtocol",
"x-ms-client-flatten": true
},
"location": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_location",
"x-ms-client-flatten": true
},
"privateIpAddress": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_privateIpAddress",
"x-ms-client-flatten": true
},
"privateIpAddressAllocation": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_privateIpAddressAllocation",
"x-ms-client-flatten": true
},
"publicIpAddress": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_publicIpAddress",
"x-ms-client-flatten": true
},
"publicIpAddressAllocation": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_publicIpAddressAllocation",
"x-ms-client-flatten": true
},
"publicIpAddressType": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_publicIpAddressType",
"x-ms-client-flatten": true
},
"routingRuleType": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_routingRuleType",
"x-ms-client-flatten": true
},
"servers": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_servers",
"x-ms-client-flatten": true
},
"skuName": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_skuName",
"x-ms-client-flatten": true
},
"skuTier": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_skuTier",
"x-ms-client-flatten": true
},
"subnet": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_subnet",
"x-ms-client-flatten": true
},
"subnetAddressPrefix": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_subnetAddressPrefix",
"x-ms-client-flatten": true
},
"subnetType": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_subnetType",
"x-ms-client-flatten": true
},
"tags": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_tags",
"x-ms-client-flatten": true
},
"virtualNetworkName": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_virtualNetworkName",
"x-ms-client-flatten": true
},
"vnetAddressPrefix": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_vnetAddressPrefix",
"x-ms-client-flatten": true
}
},
"required": [
"applicationGatewayName",
"_artifactsLocation"
]
},
"DeploymentParameter_applicationGatewayName": {
"properties": {
"value": {
"type": "string",
"description": "The name of the application gateway.",
"x-ms-client-name": "applicationGatewayName"
}
},
"required": [
"value"
]
},
"DeploymentParameter_capacity": {
"properties": {
"value": {
"type": "integer",
"description": "The number of instances to use with the application gateway.",
"x-ms-client-name": "capacity",
"default": "2"
}
}
},
"DeploymentParameter_certData": {
"properties": {
"value": {
"type": "string",
"description": "The contents of the PFX certificate file.",
"x-ms-client-name": "certData"
}
}
},
"DeploymentParameter_certPassword": {
"properties": {
"value": {
"type": "string",
"description": "The certificate password.",
"x-ms-client-name": "certPassword"
}
}
},
"DeploymentParameter_frontendPort": {
"properties": {
"value": {
"type": "integer",
"description": "The front end port number.",
"x-ms-client-name": "frontendPort"
}
}
},
"DeploymentParameter_frontendType": {
"properties": {
"value": {
"type": "string",
"description": "Specify which kind of frontend configuration to create.",
"x-ms-client-name": "frontendType",
"enum": [
"publicIp",
"privateIp"
],
"x-ms-enum": {
"name": "frontendType",
"modelAsString": false
},
"default": "privateIp"
}
}
},
"DeploymentParameter_httpListenerProtocol": {
"properties": {
"value": {
"type": "string",
"description": "The HTTP listener protocol.",
"x-ms-client-name": "httpListenerProtocol",
"enum": [
"http",
"https"
],
"x-ms-enum": {
"name": "httpListenerProtocol",
"modelAsString": false
},
"default": "http"
}
}
},
"DeploymentParameter_httpSettingsCookieBasedAffinity": {
"properties": {
"value": {
"type": "string",
"description": "Enable or disable HTTP settings cookie based affinity.",
"x-ms-client-name": "httpSettingsCookieBasedAffinity",
"enum": [
"enabled",
"disabled"
],
"x-ms-enum": {
"name": "httpSettingsCookieBasedAffinity",
"modelAsString": false
},
"default": "disabled"
}
}
},
"DeploymentParameter_httpSettingsPort": {
"properties": {
"value": {
"type": "integer",
"description": "The HTTP settings port.",
"x-ms-client-name": "httpSettingsPort",
"default": "80"
}
}
},
"DeploymentParameter_httpSettingsProtocol": {
"properties": {
"value": {
"type": "string",
"description": "The HTTP settings protocol.",
"x-ms-client-name": "httpSettingsProtocol",
"enum": [
"http",
"https"
],
"x-ms-enum": {
"name": "httpSettingsProtocol",
"modelAsString": false
},
"default": "http"
}
}
},
"DeploymentParameter_location": {
"properties": {
"value": {
"type": "string",
"description": "The location in which to create the application gateway.",
"x-ms-client-name": "location"
}
}
},
"DeploymentParameter_privateIpAddress": {
"properties": {
"value": {
"type": "string",
"description": "The static private IP address to associate with the application gateway frontend.",
"x-ms-client-name": "privateIpAddress"
}
}
},
"DeploymentParameter_privateIpAddressAllocation": {
"properties": {
"value": {
"type": "string",
"description": "Specify the kind of private IP allocation.",
"x-ms-client-name": "privateIpAddressAllocation",
"enum": [
"dynamic",
"static"
],
"x-ms-enum": {
"name": "privateIpAddressAllocation",
"modelAsString": false
},
"default": "dynamic"
}
}
},
"DeploymentParameter_publicIpAddress": {
"properties": {
"value": {
"type": "string",
"description": "The name or ID of the public IP address.",
"x-ms-client-name": "publicIpAddress"
}
}
},
"DeploymentParameter_publicIpAddressAllocation": {
"properties": {
"value": {
"type": "string",
"description": "Specify the kind of public IP allocation for new public IPs.",
"x-ms-client-name": "publicIpAddressAllocation",
"enum": [
"dynamic",
"static"
],
"x-ms-enum": {
"name": "publicIpAddressAllocation",
"modelAsString": false
},
"default": "dynamic"
}
}
},
"DeploymentParameter_publicIpAddressType": {
"properties": {
"value": {
"type": "string",
"description": "Specify the type of public IP address.",
"x-ms-client-name": "publicIpAddressType",
"enum": [
"none",
"new",
"existingName",
"existingId"
],
"x-ms-enum": {
"name": "publicIpAddressType",
"modelAsString": false
},
"default": "none"
}
}
},
"DeploymentParameter_routingRuleType": {
"properties": {
"value": {
"type": "string",
"description": "The request routing rule type.",
"x-ms-client-name": "routingRuleType",
"enum": [
"Basic",
"PathBasedRouting"
],
"x-ms-enum": {
"name": "routingRuleType",
"modelAsString": false
},
"default": "Basic"
}
}
},
"DeploymentParameter_servers": {
"properties": {
"value": {
"type": "array",
"items": {
"type": "object"
},
"description": "The list of IP addresses or DNS names corresponding to backend servers.",
"x-ms-client-name": "servers"
}
}
},
"DeploymentParameter_skuName": {
"properties": {
"value": {
"type": "string",
"description": "The name of the SKU. (Standard_Small, Standard_Medium, Standard_Large).",
"x-ms-client-name": "skuName",
"default": "Standard_Medium"
}
}
},
"DeploymentParameter_skuTier": {
"properties": {
"value": {
"type": "string",
"description": "The SKU tier.",
"x-ms-client-name": "skuTier",
"default": "Standard"
}
}
},
"DeploymentParameter_subnet": {
"properties": {
"value": {
"type": "string",
"description": "The name or ID of the subnet.",
"x-ms-client-name": "subnet",
"default": "default"
}
}
},
"DeploymentParameter_subnetAddressPrefix": {
"properties": {
"value": {
"type": "string",
"description": "The subnet prefix in CIDR format.",
"x-ms-client-name": "subnetAddressPrefix",
"default": "10.0.0.0/24"
}
}
},
"DeploymentParameter_subnetType": {
"properties": {
"value": {
"type": "string",
"description": "Use a new or existing subnet.",
"x-ms-client-name": "subnetType",
"enum": [
"new",
"existingId",
"existingName"
],
"x-ms-enum": {
"name": "subnetType",
"modelAsString": false
},
"default": "new"
}
}
},
"DeploymentParameter_tags": {
"properties": {
"value": {
"type": "object",
"description": "Tags object.",
"x-ms-client-name": "tags"
}
}
},
"DeploymentParameter_virtualNetworkName": {
"properties": {
"value": {
"type": "string",
"description": "The name of the virtual network (VNet) associated with the subnet.",
"x-ms-client-name": "virtualNetworkName"
}
}
},
"DeploymentParameter_vnetAddressPrefix": {
"properties": {
"value": {
"type": "string",
"description": "The virtual network address range in CIDR format.",
"x-ms-client-name": "vnetAddressPrefix",
"default": "10.0.0.0/16"
}
}
},
"DeploymentParameter__artifactsLocation": {
"properties": {
"value": {
"type": "string",
"description": "Container URI of of the template.",
"x-ms-client-name": "_artifactsLocation",
"enum": [
"https://azuresdkci.blob.core.windows.net/templatehost/CreateAppGateway_2016-11-16"
]
}
},
"required": [
"value"
]
},
"ParametersLink": {
"properties": {
"uri": {
"type": "string",
"description": "URI referencing the template."
},
"contentVersion": {
"type": "string",
"description": "If included it must match the ContentVersion in the template."
}
},
"required": [
"uri"
],
"description": "Entity representing the reference to the deployment paramaters."
},
"ProviderResourceType": {
"properties": {
"resourceType": {
"type": "string",
"description": "Gets or sets the resource type."
},
"locations": {
"type": "array",
"items": {
"type": "string"
},
"description": "Gets or sets the collection of locations where this resource type can be created in."
},
"apiVersions": {
"type": "array",
"items": {
"type": "string"
},
"description": "Gets or sets the api version."
},
"properties": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Gets or sets the properties."
}
},
"description": "Resource type managed by the resource provider."
},
"Provider": {
"properties": {
"id": {
"type": "string",
"description": "Gets or sets the provider id."
},
"namespace": {
"type": "string",
"description": "Gets or sets the namespace of the provider."
},
"registrationState": {
"type": "string",
"description": "Gets or sets the registration state of the provider."
},
"resourceTypes": {
"type": "array",
"items": {
"$ref": "#/definitions/ProviderResourceType"
},
"description": "Gets or sets the collection of provider resource types."
}
},
"description": "Resource provider information."
},
"BasicDependency": {
"properties": {
"id": {
"type": "string",
"description": "Gets or sets the ID of the dependency."
},
"resourceType": {
"type": "string",
"description": "Gets or sets the dependency resource type."
},
"resourceName": {
"type": "string",
"description": "Gets or sets the dependency resource name."
}
},
"description": "Deployment dependency information."
},
"Dependency": {
"properties": {
"dependsOn": {
"type": "array",
"items": {
"$ref": "#/definitions/BasicDependency"
},
"description": "Gets the list of dependencies."
},
"id": {
"type": "string",
"description": "Gets or sets the ID of the dependency."
},
"resourceType": {
"type": "string",
"description": "Gets or sets the dependency resource type."
},
"resourceName": {
"type": "string",
"description": "Gets or sets the dependency resource name."
}
},
"description": "Deployment dependency information."
},
"DeploymentPropertiesExtended": {
"properties": {
"provisioningState": {
"type": "string",
"description": "Gets or sets the state of the provisioning."
},
"correlationId": {
"type": "string",
"description": "Gets or sets the correlation ID of the deployment."
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "Gets or sets the timestamp of the template deployment."
},
"outputs": {
"type": "object",
"description": "Gets or sets key/value pairs that represent deploymentoutput."
},
"providers": {
"type": "array",
"items": {
"$ref": "#/definitions/Provider"
},
"description": "Gets the list of resource providers needed for the deployment."
},
"dependencies": {
"type": "array",
"items": {
"$ref": "#/definitions/Dependency"
},
"description": "Gets the list of deployment dependencies."
},
"template": {
"type": "object",
"description": "Gets or sets the template content. Use only one of Template or TemplateLink."
},
"TemplateLink": {
"$ref": "#/definitions/TemplateLink",
"description": "Gets or sets the URI referencing the template. Use only one of Template or TemplateLink."
},
"parameters": {
"type": "object",
"description": "Deployment parameters. Use only one of Parameters or ParametersLink."
},
"parametersLink": {
"$ref": "#/definitions/ParametersLink",
"description": "Gets or sets the URI referencing the parameters. Use only one of Parameters or ParametersLink."
},
"mode": {
"type": "string",
"description": "Gets or sets the deployment mode.",
"enum": [
"Incremental",
"Complete"
],
"x-ms-enum": {
"name": "DeploymentMode",
"modelAsString": false
}
}
},
"description": "Deployment properties with additional details."
},
"DeploymentExtended": {
"properties": {
"id": {
"type": "string",
"description": "Gets or sets the ID of the deployment."
},
"name": {
"type": "string",
"description": "Gets or sets the name of the deployment."
},
"properties": {
"$ref": "#/definitions/DeploymentPropertiesExtended",
"description": "Gets or sets deployment properties."
}
},
"required": [
"name"
],
"description": "Deployment information."
}
},
"parameters": {
"SubscriptionIdParameter": {
"name": "subscriptionId",
"in": "path",
"required": true,
"type": "string",
"description": "Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."
},
"ApiVersionParameter": {
"name": "api-version",
"in": "query",
"required": true,
"type": "string",
"description": "Client Api Version."
}
}
}

Просмотреть файл

@ -1,8 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
import pkg_resources
pkg_resources.declare_namespace(__name__)

Просмотреть файл

@ -1,303 +0,0 @@
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"_artifactsLocation": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "URL of the template to deploy."
}
},
"backendPoolName": {
"type": "string",
"defaultValue": "[concat(parameters('loadBalancerName'), 'bepool')]",
"metadata": {
"description": "Name of load balancer backend pool."
}
},
"dnsNameType": {
"type": "string",
"defaultValue": "none",
"allowedValues": [
"none",
"new"
],
"metadata": {
"description": "Associate VMs with a public IP address to a DNS name."
}
},
"frontendIpName": {
"type": "string",
"defaultValue": "LoadBalancerFrontEnd",
"metadata": {
"description": "Name of the frontend IP configuration."
}
},
"loadBalancerName": {
"type": "string",
"metadata": {
"description": "Name for load balancer."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for load balancer resource."
}
},
"privateIpAddress": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Static private IP address to use."
}
},
"privateIpAddressAllocation": {
"type": "string",
"defaultValue": "dynamic",
"allowedValues": [
"dynamic",
"static"
],
"metadata": {
"description": "Private IP address allocation method."
}
},
"publicIpAddress": {
"type": "string",
"defaultValue": "[concat('PublicIP', parameters('loadBalancerName'))]",
"metadata": {
"description": "Name or ID of the public IP address to use."
}
},
"publicIpAddressAllocation": {
"type": "string",
"defaultValue": "dynamic",
"allowedValues": [
"dynamic",
"static"
],
"metadata": {
"description": "Public IP address allocation method."
}
},
"publicIpAddressType": {
"type": "string",
"defaultValue": "new",
"allowedValues": [
"none",
"new",
"existingName",
"existingId"
],
"metadata": {
"description": "Type of Public IP Address to associate with the load balancer."
}
},
"publicIpDnsName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Globally unique DNS Name for the Public IP used to access the Virtual Machine (new public IP only)."
}
},
"subnet": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The subnet name or ID to associate with the load balancer. Cannot be used in conjunction with a Public IP."
}
},
"subnetAddressPrefix": {
"type": "string",
"defaultValue": "10.0.0.0/24",
"metadata": {
"description": "The subnet address prefix in CIDR format (new subnet only)."
}
},
"subnetType": {
"type": "string",
"defaultValue": "none",
"allowedValues": [
"none",
"new",
"existingName",
"existingId"
],
"metadata": {
"description": "Use new, existing or no subnet."
}
},
"tags": {
"type": "object",
"defaultValue": { },
"metadata": {
"description": "Tags object."
}
},
"virtualNetworkName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The VNet name containing the subnet. Cannot be used in conjunction with a Public IP."
}
},
"vnetAddressPrefix": {
"type": "string",
"defaultValue": "10.0.0.0/16",
"metadata": {
"description": "The virtual network IP address prefix in CIDR format (new subnet only)."
}
}
},
"variables": {
"frontendConfig": {
"new": [
{
"name": "[parameters('frontendIpName')]",
"properties": {
"publicIPAddress": {
"id": "[variables('publicIpAddressIds')[parameters('publicIpAddressType')]]"
}
}
}
],
"existingId": [
{
"name": "[parameters('frontendIpName')]",
"properties": {
"publicIPAddress": {
"id": "[variables('publicIpAddressIds')[parameters('publicIpAddressType')]]"
}
}
}
],
"existingName": [
{
"name": "[parameters('frontendIpName')]",
"properties": {
"publicIPAddress": {
"id": "[variables('publicIpAddressIds')[parameters('publicIpAddressType')]]"
}
}
}
],
"none": [
{
"name": "[parameters('frontendIpName')]",
"properties": {
"privateIPAllocationMethod": "[parameters('privateIpAddressAllocation')]",
"privateIPAddress": "[parameters('privateIpAddress')]",
"subnet": {
"id": "[variables('subnetIds')[parameters('subnetType')]]"
}
}
}
]
},
"frontEndIpConfigId": "[concat(variables('lbId'),'/frontendIPConfigurations/loadBalancerFrontEnd')]",
"ipDeploymentName": "[concat('IP', parameters('loadBalancerName'))]",
"publicIpTemplateUri": "https://azuresdkci.blob.core.windows.net/templatehost/CreatePublicIp_2016-07-19/azuredeploy.json",
"publicIpTemplateUriEmpty": "https://azuresdkci.blob.core.windows.net/templatehost/CreatePublicIp_2016-07-19/azuredeploy_empty.json",
"ipTemplateFilePaths": {
"existingId": "[variables('publicIpTemplateUriEmpty')]",
"existingName": "[variables('publicIpTemplateUriEmpty')]",
"new": "[variables('publicIpTemplateUri')]",
"none": "[variables('publicIpTemplateUriEmpty')]"
},
"lbId": "[resourceId('Microsoft.Network/loadBalancers',parameters('loadBalancerName'))]",
"publicIpAddressIds": {
"existingId": "[parameters('publicIpAddress')]",
"existingName": "[concat('/subscriptions/',subscription().subscriptionId,'/resourceGroups/',resourceGroup().name,'/providers/Microsoft.Network/publicIPAddresses/',parameters('publicIpAddress'))]",
"new": "[concat('/subscriptions/',subscription().subscriptionId,'/resourceGroups/',resourceGroup().name,'/providers/Microsoft.Network/publicIPAddresses/',parameters('publicIpAddress'))]",
"none": null
},
"subnetDeploymentName": "[concat('Subnet',parameters('loadBalancerName'))]",
"subnetIds": {
"existingId": "[parameters('subnet')]",
"existingName": "[concat(variables('vnetId'),'/subnets/',parameters('subnet'))]",
"new": "[concat(variables('vnetId'),'/subnets/',parameters('subnet'))]",
"none": null
},
"vnetTemplateUri": "https://azuresdkci.blob.core.windows.net/templatehost/CreateVnet_2016-07-18/azuredeploy.json",
"vnetTemplateUriEmpty": "https://azuresdkci.blob.core.windows.net/templatehost/CreateVnet_2016-07-18/azuredeploy_empty.json",
"subnetTemplateFilePaths": {
"existingId": "[variables('vnetTemplateUriEmpty')]",
"existingName": "[variables('vnetTemplateUriEmpty')]",
"new": "[variables('vnetTemplateUri')]",
"none": "[variables('vnetTemplateUriEmpty')]"
},
"vnetId": "[concat('/subscriptions/',subscription().subscriptionId,'/resourceGroups/',resourceGroup().name,'/providers/Microsoft.Network/virtualNetworks/',parameters('virtualNetworkName'))]"
},
"resources": [
{
"type": "Microsoft.Network/loadBalancers",
"name": "[parameters('loadBalancerName')]",
"location": "[parameters('location')]",
"tags": "[parameters('tags')]",
"apiVersion": "2015-06-15",
"dependsOn": [
"[concat('Microsoft.Resources/deployments/', variables('ipDeploymentName'))]",
"[concat('Microsoft.Resources/deployments/', variables('subnetDeploymentName'))]"
],
"properties": {
"backendAddressPools": [
{
"name": "[parameters('backendPoolName')]"
}
],
"frontendIPConfigurations": "[variables('frontendConfig')[parameters('publicIpAddressType')]]"
}
},
{
"name": "[variables('ipDeploymentName')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2015-01-01",
"dependsOn": [ ],
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[variables('ipTemplateFilePaths')[parameters('publicIpAddressType')]]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"dnsName": { "value": "[parameters('publicIpDnsName')]" },
"name": { "value": "[parameters('publicIPAddress')]" },
"allocationMethod": { "value": "[parameters('publicIpAddressAllocation')]" },
"location": { "value": "[parameters('location')]" },
"dnsNameType": { "value": "[parameters('dnsNameType')]" },
"tags": { "value": "[parameters('tags')]" }
}
}
},
{
"name": "[variables('subnetDeploymentName')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2015-01-01",
"dependsOn": [ ],
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[variables('subnetTemplateFilePaths')[parameters('subnetType')]]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"location": { "value": "[parameters('location')]" },
"subnetPrefix": { "value": "[parameters('subnetAddressPrefix')]" },
"subnetName": { "value": "[parameters('subnet')]" },
"virtualNetworkName": { "value": "[parameters('virtualNetworkName')]" },
"virtualNetworkPrefix": { "value": "[parameters('vnetAddressPrefix')]" },
"tags": { "value": "[parameters('tags')]" }
}
}
}
],
"outputs": {
"loadBalancer": {
"type": "object",
"value": "[reference(parameters('loadBalancerName'))]"
}
}
}

Просмотреть файл

@ -1,167 +0,0 @@
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"_artifactsLocation": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "URL of the template to deploy."
}
},
"backendPoolName": {
"type": "string",
"defaultValue": "[concat(parameters('loadBalancerName'), 'bepool')]",
"metadata": {
"description": "Name of load balancer backend pool."
}
},
"dnsNameType": {
"type": "string",
"defaultValue": "none",
"allowedValues": [
"none",
"new"
],
"metadata": {
"description": "Associate VMs with a public IP address to a DNS name."
}
},
"frontendIpName": {
"type": "string",
"defaultValue": "LoadBalancerFrontEnd",
"metadata": {
"description": "Name of the frontend IP configuration."
}
},
"loadBalancerName": {
"type": "string",
"metadata": {
"description": "Name for load balancer."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for load balancer resource."
}
},
"privateIpAddress": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Static private IP address to use."
}
},
"privateIpAddressAllocation": {
"type": "string",
"defaultValue": "dynamic",
"allowedValues": [
"dynamic",
"static"
],
"metadata": {
"description": "Private IP address allocation method."
}
},
"publicIpAddress": {
"type": "string",
"defaultValue": "[concat('PublicIP', parameters('loadBalancerName'))]",
"metadata": {
"description": "Name or ID of the public IP address to use."
}
},
"publicIpAddressAllocation": {
"type": "string",
"defaultValue": "dynamic",
"allowedValues": [
"dynamic",
"static"
],
"metadata": {
"description": "Public IP address allocation method."
}
},
"publicIpAddressType": {
"type": "string",
"defaultValue": "new",
"allowedValues": [
"none",
"new",
"existingName",
"existingId"
],
"metadata": {
"description": "Type of Public IP Address to associate with the load balancer."
}
},
"publicIpDnsName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Globally unique DNS Name for the Public IP used to access the Virtual Machine (new public IP only)."
}
},
"subnet": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The subnet name or ID to associate with the load balancer. Cannot be used in conjunction with a Public IP."
}
},
"subnetAddressPrefix": {
"type": "string",
"defaultValue": "10.0.0.0/24",
"metadata": {
"description": "The subnet address prefix in CIDR format (new subnet only)."
}
},
"subnetType": {
"type": "string",
"defaultValue": "none",
"allowedValues": [
"none",
"new",
"existingName",
"existingId"
],
"metadata": {
"description": "Use new, existing or no subnet."
}
},
"tags": {
"type": "object",
"defaultValue": { },
"metadata": {
"description": "Tags object."
}
},
"virtualNetworkName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The VNet name containing the subnet. Cannot be used in conjunction with a Public IP."
}
},
"vnetAddressPrefix": {
"type": "string",
"defaultValue": "10.0.0.0/16",
"metadata": {
"description": "The virtual network IP address prefix in CIDR format (new subnet only)."
}
}
},
"variables": {
},
"resources": [
],
"outputs": {
"loadBalancer": {
"type": "object",
"value": { }
}
}
}

Просмотреть файл

@ -1,46 +0,0 @@
# Load Balancer Create scenarios before merge #
## P0: BASIC ##
Execute P0s before any change is merged
**automated create**
- delete test_network_load_balancer.yaml
- Run test twice (first records, second verifies stability)
- delete test test_vm_scaleset_create_existing_options.yaml
- Run test twice (first records, second verifies stability)
OR
Execute the follow scenarios manually:
**Create with minimum parameters**
- create new lb with the minimum required parameters
- verify new dynamic public IP created
**Create internet facing LB with new static public IP**
- create new lb with static public IP allocation
- verify new static public IP created
**Create internal LB with existing subnet ID**
- create new vnet
- create new lb with the newly created vnet and subnet, specifying a private IP address
- verify private IP address allocation method is static
- verify lb is associated with the subnet and not a public IP
**Create internet facing LB with existing public IP**
- create new public IP
- create new lb using the public IP
- verify lb is associated with the newly created public IP
**Create LB and use it in a VM Scale Set **
- create new vnet
- create new plain lb
- create a vmss, referencing vnet and lb
- verify vmss is added to vnet and lb

Просмотреть файл

@ -1,19 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from .lb_creation_client import LbCreationClient
from .version import VERSION
__all__ = ['LbCreationClient']
__version__ = VERSION

Просмотреть файл

@ -1,21 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.authentication import (
BasicAuthentication,
BasicTokenAuthentication,
OAuthTokenAuthentication)
from msrestazure.azure_active_directory import (
InteractiveCredentials,
ServicePrincipalCredentials,
UserPassCredentials)

Просмотреть файл

@ -1,24 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.exceptions import (
ClientException,
SerializationError,
DeserializationError,
TokenExpiredError,
ClientRequestError,
AuthenticationError,
HttpOperationError,
ValidationError,
)
from msrestazure.azure_exceptions import CloudError

Просмотреть файл

@ -1,121 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.service_client import ServiceClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.lb_operations import LbOperations
from . import models
class LbCreationClientConfiguration(AzureConfiguration):
"""Configuration for LbCreationClient
Note that all parameters used to create this instance are saved as instance
attributes.
:param credentials: Gets Azure subscription credentials.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Gets subscription credentials which uniquely
identify Microsoft Azure subscription. The subscription ID forms part of
the URI for every service call.
:type subscription_id: str
:param api_version: Client Api Version.
:type api_version: str
:param accept_language: Gets or sets the preferred language for the
response.
:type accept_language: str
:param long_running_operation_retry_timeout: Gets or sets the retry
timeout in seconds for Long Running Operations. Default value is 30.
:type long_running_operation_retry_timeout: int
:param generate_client_request_id: When set to true a unique
x-ms-client-request-id value is generated and included in each request.
Default is true.
:type generate_client_request_id: bool
:param str base_url: Service URL
:param str filepath: Existing config
"""
def __init__(
self, credentials, subscription_id, api_version='2015-11-01', accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None):
if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not isinstance(subscription_id, str):
raise TypeError("Parameter 'subscription_id' must be str.")
if api_version is not None and not isinstance(api_version, str):
raise TypeError("Optional parameter 'api_version' must be str.")
if accept_language is not None and not isinstance(accept_language, str):
raise TypeError("Optional parameter 'accept_language' must be str.")
if not base_url:
base_url = 'https://management.azure.com'
super(LbCreationClientConfiguration, self).__init__(base_url, filepath)
self.add_user_agent('lbcreationclient/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')
self.credentials = credentials
self.subscription_id = subscription_id
self.api_version = api_version
self.accept_language = accept_language
self.long_running_operation_retry_timeout = long_running_operation_retry_timeout
self.generate_client_request_id = generate_client_request_id
class LbCreationClient(object):
"""LbCreationClient
:ivar config: Configuration for client.
:vartype config: LbCreationClientConfiguration
:ivar lb: Lb operations
:vartype lb: .operations.LbOperations
:param credentials: Gets Azure subscription credentials.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Gets subscription credentials which uniquely
identify Microsoft Azure subscription. The subscription ID forms part of
the URI for every service call.
:type subscription_id: str
:param api_version: Client Api Version.
:type api_version: str
:param accept_language: Gets or sets the preferred language for the
response.
:type accept_language: str
:param long_running_operation_retry_timeout: Gets or sets the retry
timeout in seconds for Long Running Operations. Default value is 30.
:type long_running_operation_retry_timeout: int
:param generate_client_request_id: When set to true a unique
x-ms-client-request-id value is generated and included in each request.
Default is true.
:type generate_client_request_id: bool
:param str base_url: Service URL
:param str filepath: Existing config
"""
def __init__(
self, credentials, subscription_id, api_version='2015-11-01', accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None):
self.config = LbCreationClientConfiguration(credentials, subscription_id, api_version, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath)
self._client = ServiceClient(self.config.credentials, self.config)
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self.lb = LbOperations(
self._client, self.config, self._serialize, self._deserialize)

Просмотреть файл

@ -1,47 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from .deployment_lb import DeploymentLb
from .template_link import TemplateLink
from .parameters_link import ParametersLink
from .provider_resource_type import ProviderResourceType
from .provider import Provider
from .basic_dependency import BasicDependency
from .dependency import Dependency
from .deployment_properties_extended import DeploymentPropertiesExtended
from .deployment_extended import DeploymentExtended
from .lb_creation_client_enums import (
dnsNameType,
privateIpAddressAllocation,
publicIpAddressAllocation,
publicIpAddressType,
subnetType,
DeploymentMode,
)
__all__ = [
'DeploymentLb',
'TemplateLink',
'ParametersLink',
'ProviderResourceType',
'Provider',
'BasicDependency',
'Dependency',
'DeploymentPropertiesExtended',
'DeploymentExtended',
'dnsNameType',
'privateIpAddressAllocation',
'publicIpAddressAllocation',
'publicIpAddressType',
'subnetType',
'DeploymentMode',
]

Просмотреть файл

@ -1,37 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class BasicDependency(Model):
"""
Deployment dependency information.
:param id: Gets or sets the ID of the dependency.
:type id: str
:param resource_type: Gets or sets the dependency resource type.
:type resource_type: str
:param resource_name: Gets or sets the dependency resource name.
:type resource_name: str
"""
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'resource_type': {'key': 'resourceType', 'type': 'str'},
'resource_name': {'key': 'resourceName', 'type': 'str'},
}
def __init__(self, id=None, resource_type=None, resource_name=None):
self.id = id
self.resource_type = resource_type
self.resource_name = resource_name

Просмотреть файл

@ -1,42 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Dependency(Model):
"""
Deployment dependency information.
:param depends_on: Gets the list of dependencies.
:type depends_on: list of :class:`BasicDependency
<default.models.BasicDependency>`
:param id: Gets or sets the ID of the dependency.
:type id: str
:param resource_type: Gets or sets the dependency resource type.
:type resource_type: str
:param resource_name: Gets or sets the dependency resource name.
:type resource_name: str
"""
_attribute_map = {
'depends_on': {'key': 'dependsOn', 'type': '[BasicDependency]'},
'id': {'key': 'id', 'type': 'str'},
'resource_type': {'key': 'resourceType', 'type': 'str'},
'resource_name': {'key': 'resourceName', 'type': 'str'},
}
def __init__(self, depends_on=None, id=None, resource_type=None, resource_name=None):
self.depends_on = depends_on
self.id = id
self.resource_type = resource_type
self.resource_name = resource_name

Просмотреть файл

@ -1,42 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class DeploymentExtended(Model):
"""
Deployment information.
:param id: Gets or sets the ID of the deployment.
:type id: str
:param name: Gets or sets the name of the deployment.
:type name: str
:param properties: Gets or sets deployment properties.
:type properties: :class:`DeploymentPropertiesExtended
<default.models.DeploymentPropertiesExtended>`
"""
_validation = {
'name': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'},
}
def __init__(self, name, id=None, properties=None):
self.id = id
self.name = name
self.properties = properties

Просмотреть файл

@ -1,150 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class DeploymentLb(Model):
"""
Deployment operation parameters.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar uri: URI referencing the template. Default value:
"https://azuresdkci.blob.core.windows.net/templatehost/CreateLb_2016-07-19/azuredeploy.json"
.
:vartype uri: str
:param content_version: If included it must match the ContentVersion in
the template.
:type content_version: str
:ivar _artifacts_location: Container URI of of the template. Default
value:
"https://azuresdkci.blob.core.windows.net/templatehost/CreateLb_2016-07-19"
.
:vartype _artifacts_location: str
:param backend_pool_name: Name of load balancer backend pool.
:type backend_pool_name: str
:param dns_name_type: Associate VMs with a public IP address to a DNS
name. Possible values include: 'none', 'new'. Default value: "none" .
:type dns_name_type: str or :class:`dnsNameType
<lbcreationclient.models.dnsNameType>`
:param frontend_ip_name: Name of the frontend IP configuration. Default
value: "LoadBalancerFrontEnd" .
:type frontend_ip_name: str
:param load_balancer_name: Name for load balancer.
:type load_balancer_name: str
:param location: Location for load balancer resource.
:type location: str
:param private_ip_address: Static private IP address to use.
:type private_ip_address: str
:param private_ip_address_allocation: Private IP address allocation
method. Possible values include: 'dynamic', 'static'. Default value:
"dynamic" .
:type private_ip_address_allocation: str or
:class:`privateIpAddressAllocation
<lbcreationclient.models.privateIpAddressAllocation>`
:param public_ip_address: Name or ID of the public IP address to use.
:type public_ip_address: str
:param public_ip_address_allocation: Public IP address allocation method.
Possible values include: 'dynamic', 'static'. Default value: "dynamic" .
:type public_ip_address_allocation: str or
:class:`publicIpAddressAllocation
<lbcreationclient.models.publicIpAddressAllocation>`
:param public_ip_address_type: Type of Public IP Address to associate
with the load balancer. Possible values include: 'none', 'new',
'existingName', 'existingId'. Default value: "new" .
:type public_ip_address_type: str or :class:`publicIpAddressType
<lbcreationclient.models.publicIpAddressType>`
:param public_ip_dns_name: Globally unique DNS Name for the Public IP
used to access the Virtual Machine (new public IP only).
:type public_ip_dns_name: str
:param subnet: The subnet name or ID to associate with the load balancer.
Cannot be used in conjunction with a Public IP.
:type subnet: str
:param subnet_address_prefix: The subnet address prefix in CIDR format
(new subnet only). Default value: "10.0.0.0/24" .
:type subnet_address_prefix: str
:param subnet_type: Use new, existing or no subnet. Possible values
include: 'none', 'new', 'existingName', 'existingId'. Default value:
"none" .
:type subnet_type: str or :class:`subnetType
<lbcreationclient.models.subnetType>`
:param tags: Tags object.
:type tags: object
:param virtual_network_name: The VNet name containing the subnet. Cannot
be used in conjunction with a Public IP.
:type virtual_network_name: str
:param vnet_address_prefix: The virtual network IP address prefix in CIDR
format (new subnet only). Default value: "10.0.0.0/16" .
:type vnet_address_prefix: str
:ivar mode: Gets or sets the deployment mode. Default value:
"Incremental" .
:vartype mode: str
"""
_validation = {
'uri': {'required': True, 'constant': True},
'_artifacts_location': {'required': True, 'constant': True},
'load_balancer_name': {'required': True},
'mode': {'required': True, 'constant': True},
}
_attribute_map = {
'uri': {'key': 'properties.templateLink.uri', 'type': 'str'},
'content_version': {'key': 'properties.templateLink.contentVersion', 'type': 'str'},
'_artifacts_location': {'key': 'properties.parameters._artifactsLocation.value', 'type': 'str'},
'backend_pool_name': {'key': 'properties.parameters.backendPoolName.value', 'type': 'str'},
'dns_name_type': {'key': 'properties.parameters.dnsNameType.value', 'type': 'dnsNameType'},
'frontend_ip_name': {'key': 'properties.parameters.frontendIpName.value', 'type': 'str'},
'load_balancer_name': {'key': 'properties.parameters.loadBalancerName.value', 'type': 'str'},
'location': {'key': 'properties.parameters.location.value', 'type': 'str'},
'private_ip_address': {'key': 'properties.parameters.privateIpAddress.value', 'type': 'str'},
'private_ip_address_allocation': {'key': 'properties.parameters.privateIpAddressAllocation.value', 'type': 'privateIpAddressAllocation'},
'public_ip_address': {'key': 'properties.parameters.publicIpAddress.value', 'type': 'str'},
'public_ip_address_allocation': {'key': 'properties.parameters.publicIpAddressAllocation.value', 'type': 'publicIpAddressAllocation'},
'public_ip_address_type': {'key': 'properties.parameters.publicIpAddressType.value', 'type': 'publicIpAddressType'},
'public_ip_dns_name': {'key': 'properties.parameters.publicIpDnsName.value', 'type': 'str'},
'subnet': {'key': 'properties.parameters.subnet.value', 'type': 'str'},
'subnet_address_prefix': {'key': 'properties.parameters.subnetAddressPrefix.value', 'type': 'str'},
'subnet_type': {'key': 'properties.parameters.subnetType.value', 'type': 'subnetType'},
'tags': {'key': 'properties.parameters.tags.value', 'type': 'object'},
'virtual_network_name': {'key': 'properties.parameters.virtualNetworkName.value', 'type': 'str'},
'vnet_address_prefix': {'key': 'properties.parameters.vnetAddressPrefix.value', 'type': 'str'},
'mode': {'key': 'properties.mode', 'type': 'str'},
}
uri = "https://azuresdkci.blob.core.windows.net/templatehost/CreateLb_2016-07-19/azuredeploy.json"
_artifacts_location = "https://azuresdkci.blob.core.windows.net/templatehost/CreateLb_2016-07-19"
mode = "Incremental"
def __init__(self, load_balancer_name, content_version=None, backend_pool_name=None, dns_name_type="none", frontend_ip_name="LoadBalancerFrontEnd", location=None, private_ip_address=None, private_ip_address_allocation="dynamic", public_ip_address=None, public_ip_address_allocation="dynamic", public_ip_address_type="new", public_ip_dns_name=None, subnet=None, subnet_address_prefix="10.0.0.0/24", subnet_type="none", tags=None, virtual_network_name=None, vnet_address_prefix="10.0.0.0/16"):
self.content_version = content_version
self.backend_pool_name = backend_pool_name
self.dns_name_type = dns_name_type
self.frontend_ip_name = frontend_ip_name
self.load_balancer_name = load_balancer_name
self.location = location
self.private_ip_address = private_ip_address
self.private_ip_address_allocation = private_ip_address_allocation
self.public_ip_address = public_ip_address
self.public_ip_address_allocation = public_ip_address_allocation
self.public_ip_address_type = public_ip_address_type
self.public_ip_dns_name = public_ip_dns_name
self.subnet = subnet
self.subnet_address_prefix = subnet_address_prefix
self.subnet_type = subnet_type
self.tags = tags
self.virtual_network_name = virtual_network_name
self.vnet_address_prefix = vnet_address_prefix

Просмотреть файл

@ -1,79 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class DeploymentPropertiesExtended(Model):
"""
Deployment properties with additional details.
:param provisioning_state: Gets or sets the state of the provisioning.
:type provisioning_state: str
:param correlation_id: Gets or sets the correlation ID of the deployment.
:type correlation_id: str
:param timestamp: Gets or sets the timestamp of the template deployment.
:type timestamp: datetime
:param outputs: Gets or sets key/value pairs that represent
deploymentoutput.
:type outputs: object
:param providers: Gets the list of resource providers needed for the
deployment.
:type providers: list of :class:`Provider <default.models.Provider>`
:param dependencies: Gets the list of deployment dependencies.
:type dependencies: list of :class:`Dependency
<default.models.Dependency>`
:param template: Gets or sets the template content. Use only one of
Template or TemplateLink.
:type template: object
:param template_link: Gets or sets the URI referencing the template. Use
only one of Template or TemplateLink.
:type template_link: :class:`TemplateLink <default.models.TemplateLink>`
:param parameters: Deployment parameters. Use only one of Parameters or
ParametersLink.
:type parameters: object
:param parameters_link: Gets or sets the URI referencing the parameters.
Use only one of Parameters or ParametersLink.
:type parameters_link: :class:`ParametersLink
<default.models.ParametersLink>`
:param mode: Gets or sets the deployment mode. Possible values include:
'Incremental', 'Complete'
:type mode: str or :class:`DeploymentMode
<lbcreationclient.models.DeploymentMode>`
"""
_attribute_map = {
'provisioning_state': {'key': 'provisioningState', 'type': 'str'},
'correlation_id': {'key': 'correlationId', 'type': 'str'},
'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
'outputs': {'key': 'outputs', 'type': 'object'},
'providers': {'key': 'providers', 'type': '[Provider]'},
'dependencies': {'key': 'dependencies', 'type': '[Dependency]'},
'template': {'key': 'template', 'type': 'object'},
'template_link': {'key': 'TemplateLink', 'type': 'TemplateLink'},
'parameters': {'key': 'parameters', 'type': 'object'},
'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'},
'mode': {'key': 'mode', 'type': 'DeploymentMode'},
}
def __init__(self, provisioning_state=None, correlation_id=None, timestamp=None, outputs=None, providers=None, dependencies=None, template=None, template_link=None, parameters=None, parameters_link=None, mode=None):
self.provisioning_state = provisioning_state
self.correlation_id = correlation_id
self.timestamp = timestamp
self.outputs = outputs
self.providers = providers
self.dependencies = dependencies
self.template = template
self.template_link = template_link
self.parameters = parameters
self.parameters_link = parameters_link
self.mode = mode

Просмотреть файл

@ -1,53 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from enum import Enum
class dnsNameType(Enum):
none = "none"
new = "new"
class privateIpAddressAllocation(Enum):
dynamic = "dynamic"
static = "static"
class publicIpAddressAllocation(Enum):
dynamic = "dynamic"
static = "static"
class publicIpAddressType(Enum):
none = "none"
new = "new"
existing_name = "existingName"
existing_id = "existingId"
class subnetType(Enum):
none = "none"
new = "new"
existing_name = "existingName"
existing_id = "existingId"
class DeploymentMode(Enum):
incremental = "Incremental"
complete = "Complete"

Просмотреть файл

@ -1,38 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class ParametersLink(Model):
"""
Entity representing the reference to the deployment paramaters.
:param uri: URI referencing the template.
:type uri: str
:param content_version: If included it must match the ContentVersion in
the template.
:type content_version: str
"""
_validation = {
'uri': {'required': True},
}
_attribute_map = {
'uri': {'key': 'uri', 'type': 'str'},
'content_version': {'key': 'contentVersion', 'type': 'str'},
}
def __init__(self, uri, content_version=None):
self.uri = uri
self.content_version = content_version

Просмотреть файл

@ -1,44 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Provider(Model):
"""
Resource provider information.
:param id: Gets or sets the provider id.
:type id: str
:param namespace: Gets or sets the namespace of the provider.
:type namespace: str
:param registration_state: Gets or sets the registration state of the
provider.
:type registration_state: str
:param resource_types: Gets or sets the collection of provider resource
types.
:type resource_types: list of :class:`ProviderResourceType
<default.models.ProviderResourceType>`
"""
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'namespace': {'key': 'namespace', 'type': 'str'},
'registration_state': {'key': 'registrationState', 'type': 'str'},
'resource_types': {'key': 'resourceTypes', 'type': '[ProviderResourceType]'},
}
def __init__(self, id=None, namespace=None, registration_state=None, resource_types=None):
self.id = id
self.namespace = namespace
self.registration_state = registration_state
self.resource_types = resource_types

Просмотреть файл

@ -1,42 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class ProviderResourceType(Model):
"""
Resource type managed by the resource provider.
:param resource_type: Gets or sets the resource type.
:type resource_type: str
:param locations: Gets or sets the collection of locations where this
resource type can be created in.
:type locations: list of str
:param api_versions: Gets or sets the api version.
:type api_versions: list of str
:param properties: Gets or sets the properties.
:type properties: dict
"""
_attribute_map = {
'resource_type': {'key': 'resourceType', 'type': 'str'},
'locations': {'key': 'locations', 'type': '[str]'},
'api_versions': {'key': 'apiVersions', 'type': '[str]'},
'properties': {'key': 'properties', 'type': '{str}'},
}
def __init__(self, resource_type=None, locations=None, api_versions=None, properties=None):
self.resource_type = resource_type
self.locations = locations
self.api_versions = api_versions
self.properties = properties

Просмотреть файл

@ -1,44 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class TemplateLink(Model):
"""
Entity representing the reference to the template.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar uri: URI referencing the template. Default value:
"https://azuresdkci.blob.core.windows.net/templatehost/CreateLb_2016-07-19/azuredeploy.json"
.
:vartype uri: str
:param content_version: If included it must match the ContentVersion in
the template.
:type content_version: str
"""
_validation = {
'uri': {'required': True, 'constant': True},
}
_attribute_map = {
'uri': {'key': 'uri', 'type': 'str'},
'content_version': {'key': 'contentVersion', 'type': 'str'},
}
uri = "https://azuresdkci.blob.core.windows.net/templatehost/CreateLb_2016-07-19/azuredeploy.json"
def __init__(self, content_version=None):
self.content_version = content_version

Просмотреть файл

@ -1,17 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from .lb_operations import LbOperations
__all__ = [
'LbOperations',
]

Просмотреть файл

@ -1,185 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrestazure.azure_operation import AzureOperationPoller
import uuid
from .. import models
class LbOperations(object):
"""LbOperations operations.
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An objec model deserializer.
"""
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.config = config
def create_or_update(
self, resource_group_name, deployment_name, load_balancer_name, content_version=None, backend_pool_name=None, dns_name_type="none", frontend_ip_name="LoadBalancerFrontEnd", location=None, private_ip_address=None, private_ip_address_allocation="dynamic", public_ip_address=None, public_ip_address_allocation="dynamic", public_ip_address_type="new", public_ip_dns_name=None, subnet=None, subnet_address_prefix="10.0.0.0/24", subnet_type="none", tags=None, virtual_network_name=None, vnet_address_prefix="10.0.0.0/16", custom_headers=None, raw=False, **operation_config):
"""
Create or update a virtual machine.
:param resource_group_name: The name of the resource group. The name
is case insensitive.
:type resource_group_name: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param load_balancer_name: Name for load balancer.
:type load_balancer_name: str
:param content_version: If included it must match the ContentVersion
in the template.
:type content_version: str
:param backend_pool_name: Name of load balancer backend pool.
:type backend_pool_name: str
:param dns_name_type: Associate VMs with a public IP address to a DNS
name. Possible values include: 'none', 'new'
:type dns_name_type: str or :class:`dnsNameType
<lbcreationclient.models.dnsNameType>`
:param frontend_ip_name: Name of the frontend IP configuration.
:type frontend_ip_name: str
:param location: Location for load balancer resource.
:type location: str
:param private_ip_address: Static private IP address to use.
:type private_ip_address: str
:param private_ip_address_allocation: Private IP address allocation
method. Possible values include: 'dynamic', 'static'
:type private_ip_address_allocation: str or
:class:`privateIpAddressAllocation
<lbcreationclient.models.privateIpAddressAllocation>`
:param public_ip_address: Name or ID of the public IP address to use.
:type public_ip_address: str
:param public_ip_address_allocation: Public IP address allocation
method. Possible values include: 'dynamic', 'static'
:type public_ip_address_allocation: str or
:class:`publicIpAddressAllocation
<lbcreationclient.models.publicIpAddressAllocation>`
:param public_ip_address_type: Type of Public IP Address to associate
with the load balancer. Possible values include: 'none', 'new',
'existingName', 'existingId'
:type public_ip_address_type: str or :class:`publicIpAddressType
<lbcreationclient.models.publicIpAddressType>`
:param public_ip_dns_name: Globally unique DNS Name for the Public IP
used to access the Virtual Machine (new public IP only).
:type public_ip_dns_name: str
:param subnet: The subnet name or ID to associate with the load
balancer. Cannot be used in conjunction with a Public IP.
:type subnet: str
:param subnet_address_prefix: The subnet address prefix in CIDR
format (new subnet only).
:type subnet_address_prefix: str
:param subnet_type: Use new, existing or no subnet. Possible values
include: 'none', 'new', 'existingName', 'existingId'
:type subnet_type: str or :class:`subnetType
<lbcreationclient.models.subnetType>`
:param tags: Tags object.
:type tags: object
:param virtual_network_name: The VNet name containing the subnet.
Cannot be used in conjunction with a Public IP.
:type virtual_network_name: str
:param vnet_address_prefix: The virtual network IP address prefix in
CIDR format (new subnet only).
:type vnet_address_prefix: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:rtype:
:class:`AzureOperationPoller<msrestazure.azure_operation.AzureOperationPoller>`
instance that returns :class:`DeploymentExtended
<default.models.DeploymentExtended>`
:rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
if raw=true
"""
parameters = models.DeploymentLb(content_version=content_version, backend_pool_name=backend_pool_name, dns_name_type=dns_name_type, frontend_ip_name=frontend_ip_name, load_balancer_name=load_balancer_name, location=location, private_ip_address=private_ip_address, private_ip_address_allocation=private_ip_address_allocation, public_ip_address=public_ip_address, public_ip_address_allocation=public_ip_address_allocation, public_ip_address_type=public_ip_address_type, public_ip_dns_name=public_ip_dns_name, subnet=subnet, subnet_address_prefix=subnet_address_prefix, subnet_type=subnet_type, tags=tags, virtual_network_name=virtual_network_name, vnet_address_prefix=vnet_address_prefix)
# Construct URL
url = '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=64, min_length=1, pattern='^[-\w\._]+$'),
'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern='^[-\w\._]+$'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
# Construct body
body_content = self._serialize.body(parameters, 'DeploymentLb')
# Construct and send request
def long_running_send():
request = self._client.put(url, query_parameters)
return self._client.send(
request, header_parameters, body_content, **operation_config)
def get_long_running_status(status_link, headers=None):
request = self._client.get(status_link)
if headers:
request.headers.update(headers)
return self._client.send(
request, header_parameters, **operation_config)
def get_long_running_output(response):
if response.status_code not in [200, 201]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('DeploymentExtended', response)
if response.status_code == 201:
deserialized = self._deserialize('DeploymentExtended', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
if raw:
response = long_running_send()
return get_long_running_output(response)
long_running_operation_timeout = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
return AzureOperationPoller(
long_running_send, get_long_running_output,
get_long_running_status, long_running_operation_timeout)

Просмотреть файл

@ -1,14 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#pylint: skip-file
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
VERSION = "2015-11-01"

Просмотреть файл

@ -1,693 +0,0 @@
{
"swagger": "2.0",
"info": {
"title": "LbCreationClient",
"version": "2015-11-01"
},
"host": "management.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"security": [
{
"azure_auth": [
"user_impersonation"
]
}
],
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"flow": "implicit",
"description": "Azure Active Directory OAuth2 Flow",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
},
"paths": {
"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}": {
"put": {
"tags": [
"Lb"
],
"operationId": "Lb_CreateOrUpdate",
"description": "Create or update a virtual machine.",
"parameters": [
{
"name": "resourceGroupName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the resource group. The name is case insensitive.",
"pattern": "^[-\\w\\._]+$",
"minLength": 1,
"maxLength": 64
},
{
"name": "deploymentName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the deployment.",
"pattern": "^[-\\w\\._]+$",
"minLength": 1,
"maxLength": 64
},
{
"name": "parameters",
"x-ms-client-flatten": true,
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/Deployment_Lb"
},
"description": "Additional parameters supplied to the operation."
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/DeploymentExtended"
}
},
"201": {
"description": "",
"schema": {
"$ref": "#/definitions/DeploymentExtended"
}
}
},
"x-ms-long-running-operation": true
}
}
},
"definitions": {
"Deployment_Lb": {
"properties": {
"properties": {
"$ref": "#/definitions/DeploymentProperties_Lb",
"description": "Gets or sets the deployment properties.",
"x-ms-client-flatten": true
}
},
"description": "Deployment operation parameters."
},
"DeploymentProperties_Lb": {
"properties": {
"templateLink": {
"$ref": "#/definitions/TemplateLink",
"description": "Gets or sets the URI referencing the template. Use only one of Template or TemplateLink.",
"x-ms-client-flatten": true
},
"parameters": {
"$ref": "#/definitions/LbParameters",
"type": "object",
"description": "Deployment parameters. Use only one of Parameters or ParametersLink.",
"x-ms-client-flatten": true
},
"mode": {
"type": "string",
"description": "Gets or sets the deployment mode.",
"enum": [
"Incremental"
],
"x-ms-enum": {
"name": "DeploymentMode",
"modelAsString": false
}
}
},
"required": [
"templateLink",
"parameters",
"mode"
],
"description": "Deployment properties."
},
"TemplateLink": {
"properties": {
"uri": {
"type": "string",
"description": "URI referencing the template.",
"enum": [
"https://azuresdkci.blob.core.windows.net/templatehost/CreateLb_2016-07-19/azuredeploy.json"
]
},
"contentVersion": {
"type": "string",
"description": "If included it must match the ContentVersion in the template."
}
},
"required": [
"uri"
],
"description": "Entity representing the reference to the template."
},
"LbParameters": {
"properties": {
"_artifactsLocation": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter__artifactsLocation",
"x-ms-client-flatten": true
},
"backendPoolName": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_backendPoolName",
"x-ms-client-flatten": true
},
"dnsNameType": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_dnsNameType",
"x-ms-client-flatten": true
},
"frontendIpName": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_frontendIpName",
"x-ms-client-flatten": true
},
"loadBalancerName": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_loadBalancerName",
"x-ms-client-flatten": true
},
"location": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_location",
"x-ms-client-flatten": true
},
"privateIpAddress": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_privateIpAddress",
"x-ms-client-flatten": true
},
"privateIpAddressAllocation": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_privateIpAddressAllocation",
"x-ms-client-flatten": true
},
"publicIpAddress": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_publicIpAddress",
"x-ms-client-flatten": true
},
"publicIpAddressAllocation": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_publicIpAddressAllocation",
"x-ms-client-flatten": true
},
"publicIpAddressType": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_publicIpAddressType",
"x-ms-client-flatten": true
},
"publicIpDnsName": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_publicIpDnsName",
"x-ms-client-flatten": true
},
"subnet": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_subnet",
"x-ms-client-flatten": true
},
"subnetAddressPrefix": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_subnetAddressPrefix",
"x-ms-client-flatten": true
},
"subnetType": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_subnetType",
"x-ms-client-flatten": true
},
"tags": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_tags",
"x-ms-client-flatten": true
},
"virtualNetworkName": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_virtualNetworkName",
"x-ms-client-flatten": true
},
"vnetAddressPrefix": {
"type": "object",
"$ref": "#/definitions/DeploymentParameter_vnetAddressPrefix",
"x-ms-client-flatten": true
}
},
"required": [
"loadBalancerName"
]
},
"DeploymentParameter_backendPoolName": {
"properties": {
"value": {
"type": "string",
"description": "Name of load balancer backend pool.",
"x-ms-client-name": "backendPoolName"
}
}
},
"DeploymentParameter_dnsNameType": {
"properties": {
"value": {
"type": "string",
"description": "Associate VMs with a public IP address to a DNS name.",
"x-ms-client-name": "dnsNameType",
"enum": [
"none",
"new"
],
"x-ms-enum": {
"name": "dnsNameType",
"modelAsString": false
},
"default": "none"
}
}
},
"DeploymentParameter_frontendIpName": {
"properties": {
"value": {
"type": "string",
"description": "Name of the frontend IP configuration.",
"x-ms-client-name": "frontendIpName",
"default": "LoadBalancerFrontEnd"
}
}
},
"DeploymentParameter_loadBalancerName": {
"properties": {
"value": {
"type": "string",
"description": "Name for load balancer.",
"x-ms-client-name": "loadBalancerName"
}
},
"required": [
"value"
]
},
"DeploymentParameter_location": {
"properties": {
"value": {
"type": "string",
"description": "Location for load balancer resource.",
"x-ms-client-name": "location"
}
}
},
"DeploymentParameter_privateIpAddress": {
"properties": {
"value": {
"type": "string",
"description": "Static private IP address to use.",
"x-ms-client-name": "privateIpAddress"
}
}
},
"DeploymentParameter_privateIpAddressAllocation": {
"properties": {
"value": {
"type": "string",
"description": "Private IP address allocation method.",
"x-ms-client-name": "privateIpAddressAllocation",
"enum": [
"dynamic",
"static"
],
"x-ms-enum": {
"name": "privateIpAddressAllocation",
"modelAsString": false
},
"default": "dynamic"
}
}
},
"DeploymentParameter_publicIpAddress": {
"properties": {
"value": {
"type": "string",
"description": "Name or ID of the public IP address to use.",
"x-ms-client-name": "publicIpAddress"
}
}
},
"DeploymentParameter_publicIpAddressAllocation": {
"properties": {
"value": {
"type": "string",
"description": "Public IP address allocation method.",
"x-ms-client-name": "publicIpAddressAllocation",
"enum": [
"dynamic",
"static"
],
"x-ms-enum": {
"name": "publicIpAddressAllocation",
"modelAsString": false
},
"default": "dynamic"
}
}
},
"DeploymentParameter_publicIpAddressType": {
"properties": {
"value": {
"type": "string",
"description": "Type of Public IP Address to associate with the load balancer.",
"x-ms-client-name": "publicIpAddressType",
"enum": [
"none",
"new",
"existingName",
"existingId"
],
"x-ms-enum": {
"name": "publicIpAddressType",
"modelAsString": false
},
"default": "new"
}
}
},
"DeploymentParameter_publicIpDnsName": {
"properties": {
"value": {
"type": "string",
"description": "Globally unique DNS Name for the Public IP used to access the Virtual Machine (new public IP only).",
"x-ms-client-name": "publicIpDnsName"
}
}
},
"DeploymentParameter_subnet": {
"properties": {
"value": {
"type": "string",
"description": "The subnet name or ID to associate with the load balancer. Cannot be used in conjunction with a Public IP.",
"x-ms-client-name": "subnet"
}
}
},
"DeploymentParameter_subnetAddressPrefix": {
"properties": {
"value": {
"type": "string",
"description": "The subnet address prefix in CIDR format (new subnet only).",
"x-ms-client-name": "subnetAddressPrefix",
"default": "10.0.0.0/24"
}
}
},
"DeploymentParameter_subnetType": {
"properties": {
"value": {
"type": "string",
"description": "Use new, existing or no subnet.",
"x-ms-client-name": "subnetType",
"enum": [
"none",
"new",
"existingName",
"existingId"
],
"x-ms-enum": {
"name": "subnetType",
"modelAsString": false
},
"default": "none"
}
}
},
"DeploymentParameter_tags": {
"properties": {
"value": {
"type": "object",
"description": "Tags object.",
"x-ms-client-name": "tags"
}
}
},
"DeploymentParameter_virtualNetworkName": {
"properties": {
"value": {
"type": "string",
"description": "The VNet name containing the subnet. Cannot be used in conjunction with a Public IP.",
"x-ms-client-name": "virtualNetworkName"
}
}
},
"DeploymentParameter_vnetAddressPrefix": {
"properties": {
"value": {
"type": "string",
"description": "The virtual network IP address prefix in CIDR format (new subnet only).",
"x-ms-client-name": "vnetAddressPrefix",
"default": "10.0.0.0/16"
}
}
},
"DeploymentParameter__artifactsLocation": {
"properties": {
"value": {
"type": "string",
"description": "Container URI of of the template.",
"x-ms-client-name": "_artifactsLocation",
"enum": [
"https://azuresdkci.blob.core.windows.net/templatehost/CreateLb_2016-07-19"
]
}
},
"required": [
"value"
]
},
"ParametersLink": {
"properties": {
"uri": {
"type": "string",
"description": "URI referencing the template."
},
"contentVersion": {
"type": "string",
"description": "If included it must match the ContentVersion in the template."
}
},
"required": [
"uri"
],
"description": "Entity representing the reference to the deployment paramaters."
},
"ProviderResourceType": {
"properties": {
"resourceType": {
"type": "string",
"description": "Gets or sets the resource type."
},
"locations": {
"type": "array",
"items": {
"type": "string"
},
"description": "Gets or sets the collection of locations where this resource type can be created in."
},
"apiVersions": {
"type": "array",
"items": {
"type": "string"
},
"description": "Gets or sets the api version."
},
"properties": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Gets or sets the properties."
}
},
"description": "Resource type managed by the resource provider."
},
"Provider": {
"properties": {
"id": {
"type": "string",
"description": "Gets or sets the provider id."
},
"namespace": {
"type": "string",
"description": "Gets or sets the namespace of the provider."
},
"registrationState": {
"type": "string",
"description": "Gets or sets the registration state of the provider."
},
"resourceTypes": {
"type": "array",
"items": {
"$ref": "#/definitions/ProviderResourceType"
},
"description": "Gets or sets the collection of provider resource types."
}
},
"description": "Resource provider information."
},
"BasicDependency": {
"properties": {
"id": {
"type": "string",
"description": "Gets or sets the ID of the dependency."
},
"resourceType": {
"type": "string",
"description": "Gets or sets the dependency resource type."
},
"resourceName": {
"type": "string",
"description": "Gets or sets the dependency resource name."
}
},
"description": "Deployment dependency information."
},
"Dependency": {
"properties": {
"dependsOn": {
"type": "array",
"items": {
"$ref": "#/definitions/BasicDependency"
},
"description": "Gets the list of dependencies."
},
"id": {
"type": "string",
"description": "Gets or sets the ID of the dependency."
},
"resourceType": {
"type": "string",
"description": "Gets or sets the dependency resource type."
},
"resourceName": {
"type": "string",
"description": "Gets or sets the dependency resource name."
}
},
"description": "Deployment dependency information."
},
"DeploymentPropertiesExtended": {
"properties": {
"provisioningState": {
"type": "string",
"description": "Gets or sets the state of the provisioning."
},
"correlationId": {
"type": "string",
"description": "Gets or sets the correlation ID of the deployment."
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "Gets or sets the timestamp of the template deployment."
},
"outputs": {
"type": "object",
"description": "Gets or sets key/value pairs that represent deploymentoutput."
},
"providers": {
"type": "array",
"items": {
"$ref": "#/definitions/Provider"
},
"description": "Gets the list of resource providers needed for the deployment."
},
"dependencies": {
"type": "array",
"items": {
"$ref": "#/definitions/Dependency"
},
"description": "Gets the list of deployment dependencies."
},
"template": {
"type": "object",
"description": "Gets or sets the template content. Use only one of Template or TemplateLink."
},
"TemplateLink": {
"$ref": "#/definitions/TemplateLink",
"description": "Gets or sets the URI referencing the template. Use only one of Template or TemplateLink."
},
"parameters": {
"type": "object",
"description": "Deployment parameters. Use only one of Parameters or ParametersLink."
},
"parametersLink": {
"$ref": "#/definitions/ParametersLink",
"description": "Gets or sets the URI referencing the parameters. Use only one of Parameters or ParametersLink."
},
"mode": {
"type": "string",
"description": "Gets or sets the deployment mode.",
"enum": [
"Incremental",
"Complete"
],
"x-ms-enum": {
"name": "DeploymentMode",
"modelAsString": false
}
}
},
"description": "Deployment properties with additional details."
},
"DeploymentExtended": {
"properties": {
"id": {
"type": "string",
"description": "Gets or sets the ID of the deployment."
},
"name": {
"type": "string",
"description": "Gets or sets the name of the deployment."
},
"properties": {
"$ref": "#/definitions/DeploymentPropertiesExtended",
"description": "Gets or sets deployment properties."
}
},
"required": [
"name"
],
"description": "Deployment information."
}
},
"parameters": {
"SubscriptionIdParameter": {
"name": "subscriptionId",
"in": "path",
"required": true,
"type": "string",
"description": "Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."
},
"ApiVersionParameter": {
"name": "api-version",
"in": "query",
"required": true,
"type": "string",
"description": "Client Api Version."
}
}
}

Просмотреть файл

@ -54,14 +54,6 @@ setup(
],
packages=[
'azure.cli.command_modules.network',
'azure.cli.command_modules.network.mgmt_app_gateway',
'azure.cli.command_modules.network.mgmt_app_gateway.lib',
'azure.cli.command_modules.network.mgmt_app_gateway.lib.models',
'azure.cli.command_modules.network.mgmt_app_gateway.lib.operations',
'azure.cli.command_modules.network.mgmt_lb',
'azure.cli.command_modules.network.mgmt_lb.lib',
'azure.cli.command_modules.network.mgmt_lb.lib.models',
'azure.cli.command_modules.network.mgmt_lb.lib.operations',
'azure.cli.command_modules.network.zone_file'
],
install_requires=DEPENDENCIES,

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Разница между файлами не показана из-за своего большого размера Загрузить разницу