From 9c99a05e8af1835a62cb9201f824e81fb85726bf Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 6 Nov 2018 23:34:04 +0000 Subject: [PATCH] Generated from c20fca30611e2e0f9c73b98729045be7d8f1e0a3 update swagger for ANT79 milestone --- .../azure/mgmt/web/models/cors_settings.py | 7 + .../mgmt/web/models/cors_settings_py3.py | 9 +- .../web/models/deleted_app_restore_request.py | 5 + .../models/deleted_app_restore_request_py3.py | 7 +- .../mgmt/web/models/site_auth_settings.py | 7 + .../mgmt/web/models/site_auth_settings_py3.py | 9 +- .../azure/mgmt/web/models/site_config.py | 12 +- .../azure/mgmt/web/models/site_config_py3.py | 14 +- .../mgmt/web/models/site_config_resource.py | 12 +- .../web/models/site_config_resource_py3.py | 14 +- .../web/models/snapshot_restore_request.py | 5 + .../models/snapshot_restore_request_py3.py | 7 +- .../mgmt/web/models/stack_major_version.py | 5 + .../web/models/stack_major_version_py3.py | 7 +- .../azure/mgmt/web/models/vnet_info.py | 4 + .../azure/mgmt/web/models/vnet_info_py3.py | 6 +- .../web/operations/web_apps_operations.py | 1899 ++++++++++++----- 17 files changed, 1425 insertions(+), 604 deletions(-) diff --git a/azure-mgmt-web/azure/mgmt/web/models/cors_settings.py b/azure-mgmt-web/azure/mgmt/web/models/cors_settings.py index 5096932c5327..aa2ffd08ff69 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/cors_settings.py +++ b/azure-mgmt-web/azure/mgmt/web/models/cors_settings.py @@ -19,12 +19,19 @@ class CorsSettings(Model): allowed to make cross-origin calls (for example: http://example.com:12345). Use "*" to allow all. :type allowed_origins: list[str] + :param support_credentials: Gets or sets whether CORS requests with + credentials are allowed. See + https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + for more details. + :type support_credentials: bool """ _attribute_map = { 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'support_credentials': {'key': 'supportCredentials', 'type': 'bool'}, } def __init__(self, **kwargs): super(CorsSettings, self).__init__(**kwargs) self.allowed_origins = kwargs.get('allowed_origins', None) + self.support_credentials = kwargs.get('support_credentials', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/cors_settings_py3.py b/azure-mgmt-web/azure/mgmt/web/models/cors_settings_py3.py index 17c530afdd67..ca466b9648c4 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/cors_settings_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/cors_settings_py3.py @@ -19,12 +19,19 @@ class CorsSettings(Model): allowed to make cross-origin calls (for example: http://example.com:12345). Use "*" to allow all. :type allowed_origins: list[str] + :param support_credentials: Gets or sets whether CORS requests with + credentials are allowed. See + https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + for more details. + :type support_credentials: bool """ _attribute_map = { 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'support_credentials': {'key': 'supportCredentials', 'type': 'bool'}, } - def __init__(self, *, allowed_origins=None, **kwargs) -> None: + def __init__(self, *, allowed_origins=None, support_credentials: bool=None, **kwargs) -> None: super(CorsSettings, self).__init__(**kwargs) self.allowed_origins = allowed_origins + self.support_credentials = support_credentials diff --git a/azure-mgmt-web/azure/mgmt/web/models/deleted_app_restore_request.py b/azure-mgmt-web/azure/mgmt/web/models/deleted_app_restore_request.py index 0fe0f903f66d..42d5ae80a25e 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/deleted_app_restore_request.py +++ b/azure-mgmt-web/azure/mgmt/web/models/deleted_app_restore_request.py @@ -36,6 +36,9 @@ class DeletedAppRestoreRequest(ProxyOnlyResource): formatted as a DateTime string. If unspecified, default value is the time that the app was deleted. :type snapshot_time: str + :param use_dr_secondary: If true, the snapshot is retrieved from + DRSecondary endpoint. + :type use_dr_secondary: bool """ _validation = { @@ -52,6 +55,7 @@ class DeletedAppRestoreRequest(ProxyOnlyResource): 'deleted_site_id': {'key': 'properties.deletedSiteId', 'type': 'str'}, 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'str'}, + 'use_dr_secondary': {'key': 'properties.useDRSecondary', 'type': 'bool'}, } def __init__(self, **kwargs): @@ -59,3 +63,4 @@ def __init__(self, **kwargs): self.deleted_site_id = kwargs.get('deleted_site_id', None) self.recover_configuration = kwargs.get('recover_configuration', None) self.snapshot_time = kwargs.get('snapshot_time', None) + self.use_dr_secondary = kwargs.get('use_dr_secondary', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/deleted_app_restore_request_py3.py b/azure-mgmt-web/azure/mgmt/web/models/deleted_app_restore_request_py3.py index 69ca457e864b..3216b8c3056f 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/deleted_app_restore_request_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/deleted_app_restore_request_py3.py @@ -36,6 +36,9 @@ class DeletedAppRestoreRequest(ProxyOnlyResource): formatted as a DateTime string. If unspecified, default value is the time that the app was deleted. :type snapshot_time: str + :param use_dr_secondary: If true, the snapshot is retrieved from + DRSecondary endpoint. + :type use_dr_secondary: bool """ _validation = { @@ -52,10 +55,12 @@ class DeletedAppRestoreRequest(ProxyOnlyResource): 'deleted_site_id': {'key': 'properties.deletedSiteId', 'type': 'str'}, 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'str'}, + 'use_dr_secondary': {'key': 'properties.useDRSecondary', 'type': 'bool'}, } - def __init__(self, *, kind: str=None, deleted_site_id: str=None, recover_configuration: bool=None, snapshot_time: str=None, **kwargs) -> None: + def __init__(self, *, kind: str=None, deleted_site_id: str=None, recover_configuration: bool=None, snapshot_time: str=None, use_dr_secondary: bool=None, **kwargs) -> None: super(DeletedAppRestoreRequest, self).__init__(kind=kind, **kwargs) self.deleted_site_id = deleted_site_id self.recover_configuration = recover_configuration self.snapshot_time = snapshot_time + self.use_dr_secondary = use_dr_secondary diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_auth_settings.py b/azure-mgmt-web/azure/mgmt/web/models/site_auth_settings.py index c280193927e4..2256599aea41 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_auth_settings.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_auth_settings.py @@ -82,6 +82,11 @@ class SiteAuthSettings(ProxyOnlyResource): More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html :type client_secret: str + :param client_secret_certificate_thumbprint: An alternative to the client + secret, that is the thumbprint of a certifite used for signing purposes. + This property acts as + a replacement for the Client Secret. It is also optional. + :type client_secret_certificate_thumbprint: str :param issuer: The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. When using Azure Active Directory, this value is the URI of the directory @@ -190,6 +195,7 @@ class SiteAuthSettings(ProxyOnlyResource): 'token_refresh_extension_hours': {'key': 'properties.tokenRefreshExtensionHours', 'type': 'float'}, 'client_id': {'key': 'properties.clientId', 'type': 'str'}, 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + 'client_secret_certificate_thumbprint': {'key': 'properties.clientSecretCertificateThumbprint', 'type': 'str'}, 'issuer': {'key': 'properties.issuer', 'type': 'str'}, 'validate_issuer': {'key': 'properties.validateIssuer', 'type': 'bool'}, 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, @@ -218,6 +224,7 @@ def __init__(self, **kwargs): self.token_refresh_extension_hours = kwargs.get('token_refresh_extension_hours', None) self.client_id = kwargs.get('client_id', None) self.client_secret = kwargs.get('client_secret', None) + self.client_secret_certificate_thumbprint = kwargs.get('client_secret_certificate_thumbprint', None) self.issuer = kwargs.get('issuer', None) self.validate_issuer = kwargs.get('validate_issuer', None) self.allowed_audiences = kwargs.get('allowed_audiences', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_auth_settings_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_auth_settings_py3.py index b2b246e30079..0684318a3ce1 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_auth_settings_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_auth_settings_py3.py @@ -82,6 +82,11 @@ class SiteAuthSettings(ProxyOnlyResource): More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html :type client_secret: str + :param client_secret_certificate_thumbprint: An alternative to the client + secret, that is the thumbprint of a certifite used for signing purposes. + This property acts as + a replacement for the Client Secret. It is also optional. + :type client_secret_certificate_thumbprint: str :param issuer: The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. When using Azure Active Directory, this value is the URI of the directory @@ -190,6 +195,7 @@ class SiteAuthSettings(ProxyOnlyResource): 'token_refresh_extension_hours': {'key': 'properties.tokenRefreshExtensionHours', 'type': 'float'}, 'client_id': {'key': 'properties.clientId', 'type': 'str'}, 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + 'client_secret_certificate_thumbprint': {'key': 'properties.clientSecretCertificateThumbprint', 'type': 'str'}, 'issuer': {'key': 'properties.issuer', 'type': 'str'}, 'validate_issuer': {'key': 'properties.validateIssuer', 'type': 'bool'}, 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, @@ -207,7 +213,7 @@ class SiteAuthSettings(ProxyOnlyResource): 'microsoft_account_oauth_scopes': {'key': 'properties.microsoftAccountOAuthScopes', 'type': '[str]'}, } - def __init__(self, *, kind: str=None, enabled: bool=None, runtime_version: str=None, unauthenticated_client_action=None, token_store_enabled: bool=None, allowed_external_redirect_urls=None, default_provider=None, token_refresh_extension_hours: float=None, client_id: str=None, client_secret: str=None, issuer: str=None, validate_issuer: bool=None, allowed_audiences=None, additional_login_params=None, google_client_id: str=None, google_client_secret: str=None, google_oauth_scopes=None, facebook_app_id: str=None, facebook_app_secret: str=None, facebook_oauth_scopes=None, twitter_consumer_key: str=None, twitter_consumer_secret: str=None, microsoft_account_client_id: str=None, microsoft_account_client_secret: str=None, microsoft_account_oauth_scopes=None, **kwargs) -> None: + def __init__(self, *, kind: str=None, enabled: bool=None, runtime_version: str=None, unauthenticated_client_action=None, token_store_enabled: bool=None, allowed_external_redirect_urls=None, default_provider=None, token_refresh_extension_hours: float=None, client_id: str=None, client_secret: str=None, client_secret_certificate_thumbprint: str=None, issuer: str=None, validate_issuer: bool=None, allowed_audiences=None, additional_login_params=None, google_client_id: str=None, google_client_secret: str=None, google_oauth_scopes=None, facebook_app_id: str=None, facebook_app_secret: str=None, facebook_oauth_scopes=None, twitter_consumer_key: str=None, twitter_consumer_secret: str=None, microsoft_account_client_id: str=None, microsoft_account_client_secret: str=None, microsoft_account_oauth_scopes=None, **kwargs) -> None: super(SiteAuthSettings, self).__init__(kind=kind, **kwargs) self.enabled = enabled self.runtime_version = runtime_version @@ -218,6 +224,7 @@ def __init__(self, *, kind: str=None, enabled: bool=None, runtime_version: str=N self.token_refresh_extension_hours = token_refresh_extension_hours self.client_id = client_id self.client_secret = client_secret + self.client_secret_certificate_thumbprint = client_secret_certificate_thumbprint self.issuer = issuer self.validate_issuer = validate_issuer self.allowed_audiences = allowed_audiences diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_config.py b/azure-mgmt-web/azure/mgmt/web/models/site_config.py index 759ff0876aaa..81a874dc03f0 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_config.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_config.py @@ -129,9 +129,15 @@ class SiteConfig(Model): :type managed_service_identity_id: int :param x_managed_service_identity_id: Explicit Managed Service Identity Id :type x_managed_service_identity_id: int - :param ip_security_restrictions: IP security restrictions. + :param ip_security_restrictions: IP security restrictions for main. :type ip_security_restrictions: list[~azure.mgmt.web.models.IpSecurityRestriction] + :param scm_ip_security_restrictions: IP security restrictions for scm. + :type scm_ip_security_restrictions: + list[~azure.mgmt.web.models.IpSecurityRestriction] + :param scm_ip_security_restrictions_use_main: IP security restrictions for + scm to use main. + :type scm_ip_security_restrictions_use_main: bool :param http20_enabled: Http20Enabled: configures a web site to allow clients to connect over http2.0. Default value: True . :type http20_enabled: bool @@ -200,6 +206,8 @@ class SiteConfig(Model): 'managed_service_identity_id': {'key': 'managedServiceIdentityId', 'type': 'int'}, 'x_managed_service_identity_id': {'key': 'xManagedServiceIdentityId', 'type': 'int'}, 'ip_security_restrictions': {'key': 'ipSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions': {'key': 'scmIpSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions_use_main': {'key': 'scmIpSecurityRestrictionsUseMain', 'type': 'bool'}, 'http20_enabled': {'key': 'http20Enabled', 'type': 'bool'}, 'min_tls_version': {'key': 'minTlsVersion', 'type': 'str'}, 'ftps_state': {'key': 'ftpsState', 'type': 'str'}, @@ -255,6 +263,8 @@ def __init__(self, **kwargs): self.managed_service_identity_id = kwargs.get('managed_service_identity_id', None) self.x_managed_service_identity_id = kwargs.get('x_managed_service_identity_id', None) self.ip_security_restrictions = kwargs.get('ip_security_restrictions', None) + self.scm_ip_security_restrictions = kwargs.get('scm_ip_security_restrictions', None) + self.scm_ip_security_restrictions_use_main = kwargs.get('scm_ip_security_restrictions_use_main', None) self.http20_enabled = kwargs.get('http20_enabled', True) self.min_tls_version = kwargs.get('min_tls_version', None) self.ftps_state = kwargs.get('ftps_state', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_config_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_config_py3.py index a8534e4686b4..b1c6f59d8521 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_config_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_config_py3.py @@ -129,9 +129,15 @@ class SiteConfig(Model): :type managed_service_identity_id: int :param x_managed_service_identity_id: Explicit Managed Service Identity Id :type x_managed_service_identity_id: int - :param ip_security_restrictions: IP security restrictions. + :param ip_security_restrictions: IP security restrictions for main. :type ip_security_restrictions: list[~azure.mgmt.web.models.IpSecurityRestriction] + :param scm_ip_security_restrictions: IP security restrictions for scm. + :type scm_ip_security_restrictions: + list[~azure.mgmt.web.models.IpSecurityRestriction] + :param scm_ip_security_restrictions_use_main: IP security restrictions for + scm to use main. + :type scm_ip_security_restrictions_use_main: bool :param http20_enabled: Http20Enabled: configures a web site to allow clients to connect over http2.0. Default value: True . :type http20_enabled: bool @@ -200,13 +206,15 @@ class SiteConfig(Model): 'managed_service_identity_id': {'key': 'managedServiceIdentityId', 'type': 'int'}, 'x_managed_service_identity_id': {'key': 'xManagedServiceIdentityId', 'type': 'int'}, 'ip_security_restrictions': {'key': 'ipSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions': {'key': 'scmIpSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions_use_main': {'key': 'scmIpSecurityRestrictionsUseMain', 'type': 'bool'}, 'http20_enabled': {'key': 'http20Enabled', 'type': 'bool'}, 'min_tls_version': {'key': 'minTlsVersion', 'type': 'str'}, 'ftps_state': {'key': 'ftpsState', 'type': 'str'}, 'reserved_instance_count': {'key': 'reservedInstanceCount', 'type': 'int'}, } - def __init__(self, *, number_of_workers: int=None, default_documents=None, net_framework_version: str="v4.6", php_version: str=None, python_version: str=None, node_version: str=None, linux_fx_version: str=None, windows_fx_version: str=None, request_tracing_enabled: bool=None, request_tracing_expiration_time=None, remote_debugging_enabled: bool=None, remote_debugging_version: str=None, http_logging_enabled: bool=None, logs_directory_size_limit: int=None, detailed_error_logging_enabled: bool=None, publishing_username: str=None, app_settings=None, azure_storage_accounts=None, connection_strings=None, handler_mappings=None, document_root: str=None, scm_type=None, use32_bit_worker_process: bool=None, web_sockets_enabled: bool=None, always_on: bool=None, java_version: str=None, java_container: str=None, java_container_version: str=None, app_command_line: str=None, managed_pipeline_mode=None, virtual_applications=None, load_balancing=None, experiments=None, limits=None, auto_heal_enabled: bool=None, auto_heal_rules=None, tracing_options: str=None, vnet_name: str=None, cors=None, push=None, api_definition=None, auto_swap_slot_name: str=None, local_my_sql_enabled: bool=False, managed_service_identity_id: int=None, x_managed_service_identity_id: int=None, ip_security_restrictions=None, http20_enabled: bool=True, min_tls_version=None, ftps_state=None, reserved_instance_count: int=None, **kwargs) -> None: + def __init__(self, *, number_of_workers: int=None, default_documents=None, net_framework_version: str="v4.6", php_version: str=None, python_version: str=None, node_version: str=None, linux_fx_version: str=None, windows_fx_version: str=None, request_tracing_enabled: bool=None, request_tracing_expiration_time=None, remote_debugging_enabled: bool=None, remote_debugging_version: str=None, http_logging_enabled: bool=None, logs_directory_size_limit: int=None, detailed_error_logging_enabled: bool=None, publishing_username: str=None, app_settings=None, azure_storage_accounts=None, connection_strings=None, handler_mappings=None, document_root: str=None, scm_type=None, use32_bit_worker_process: bool=None, web_sockets_enabled: bool=None, always_on: bool=None, java_version: str=None, java_container: str=None, java_container_version: str=None, app_command_line: str=None, managed_pipeline_mode=None, virtual_applications=None, load_balancing=None, experiments=None, limits=None, auto_heal_enabled: bool=None, auto_heal_rules=None, tracing_options: str=None, vnet_name: str=None, cors=None, push=None, api_definition=None, auto_swap_slot_name: str=None, local_my_sql_enabled: bool=False, managed_service_identity_id: int=None, x_managed_service_identity_id: int=None, ip_security_restrictions=None, scm_ip_security_restrictions=None, scm_ip_security_restrictions_use_main: bool=None, http20_enabled: bool=True, min_tls_version=None, ftps_state=None, reserved_instance_count: int=None, **kwargs) -> None: super(SiteConfig, self).__init__(**kwargs) self.number_of_workers = number_of_workers self.default_documents = default_documents @@ -255,6 +263,8 @@ def __init__(self, *, number_of_workers: int=None, default_documents=None, net_f self.managed_service_identity_id = managed_service_identity_id self.x_managed_service_identity_id = x_managed_service_identity_id self.ip_security_restrictions = ip_security_restrictions + self.scm_ip_security_restrictions = scm_ip_security_restrictions + self.scm_ip_security_restrictions_use_main = scm_ip_security_restrictions_use_main self.http20_enabled = http20_enabled self.min_tls_version = min_tls_version self.ftps_state = ftps_state diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_config_resource.py b/azure-mgmt-web/azure/mgmt/web/models/site_config_resource.py index 1c4b3bc66086..e95309f42e4b 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_config_resource.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_config_resource.py @@ -137,9 +137,15 @@ class SiteConfigResource(ProxyOnlyResource): :type managed_service_identity_id: int :param x_managed_service_identity_id: Explicit Managed Service Identity Id :type x_managed_service_identity_id: int - :param ip_security_restrictions: IP security restrictions. + :param ip_security_restrictions: IP security restrictions for main. :type ip_security_restrictions: list[~azure.mgmt.web.models.IpSecurityRestriction] + :param scm_ip_security_restrictions: IP security restrictions for scm. + :type scm_ip_security_restrictions: + list[~azure.mgmt.web.models.IpSecurityRestriction] + :param scm_ip_security_restrictions_use_main: IP security restrictions for + scm to use main. + :type scm_ip_security_restrictions_use_main: bool :param http20_enabled: Http20Enabled: configures a web site to allow clients to connect over http2.0. Default value: True . :type http20_enabled: bool @@ -215,6 +221,8 @@ class SiteConfigResource(ProxyOnlyResource): 'managed_service_identity_id': {'key': 'properties.managedServiceIdentityId', 'type': 'int'}, 'x_managed_service_identity_id': {'key': 'properties.xManagedServiceIdentityId', 'type': 'int'}, 'ip_security_restrictions': {'key': 'properties.ipSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions': {'key': 'properties.scmIpSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions_use_main': {'key': 'properties.scmIpSecurityRestrictionsUseMain', 'type': 'bool'}, 'http20_enabled': {'key': 'properties.http20Enabled', 'type': 'bool'}, 'min_tls_version': {'key': 'properties.minTlsVersion', 'type': 'str'}, 'ftps_state': {'key': 'properties.ftpsState', 'type': 'str'}, @@ -270,6 +278,8 @@ def __init__(self, **kwargs): self.managed_service_identity_id = kwargs.get('managed_service_identity_id', None) self.x_managed_service_identity_id = kwargs.get('x_managed_service_identity_id', None) self.ip_security_restrictions = kwargs.get('ip_security_restrictions', None) + self.scm_ip_security_restrictions = kwargs.get('scm_ip_security_restrictions', None) + self.scm_ip_security_restrictions_use_main = kwargs.get('scm_ip_security_restrictions_use_main', None) self.http20_enabled = kwargs.get('http20_enabled', True) self.min_tls_version = kwargs.get('min_tls_version', None) self.ftps_state = kwargs.get('ftps_state', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_config_resource_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_config_resource_py3.py index e766a1a891b2..f0ed5ad5cada 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_config_resource_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_config_resource_py3.py @@ -137,9 +137,15 @@ class SiteConfigResource(ProxyOnlyResource): :type managed_service_identity_id: int :param x_managed_service_identity_id: Explicit Managed Service Identity Id :type x_managed_service_identity_id: int - :param ip_security_restrictions: IP security restrictions. + :param ip_security_restrictions: IP security restrictions for main. :type ip_security_restrictions: list[~azure.mgmt.web.models.IpSecurityRestriction] + :param scm_ip_security_restrictions: IP security restrictions for scm. + :type scm_ip_security_restrictions: + list[~azure.mgmt.web.models.IpSecurityRestriction] + :param scm_ip_security_restrictions_use_main: IP security restrictions for + scm to use main. + :type scm_ip_security_restrictions_use_main: bool :param http20_enabled: Http20Enabled: configures a web site to allow clients to connect over http2.0. Default value: True . :type http20_enabled: bool @@ -215,13 +221,15 @@ class SiteConfigResource(ProxyOnlyResource): 'managed_service_identity_id': {'key': 'properties.managedServiceIdentityId', 'type': 'int'}, 'x_managed_service_identity_id': {'key': 'properties.xManagedServiceIdentityId', 'type': 'int'}, 'ip_security_restrictions': {'key': 'properties.ipSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions': {'key': 'properties.scmIpSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions_use_main': {'key': 'properties.scmIpSecurityRestrictionsUseMain', 'type': 'bool'}, 'http20_enabled': {'key': 'properties.http20Enabled', 'type': 'bool'}, 'min_tls_version': {'key': 'properties.minTlsVersion', 'type': 'str'}, 'ftps_state': {'key': 'properties.ftpsState', 'type': 'str'}, 'reserved_instance_count': {'key': 'properties.reservedInstanceCount', 'type': 'int'}, } - def __init__(self, *, kind: str=None, number_of_workers: int=None, default_documents=None, net_framework_version: str="v4.6", php_version: str=None, python_version: str=None, node_version: str=None, linux_fx_version: str=None, windows_fx_version: str=None, request_tracing_enabled: bool=None, request_tracing_expiration_time=None, remote_debugging_enabled: bool=None, remote_debugging_version: str=None, http_logging_enabled: bool=None, logs_directory_size_limit: int=None, detailed_error_logging_enabled: bool=None, publishing_username: str=None, app_settings=None, azure_storage_accounts=None, connection_strings=None, handler_mappings=None, document_root: str=None, scm_type=None, use32_bit_worker_process: bool=None, web_sockets_enabled: bool=None, always_on: bool=None, java_version: str=None, java_container: str=None, java_container_version: str=None, app_command_line: str=None, managed_pipeline_mode=None, virtual_applications=None, load_balancing=None, experiments=None, limits=None, auto_heal_enabled: bool=None, auto_heal_rules=None, tracing_options: str=None, vnet_name: str=None, cors=None, push=None, api_definition=None, auto_swap_slot_name: str=None, local_my_sql_enabled: bool=False, managed_service_identity_id: int=None, x_managed_service_identity_id: int=None, ip_security_restrictions=None, http20_enabled: bool=True, min_tls_version=None, ftps_state=None, reserved_instance_count: int=None, **kwargs) -> None: + def __init__(self, *, kind: str=None, number_of_workers: int=None, default_documents=None, net_framework_version: str="v4.6", php_version: str=None, python_version: str=None, node_version: str=None, linux_fx_version: str=None, windows_fx_version: str=None, request_tracing_enabled: bool=None, request_tracing_expiration_time=None, remote_debugging_enabled: bool=None, remote_debugging_version: str=None, http_logging_enabled: bool=None, logs_directory_size_limit: int=None, detailed_error_logging_enabled: bool=None, publishing_username: str=None, app_settings=None, azure_storage_accounts=None, connection_strings=None, handler_mappings=None, document_root: str=None, scm_type=None, use32_bit_worker_process: bool=None, web_sockets_enabled: bool=None, always_on: bool=None, java_version: str=None, java_container: str=None, java_container_version: str=None, app_command_line: str=None, managed_pipeline_mode=None, virtual_applications=None, load_balancing=None, experiments=None, limits=None, auto_heal_enabled: bool=None, auto_heal_rules=None, tracing_options: str=None, vnet_name: str=None, cors=None, push=None, api_definition=None, auto_swap_slot_name: str=None, local_my_sql_enabled: bool=False, managed_service_identity_id: int=None, x_managed_service_identity_id: int=None, ip_security_restrictions=None, scm_ip_security_restrictions=None, scm_ip_security_restrictions_use_main: bool=None, http20_enabled: bool=True, min_tls_version=None, ftps_state=None, reserved_instance_count: int=None, **kwargs) -> None: super(SiteConfigResource, self).__init__(kind=kind, **kwargs) self.number_of_workers = number_of_workers self.default_documents = default_documents @@ -270,6 +278,8 @@ def __init__(self, *, kind: str=None, number_of_workers: int=None, default_docum self.managed_service_identity_id = managed_service_identity_id self.x_managed_service_identity_id = x_managed_service_identity_id self.ip_security_restrictions = ip_security_restrictions + self.scm_ip_security_restrictions = scm_ip_security_restrictions + self.scm_ip_security_restrictions_use_main = scm_ip_security_restrictions_use_main self.http20_enabled = http20_enabled self.min_tls_version = min_tls_version self.ftps_state = ftps_state diff --git a/azure-mgmt-web/azure/mgmt/web/models/snapshot_restore_request.py b/azure-mgmt-web/azure/mgmt/web/models/snapshot_restore_request.py index ef65405d81ab..7924152d75a8 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/snapshot_restore_request.py +++ b/azure-mgmt-web/azure/mgmt/web/models/snapshot_restore_request.py @@ -45,6 +45,9 @@ class SnapshotRestoreRequest(ProxyOnlyResource): will be ignored when recovering to a target web app. This setting is only necessary when RecoverConfiguration is enabled. :type ignore_conflicting_host_names: bool + :param use_dr_secondary: If true, the snapshot is retrieved from + DRSecondary endpoint. + :type use_dr_secondary: bool """ _validation = { @@ -64,6 +67,7 @@ class SnapshotRestoreRequest(ProxyOnlyResource): 'overwrite': {'key': 'properties.overwrite', 'type': 'bool'}, 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, 'ignore_conflicting_host_names': {'key': 'properties.ignoreConflictingHostNames', 'type': 'bool'}, + 'use_dr_secondary': {'key': 'properties.useDRSecondary', 'type': 'bool'}, } def __init__(self, **kwargs): @@ -73,3 +77,4 @@ def __init__(self, **kwargs): self.overwrite = kwargs.get('overwrite', None) self.recover_configuration = kwargs.get('recover_configuration', None) self.ignore_conflicting_host_names = kwargs.get('ignore_conflicting_host_names', None) + self.use_dr_secondary = kwargs.get('use_dr_secondary', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/snapshot_restore_request_py3.py b/azure-mgmt-web/azure/mgmt/web/models/snapshot_restore_request_py3.py index e32f278bc028..2d6c5ca1dcd5 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/snapshot_restore_request_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/snapshot_restore_request_py3.py @@ -45,6 +45,9 @@ class SnapshotRestoreRequest(ProxyOnlyResource): will be ignored when recovering to a target web app. This setting is only necessary when RecoverConfiguration is enabled. :type ignore_conflicting_host_names: bool + :param use_dr_secondary: If true, the snapshot is retrieved from + DRSecondary endpoint. + :type use_dr_secondary: bool """ _validation = { @@ -64,12 +67,14 @@ class SnapshotRestoreRequest(ProxyOnlyResource): 'overwrite': {'key': 'properties.overwrite', 'type': 'bool'}, 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, 'ignore_conflicting_host_names': {'key': 'properties.ignoreConflictingHostNames', 'type': 'bool'}, + 'use_dr_secondary': {'key': 'properties.useDRSecondary', 'type': 'bool'}, } - def __init__(self, *, overwrite: bool, kind: str=None, snapshot_time: str=None, recovery_source=None, recover_configuration: bool=None, ignore_conflicting_host_names: bool=None, **kwargs) -> None: + def __init__(self, *, overwrite: bool, kind: str=None, snapshot_time: str=None, recovery_source=None, recover_configuration: bool=None, ignore_conflicting_host_names: bool=None, use_dr_secondary: bool=None, **kwargs) -> None: super(SnapshotRestoreRequest, self).__init__(kind=kind, **kwargs) self.snapshot_time = snapshot_time self.recovery_source = recovery_source self.overwrite = overwrite self.recover_configuration = recover_configuration self.ignore_conflicting_host_names = ignore_conflicting_host_names + self.use_dr_secondary = use_dr_secondary diff --git a/azure-mgmt-web/azure/mgmt/web/models/stack_major_version.py b/azure-mgmt-web/azure/mgmt/web/models/stack_major_version.py index d5faa48be425..44390b4d28c6 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/stack_major_version.py +++ b/azure-mgmt-web/azure/mgmt/web/models/stack_major_version.py @@ -24,6 +24,9 @@ class StackMajorVersion(Model): :type is_default: bool :param minor_versions: Minor versions associated with the major version. :type minor_versions: list[~azure.mgmt.web.models.StackMinorVersion] + :param application_insights: true if this supports + Application Insights; otherwise, false. + :type application_insights: bool """ _attribute_map = { @@ -31,6 +34,7 @@ class StackMajorVersion(Model): 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, 'is_default': {'key': 'isDefault', 'type': 'bool'}, 'minor_versions': {'key': 'minorVersions', 'type': '[StackMinorVersion]'}, + 'application_insights': {'key': 'applicationInsights', 'type': 'bool'}, } def __init__(self, **kwargs): @@ -39,3 +43,4 @@ def __init__(self, **kwargs): self.runtime_version = kwargs.get('runtime_version', None) self.is_default = kwargs.get('is_default', None) self.minor_versions = kwargs.get('minor_versions', None) + self.application_insights = kwargs.get('application_insights', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/stack_major_version_py3.py b/azure-mgmt-web/azure/mgmt/web/models/stack_major_version_py3.py index d53e57163b0d..29563e003781 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/stack_major_version_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/stack_major_version_py3.py @@ -24,6 +24,9 @@ class StackMajorVersion(Model): :type is_default: bool :param minor_versions: Minor versions associated with the major version. :type minor_versions: list[~azure.mgmt.web.models.StackMinorVersion] + :param application_insights: true if this supports + Application Insights; otherwise, false. + :type application_insights: bool """ _attribute_map = { @@ -31,11 +34,13 @@ class StackMajorVersion(Model): 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, 'is_default': {'key': 'isDefault', 'type': 'bool'}, 'minor_versions': {'key': 'minorVersions', 'type': '[StackMinorVersion]'}, + 'application_insights': {'key': 'applicationInsights', 'type': 'bool'}, } - def __init__(self, *, display_version: str=None, runtime_version: str=None, is_default: bool=None, minor_versions=None, **kwargs) -> None: + def __init__(self, *, display_version: str=None, runtime_version: str=None, is_default: bool=None, minor_versions=None, application_insights: bool=None, **kwargs) -> None: super(StackMajorVersion, self).__init__(**kwargs) self.display_version = display_version self.runtime_version = runtime_version self.is_default = is_default self.minor_versions = minor_versions + self.application_insights = application_insights diff --git a/azure-mgmt-web/azure/mgmt/web/models/vnet_info.py b/azure-mgmt-web/azure/mgmt/web/models/vnet_info.py index 2a6527234b04..c7cca0aeb2f4 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/vnet_info.py +++ b/azure-mgmt-web/azure/mgmt/web/models/vnet_info.py @@ -42,6 +42,8 @@ class VnetInfo(ProxyOnlyResource): :param dns_servers: DNS servers to be used by this Virtual Network. This should be a comma-separated list of IP addresses. :type dns_servers: str + :param is_swift: Flag that is used to denote if this is VNET injection + :type is_swift: bool """ _validation = { @@ -64,6 +66,7 @@ class VnetInfo(ProxyOnlyResource): 'routes': {'key': 'properties.routes', 'type': '[VnetRoute]'}, 'resync_required': {'key': 'properties.resyncRequired', 'type': 'bool'}, 'dns_servers': {'key': 'properties.dnsServers', 'type': 'str'}, + 'is_swift': {'key': 'properties.isSwift', 'type': 'bool'}, } def __init__(self, **kwargs): @@ -74,3 +77,4 @@ def __init__(self, **kwargs): self.routes = None self.resync_required = None self.dns_servers = kwargs.get('dns_servers', None) + self.is_swift = kwargs.get('is_swift', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/vnet_info_py3.py b/azure-mgmt-web/azure/mgmt/web/models/vnet_info_py3.py index 2aad16e2d9dc..d60038dea1e8 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/vnet_info_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/vnet_info_py3.py @@ -42,6 +42,8 @@ class VnetInfo(ProxyOnlyResource): :param dns_servers: DNS servers to be used by this Virtual Network. This should be a comma-separated list of IP addresses. :type dns_servers: str + :param is_swift: Flag that is used to denote if this is VNET injection + :type is_swift: bool """ _validation = { @@ -64,9 +66,10 @@ class VnetInfo(ProxyOnlyResource): 'routes': {'key': 'properties.routes', 'type': '[VnetRoute]'}, 'resync_required': {'key': 'properties.resyncRequired', 'type': 'bool'}, 'dns_servers': {'key': 'properties.dnsServers', 'type': 'str'}, + 'is_swift': {'key': 'properties.isSwift', 'type': 'bool'}, } - def __init__(self, *, kind: str=None, vnet_resource_id: str=None, cert_blob: bytearray=None, dns_servers: str=None, **kwargs) -> None: + def __init__(self, *, kind: str=None, vnet_resource_id: str=None, cert_blob: bytearray=None, dns_servers: str=None, is_swift: bool=None, **kwargs) -> None: super(VnetInfo, self).__init__(kind=kind, **kwargs) self.vnet_resource_id = vnet_resource_id self.cert_thumbprint = None @@ -74,3 +77,4 @@ def __init__(self, *, kind: str=None, vnet_resource_id: str=None, cert_blob: byt self.routes = None self.resync_required = None self.dns_servers = dns_servers + self.is_swift = is_swift diff --git a/azure-mgmt-web/azure/mgmt/web/operations/web_apps_operations.py b/azure-mgmt-web/azure/mgmt/web/operations/web_apps_operations.py index 3db347f680c8..cbedc70935bc 100644 --- a/azure-mgmt-web/azure/mgmt/web/operations/web_apps_operations.py +++ b/azure-mgmt-web/azure/mgmt/web/operations/web_apps_operations.py @@ -7660,38 +7660,33 @@ def get_migrate_my_sql_status( return deserialized get_migrate_my_sql_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status'} - def list_network_features( - self, resource_group_name, name, view, custom_headers=None, raw=False, **operation_config): - """Gets all network features used by the app (or deployment slot, if - specified). + def get_swift_virtual_network_connection1( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets a Swift Virtual Network connection. - Gets all network features used by the app (or deployment slot, if - specified). + Gets a Swift Virtual Network connection. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param name: Name of the app. :type name: str - :param view: The type of view. This can either be "summary" or - "detailed". - :type view: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: NetworkFeatures or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.NetworkFeatures or + :return: SwiftVirtualNetwork or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.SwiftVirtualNetwork or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.list_network_features.metadata['url'] + url = self.get_swift_virtual_network_connection1.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), - 'view': self._serialize.url("view", view, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -7714,55 +7709,57 @@ def list_network_features( request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 404]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('NetworkFeatures', response) + deserialized = self._deserialize('SwiftVirtualNetwork', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_network_features.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}'} + get_swift_virtual_network_connection1.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} - def get_network_trace_operation( - self, resource_group_name, name, operation_id, custom_headers=None, raw=False, **operation_config): - """Gets a named operation for a network trace capturing (or deployment - slot, if specified). + def create_or_update_swift_virtual_network_connection1( + self, resource_group_name, name, connection_envelope, custom_headers=None, raw=False, **operation_config): + """Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) + that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. - Gets a named operation for a network trace capturing (or deployment - slot, if specified). + Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) + that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param name: Name of the app. :type name: str - :param operation_id: GUID of the operation. - :type operation_id: str + :param connection_envelope: Properties of the Virtual Network + connection. See example. + :type connection_envelope: ~azure.mgmt.web.models.SwiftVirtualNetwork :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: list[~azure.mgmt.web.models.NetworkTrace] or + :return: SwiftVirtualNetwork or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.SwiftVirtualNetwork or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_network_trace_operation.metadata['url'] + url = self.create_or_update_swift_virtual_network_connection1.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -7774,6 +7771,7 @@ def get_network_trace_operation( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' + 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: @@ -7781,56 +7779,52 @@ def get_network_trace_operation( 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(connection_envelope, 'SwiftVirtualNetwork') + # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 202]: + if response.status_code not in [200]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('[NetworkTrace]', response) - if response.status_code == 202: - deserialized = self._deserialize('[NetworkTrace]', response) + deserialized = self._deserialize('SwiftVirtualNetwork', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}'} + create_or_update_swift_virtual_network_connection1.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} - def start_web_site_network_trace( - self, resource_group_name, name, duration_in_seconds=None, max_frame_length=None, sas_url=None, custom_headers=None, raw=False, **operation_config): - """Start capturing network packets for the site (To be deprecated). + def delete_swift_virtual_network1( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Deletes a Swift Virtual Network connection from an app (or deployment + slot). - Start capturing network packets for the site (To be deprecated). + Deletes a Swift Virtual Network connection from an app (or deployment + slot). :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str - :param name: The name of the web app. + :param name: Name of the app. :type name: str - :param duration_in_seconds: The duration to keep capturing in seconds. - :type duration_in_seconds: int - :param max_frame_length: The maximum frame length in bytes (Optional). - :type max_frame_length: int - :param sas_url: The Blob URL to store capture file. - :type sas_url: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` """ # Construct URL - url = self.start_web_site_network_trace.metadata['url'] + url = self.delete_swift_virtual_network1.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), @@ -7840,17 +7834,10 @@ def start_web_site_network_trace( # Construct parameters query_parameters = {} - if duration_in_seconds is not None: - query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') - if max_frame_length is not None: - query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') - if sas_url is not None: - query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -7859,29 +7846,52 @@ def start_web_site_network_trace( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('str', response) + if response.status_code not in [200, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete_swift_virtual_network1.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} - return deserialized - start_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start'} + def update_swift_virtual_network_connection1( + self, resource_group_name, name, connection_envelope, custom_headers=None, raw=False, **operation_config): + """Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) + that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) + that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. - def _start_web_site_network_trace_operation_initial( - self, resource_group_name, name, duration_in_seconds=None, max_frame_length=None, sas_url=None, custom_headers=None, raw=False, **operation_config): + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_envelope: Properties of the Virtual Network + connection. See example. + :type connection_envelope: ~azure.mgmt.web.models.SwiftVirtualNetwork + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SwiftVirtualNetwork or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.SwiftVirtualNetwork or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ # Construct URL - url = self.start_web_site_network_trace_operation.metadata['url'] + url = self.update_swift_virtual_network_connection1.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), @@ -7891,17 +7901,12 @@ def _start_web_site_network_trace_operation_initial( # Construct parameters query_parameters = {} - if duration_in_seconds is not None: - query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') - if max_frame_length is not None: - query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') - if sas_url is not None: - query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' + 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: @@ -7909,111 +7914,60 @@ def _start_web_site_network_trace_operation_initial( 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(connection_envelope, 'SwiftVirtualNetwork') + # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 202]: + if response.status_code not in [200]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('[NetworkTrace]', response) - if response.status_code == 202: - deserialized = self._deserialize('[NetworkTrace]', response) + deserialized = self._deserialize('SwiftVirtualNetwork', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized + update_swift_virtual_network_connection1.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} - def start_web_site_network_trace_operation( - self, resource_group_name, name, duration_in_seconds=None, max_frame_length=None, sas_url=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Start capturing network packets for the site. - - Start capturing network packets for the site. - - :param resource_group_name: Name of the resource group to which the - resource belongs. - :type resource_group_name: str - :param name: The name of the web app. - :type name: str - :param duration_in_seconds: The duration to keep capturing in seconds. - :type duration_in_seconds: int - :param max_frame_length: The maximum frame length in bytes (Optional). - :type max_frame_length: int - :param sas_url: The Blob URL to store capture file. - :type sas_url: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns list or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[list[~azure.mgmt.web.models.NetworkTrace]] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[list[~azure.mgmt.web.models.NetworkTrace]]] - :raises: - :class:`DefaultErrorResponseException` - """ - raw_result = self._start_web_site_network_trace_operation_initial( - resource_group_name=resource_group_name, - name=name, - duration_in_seconds=duration_in_seconds, - max_frame_length=max_frame_length, - sas_url=sas_url, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('[NetworkTrace]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - start_web_site_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation'} - - def stop_web_site_network_trace( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Stop ongoing capturing network packets for the site. + def list_network_features( + self, resource_group_name, name, view, custom_headers=None, raw=False, **operation_config): + """Gets all network features used by the app (or deployment slot, if + specified). - Stop ongoing capturing network packets for the site. + Gets all network features used by the app (or deployment slot, if + specified). :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str - :param name: The name of the web app. + :param name: Name of the app. :type name: str + :param view: The type of view. This can either be "summary" or + "detailed". + :type view: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: NetworkFeatures or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.NetworkFeatures or + ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.stop_web_site_network_trace.metadata['url'] + url = self.list_network_features.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), + 'view': self._serialize.url("view", view, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -8024,6 +7978,7 @@ def stop_web_site_network_trace( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -8032,20 +7987,27 @@ def stop_web_site_network_trace( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 204]: + if response.status_code not in [200, 404]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp - if raw: - client_raw_response = ClientRawResponse(None, response) + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NetworkFeatures', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - stop_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop'} - def get_network_traces( + return deserialized + list_network_features.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}'} + + def get_network_trace_operation( self, resource_group_name, name, operation_id, custom_headers=None, raw=False, **operation_config): """Gets a named operation for a network trace capturing (or deployment slot, if specified). @@ -8072,7 +8034,7 @@ def get_network_traces( :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_network_traces.metadata['url'] + url = self.get_network_trace_operation.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), @@ -8099,59 +8061,67 @@ def get_network_traces( request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: deserialized = self._deserialize('[NetworkTrace]', response) + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_network_traces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}'} + get_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}'} - def get_network_trace_operation_v2( - self, resource_group_name, name, operation_id, custom_headers=None, raw=False, **operation_config): - """Gets a named operation for a network trace capturing (or deployment - slot, if specified). + def start_web_site_network_trace( + self, resource_group_name, name, duration_in_seconds=None, max_frame_length=None, sas_url=None, custom_headers=None, raw=False, **operation_config): + """Start capturing network packets for the site (To be deprecated). - Gets a named operation for a network trace capturing (or deployment - slot, if specified). + Start capturing network packets for the site (To be deprecated). :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str - :param name: Name of the app. + :param name: The name of the web app. :type name: str - :param operation_id: GUID of the operation. - :type operation_id: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: list[~azure.mgmt.web.models.NetworkTrace] or - ~msrest.pipeline.ClientRawResponse + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_network_trace_operation_v2.metadata['url'] + url = self.start_web_site_network_trace.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), '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 = {} + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers @@ -8165,64 +8135,44 @@ def get_network_trace_operation_v2( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 202]: + if response.status_code not in [200]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('[NetworkTrace]', response) - if response.status_code == 202: - deserialized = self._deserialize('[NetworkTrace]', response) + deserialized = self._deserialize('str', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_network_trace_operation_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}'} - - def get_network_traces_v2( - self, resource_group_name, name, operation_id, custom_headers=None, raw=False, **operation_config): - """Gets a named operation for a network trace capturing (or deployment - slot, if specified). + start_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start'} - Gets a named operation for a network trace capturing (or deployment - slot, if specified). - :param resource_group_name: Name of the resource group to which the - resource belongs. - :type resource_group_name: str - :param name: Name of the app. - :type name: str - :param operation_id: GUID of the operation. - :type operation_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: list[~azure.mgmt.web.models.NetworkTrace] or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` - """ + def _start_web_site_network_trace_operation_initial( + self, resource_group_name, name, duration_in_seconds=None, max_frame_length=None, sas_url=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.get_network_traces_v2.metadata['url'] + url = self.start_web_site_network_trace_operation.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), '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 = {} + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers @@ -8236,36 +8186,95 @@ def get_network_traces_v2( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: deserialized = self._deserialize('[NetworkTrace]', response) + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_network_traces_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}'} - def generate_new_site_publishing_password( + def start_web_site_network_trace_operation( + self, resource_group_name, name, duration_in_seconds=None, max_frame_length=None, sas_url=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Start capturing network packets for the site. + + Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns list or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[list[~azure.mgmt.web.models.NetworkTrace]] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[list[~azure.mgmt.web.models.NetworkTrace]]] + :raises: + :class:`DefaultErrorResponseException` + """ + raw_result = self._start_web_site_network_trace_operation_initial( + resource_group_name=resource_group_name, + name=name, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('[NetworkTrace]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start_web_site_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation'} + + def stop_web_site_network_trace( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Generates a new publishing password for an app (or deployment slot, if - specified). + """Stop ongoing capturing network packets for the site. - Generates a new publishing password for an app (or deployment slot, if - specified). + Stop ongoing capturing network packets for the site. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str - :param name: Name of the app. + :param name: The name of the web app. :type name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -8277,7 +8286,7 @@ def generate_new_site_publishing_password( :raises: :class:`CloudError` """ # Construct URL - url = self.generate_new_site_publishing_password.metadata['url'] + url = self.stop_web_site_network_trace.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), @@ -8310,114 +8319,109 @@ def generate_new_site_publishing_password( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - generate_new_site_publishing_password.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword'} + stop_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop'} - def list_perf_mon_counters( - self, resource_group_name, name, filter=None, custom_headers=None, raw=False, **operation_config): - """Gets perfmon counters for web app. + def get_network_traces( + self, resource_group_name, name, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets a named operation for a network trace capturing (or deployment + slot, if specified). - Gets perfmon counters for web app. + Gets a named operation for a network trace capturing (or deployment + slot, if specified). :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str - :param name: Name of web app. + :param name: Name of the app. :type name: str - :param filter: Return only usages/metrics specified in the filter. - Filter conforms to odata syntax. Example: $filter=(startTime eq - 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain - eq duration'[Hour|Minute|Day]'. - :type filter: str + :param operation_id: GUID of the operation. + :type operation_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of PerfMonResponse - :rtype: - ~azure.mgmt.web.models.PerfMonResponsePaged[~azure.mgmt.web.models.PerfMonResponse] + :return: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.web.models.NetworkTrace] or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ - def internal_paging(next_link=None, raw=False): + # Construct URL + url = self.get_network_traces.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) - if not next_link: - # Construct URL - url = self.list_perf_mon_counters.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), - 'name': self._serialize.url("name", name, 'str'), - '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.api_version", self.api_version, 'str') - # Construct parameters - query_parameters = {} - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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') - else: - url = next_link - query_parameters = {} + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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 and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.DefaultErrorResponseException(self._deserialize, response) + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) - return response + deserialized = None - # Deserialize response - deserialized = models.PerfMonResponsePaged(internal_paging, self._deserialize.dependencies) + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', response) if raw: - header_dict = {} - client_raw_response = models.PerfMonResponsePaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_perf_mon_counters.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters'} + get_network_traces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}'} - def get_site_php_error_log_flag( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Gets web app's event logs. + def get_network_trace_operation_v2( + self, resource_group_name, name, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets a named operation for a network trace capturing (or deployment + slot, if specified). - Gets web app's event logs. + Gets a named operation for a network trace capturing (or deployment + slot, if specified). :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str - :param name: Name of web app. + :param name: Name of the app. :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: SitePhpErrorLogFlag or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.SitePhpErrorLogFlag or + :return: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.web.models.NetworkTrace] or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_site_php_error_log_flag.metadata['url'] + url = self.get_network_trace_operation_v2.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -8440,48 +8444,55 @@ def get_site_php_error_log_flag( request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SitePhpErrorLogFlag', response) + deserialized = self._deserialize('[NetworkTrace]', response) + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_site_php_error_log_flag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging'} + get_network_trace_operation_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}'} - def list_premier_add_ons( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Gets the premier add-ons of an app. + def get_network_traces_v2( + self, resource_group_name, name, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets a named operation for a network trace capturing (or deployment + slot, if specified). - Gets the premier add-ons of an app. + Gets a named operation for a network trace capturing (or deployment + slot, if specified). :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param name: Name of the app. :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: PremierAddOn or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.PremierAddOn or + :return: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.web.models.NetworkTrace] or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.list_premier_add_ons.metadata['url'] + url = self.get_network_traces_v2.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -8510,45 +8521,42 @@ def list_premier_add_ons( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('PremierAddOn', response) + deserialized = self._deserialize('[NetworkTrace]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_premier_add_ons.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons'} + get_network_traces_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}'} - def get_premier_add_on( - self, resource_group_name, name, premier_add_on_name, custom_headers=None, raw=False, **operation_config): - """Gets a named add-on of an app. + def generate_new_site_publishing_password( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Generates a new publishing password for an app (or deployment slot, if + specified). - Gets a named add-on of an app. + Generates a new publishing password for an app (or deployment slot, if + specified). :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param name: Name of the app. :type name: str - :param premier_add_on_name: Add-on name. - :type premier_add_on_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: PremierAddOn or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.PremierAddOn or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` """ # Construct URL - url = self.get_premier_add_on.metadata['url'] + url = self.generate_new_site_publishing_password.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), - 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -8559,7 +8567,6 @@ def get_premier_add_on( # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -8568,57 +8575,125 @@ def get_premier_add_on( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: - raise models.DefaultErrorResponseException(self._deserialize, response) + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - deserialized = None + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + generate_new_site_publishing_password.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword'} - if response.status_code == 200: - deserialized = self._deserialize('PremierAddOn', response) + def list_perf_mon_counters( + self, resource_group_name, name, filter=None, custom_headers=None, raw=False, **operation_config): + """Gets perfmon counters for web app. + + Gets perfmon counters for web app. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param filter: Return only usages/metrics specified in the filter. + Filter conforms to odata syntax. Example: $filter=(startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain + eq duration'[Hour|Minute|Day]'. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PerfMonResponse + :rtype: + ~azure.mgmt.web.models.PerfMonResponsePaged[~azure.mgmt.web.models.PerfMonResponse] + :raises: + :class:`DefaultErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_perf_mon_counters.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + '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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.PerfMonResponsePaged(internal_paging, self._deserialize.dependencies) if raw: - client_raw_response = ClientRawResponse(deserialized, response) + header_dict = {} + client_raw_response = models.PerfMonResponsePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - get_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} + list_perf_mon_counters.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters'} - def add_premier_add_on( - self, resource_group_name, name, premier_add_on_name, premier_add_on, custom_headers=None, raw=False, **operation_config): - """Updates a named add-on of an app. + def get_site_php_error_log_flag( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets web app's event logs. - Updates a named add-on of an app. + Gets web app's event logs. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str - :param name: Name of the app. + :param name: Name of web app. :type name: str - :param premier_add_on_name: Add-on name. - :type premier_add_on_name: str - :param premier_add_on: A JSON representation of the edited premier - add-on. - :type premier_add_on: ~azure.mgmt.web.models.PremierAddOn :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: PremierAddOn or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.PremierAddOn or + :return: SitePhpErrorLogFlag or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.SitePhpErrorLogFlag or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.add_premier_add_on.metadata['url'] + url = self.get_site_php_error_log_flag.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), - 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -8630,7 +8705,6 @@ def add_premier_add_on( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' - 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: @@ -8638,11 +8712,8 @@ def add_premier_add_on( 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(premier_add_on, 'PremierAddOn') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -8651,43 +8722,42 @@ def add_premier_add_on( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('PremierAddOn', response) + deserialized = self._deserialize('SitePhpErrorLogFlag', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - add_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} + get_site_php_error_log_flag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging'} - def delete_premier_add_on( - self, resource_group_name, name, premier_add_on_name, custom_headers=None, raw=False, **operation_config): - """Delete a premier add-on from an app. + def list_premier_add_ons( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets the premier add-ons of an app. - Delete a premier add-on from an app. + Gets the premier add-ons of an app. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param name: Name of the app. :type name: str - :param premier_add_on_name: Add-on name. - :type premier_add_on_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :return: PremierAddOn or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.PremierAddOn or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_premier_add_on.metadata['url'] + url = self.list_premier_add_ons.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), - 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -8698,6 +8768,7 @@ def delete_premier_add_on( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -8706,16 +8777,221 @@ def delete_premier_add_on( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PremierAddOn', response) if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_premier_add_ons.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons'} + + def get_premier_add_on( + self, resource_group_name, name, premier_add_on_name, custom_headers=None, raw=False, **operation_config): + """Gets a named add-on of an app. + + Gets a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PremierAddOn or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.PremierAddOn or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.get_premier_add_on.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + '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.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PremierAddOn', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} + + def add_premier_add_on( + self, resource_group_name, name, premier_add_on_name, premier_add_on, custom_headers=None, raw=False, **operation_config): + """Updates a named add-on of an app. + + Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param premier_add_on: A JSON representation of the edited premier + add-on. + :type premier_add_on: ~azure.mgmt.web.models.PremierAddOn + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PremierAddOn or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.PremierAddOn or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.add_premier_add_on.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + '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.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(premier_add_on, 'PremierAddOn') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PremierAddOn', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} + + def delete_premier_add_on( + self, resource_group_name, name, premier_add_on_name, custom_headers=None, raw=False, **operation_config): + """Delete a premier add-on from an app. + + Delete a premier add-on from an app. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete_premier_add_on.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + '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.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) return client_raw_response delete_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} @@ -17631,57 +17907,446 @@ def get_instance_process_module_slot( return client_raw_response return deserialized - get_instance_process_module_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'} + get_instance_process_module_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'} + + def list_instance_process_threads_slot( + self, resource_group_name, name, process_id, slot, instance_id, custom_headers=None, raw=False, **operation_config): + """List the threads in a process by its ID for a specific scaled-out + instance in a web site. + + List the threads in a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, + the API returns deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the + value of the name property in the JSON response from "GET + api/sites/{siteName}/instances". + :type instance_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ProcessThreadInfo + :rtype: + ~azure.mgmt.web.models.ProcessThreadInfoPaged[~azure.mgmt.web.models.ProcessThreadInfo] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_instance_process_threads_slot.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ProcessThreadInfoPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ProcessThreadInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_instance_process_threads_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads'} + + def get_instance_process_thread_slot( + self, resource_group_name, name, process_id, thread_id, slot, instance_id, custom_headers=None, raw=False, **operation_config): + """Get thread information by Thread ID for a specific process, in a + specific scaled-out instance in a web site. + + Get thread information by Thread ID for a specific process, in a + specific scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param thread_id: TID. + :type thread_id: str + :param slot: Name of the deployment slot. If a slot is not specified, + the API returns deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the + value of the name property in the JSON response from "GET + api/sites/{siteName}/instances". + :type instance_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ProcessThreadInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.ProcessThreadInfo or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_instance_process_thread_slot.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'threadId': self._serialize.url("thread_id", thread_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + 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('ProcessThreadInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_instance_process_thread_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads/{threadId}'} + + def is_cloneable_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Shows whether an app can be cloned to another resource group or + subscription. + + Shows whether an app can be cloned to another resource group or + subscription. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. By default, this API returns + information on the production slot. + :type slot: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SiteCloneability or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.SiteCloneability or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.is_cloneable_slot.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + '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.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SiteCloneability', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + is_cloneable_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable'} + + def list_sync_function_triggers_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """This is to allow calling via powershell and ARM template. + + This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, + the API will restore a backup of the production slot. + :type slot: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: FunctionSecrets or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.FunctionSecrets or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.list_sync_function_triggers_slot.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + '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.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('FunctionSecrets', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_sync_function_triggers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus'} + + def list_metric_definitions_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Gets all metric definitions of an app (or deployment slot, if + specified). + + Gets all metric definitions of an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, + the API will get metric definitions of the production slot. + :type slot: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ResourceMetricDefinition + :rtype: + ~azure.mgmt.web.models.ResourceMetricDefinitionPaged[~azure.mgmt.web.models.ResourceMetricDefinition] + :raises: + :class:`DefaultErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_metric_definitions_slot.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + '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.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ResourceMetricDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ResourceMetricDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_metric_definitions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metricdefinitions'} - def list_instance_process_threads_slot( - self, resource_group_name, name, process_id, slot, instance_id, custom_headers=None, raw=False, **operation_config): - """List the threads in a process by its ID for a specific scaled-out - instance in a web site. + def list_metrics_slot( + self, resource_group_name, name, slot, details=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Gets performance metrics of an app (or deployment slot, if specified). - List the threads in a process by its ID for a specific scaled-out - instance in a web site. + Gets performance metrics of an app (or deployment slot, if specified). :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str - :param name: Site name. + :param name: Name of the app. :type name: str - :param process_id: PID. - :type process_id: str :param slot: Name of the deployment slot. If a slot is not specified, - the API returns deployments for the production slot. + the API will get metrics of the production slot. :type slot: str - :param instance_id: ID of a specific scaled-out instance. This is the - value of the name property in the JSON response from "GET - api/sites/{siteName}/instances". - :type instance_id: str + :param details: Specify "true" to include metric details in the + response. It is "false" by default. + :type details: bool + :param filter: Return only metrics specified in the filter (using + OData syntax). For example: $filter=(name.value eq 'Metric1' or + name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and + endTime eq 2014-12-31T23:59:59Z and timeGrain eq + duration'[Hour|Minute|Day]'. + :type filter: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of ProcessThreadInfo + :return: An iterator like instance of ResourceMetric :rtype: - ~azure.mgmt.web.models.ProcessThreadInfoPaged[~azure.mgmt.web.models.ProcessThreadInfo] - :raises: :class:`CloudError` + ~azure.mgmt.web.models.ResourceMetricPaged[~azure.mgmt.web.models.ResourceMetric] + :raises: + :class:`DefaultErrorResponseException` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = self.list_instance_process_threads_slot.metadata['url'] + url = self.list_metrics_slot.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), - 'processId': self._serialize.url("process_id", process_id, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), - 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), '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 = {} + if details is not None: + query_parameters['details'] = self._serialize.query("details", details, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: @@ -17702,67 +18367,54 @@ def internal_paging(next_link=None, raw=False): request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 404]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) return response # Deserialize response - deserialized = models.ProcessThreadInfoPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.ResourceMetricPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.ProcessThreadInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.ResourceMetricPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_instance_process_threads_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads'} + list_metrics_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metrics'} - def get_instance_process_thread_slot( - self, resource_group_name, name, process_id, thread_id, slot, instance_id, custom_headers=None, raw=False, **operation_config): - """Get thread information by Thread ID for a specific process, in a - specific scaled-out instance in a web site. + def get_migrate_my_sql_status_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Returns the status of MySql in app migration, if one is active, and + whether or not MySql in app is enabled. - Get thread information by Thread ID for a specific process, in a - specific scaled-out instance in a web site. + Returns the status of MySql in app migration, if one is active, and + whether or not MySql in app is enabled. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str - :param name: Site name. + :param name: Name of web app. :type name: str - :param process_id: PID. - :type process_id: str - :param thread_id: TID. - :type thread_id: str - :param slot: Name of the deployment slot. If a slot is not specified, - the API returns deployments for the production slot. + :param slot: Name of the deployment slot. :type slot: str - :param instance_id: ID of a specific scaled-out instance. This is the - value of the name property in the JSON response from "GET - api/sites/{siteName}/instances". - :type instance_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: ProcessThreadInfo or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.ProcessThreadInfo or + :return: MigrateMySqlStatus or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.MigrateMySqlStatus or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_instance_process_thread_slot.metadata['url'] + url = self.get_migrate_my_sql_status_slot.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), - 'processId': self._serialize.url("process_id", process_id, 'str'), - 'threadId': self._serialize.url("thread_id", thread_id, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), - 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -17785,52 +18437,48 @@ def get_instance_process_thread_slot( request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 404]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ProcessThreadInfo', response) + deserialized = self._deserialize('MigrateMySqlStatus', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_instance_process_thread_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads/{threadId}'} + get_migrate_my_sql_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status'} - def is_cloneable_slot( + def get_swift_virtual_network_connection_slot1( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Shows whether an app can be cloned to another resource group or - subscription. + """Gets a Swift Virtual Network connection. - Shows whether an app can be cloned to another resource group or - subscription. + Gets a Swift Virtual Network connection. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param name: Name of the app. :type name: str - :param slot: Name of the deployment slot. By default, this API returns - information on the production slot. + :param slot: Name of the deployment slot. If a slot is not specified, + the API will get a gateway for the production slot's Virtual Network. :type slot: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: SiteCloneability or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.SiteCloneability or + :return: SwiftVirtualNetwork or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.SwiftVirtualNetwork or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.is_cloneable_slot.metadata['url'] + url = self.get_swift_virtual_network_connection_slot1.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), @@ -17854,7 +18502,7 @@ def is_cloneable_slot( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -17863,42 +18511,51 @@ def is_cloneable_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SiteCloneability', response) + deserialized = self._deserialize('SwiftVirtualNetwork', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - is_cloneable_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable'} + get_swift_virtual_network_connection_slot1.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} - def list_sync_function_triggers_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """This is to allow calling via powershell and ARM template. + def create_or_update_swift_virtual_network_connection_slot1( + self, resource_group_name, name, connection_envelope, slot, custom_headers=None, raw=False, **operation_config): + """Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) + that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. - This is to allow calling via powershell and ARM template. + Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) + that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param name: Name of the app. :type name: str + :param connection_envelope: Properties of the Virtual Network + connection. See example. + :type connection_envelope: ~azure.mgmt.web.models.SwiftVirtualNetwork :param slot: Name of the deployment slot. If a slot is not specified, - the API will restore a backup of the production slot. + the API will add or update connections for the production slot. :type slot: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: FunctionSecrets or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.FunctionSecrets or + :return: SwiftVirtualNetwork or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.SwiftVirtualNetwork or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.list_sync_function_triggers_slot.metadata['url'] + url = self.create_or_update_swift_virtual_network_connection_slot1.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), @@ -17914,6 +18571,7 @@ def list_sync_function_triggers_slot( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' + 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: @@ -17921,8 +18579,11 @@ def list_sync_function_triggers_slot( 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(connection_envelope, 'SwiftVirtualNetwork') + # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -17931,98 +18592,22 @@ def list_sync_function_triggers_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('FunctionSecrets', response) + deserialized = self._deserialize('SwiftVirtualNetwork', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_sync_function_triggers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus'} + create_or_update_swift_virtual_network_connection_slot1.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} - def list_metric_definitions_slot( + def delete_swift_virtual_network_slot1( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Gets all metric definitions of an app (or deployment slot, if - specified). - - Gets all metric definitions of an app (or deployment slot, if - specified). - - :param resource_group_name: Name of the resource group to which the - resource belongs. - :type resource_group_name: str - :param name: Name of the app. - :type name: str - :param slot: Name of the deployment slot. If a slot is not specified, - the API will get metric definitions of the production slot. - :type slot: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ResourceMetricDefinition - :rtype: - ~azure.mgmt.web.models.ResourceMetricDefinitionPaged[~azure.mgmt.web.models.ResourceMetricDefinition] - :raises: - :class:`DefaultErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_metric_definitions_slot.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), - 'name': self._serialize.url("name", name, 'str'), - 'slot': self._serialize.url("slot", slot, 'str'), - '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.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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 and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.ResourceMetricDefinitionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ResourceMetricDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_metric_definitions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metricdefinitions'} - - def list_metrics_slot( - self, resource_group_name, name, slot, details=None, filter=None, custom_headers=None, raw=False, **operation_config): - """Gets performance metrics of an app (or deployment slot, if specified). + """Deletes a Swift Virtual Network connection from an app (or deployment + slot). - Gets performance metrics of an app (or deployment slot, if specified). + Deletes a Swift Virtual Network connection from an app (or deployment + slot). :param resource_group_name: Name of the resource group to which the resource belongs. @@ -18030,111 +18615,90 @@ def list_metrics_slot( :param name: Name of the app. :type name: str :param slot: Name of the deployment slot. If a slot is not specified, - the API will get metrics of the production slot. + the API will delete the connection for the production slot. :type slot: str - :param details: Specify "true" to include metric details in the - response. It is "false" by default. - :type details: bool - :param filter: Return only metrics specified in the filter (using - OData syntax). For example: $filter=(name.value eq 'Metric1' or - name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - endTime eq 2014-12-31T23:59:59Z and timeGrain eq - duration'[Hour|Minute|Day]'. - :type filter: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of ResourceMetric - :rtype: - ~azure.mgmt.web.models.ResourceMetricPaged[~azure.mgmt.web.models.ResourceMetric] - :raises: - :class:`DefaultErrorResponseException` + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_metrics_slot.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), - 'name': self._serialize.url("name", name, 'str'), - 'slot': self._serialize.url("slot", slot, 'str'), - '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 = {} - if details is not None: - query_parameters['details'] = self._serialize.query("details", details, 'bool') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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 URL + url = self.delete_swift_virtual_network_slot1.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if response.status_code not in [200]: - raise models.DefaultErrorResponseException(self._deserialize, response) + # Construct headers + header_parameters = {} + 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') - return response + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) - # Deserialize response - deserialized = models.ResourceMetricPaged(internal_paging, self._deserialize.dependencies) + if response.status_code not in [200, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp if raw: - header_dict = {} - client_raw_response = models.ResourceMetricPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete_swift_virtual_network_slot1.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} - return deserialized - list_metrics_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metrics'} - - def get_migrate_my_sql_status_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Returns the status of MySql in app migration, if one is active, and - whether or not MySql in app is enabled. + def update_swift_virtual_network_connection_slot1( + self, resource_group_name, name, connection_envelope, slot, custom_headers=None, raw=False, **operation_config): + """Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) + that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. - Returns the status of MySql in app migration, if one is active, and - whether or not MySql in app is enabled. + Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) + that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str - :param name: Name of web app. + :param name: Name of the app. :type name: str - :param slot: Name of the deployment slot. + :param connection_envelope: Properties of the Virtual Network + connection. See example. + :type connection_envelope: ~azure.mgmt.web.models.SwiftVirtualNetwork + :param slot: Name of the deployment slot. If a slot is not specified, + the API will add or update connections for the production slot. :type slot: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: MigrateMySqlStatus or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.MigrateMySqlStatus or + :return: SwiftVirtualNetwork or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.SwiftVirtualNetwork or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_migrate_my_sql_status_slot.metadata['url'] + url = self.update_swift_virtual_network_connection_slot1.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), @@ -18150,6 +18714,7 @@ def get_migrate_my_sql_status_slot( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' + 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: @@ -18157,8 +18722,11 @@ def get_migrate_my_sql_status_slot( 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(connection_envelope, 'SwiftVirtualNetwork') + # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -18167,14 +18735,14 @@ def get_migrate_my_sql_status_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('MigrateMySqlStatus', response) + deserialized = self._deserialize('SwiftVirtualNetwork', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_migrate_my_sql_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status'} + update_swift_virtual_network_connection_slot1.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} def list_network_features_slot( self, resource_group_name, name, view, slot, custom_headers=None, raw=False, **operation_config): @@ -21508,6 +22076,81 @@ def internal_paging(next_link=None, raw=False): return deserialized list_snapshots_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots'} + def list_snapshots_from_dr_secondary_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Returns all Snapshots to the user from DRSecondary endpoint. + + Returns all Snapshots to the user from DRSecondary endpoint. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :param slot: Website Slot. + :type slot: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Snapshot + :rtype: + ~azure.mgmt.web.models.SnapshotPaged[~azure.mgmt.web.models.Snapshot] + :raises: + :class:`DefaultErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_snapshots_from_dr_secondary_slot.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + '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.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.SnapshotPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SnapshotPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_snapshots_from_dr_secondary_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshotsdr'} + def get_source_control_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): """Gets the source control configuration of an app. @@ -23776,6 +24419,78 @@ def internal_paging(next_link=None, raw=False): return deserialized list_snapshots.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots'} + def list_snapshots_from_dr_secondary( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Returns all Snapshots to the user from DRSecondary endpoint. + + Returns all Snapshots to the user from DRSecondary endpoint. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Snapshot + :rtype: + ~azure.mgmt.web.models.SnapshotPaged[~azure.mgmt.web.models.Snapshot] + :raises: + :class:`DefaultErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_snapshots_from_dr_secondary.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + '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.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.SnapshotPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SnapshotPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_snapshots_from_dr_secondary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshotsdr'} + def get_source_control( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): """Gets the source control configuration of an app.