diff --git a/azure-mgmt-web/HISTORY.rst b/azure-mgmt-web/HISTORY.rst index 481f24e65132..82042967c769 100644 --- a/azure-mgmt-web/HISTORY.rst +++ b/azure-mgmt-web/HISTORY.rst @@ -3,6 +3,64 @@ Release History =============== +0.41.0 (2019-02-13) ++++++++++++++++++++ + +**Features** + +- Model DeletedAppRestoreRequest has a new parameter use_dr_secondary +- Model StackMinorVersion has a new parameter is_remote_debugging_enabled +- Model IpSecurityRestriction has a new parameter subnet_traffic_tag +- Model IpSecurityRestriction has a new parameter vnet_traffic_tag +- Model IpSecurityRestriction has a new parameter vnet_subnet_resource_id +- Model DeletedSite has a new parameter geo_region_name +- Model SnapshotRestoreRequest has a new parameter use_dr_secondary +- Model SiteAuthSettings has a new parameter client_secret_certificate_thumbprint +- Model SiteConfig has a new parameter scm_ip_security_restrictions_use_main +- Model SiteConfig has a new parameter scm_ip_security_restrictions +- Model CorsSettings has a new parameter support_credentials +- Model SiteConfigResource has a new parameter scm_ip_security_restrictions_use_main +- Model SiteConfigResource has a new parameter scm_ip_security_restrictions +- Model StackMajorVersion has a new parameter application_insights +- Model AppServicePlanPatchResource has a new parameter maximum_elastic_worker_count +- Model AppServicePlan has a new parameter maximum_elastic_worker_count +- Model SitePatchResource has a new parameter geo_distributions +- Model SitePatchResource has a new parameter in_progress_operation_id +- Model SitePatchResource has a new parameter client_cert_exclusion_paths +- Model SitePatchResource has a new parameter redundancy_mode +- Model Site has a new parameter geo_distributions +- Model Site has a new parameter in_progress_operation_id +- Model Site has a new parameter client_cert_exclusion_paths +- Model Site has a new parameter redundancy_mode +- Model VnetInfo has a new parameter is_swift +- Added operation WebAppsOperations.get_network_traces_slot_v2 +- Added operation WebAppsOperations.list_snapshots_from_dr_secondary_slot +- Added operation WebAppsOperations.get_network_traces_slot +- Added operation WebAppsOperations.start_web_site_network_trace_operation_slot +- Added operation WebAppsOperations.get_network_trace_operation_v2 +- Added operation WebAppsOperations.start_web_site_network_trace_operation +- Added operation WebAppsOperations.get_network_traces_v2 +- Added operation WebAppsOperations.stop_network_trace_slot +- Added operation WebAppsOperations.get_network_trace_operation_slot_v2 +- Added operation WebAppsOperations.list_snapshots_from_dr_secondary +- Added operation WebAppsOperations.get_network_trace_operation_slot +- Added operation WebAppsOperations.stop_network_trace +- Added operation WebAppsOperations.start_network_trace_slot +- Added operation WebAppsOperations.get_network_trace_operation +- Added operation WebAppsOperations.start_network_trace +- Added operation WebAppsOperations.get_network_traces +- Added operation RecommendationsOperations.list_recommended_rules_for_hosting_environment +- Added operation RecommendationsOperations.list_history_for_hosting_environment +- Added operation RecommendationsOperations.disable_all_for_hosting_environment +- Added operation RecommendationsOperations.disable_recommendation_for_hosting_environment +- Added operation RecommendationsOperations.reset_all_filters_for_hosting_environment +- Added operation RecommendationsOperations.get_rule_details_by_hosting_environment + +**Breaking changes** + +- Model AppServicePlanPatchResource no longer has parameter admin_site_name +- Model AppServicePlan no longer has parameter admin_site_name + 0.40.0 (2018-08-28) +++++++++++++++++++ diff --git a/azure-mgmt-web/README.rst b/azure-mgmt-web/README.rst index 68611479f5c6..7de70a613af5 100644 --- a/azure-mgmt-web/README.rst +++ b/azure-mgmt-web/README.rst @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see For a more complete set of Azure libraries, see the `azure `__ bundle package. -Compatibility -============= - -**IMPORTANT**: If you have an earlier version of the azure package -(version < 1.0), you should uninstall it before installing this package. - -You can check the version using pip: - -.. code:: shell - - pip freeze - -If you see azure==0.11.0 (or any version below 1.0), uninstall it first: - -.. code:: shell - - pip uninstall azure - - Usage ===== diff --git a/azure-mgmt-web/azure/mgmt/web/models/__init__.py b/azure-mgmt-web/azure/mgmt/web/models/__init__.py index 25af3a3d7bbe..45200dfe9a17 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/__init__.py +++ b/azure-mgmt-web/azure/mgmt/web/models/__init__.py @@ -36,6 +36,7 @@ from .deleted_site_py3 import DeletedSite from .proxy_only_resource_py3 import ProxyOnlyResource from .managed_service_identity_py3 import ManagedServiceIdentity + from .geo_distribution_py3 import GeoDistribution from .slot_swap_status_py3 import SlotSwapStatus from .cloning_info_py3 import CloningInfo from .hosting_environment_profile_py3 import HostingEnvironmentProfile @@ -144,6 +145,7 @@ from .resource_name_availability_request_py3 import ResourceNameAvailabilityRequest from .sku_infos_py3 import SkuInfos from .source_control_py3 import SourceControl + from .validate_container_settings_request_py3 import ValidateContainerSettingsRequest from .validate_request_py3 import ValidateRequest from .validate_response_error_py3 import ValidateResponseError from .validate_response_py3 import ValidateResponse @@ -182,6 +184,7 @@ from .migrate_my_sql_status_py3 import MigrateMySqlStatus from .relay_service_connection_entity_py3 import RelayServiceConnectionEntity from .network_features_py3 import NetworkFeatures + from .network_trace_py3 import NetworkTrace from .perf_mon_sample_py3 import PerfMonSample from .perf_mon_set_py3 import PerfMonSet from .perf_mon_response_py3 import PerfMonResponse @@ -257,6 +260,7 @@ from .deleted_site import DeletedSite from .proxy_only_resource import ProxyOnlyResource from .managed_service_identity import ManagedServiceIdentity + from .geo_distribution import GeoDistribution from .slot_swap_status import SlotSwapStatus from .cloning_info import CloningInfo from .hosting_environment_profile import HostingEnvironmentProfile @@ -365,6 +369,7 @@ from .resource_name_availability_request import ResourceNameAvailabilityRequest from .sku_infos import SkuInfos from .source_control import SourceControl + from .validate_container_settings_request import ValidateContainerSettingsRequest from .validate_request import ValidateRequest from .validate_response_error import ValidateResponseError from .validate_response import ValidateResponse @@ -403,6 +408,7 @@ from .migrate_my_sql_status import MigrateMySqlStatus from .relay_service_connection_entity import RelayServiceConnectionEntity from .network_features import NetworkFeatures + from .network_trace import NetworkTrace from .perf_mon_sample import PerfMonSample from .perf_mon_set import PerfMonSet from .perf_mon_response import PerfMonResponse @@ -526,6 +532,7 @@ HostType, UsageState, SiteAvailabilityState, + RedundancyMode, StatusOptions, DomainStatus, AzureResourceType, @@ -597,6 +604,7 @@ 'DeletedSite', 'ProxyOnlyResource', 'ManagedServiceIdentity', + 'GeoDistribution', 'SlotSwapStatus', 'CloningInfo', 'HostingEnvironmentProfile', @@ -705,6 +713,7 @@ 'ResourceNameAvailabilityRequest', 'SkuInfos', 'SourceControl', + 'ValidateContainerSettingsRequest', 'ValidateRequest', 'ValidateResponseError', 'ValidateResponse', @@ -743,6 +752,7 @@ 'MigrateMySqlStatus', 'RelayServiceConnectionEntity', 'NetworkFeatures', + 'NetworkTrace', 'PerfMonSample', 'PerfMonSet', 'PerfMonResponse', @@ -865,6 +875,7 @@ 'HostType', 'UsageState', 'SiteAvailabilityState', + 'RedundancyMode', 'StatusOptions', 'DomainStatus', 'AzureResourceType', diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_patch_resource.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_patch_resource.py index 4a4f9b8a267d..2f8cb07faeaa 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_patch_resource.py +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_patch_resource.py @@ -13,7 +13,7 @@ class AppServiceEnvironmentPatchResource(ProxyOnlyResource): - """ARM resource for a app service enviroment. + """ARM resource for a app service environment. Variables are only populated by the server, and will be ignored when sending a request. diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_patch_resource_py3.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_patch_resource_py3.py index f017aff5069e..35f2b72733b1 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_patch_resource_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_patch_resource_py3.py @@ -13,7 +13,7 @@ class AppServiceEnvironmentPatchResource(ProxyOnlyResource): - """ARM resource for a app service enviroment. + """ARM resource for a app service environment. Variables are only populated by the server, and will be ignored when sending a request. diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_plan.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_plan.py index c34010da2706..f0095b3c83b9 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/app_service_plan.py +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_plan.py @@ -40,8 +40,6 @@ class AppServicePlan(Resource): :vartype status: str or ~azure.mgmt.web.models.StatusOptions :ivar subscription: App Service plan subscription. :vartype subscription: str - :param admin_site_name: App Service plan administration site. - :type admin_site_name: str :param hosting_environment_profile: Specification for the App Service Environment to use for the App Service plan. :type hosting_environment_profile: @@ -56,6 +54,9 @@ class AppServicePlan(Resource): If false, apps assigned to this App Service plan will scale to all instances of the plan. Default value: False . :type per_site_scaling: bool + :param maximum_elastic_worker_count: Maximum number of total workers + allowed for this ElasticScaleEnabled App Service Plan + :type maximum_elastic_worker_count: int :ivar number_of_sites: Number of apps assigned to this App Service plan. :vartype number_of_sites: int :param is_spot: If true, this App Service Plan owns spot @@ -115,11 +116,11 @@ class AppServicePlan(Resource): 'worker_tier_name': {'key': 'properties.workerTierName', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'StatusOptions'}, 'subscription': {'key': 'properties.subscription', 'type': 'str'}, - 'admin_site_name': {'key': 'properties.adminSiteName', 'type': 'str'}, 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, 'maximum_number_of_workers': {'key': 'properties.maximumNumberOfWorkers', 'type': 'int'}, 'geo_region': {'key': 'properties.geoRegion', 'type': 'str'}, 'per_site_scaling': {'key': 'properties.perSiteScaling', 'type': 'bool'}, + 'maximum_elastic_worker_count': {'key': 'properties.maximumElasticWorkerCount', 'type': 'int'}, 'number_of_sites': {'key': 'properties.numberOfSites', 'type': 'int'}, 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, 'spot_expiration_time': {'key': 'properties.spotExpirationTime', 'type': 'iso-8601'}, @@ -139,11 +140,11 @@ def __init__(self, **kwargs): self.worker_tier_name = kwargs.get('worker_tier_name', None) self.status = None self.subscription = None - self.admin_site_name = kwargs.get('admin_site_name', None) self.hosting_environment_profile = kwargs.get('hosting_environment_profile', None) self.maximum_number_of_workers = None self.geo_region = None self.per_site_scaling = kwargs.get('per_site_scaling', False) + self.maximum_elastic_worker_count = kwargs.get('maximum_elastic_worker_count', None) self.number_of_sites = None self.is_spot = kwargs.get('is_spot', None) self.spot_expiration_time = kwargs.get('spot_expiration_time', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_patch_resource.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_patch_resource.py index fe641394a178..4ae9d3769c03 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_patch_resource.py +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_patch_resource.py @@ -34,8 +34,6 @@ class AppServicePlanPatchResource(ProxyOnlyResource): :vartype status: str or ~azure.mgmt.web.models.StatusOptions :ivar subscription: App Service plan subscription. :vartype subscription: str - :param admin_site_name: App Service plan administration site. - :type admin_site_name: str :param hosting_environment_profile: Specification for the App Service Environment to use for the App Service plan. :type hosting_environment_profile: @@ -50,6 +48,9 @@ class AppServicePlanPatchResource(ProxyOnlyResource): If false, apps assigned to this App Service plan will scale to all instances of the plan. Default value: False . :type per_site_scaling: bool + :param maximum_elastic_worker_count: Maximum number of total workers + allowed for this ElasticScaleEnabled App Service Plan + :type maximum_elastic_worker_count: int :ivar number_of_sites: Number of apps assigned to this App Service plan. :vartype number_of_sites: int :param is_spot: If true, this App Service Plan owns spot @@ -104,11 +105,11 @@ class AppServicePlanPatchResource(ProxyOnlyResource): 'worker_tier_name': {'key': 'properties.workerTierName', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'StatusOptions'}, 'subscription': {'key': 'properties.subscription', 'type': 'str'}, - 'admin_site_name': {'key': 'properties.adminSiteName', 'type': 'str'}, 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, 'maximum_number_of_workers': {'key': 'properties.maximumNumberOfWorkers', 'type': 'int'}, 'geo_region': {'key': 'properties.geoRegion', 'type': 'str'}, 'per_site_scaling': {'key': 'properties.perSiteScaling', 'type': 'bool'}, + 'maximum_elastic_worker_count': {'key': 'properties.maximumElasticWorkerCount', 'type': 'int'}, 'number_of_sites': {'key': 'properties.numberOfSites', 'type': 'int'}, 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, 'spot_expiration_time': {'key': 'properties.spotExpirationTime', 'type': 'iso-8601'}, @@ -127,11 +128,11 @@ def __init__(self, **kwargs): self.worker_tier_name = kwargs.get('worker_tier_name', None) self.status = None self.subscription = None - self.admin_site_name = kwargs.get('admin_site_name', None) self.hosting_environment_profile = kwargs.get('hosting_environment_profile', None) self.maximum_number_of_workers = None self.geo_region = None self.per_site_scaling = kwargs.get('per_site_scaling', False) + self.maximum_elastic_worker_count = kwargs.get('maximum_elastic_worker_count', None) self.number_of_sites = None self.is_spot = kwargs.get('is_spot', None) self.spot_expiration_time = kwargs.get('spot_expiration_time', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_patch_resource_py3.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_patch_resource_py3.py index 0d04154d0093..626784de7625 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_patch_resource_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_patch_resource_py3.py @@ -34,8 +34,6 @@ class AppServicePlanPatchResource(ProxyOnlyResource): :vartype status: str or ~azure.mgmt.web.models.StatusOptions :ivar subscription: App Service plan subscription. :vartype subscription: str - :param admin_site_name: App Service plan administration site. - :type admin_site_name: str :param hosting_environment_profile: Specification for the App Service Environment to use for the App Service plan. :type hosting_environment_profile: @@ -50,6 +48,9 @@ class AppServicePlanPatchResource(ProxyOnlyResource): If false, apps assigned to this App Service plan will scale to all instances of the plan. Default value: False . :type per_site_scaling: bool + :param maximum_elastic_worker_count: Maximum number of total workers + allowed for this ElasticScaleEnabled App Service Plan + :type maximum_elastic_worker_count: int :ivar number_of_sites: Number of apps assigned to this App Service plan. :vartype number_of_sites: int :param is_spot: If true, this App Service Plan owns spot @@ -104,11 +105,11 @@ class AppServicePlanPatchResource(ProxyOnlyResource): 'worker_tier_name': {'key': 'properties.workerTierName', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'StatusOptions'}, 'subscription': {'key': 'properties.subscription', 'type': 'str'}, - 'admin_site_name': {'key': 'properties.adminSiteName', 'type': 'str'}, 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, 'maximum_number_of_workers': {'key': 'properties.maximumNumberOfWorkers', 'type': 'int'}, 'geo_region': {'key': 'properties.geoRegion', 'type': 'str'}, 'per_site_scaling': {'key': 'properties.perSiteScaling', 'type': 'bool'}, + 'maximum_elastic_worker_count': {'key': 'properties.maximumElasticWorkerCount', 'type': 'int'}, 'number_of_sites': {'key': 'properties.numberOfSites', 'type': 'int'}, 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, 'spot_expiration_time': {'key': 'properties.spotExpirationTime', 'type': 'iso-8601'}, @@ -122,16 +123,16 @@ class AppServicePlanPatchResource(ProxyOnlyResource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, } - def __init__(self, *, kind: str=None, worker_tier_name: str=None, admin_site_name: str=None, hosting_environment_profile=None, per_site_scaling: bool=False, is_spot: bool=None, spot_expiration_time=None, free_offer_expiration_time=None, reserved: bool=False, is_xenon: bool=False, hyper_v: bool=False, target_worker_count: int=None, target_worker_size_id: int=None, **kwargs) -> None: + def __init__(self, *, kind: str=None, worker_tier_name: str=None, hosting_environment_profile=None, per_site_scaling: bool=False, maximum_elastic_worker_count: int=None, is_spot: bool=None, spot_expiration_time=None, free_offer_expiration_time=None, reserved: bool=False, is_xenon: bool=False, hyper_v: bool=False, target_worker_count: int=None, target_worker_size_id: int=None, **kwargs) -> None: super(AppServicePlanPatchResource, self).__init__(kind=kind, **kwargs) self.worker_tier_name = worker_tier_name self.status = None self.subscription = None - self.admin_site_name = admin_site_name self.hosting_environment_profile = hosting_environment_profile self.maximum_number_of_workers = None self.geo_region = None self.per_site_scaling = per_site_scaling + self.maximum_elastic_worker_count = maximum_elastic_worker_count self.number_of_sites = None self.is_spot = is_spot self.spot_expiration_time = spot_expiration_time diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_py3.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_py3.py index 3a8d6e22c267..5f6f9176cf20 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_py3.py @@ -40,8 +40,6 @@ class AppServicePlan(Resource): :vartype status: str or ~azure.mgmt.web.models.StatusOptions :ivar subscription: App Service plan subscription. :vartype subscription: str - :param admin_site_name: App Service plan administration site. - :type admin_site_name: str :param hosting_environment_profile: Specification for the App Service Environment to use for the App Service plan. :type hosting_environment_profile: @@ -56,6 +54,9 @@ class AppServicePlan(Resource): If false, apps assigned to this App Service plan will scale to all instances of the plan. Default value: False . :type per_site_scaling: bool + :param maximum_elastic_worker_count: Maximum number of total workers + allowed for this ElasticScaleEnabled App Service Plan + :type maximum_elastic_worker_count: int :ivar number_of_sites: Number of apps assigned to this App Service plan. :vartype number_of_sites: int :param is_spot: If true, this App Service Plan owns spot @@ -115,11 +116,11 @@ class AppServicePlan(Resource): 'worker_tier_name': {'key': 'properties.workerTierName', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'StatusOptions'}, 'subscription': {'key': 'properties.subscription', 'type': 'str'}, - 'admin_site_name': {'key': 'properties.adminSiteName', 'type': 'str'}, 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, 'maximum_number_of_workers': {'key': 'properties.maximumNumberOfWorkers', 'type': 'int'}, 'geo_region': {'key': 'properties.geoRegion', 'type': 'str'}, 'per_site_scaling': {'key': 'properties.perSiteScaling', 'type': 'bool'}, + 'maximum_elastic_worker_count': {'key': 'properties.maximumElasticWorkerCount', 'type': 'int'}, 'number_of_sites': {'key': 'properties.numberOfSites', 'type': 'int'}, 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, 'spot_expiration_time': {'key': 'properties.spotExpirationTime', 'type': 'iso-8601'}, @@ -134,16 +135,16 @@ class AppServicePlan(Resource): 'sku': {'key': 'sku', 'type': 'SkuDescription'}, } - def __init__(self, *, location: str, kind: str=None, tags=None, worker_tier_name: str=None, admin_site_name: str=None, hosting_environment_profile=None, per_site_scaling: bool=False, is_spot: bool=None, spot_expiration_time=None, free_offer_expiration_time=None, reserved: bool=False, is_xenon: bool=False, hyper_v: bool=False, target_worker_count: int=None, target_worker_size_id: int=None, sku=None, **kwargs) -> None: + def __init__(self, *, location: str, kind: str=None, tags=None, worker_tier_name: str=None, hosting_environment_profile=None, per_site_scaling: bool=False, maximum_elastic_worker_count: int=None, is_spot: bool=None, spot_expiration_time=None, free_offer_expiration_time=None, reserved: bool=False, is_xenon: bool=False, hyper_v: bool=False, target_worker_count: int=None, target_worker_size_id: int=None, sku=None, **kwargs) -> None: super(AppServicePlan, self).__init__(kind=kind, location=location, tags=tags, **kwargs) self.worker_tier_name = worker_tier_name self.status = None self.subscription = None - self.admin_site_name = admin_site_name self.hosting_environment_profile = hosting_environment_profile self.maximum_number_of_workers = None self.geo_region = None self.per_site_scaling = per_site_scaling + self.maximum_elastic_worker_count = maximum_elastic_worker_count self.number_of_sites = None self.is_spot = is_spot self.spot_expiration_time = spot_expiration_time diff --git a/azure-mgmt-web/azure/mgmt/web/models/certificate.py b/azure-mgmt-web/azure/mgmt/web/models/certificate.py index bd2c25e366d8..d05513dc8764 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/certificate.py +++ b/azure-mgmt-web/azure/mgmt/web/models/certificate.py @@ -48,7 +48,7 @@ class Certificate(Resource): :vartype issuer: str :ivar issue_date: Certificate issue Date. :vartype issue_date: datetime - :ivar expiration_date: Certificate expriration date. + :ivar expiration_date: Certificate expiration date. :vartype expiration_date: datetime :param password: Required. Certificate password. :type password: str diff --git a/azure-mgmt-web/azure/mgmt/web/models/certificate_patch_resource.py b/azure-mgmt-web/azure/mgmt/web/models/certificate_patch_resource.py index 00640f893069..2c8d4dd7b8d4 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/certificate_patch_resource.py +++ b/azure-mgmt-web/azure/mgmt/web/models/certificate_patch_resource.py @@ -44,7 +44,7 @@ class CertificatePatchResource(ProxyOnlyResource): :vartype issuer: str :ivar issue_date: Certificate issue Date. :vartype issue_date: datetime - :ivar expiration_date: Certificate expriration date. + :ivar expiration_date: Certificate expiration date. :vartype expiration_date: datetime :param password: Required. Certificate password. :type password: str diff --git a/azure-mgmt-web/azure/mgmt/web/models/certificate_patch_resource_py3.py b/azure-mgmt-web/azure/mgmt/web/models/certificate_patch_resource_py3.py index afe00d21362b..509a96b8f663 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/certificate_patch_resource_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/certificate_patch_resource_py3.py @@ -44,7 +44,7 @@ class CertificatePatchResource(ProxyOnlyResource): :vartype issuer: str :ivar issue_date: Certificate issue Date. :vartype issue_date: datetime - :ivar expiration_date: Certificate expriration date. + :ivar expiration_date: Certificate expiration date. :vartype expiration_date: datetime :param password: Required. Certificate password. :type password: str diff --git a/azure-mgmt-web/azure/mgmt/web/models/certificate_py3.py b/azure-mgmt-web/azure/mgmt/web/models/certificate_py3.py index e18577a8f98c..72c91584d182 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/certificate_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/certificate_py3.py @@ -48,7 +48,7 @@ class Certificate(Resource): :vartype issuer: str :ivar issue_date: Certificate issue Date. :vartype issue_date: datetime - :ivar expiration_date: Certificate expriration date. + :ivar expiration_date: Certificate expiration date. :vartype expiration_date: datetime :param password: Required. Certificate password. :type password: str 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/csm_usage_quota.py b/azure-mgmt-web/azure/mgmt/web/models/csm_usage_quota.py index 6ec31a0dbbab..73a378492874 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/csm_usage_quota.py +++ b/azure-mgmt-web/azure/mgmt/web/models/csm_usage_quota.py @@ -15,7 +15,7 @@ class CsmUsageQuota(Model): """Usage of the quota resource. - :param unit: Units of measurement for the quota resourse. + :param unit: Units of measurement for the quota resource. :type unit: str :param next_reset_time: Next reset time for the resource counter. :type next_reset_time: datetime diff --git a/azure-mgmt-web/azure/mgmt/web/models/csm_usage_quota_py3.py b/azure-mgmt-web/azure/mgmt/web/models/csm_usage_quota_py3.py index ec46c5675a51..4145c0317284 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/csm_usage_quota_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/csm_usage_quota_py3.py @@ -15,7 +15,7 @@ class CsmUsageQuota(Model): """Usage of the quota resource. - :param unit: Units of measurement for the quota resourse. + :param unit: Units of measurement for the quota resource. :type unit: str :param next_reset_time: Next reset time for the resource counter. :type next_reset_time: datetime diff --git a/azure-mgmt-web/azure/mgmt/web/models/custom_hostname_analysis_result.py b/azure-mgmt-web/azure/mgmt/web/models/custom_hostname_analysis_result.py index caad9e011ea0..b94776a8625c 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/custom_hostname_analysis_result.py +++ b/azure-mgmt-web/azure/mgmt/web/models/custom_hostname_analysis_result.py @@ -40,7 +40,7 @@ class CustomHostnameAnalysisResult(ProxyOnlyResource): :ivar has_conflict_on_scale_unit: true if there is a conflict on a scale unit; otherwise, false. :vartype has_conflict_on_scale_unit: bool - :ivar has_conflict_across_subscription: true if htere is a + :ivar has_conflict_across_subscription: true if there is a conflict across subscriptions; otherwise, false. :vartype has_conflict_across_subscription: bool :ivar conflicting_app_resource_id: Name of the conflicting app on scale diff --git a/azure-mgmt-web/azure/mgmt/web/models/custom_hostname_analysis_result_py3.py b/azure-mgmt-web/azure/mgmt/web/models/custom_hostname_analysis_result_py3.py index 0646bccb298a..d8bbfe11a508 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/custom_hostname_analysis_result_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/custom_hostname_analysis_result_py3.py @@ -40,7 +40,7 @@ class CustomHostnameAnalysisResult(ProxyOnlyResource): :ivar has_conflict_on_scale_unit: true if there is a conflict on a scale unit; otherwise, false. :vartype has_conflict_on_scale_unit: bool - :ivar has_conflict_across_subscription: true if htere is a + :ivar has_conflict_across_subscription: true if there is a conflict across subscriptions; otherwise, false. :vartype has_conflict_across_subscription: bool :ivar conflicting_app_resource_id: Name of the conflicting app on scale diff --git a/azure-mgmt-web/azure/mgmt/web/models/data_source.py b/azure-mgmt-web/azure/mgmt/web/models/data_source.py index 7a2c50d6e370..a49bb6e1caf5 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/data_source.py +++ b/azure-mgmt-web/azure/mgmt/web/models/data_source.py @@ -15,7 +15,7 @@ class DataSource(Model): """Class representing data source used by the detectors. - :param instructions: Instrunctions if any for the data source + :param instructions: Instructions if any for the data source :type instructions: list[str] :param data_source_uri: Datasource Uri Links :type data_source_uri: list[~azure.mgmt.web.models.NameValuePair] diff --git a/azure-mgmt-web/azure/mgmt/web/models/data_source_py3.py b/azure-mgmt-web/azure/mgmt/web/models/data_source_py3.py index b6db5b64ff21..29079057ce34 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/data_source_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/data_source_py3.py @@ -15,7 +15,7 @@ class DataSource(Model): """Class representing data source used by the detectors. - :param instructions: Instrunctions if any for the data source + :param instructions: Instructions if any for the data source :type instructions: list[str] :param data_source_uri: Datasource Uri Links :type data_source_uri: list[~azure.mgmt.web.models.NameValuePair] 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/deleted_site.py b/azure-mgmt-web/azure/mgmt/web/models/deleted_site.py index cab4d170ab91..988f07e40f40 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/deleted_site.py +++ b/azure-mgmt-web/azure/mgmt/web/models/deleted_site.py @@ -40,6 +40,8 @@ class DeletedSite(ProxyOnlyResource): :vartype slot: str :ivar deleted_site_kind: Kind of site that was deleted :vartype deleted_site_kind: str + :ivar geo_region_name: Geo Region of the deleted site + :vartype geo_region_name: str """ _validation = { @@ -53,6 +55,7 @@ class DeletedSite(ProxyOnlyResource): 'deleted_site_name': {'readonly': True}, 'slot': {'readonly': True}, 'deleted_site_kind': {'readonly': True}, + 'geo_region_name': {'readonly': True}, } _attribute_map = { @@ -67,6 +70,7 @@ class DeletedSite(ProxyOnlyResource): 'deleted_site_name': {'key': 'properties.deletedSiteName', 'type': 'str'}, 'slot': {'key': 'properties.slot', 'type': 'str'}, 'deleted_site_kind': {'key': 'properties.kind', 'type': 'str'}, + 'geo_region_name': {'key': 'properties.geoRegionName', 'type': 'str'}, } def __init__(self, **kwargs): @@ -78,3 +82,4 @@ def __init__(self, **kwargs): self.deleted_site_name = None self.slot = None self.deleted_site_kind = None + self.geo_region_name = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/deleted_site_py3.py b/azure-mgmt-web/azure/mgmt/web/models/deleted_site_py3.py index 85152fdd18f8..91ceedb6c2cd 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/deleted_site_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/deleted_site_py3.py @@ -40,6 +40,8 @@ class DeletedSite(ProxyOnlyResource): :vartype slot: str :ivar deleted_site_kind: Kind of site that was deleted :vartype deleted_site_kind: str + :ivar geo_region_name: Geo Region of the deleted site + :vartype geo_region_name: str """ _validation = { @@ -53,6 +55,7 @@ class DeletedSite(ProxyOnlyResource): 'deleted_site_name': {'readonly': True}, 'slot': {'readonly': True}, 'deleted_site_kind': {'readonly': True}, + 'geo_region_name': {'readonly': True}, } _attribute_map = { @@ -67,6 +70,7 @@ class DeletedSite(ProxyOnlyResource): 'deleted_site_name': {'key': 'properties.deletedSiteName', 'type': 'str'}, 'slot': {'key': 'properties.slot', 'type': 'str'}, 'deleted_site_kind': {'key': 'properties.kind', 'type': 'str'}, + 'geo_region_name': {'key': 'properties.geoRegionName', 'type': 'str'}, } def __init__(self, *, kind: str=None, **kwargs) -> None: @@ -78,3 +82,4 @@ def __init__(self, *, kind: str=None, **kwargs) -> None: self.deleted_site_name = None self.slot = None self.deleted_site_kind = None + self.geo_region_name = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/deployment.py b/azure-mgmt-web/azure/mgmt/web/models/deployment.py index 75a3a6e26b9e..e1edd8b35d22 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/deployment.py +++ b/azure-mgmt-web/azure/mgmt/web/models/deployment.py @@ -13,7 +13,7 @@ class Deployment(ProxyOnlyResource): - """User crendentials used for publishing activity. + """User credentials used for publishing activity. Variables are only populated by the server, and will be ignored when sending a request. diff --git a/azure-mgmt-web/azure/mgmt/web/models/deployment_py3.py b/azure-mgmt-web/azure/mgmt/web/models/deployment_py3.py index abc4448dc021..31037b9858d8 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/deployment_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/deployment_py3.py @@ -13,7 +13,7 @@ class Deployment(ProxyOnlyResource): - """User crendentials used for publishing activity. + """User credentials used for publishing activity. Variables are only populated by the server, and will be ignored when sending a request. diff --git a/azure-mgmt-web/azure/mgmt/web/models/detector_abnormal_time_period.py b/azure-mgmt-web/azure/mgmt/web/models/detector_abnormal_time_period.py index 79d6784e465e..f1b0e84468d5 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/detector_abnormal_time_period.py +++ b/azure-mgmt-web/azure/mgmt/web/models/detector_abnormal_time_period.py @@ -15,9 +15,9 @@ class DetectorAbnormalTimePeriod(Model): """Class representing Abnormal Time Period detected. - :param start_time: Start time of the corelated event + :param start_time: Start time of the correlated event :type start_time: datetime - :param end_time: End time of the corelated event + :param end_time: End time of the correlated event :type end_time: datetime :param message: Message describing the event :type message: str diff --git a/azure-mgmt-web/azure/mgmt/web/models/detector_abnormal_time_period_py3.py b/azure-mgmt-web/azure/mgmt/web/models/detector_abnormal_time_period_py3.py index 63507c374c07..6fc4258bef34 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/detector_abnormal_time_period_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/detector_abnormal_time_period_py3.py @@ -15,9 +15,9 @@ class DetectorAbnormalTimePeriod(Model): """Class representing Abnormal Time Period detected. - :param start_time: Start time of the corelated event + :param start_time: Start time of the correlated event :type start_time: datetime - :param end_time: End time of the corelated event + :param end_time: End time of the correlated event :type end_time: datetime :param message: Message describing the event :type message: str diff --git a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_detector_response.py b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_detector_response.py index 54efec97da7b..02cf6db30707 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_detector_response.py +++ b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_detector_response.py @@ -13,7 +13,7 @@ class DiagnosticDetectorResponse(ProxyOnlyResource): - """Class representing Reponse from Diagnostic Detectors. + """Class representing Response from Diagnostic Detectors. Variables are only populated by the server, and will be ignored when sending a request. diff --git a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_detector_response_py3.py b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_detector_response_py3.py index 165d011ecccc..a7fb46dbb467 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_detector_response_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_detector_response_py3.py @@ -13,7 +13,7 @@ class DiagnosticDetectorResponse(ProxyOnlyResource): - """Class representing Reponse from Diagnostic Detectors. + """Class representing Response from Diagnostic Detectors. Variables are only populated by the server, and will be ignored when sending a request. diff --git a/azure-mgmt-web/azure/mgmt/web/models/domain_availablility_check_result.py b/azure-mgmt-web/azure/mgmt/web/models/domain_availablility_check_result.py index 45ea1738a52f..e56481b9dfeb 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/domain_availablility_check_result.py +++ b/azure-mgmt-web/azure/mgmt/web/models/domain_availablility_check_result.py @@ -13,7 +13,7 @@ class DomainAvailablilityCheckResult(Model): - """Domain availablility check result. + """Domain availability check result. :param name: Name of the domain. :type name: str diff --git a/azure-mgmt-web/azure/mgmt/web/models/domain_availablility_check_result_py3.py b/azure-mgmt-web/azure/mgmt/web/models/domain_availablility_check_result_py3.py index 58bc30851baf..605e13392d04 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/domain_availablility_check_result_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/domain_availablility_check_result_py3.py @@ -13,7 +13,7 @@ class DomainAvailablilityCheckResult(Model): - """Domain availablility check result. + """Domain availability check result. :param name: Name of the domain. :type name: str diff --git a/azure-mgmt-web/azure/mgmt/web/models/geo_distribution.py b/azure-mgmt-web/azure/mgmt/web/models/geo_distribution.py new file mode 100644 index 000000000000..89dae8bfe72a --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/geo_distribution.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GeoDistribution(Model): + """A global distribution definition. + + :param location: Location. + :type location: str + :param number_of_workers: NumberOfWorkers. + :type number_of_workers: int + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(GeoDistribution, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.number_of_workers = kwargs.get('number_of_workers', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/geo_distribution_py3.py b/azure-mgmt-web/azure/mgmt/web/models/geo_distribution_py3.py new file mode 100644 index 000000000000..c20bb714fe0e --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/geo_distribution_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GeoDistribution(Model): + """A global distribution definition. + + :param location: Location. + :type location: str + :param number_of_workers: NumberOfWorkers. + :type number_of_workers: int + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, + } + + def __init__(self, *, location: str=None, number_of_workers: int=None, **kwargs) -> None: + super(GeoDistribution, self).__init__(**kwargs) + self.location = location + self.number_of_workers = number_of_workers diff --git a/azure-mgmt-web/azure/mgmt/web/models/ip_security_restriction.py b/azure-mgmt-web/azure/mgmt/web/models/ip_security_restriction.py index d74f523c3fe7..fe05f46d1be7 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/ip_security_restriction.py +++ b/azure-mgmt-web/azure/mgmt/web/models/ip_security_restriction.py @@ -15,10 +15,7 @@ class IpSecurityRestriction(Model): """IP security restriction on an app. - All required parameters must be populated in order to send to Azure. - - :param ip_address: Required. IP address the security restriction is valid - for. + :param ip_address: IP address the security restriction is valid for. It can be in form of pure ipv4 address (required SubnetMask property) or CIDR notation such as ipv4/mask (leading bit match). For CIDR, SubnetMask property must not be specified. @@ -26,6 +23,12 @@ class IpSecurityRestriction(Model): :param subnet_mask: Subnet mask for the range of IP addresses the restriction is valid for. :type subnet_mask: str + :param vnet_subnet_resource_id: Virtual network resource id + :type vnet_subnet_resource_id: str + :param vnet_traffic_tag: (internal) Vnet traffic tag + :type vnet_traffic_tag: int + :param subnet_traffic_tag: (internal) Subnet traffic tag + :type subnet_traffic_tag: int :param action: Allow or Deny access for this IP range. :type action: str :param tag: Defines what this IP filter will be used for. This is to @@ -40,13 +43,12 @@ class IpSecurityRestriction(Model): :type description: str """ - _validation = { - 'ip_address': {'required': True}, - } - _attribute_map = { 'ip_address': {'key': 'ipAddress', 'type': 'str'}, 'subnet_mask': {'key': 'subnetMask', 'type': 'str'}, + 'vnet_subnet_resource_id': {'key': 'vnetSubnetResourceId', 'type': 'str'}, + 'vnet_traffic_tag': {'key': 'vnetTrafficTag', 'type': 'int'}, + 'subnet_traffic_tag': {'key': 'subnetTrafficTag', 'type': 'int'}, 'action': {'key': 'action', 'type': 'str'}, 'tag': {'key': 'tag', 'type': 'IpFilterTag'}, 'priority': {'key': 'priority', 'type': 'int'}, @@ -58,6 +60,9 @@ def __init__(self, **kwargs): super(IpSecurityRestriction, self).__init__(**kwargs) self.ip_address = kwargs.get('ip_address', None) self.subnet_mask = kwargs.get('subnet_mask', None) + self.vnet_subnet_resource_id = kwargs.get('vnet_subnet_resource_id', None) + self.vnet_traffic_tag = kwargs.get('vnet_traffic_tag', None) + self.subnet_traffic_tag = kwargs.get('subnet_traffic_tag', None) self.action = kwargs.get('action', None) self.tag = kwargs.get('tag', None) self.priority = kwargs.get('priority', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/ip_security_restriction_py3.py b/azure-mgmt-web/azure/mgmt/web/models/ip_security_restriction_py3.py index a494599a9ba0..bb62cc8b34e2 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/ip_security_restriction_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/ip_security_restriction_py3.py @@ -15,10 +15,7 @@ class IpSecurityRestriction(Model): """IP security restriction on an app. - All required parameters must be populated in order to send to Azure. - - :param ip_address: Required. IP address the security restriction is valid - for. + :param ip_address: IP address the security restriction is valid for. It can be in form of pure ipv4 address (required SubnetMask property) or CIDR notation such as ipv4/mask (leading bit match). For CIDR, SubnetMask property must not be specified. @@ -26,6 +23,12 @@ class IpSecurityRestriction(Model): :param subnet_mask: Subnet mask for the range of IP addresses the restriction is valid for. :type subnet_mask: str + :param vnet_subnet_resource_id: Virtual network resource id + :type vnet_subnet_resource_id: str + :param vnet_traffic_tag: (internal) Vnet traffic tag + :type vnet_traffic_tag: int + :param subnet_traffic_tag: (internal) Subnet traffic tag + :type subnet_traffic_tag: int :param action: Allow or Deny access for this IP range. :type action: str :param tag: Defines what this IP filter will be used for. This is to @@ -40,13 +43,12 @@ class IpSecurityRestriction(Model): :type description: str """ - _validation = { - 'ip_address': {'required': True}, - } - _attribute_map = { 'ip_address': {'key': 'ipAddress', 'type': 'str'}, 'subnet_mask': {'key': 'subnetMask', 'type': 'str'}, + 'vnet_subnet_resource_id': {'key': 'vnetSubnetResourceId', 'type': 'str'}, + 'vnet_traffic_tag': {'key': 'vnetTrafficTag', 'type': 'int'}, + 'subnet_traffic_tag': {'key': 'subnetTrafficTag', 'type': 'int'}, 'action': {'key': 'action', 'type': 'str'}, 'tag': {'key': 'tag', 'type': 'IpFilterTag'}, 'priority': {'key': 'priority', 'type': 'int'}, @@ -54,10 +56,13 @@ class IpSecurityRestriction(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, *, ip_address: str, subnet_mask: str=None, action: str=None, tag=None, priority: int=None, name: str=None, description: str=None, **kwargs) -> None: + def __init__(self, *, ip_address: str=None, subnet_mask: str=None, vnet_subnet_resource_id: str=None, vnet_traffic_tag: int=None, subnet_traffic_tag: int=None, action: str=None, tag=None, priority: int=None, name: str=None, description: str=None, **kwargs) -> None: super(IpSecurityRestriction, self).__init__(**kwargs) self.ip_address = ip_address self.subnet_mask = subnet_mask + self.vnet_subnet_resource_id = vnet_subnet_resource_id + self.vnet_traffic_tag = vnet_traffic_tag + self.subnet_traffic_tag = subnet_traffic_tag self.action = action self.tag = tag self.priority = priority diff --git a/azure-mgmt-web/azure/mgmt/web/models/network_trace.py b/azure-mgmt-web/azure/mgmt/web/models/network_trace.py new file mode 100644 index 000000000000..c6dcab7967e9 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/network_trace.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkTrace(Model): + """Network trace. + + :param path: Local file path for the captured network trace file. + :type path: str + :param status: Current status of the network trace operation, same as + Operation.Status (InProgress/Succeeded/Failed). + :type status: str + :param message: Detailed message of a network trace operation, e.g. error + message in case of failure. + :type message: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NetworkTrace, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.status = kwargs.get('status', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/network_trace_py3.py b/azure-mgmt-web/azure/mgmt/web/models/network_trace_py3.py new file mode 100644 index 000000000000..58f8bf5b7a8c --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/network_trace_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkTrace(Model): + """Network trace. + + :param path: Local file path for the captured network trace file. + :type path: str + :param status: Current status of the network trace operation, same as + Operation.Status (InProgress/Succeeded/Failed). + :type status: str + :param message: Detailed message of a network trace operation, e.g. error + message in case of failure. + :type message: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, path: str=None, status: str=None, message: str=None, **kwargs) -> None: + super(NetworkTrace, self).__init__(**kwargs) + self.path = path + self.status = status + self.message = message diff --git a/azure-mgmt-web/azure/mgmt/web/models/process_thread_info.py b/azure-mgmt-web/azure/mgmt/web/models/process_thread_info.py index fa19e32d621c..e846621c0160 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/process_thread_info.py +++ b/azure-mgmt-web/azure/mgmt/web/models/process_thread_info.py @@ -46,7 +46,7 @@ class ProcessThreadInfo(ProxyOnlyResource): :type total_processor_time: str :param user_processor_time: User processor time. :type user_processor_time: str - :param priviledged_processor_time: Priviledged processor time. + :param priviledged_processor_time: Privileged processor time. :type priviledged_processor_time: str :param state: Thread state. :type state: str diff --git a/azure-mgmt-web/azure/mgmt/web/models/process_thread_info_py3.py b/azure-mgmt-web/azure/mgmt/web/models/process_thread_info_py3.py index 573193cc1855..818613966ecd 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/process_thread_info_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/process_thread_info_py3.py @@ -46,7 +46,7 @@ class ProcessThreadInfo(ProxyOnlyResource): :type total_processor_time: str :param user_processor_time: User processor time. :type user_processor_time: str - :param priviledged_processor_time: Priviledged processor time. + :param priviledged_processor_time: Privileged processor time. :type priviledged_processor_time: str :param state: Thread state. :type state: str diff --git a/azure-mgmt-web/azure/mgmt/web/models/ramp_up_rule.py b/azure-mgmt-web/azure/mgmt/web/models/ramp_up_rule.py index beac73be59d5..084ce8052951 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/ramp_up_rule.py +++ b/azure-mgmt-web/azure/mgmt/web/models/ramp_up_rule.py @@ -22,15 +22,15 @@ class RampUpRule(Model): :param reroute_percentage: Percentage of the traffic which will be redirected to ActionHostName. :type reroute_percentage: float - :param change_step: In auto ramp up scenario this is the step to to + :param change_step: In auto ramp up scenario this is the step to add/remove from ReroutePercentage until it reaches MinReroutePercentage or MaxReroutePercentage. - Site metrics are checked every N minutes specificed in + Site metrics are checked every N minutes specified in ChangeIntervalInMinutes. Custom decision algorithm can be provided in TiPCallback site extension which URL can be specified in ChangeDecisionCallbackUrl. :type change_step: float - :param change_interval_in_minutes: Specifies interval in mimuntes to + :param change_interval_in_minutes: Specifies interval in minutes to reevaluate ReroutePercentage. :type change_interval_in_minutes: int :param min_reroute_percentage: Specifies lower boundary above which diff --git a/azure-mgmt-web/azure/mgmt/web/models/ramp_up_rule_py3.py b/azure-mgmt-web/azure/mgmt/web/models/ramp_up_rule_py3.py index 224fea9b4023..ccc3f0224724 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/ramp_up_rule_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/ramp_up_rule_py3.py @@ -22,15 +22,15 @@ class RampUpRule(Model): :param reroute_percentage: Percentage of the traffic which will be redirected to ActionHostName. :type reroute_percentage: float - :param change_step: In auto ramp up scenario this is the step to to + :param change_step: In auto ramp up scenario this is the step to add/remove from ReroutePercentage until it reaches MinReroutePercentage or MaxReroutePercentage. - Site metrics are checked every N minutes specificed in + Site metrics are checked every N minutes specified in ChangeIntervalInMinutes. Custom decision algorithm can be provided in TiPCallback site extension which URL can be specified in ChangeDecisionCallbackUrl. :type change_step: float - :param change_interval_in_minutes: Specifies interval in mimuntes to + :param change_interval_in_minutes: Specifies interval in minutes to reevaluate ReroutePercentage. :type change_interval_in_minutes: int :param min_reroute_percentage: Specifies lower boundary above which diff --git a/azure-mgmt-web/azure/mgmt/web/models/recommendation.py b/azure-mgmt-web/azure/mgmt/web/models/recommendation.py index 05e942d4c9dc..2871f19fb3ce 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/recommendation.py +++ b/azure-mgmt-web/azure/mgmt/web/models/recommendation.py @@ -60,7 +60,7 @@ class Recommendation(ProxyOnlyResource): "actionable"). False if it is invalid. :type enabled: int :param states: The list of states of this recommendation. If it's null - then it shoud be considered "Active". + then it should be considered "Active". :type states: list[str] :param start_time: The beginning time in UTC of a range that the recommendation refers to. diff --git a/azure-mgmt-web/azure/mgmt/web/models/recommendation_py3.py b/azure-mgmt-web/azure/mgmt/web/models/recommendation_py3.py index 02241485d2d1..ead4f7d4852d 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/recommendation_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/recommendation_py3.py @@ -60,7 +60,7 @@ class Recommendation(ProxyOnlyResource): "actionable"). False if it is invalid. :type enabled: int :param states: The list of states of this recommendation. If it's null - then it shoud be considered "Active". + then it should be considered "Active". :type states: list[str] :param start_time: The beginning time in UTC of a range that the recommendation refers to. diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability.py b/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability.py index 00e19a02dfe2..f24b6def4e5b 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability.py +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability.py @@ -13,7 +13,7 @@ class ResourceNameAvailability(Model): - """Information regarding availbility of a resource name. + """Information regarding availability of a resource name. :param name_available: true indicates name is valid and available. false indicates the name is invalid, unavailable, diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability_py3.py b/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability_py3.py index 29684bed5cd3..a468f894cde5 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability_py3.py @@ -13,7 +13,7 @@ class ResourceNameAvailability(Model): - """Information regarding availbility of a resource name. + """Information regarding availability of a resource name. :param name_available: true indicates name is valid and available. false indicates the name is invalid, unavailable, diff --git a/azure-mgmt-web/azure/mgmt/web/models/site.py b/azure-mgmt-web/azure/mgmt/web/models/site.py index 0bf04d727a18..ba5c03e5224e 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site.py @@ -96,6 +96,9 @@ class Site(Resource): authentication (TLS mutual authentication); otherwise, false. Default is false. :type client_cert_enabled: bool + :param client_cert_exclusion_paths: client certificate authentication + comma-separated exclusion paths + :type client_cert_exclusion_paths: str :param host_names_disabled: true to disable the public hostnames of the app; otherwise, false. If true, the app is only accessible via API management @@ -137,6 +140,14 @@ class Site(Resource): requests. Issues redirect for http requests :type https_only: bool + :param redundancy_mode: Site redundancy mode. Possible values include: + 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + :type redundancy_mode: str or ~azure.mgmt.web.models.RedundancyMode + :ivar in_progress_operation_id: Specifies an operation id if this site has + a pending operation. + :vartype in_progress_operation_id: str + :param geo_distributions: GeoDistributions for this site + :type geo_distributions: list[~azure.mgmt.web.models.GeoDistribution] :param identity: :type identity: ~azure.mgmt.web.models.ManagedServiceIdentity """ @@ -163,6 +174,7 @@ class Site(Resource): 'is_default_container': {'readonly': True}, 'default_host_name': {'readonly': True}, 'slot_swap_status': {'readonly': True}, + 'in_progress_operation_id': {'readonly': True}, } _attribute_map = { @@ -192,6 +204,7 @@ class Site(Resource): 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, 'client_affinity_enabled': {'key': 'properties.clientAffinityEnabled', 'type': 'bool'}, 'client_cert_enabled': {'key': 'properties.clientCertEnabled', 'type': 'bool'}, + 'client_cert_exclusion_paths': {'key': 'properties.clientCertExclusionPaths', 'type': 'str'}, 'host_names_disabled': {'key': 'properties.hostNamesDisabled', 'type': 'bool'}, 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': 'str'}, 'possible_outbound_ip_addresses': {'key': 'properties.possibleOutboundIpAddresses', 'type': 'str'}, @@ -205,6 +218,9 @@ class Site(Resource): 'default_host_name': {'key': 'properties.defaultHostName', 'type': 'str'}, 'slot_swap_status': {'key': 'properties.slotSwapStatus', 'type': 'SlotSwapStatus'}, 'https_only': {'key': 'properties.httpsOnly', 'type': 'bool'}, + 'redundancy_mode': {'key': 'properties.redundancyMode', 'type': 'RedundancyMode'}, + 'in_progress_operation_id': {'key': 'properties.inProgressOperationId', 'type': 'str'}, + 'geo_distributions': {'key': 'properties.geoDistributions', 'type': '[GeoDistribution]'}, 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, } @@ -230,6 +246,7 @@ def __init__(self, **kwargs): self.hosting_environment_profile = kwargs.get('hosting_environment_profile', None) self.client_affinity_enabled = kwargs.get('client_affinity_enabled', None) self.client_cert_enabled = kwargs.get('client_cert_enabled', None) + self.client_cert_exclusion_paths = kwargs.get('client_cert_exclusion_paths', None) self.host_names_disabled = kwargs.get('host_names_disabled', None) self.outbound_ip_addresses = None self.possible_outbound_ip_addresses = None @@ -243,4 +260,7 @@ def __init__(self, **kwargs): self.default_host_name = None self.slot_swap_status = None self.https_only = kwargs.get('https_only', None) + self.redundancy_mode = kwargs.get('redundancy_mode', None) + self.in_progress_operation_id = None + self.geo_distributions = kwargs.get('geo_distributions', None) self.identity = kwargs.get('identity', None) 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..951a00be4b55 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 certificate 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..90f3e14c2c0c 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 certificate 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..09b9e8cf7f1c 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_config.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_config.py @@ -100,7 +100,7 @@ class SiteConfig(Model): 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' :type load_balancing: str or ~azure.mgmt.web.models.SiteLoadBalancing - :param experiments: This is work around for polymophic types. + :param experiments: This is work around for polymorphic types. :type experiments: ~azure.mgmt.web.models.Experiments :param limits: Site limits. :type limits: ~azure.mgmt.web.models.SiteLimits @@ -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..1c559b452f32 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 @@ -100,7 +100,7 @@ class SiteConfig(Model): 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' :type load_balancing: str or ~azure.mgmt.web.models.SiteLoadBalancing - :param experiments: This is work around for polymophic types. + :param experiments: This is work around for polymorphic types. :type experiments: ~azure.mgmt.web.models.Experiments :param limits: Site limits. :type limits: ~azure.mgmt.web.models.SiteLimits @@ -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..43af2c3a92eb 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 @@ -108,7 +108,7 @@ class SiteConfigResource(ProxyOnlyResource): 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' :type load_balancing: str or ~azure.mgmt.web.models.SiteLoadBalancing - :param experiments: This is work around for polymophic types. + :param experiments: This is work around for polymorphic types. :type experiments: ~azure.mgmt.web.models.Experiments :param limits: Site limits. :type limits: ~azure.mgmt.web.models.SiteLimits @@ -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..fe8ce425406b 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 @@ -108,7 +108,7 @@ class SiteConfigResource(ProxyOnlyResource): 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' :type load_balancing: str or ~azure.mgmt.web.models.SiteLoadBalancing - :param experiments: This is work around for polymophic types. + :param experiments: This is work around for polymorphic types. :type experiments: ~azure.mgmt.web.models.Experiments :param limits: Site limits. :type limits: ~azure.mgmt.web.models.SiteLimits @@ -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/site_patch_resource.py b/azure-mgmt-web/azure/mgmt/web/models/site_patch_resource.py index 392b54229183..ce1c2a7086ad 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_patch_resource.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_patch_resource.py @@ -90,6 +90,9 @@ class SitePatchResource(ProxyOnlyResource): authentication (TLS mutual authentication); otherwise, false. Default is false. :type client_cert_enabled: bool + :param client_cert_exclusion_paths: client certificate authentication + comma-separated exclusion paths + :type client_cert_exclusion_paths: str :param host_names_disabled: true to disable the public hostnames of the app; otherwise, false. If true, the app is only accessible via API management @@ -131,6 +134,14 @@ class SitePatchResource(ProxyOnlyResource): requests. Issues redirect for http requests :type https_only: bool + :param redundancy_mode: Site redundancy mode. Possible values include: + 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + :type redundancy_mode: str or ~azure.mgmt.web.models.RedundancyMode + :ivar in_progress_operation_id: Specifies an operation id if this site has + a pending operation. + :vartype in_progress_operation_id: str + :param geo_distributions: GeoDistributions for this site + :type geo_distributions: list[~azure.mgmt.web.models.GeoDistribution] """ _validation = { @@ -154,6 +165,7 @@ class SitePatchResource(ProxyOnlyResource): 'is_default_container': {'readonly': True}, 'default_host_name': {'readonly': True}, 'slot_swap_status': {'readonly': True}, + 'in_progress_operation_id': {'readonly': True}, } _attribute_map = { @@ -181,6 +193,7 @@ class SitePatchResource(ProxyOnlyResource): 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, 'client_affinity_enabled': {'key': 'properties.clientAffinityEnabled', 'type': 'bool'}, 'client_cert_enabled': {'key': 'properties.clientCertEnabled', 'type': 'bool'}, + 'client_cert_exclusion_paths': {'key': 'properties.clientCertExclusionPaths', 'type': 'str'}, 'host_names_disabled': {'key': 'properties.hostNamesDisabled', 'type': 'bool'}, 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': 'str'}, 'possible_outbound_ip_addresses': {'key': 'properties.possibleOutboundIpAddresses', 'type': 'str'}, @@ -194,6 +207,9 @@ class SitePatchResource(ProxyOnlyResource): 'default_host_name': {'key': 'properties.defaultHostName', 'type': 'str'}, 'slot_swap_status': {'key': 'properties.slotSwapStatus', 'type': 'SlotSwapStatus'}, 'https_only': {'key': 'properties.httpsOnly', 'type': 'bool'}, + 'redundancy_mode': {'key': 'properties.redundancyMode', 'type': 'RedundancyMode'}, + 'in_progress_operation_id': {'key': 'properties.inProgressOperationId', 'type': 'str'}, + 'geo_distributions': {'key': 'properties.geoDistributions', 'type': '[GeoDistribution]'}, } def __init__(self, **kwargs): @@ -218,6 +234,7 @@ def __init__(self, **kwargs): self.hosting_environment_profile = kwargs.get('hosting_environment_profile', None) self.client_affinity_enabled = kwargs.get('client_affinity_enabled', None) self.client_cert_enabled = kwargs.get('client_cert_enabled', None) + self.client_cert_exclusion_paths = kwargs.get('client_cert_exclusion_paths', None) self.host_names_disabled = kwargs.get('host_names_disabled', None) self.outbound_ip_addresses = None self.possible_outbound_ip_addresses = None @@ -231,3 +248,6 @@ def __init__(self, **kwargs): self.default_host_name = None self.slot_swap_status = None self.https_only = kwargs.get('https_only', None) + self.redundancy_mode = kwargs.get('redundancy_mode', None) + self.in_progress_operation_id = None + self.geo_distributions = kwargs.get('geo_distributions', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_patch_resource_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_patch_resource_py3.py index e459e6d70bbd..733ce536270a 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_patch_resource_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_patch_resource_py3.py @@ -90,6 +90,9 @@ class SitePatchResource(ProxyOnlyResource): authentication (TLS mutual authentication); otherwise, false. Default is false. :type client_cert_enabled: bool + :param client_cert_exclusion_paths: client certificate authentication + comma-separated exclusion paths + :type client_cert_exclusion_paths: str :param host_names_disabled: true to disable the public hostnames of the app; otherwise, false. If true, the app is only accessible via API management @@ -131,6 +134,14 @@ class SitePatchResource(ProxyOnlyResource): requests. Issues redirect for http requests :type https_only: bool + :param redundancy_mode: Site redundancy mode. Possible values include: + 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + :type redundancy_mode: str or ~azure.mgmt.web.models.RedundancyMode + :ivar in_progress_operation_id: Specifies an operation id if this site has + a pending operation. + :vartype in_progress_operation_id: str + :param geo_distributions: GeoDistributions for this site + :type geo_distributions: list[~azure.mgmt.web.models.GeoDistribution] """ _validation = { @@ -154,6 +165,7 @@ class SitePatchResource(ProxyOnlyResource): 'is_default_container': {'readonly': True}, 'default_host_name': {'readonly': True}, 'slot_swap_status': {'readonly': True}, + 'in_progress_operation_id': {'readonly': True}, } _attribute_map = { @@ -181,6 +193,7 @@ class SitePatchResource(ProxyOnlyResource): 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, 'client_affinity_enabled': {'key': 'properties.clientAffinityEnabled', 'type': 'bool'}, 'client_cert_enabled': {'key': 'properties.clientCertEnabled', 'type': 'bool'}, + 'client_cert_exclusion_paths': {'key': 'properties.clientCertExclusionPaths', 'type': 'str'}, 'host_names_disabled': {'key': 'properties.hostNamesDisabled', 'type': 'bool'}, 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': 'str'}, 'possible_outbound_ip_addresses': {'key': 'properties.possibleOutboundIpAddresses', 'type': 'str'}, @@ -194,9 +207,12 @@ class SitePatchResource(ProxyOnlyResource): 'default_host_name': {'key': 'properties.defaultHostName', 'type': 'str'}, 'slot_swap_status': {'key': 'properties.slotSwapStatus', 'type': 'SlotSwapStatus'}, 'https_only': {'key': 'properties.httpsOnly', 'type': 'bool'}, + 'redundancy_mode': {'key': 'properties.redundancyMode', 'type': 'RedundancyMode'}, + 'in_progress_operation_id': {'key': 'properties.inProgressOperationId', 'type': 'str'}, + 'geo_distributions': {'key': 'properties.geoDistributions', 'type': '[GeoDistribution]'}, } - def __init__(self, *, kind: str=None, enabled: bool=None, host_name_ssl_states=None, server_farm_id: str=None, reserved: bool=False, is_xenon: bool=False, hyper_v: bool=False, site_config=None, scm_site_also_stopped: bool=False, hosting_environment_profile=None, client_affinity_enabled: bool=None, client_cert_enabled: bool=None, host_names_disabled: bool=None, container_size: int=None, daily_memory_time_quota: int=None, cloning_info=None, https_only: bool=None, **kwargs) -> None: + def __init__(self, *, kind: str=None, enabled: bool=None, host_name_ssl_states=None, server_farm_id: str=None, reserved: bool=False, is_xenon: bool=False, hyper_v: bool=False, site_config=None, scm_site_also_stopped: bool=False, hosting_environment_profile=None, client_affinity_enabled: bool=None, client_cert_enabled: bool=None, client_cert_exclusion_paths: str=None, host_names_disabled: bool=None, container_size: int=None, daily_memory_time_quota: int=None, cloning_info=None, https_only: bool=None, redundancy_mode=None, geo_distributions=None, **kwargs) -> None: super(SitePatchResource, self).__init__(kind=kind, **kwargs) self.state = None self.host_names = None @@ -218,6 +234,7 @@ def __init__(self, *, kind: str=None, enabled: bool=None, host_name_ssl_states=N self.hosting_environment_profile = hosting_environment_profile self.client_affinity_enabled = client_affinity_enabled self.client_cert_enabled = client_cert_enabled + self.client_cert_exclusion_paths = client_cert_exclusion_paths self.host_names_disabled = host_names_disabled self.outbound_ip_addresses = None self.possible_outbound_ip_addresses = None @@ -231,3 +248,6 @@ def __init__(self, *, kind: str=None, enabled: bool=None, host_name_ssl_states=N self.default_host_name = None self.slot_swap_status = None self.https_only = https_only + self.redundancy_mode = redundancy_mode + self.in_progress_operation_id = None + self.geo_distributions = geo_distributions diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_py3.py index d4ec907a9c06..0f00fc18257d 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_py3.py @@ -96,6 +96,9 @@ class Site(Resource): authentication (TLS mutual authentication); otherwise, false. Default is false. :type client_cert_enabled: bool + :param client_cert_exclusion_paths: client certificate authentication + comma-separated exclusion paths + :type client_cert_exclusion_paths: str :param host_names_disabled: true to disable the public hostnames of the app; otherwise, false. If true, the app is only accessible via API management @@ -137,6 +140,14 @@ class Site(Resource): requests. Issues redirect for http requests :type https_only: bool + :param redundancy_mode: Site redundancy mode. Possible values include: + 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + :type redundancy_mode: str or ~azure.mgmt.web.models.RedundancyMode + :ivar in_progress_operation_id: Specifies an operation id if this site has + a pending operation. + :vartype in_progress_operation_id: str + :param geo_distributions: GeoDistributions for this site + :type geo_distributions: list[~azure.mgmt.web.models.GeoDistribution] :param identity: :type identity: ~azure.mgmt.web.models.ManagedServiceIdentity """ @@ -163,6 +174,7 @@ class Site(Resource): 'is_default_container': {'readonly': True}, 'default_host_name': {'readonly': True}, 'slot_swap_status': {'readonly': True}, + 'in_progress_operation_id': {'readonly': True}, } _attribute_map = { @@ -192,6 +204,7 @@ class Site(Resource): 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, 'client_affinity_enabled': {'key': 'properties.clientAffinityEnabled', 'type': 'bool'}, 'client_cert_enabled': {'key': 'properties.clientCertEnabled', 'type': 'bool'}, + 'client_cert_exclusion_paths': {'key': 'properties.clientCertExclusionPaths', 'type': 'str'}, 'host_names_disabled': {'key': 'properties.hostNamesDisabled', 'type': 'bool'}, 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': 'str'}, 'possible_outbound_ip_addresses': {'key': 'properties.possibleOutboundIpAddresses', 'type': 'str'}, @@ -205,10 +218,13 @@ class Site(Resource): 'default_host_name': {'key': 'properties.defaultHostName', 'type': 'str'}, 'slot_swap_status': {'key': 'properties.slotSwapStatus', 'type': 'SlotSwapStatus'}, 'https_only': {'key': 'properties.httpsOnly', 'type': 'bool'}, + 'redundancy_mode': {'key': 'properties.redundancyMode', 'type': 'RedundancyMode'}, + 'in_progress_operation_id': {'key': 'properties.inProgressOperationId', 'type': 'str'}, + 'geo_distributions': {'key': 'properties.geoDistributions', 'type': '[GeoDistribution]'}, 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, } - def __init__(self, *, location: str, kind: str=None, tags=None, enabled: bool=None, host_name_ssl_states=None, server_farm_id: str=None, reserved: bool=False, is_xenon: bool=False, hyper_v: bool=False, site_config=None, scm_site_also_stopped: bool=False, hosting_environment_profile=None, client_affinity_enabled: bool=None, client_cert_enabled: bool=None, host_names_disabled: bool=None, container_size: int=None, daily_memory_time_quota: int=None, cloning_info=None, https_only: bool=None, identity=None, **kwargs) -> None: + def __init__(self, *, location: str, kind: str=None, tags=None, enabled: bool=None, host_name_ssl_states=None, server_farm_id: str=None, reserved: bool=False, is_xenon: bool=False, hyper_v: bool=False, site_config=None, scm_site_also_stopped: bool=False, hosting_environment_profile=None, client_affinity_enabled: bool=None, client_cert_enabled: bool=None, client_cert_exclusion_paths: str=None, host_names_disabled: bool=None, container_size: int=None, daily_memory_time_quota: int=None, cloning_info=None, https_only: bool=None, redundancy_mode=None, geo_distributions=None, identity=None, **kwargs) -> None: super(Site, self).__init__(kind=kind, location=location, tags=tags, **kwargs) self.state = None self.host_names = None @@ -230,6 +246,7 @@ def __init__(self, *, location: str, kind: str=None, tags=None, enabled: bool=No self.hosting_environment_profile = hosting_environment_profile self.client_affinity_enabled = client_affinity_enabled self.client_cert_enabled = client_cert_enabled + self.client_cert_exclusion_paths = client_cert_exclusion_paths self.host_names_disabled = host_names_disabled self.outbound_ip_addresses = None self.possible_outbound_ip_addresses = None @@ -243,4 +260,7 @@ def __init__(self, *, location: str, kind: str=None, tags=None, enabled: bool=No self.default_host_name = None self.slot_swap_status = None self.https_only = https_only + self.redundancy_mode = redundancy_mode + self.in_progress_operation_id = None + self.geo_distributions = geo_distributions self.identity = identity diff --git a/azure-mgmt-web/azure/mgmt/web/models/slot_swap_status.py b/azure-mgmt-web/azure/mgmt/web/models/slot_swap_status.py index 73c238d3fd5b..ec53d53176b3 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/slot_swap_status.py +++ b/azure-mgmt-web/azure/mgmt/web/models/slot_swap_status.py @@ -13,7 +13,7 @@ class SlotSwapStatus(Model): - """The status of the last successfull slot swap operation. + """The status of the last successful slot swap operation. Variables are only populated by the server, and will be ignored when sending a request. diff --git a/azure-mgmt-web/azure/mgmt/web/models/slot_swap_status_py3.py b/azure-mgmt-web/azure/mgmt/web/models/slot_swap_status_py3.py index 9d555a5fe6f2..3b761bdd0f62 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/slot_swap_status_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/slot_swap_status_py3.py @@ -13,7 +13,7 @@ class SlotSwapStatus(Model): - """The status of the last successfull slot swap operation. + """The status of the last successful slot swap operation. Variables are only populated by the server, and will be ignored when sending a request. 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/stack_minor_version.py b/azure-mgmt-web/azure/mgmt/web/models/stack_minor_version.py index f732bbb506a0..bda75c672856 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/stack_minor_version.py +++ b/azure-mgmt-web/azure/mgmt/web/models/stack_minor_version.py @@ -22,12 +22,16 @@ class StackMinorVersion(Model): :param is_default: true if this is the default minor version; otherwise, false. :type is_default: bool + :param is_remote_debugging_enabled: true if this supports + Remote Debugging, otherwise false. + :type is_remote_debugging_enabled: bool """ _attribute_map = { 'display_version': {'key': 'displayVersion', 'type': 'str'}, 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'is_remote_debugging_enabled': {'key': 'isRemoteDebuggingEnabled', 'type': 'bool'}, } def __init__(self, **kwargs): @@ -35,3 +39,4 @@ def __init__(self, **kwargs): self.display_version = kwargs.get('display_version', None) self.runtime_version = kwargs.get('runtime_version', None) self.is_default = kwargs.get('is_default', None) + self.is_remote_debugging_enabled = kwargs.get('is_remote_debugging_enabled', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/stack_minor_version_py3.py b/azure-mgmt-web/azure/mgmt/web/models/stack_minor_version_py3.py index 3d1d4741da2c..4e22ceb6be53 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/stack_minor_version_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/stack_minor_version_py3.py @@ -22,16 +22,21 @@ class StackMinorVersion(Model): :param is_default: true if this is the default minor version; otherwise, false. :type is_default: bool + :param is_remote_debugging_enabled: true if this supports + Remote Debugging, otherwise false. + :type is_remote_debugging_enabled: bool """ _attribute_map = { 'display_version': {'key': 'displayVersion', 'type': 'str'}, 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'is_remote_debugging_enabled': {'key': 'isRemoteDebuggingEnabled', 'type': 'bool'}, } - def __init__(self, *, display_version: str=None, runtime_version: str=None, is_default: bool=None, **kwargs) -> None: + def __init__(self, *, display_version: str=None, runtime_version: str=None, is_default: bool=None, is_remote_debugging_enabled: bool=None, **kwargs) -> None: super(StackMinorVersion, self).__init__(**kwargs) self.display_version = display_version self.runtime_version = runtime_version self.is_default = is_default + self.is_remote_debugging_enabled = is_remote_debugging_enabled diff --git a/azure-mgmt-web/azure/mgmt/web/models/user.py b/azure-mgmt-web/azure/mgmt/web/models/user.py index 548b51584a9e..09fa23dbe8f0 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/user.py +++ b/azure-mgmt-web/azure/mgmt/web/models/user.py @@ -13,7 +13,7 @@ class User(ProxyOnlyResource): - """User crendentials used for publishing activity. + """User credentials used for publishing activity. Variables are only populated by the server, and will be ignored when sending a request. diff --git a/azure-mgmt-web/azure/mgmt/web/models/user_py3.py b/azure-mgmt-web/azure/mgmt/web/models/user_py3.py index 6f57069f740b..b6b6d210a0a6 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/user_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/user_py3.py @@ -13,7 +13,7 @@ class User(ProxyOnlyResource): - """User crendentials used for publishing activity. + """User credentials used for publishing activity. Variables are only populated by the server, and will be ignored when sending a request. diff --git a/azure-mgmt-web/azure/mgmt/web/models/validate_container_settings_request.py b/azure-mgmt-web/azure/mgmt/web/models/validate_container_settings_request.py new file mode 100644 index 000000000000..c8a4a5d97903 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/validate_container_settings_request.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ValidateContainerSettingsRequest(Model): + """Container settings validation request context. + + :param base_url: Base URL of the container registry + :type base_url: str + :param username: Username for to access the container registry + :type username: str + :param password: Password for to access the container registry + :type password: str + :param repository: Repository name (image name) + :type repository: str + :param tag: Image tag + :type tag: str + :param platform: Platform (windows or linux) + :type platform: str + """ + + _attribute_map = { + 'base_url': {'key': 'baseUrl', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'repository': {'key': 'repository', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'platform': {'key': 'platform', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ValidateContainerSettingsRequest, self).__init__(**kwargs) + self.base_url = kwargs.get('base_url', None) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) + self.repository = kwargs.get('repository', None) + self.tag = kwargs.get('tag', None) + self.platform = kwargs.get('platform', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/validate_container_settings_request_py3.py b/azure-mgmt-web/azure/mgmt/web/models/validate_container_settings_request_py3.py new file mode 100644 index 000000000000..95e2ecfb46e3 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/validate_container_settings_request_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ValidateContainerSettingsRequest(Model): + """Container settings validation request context. + + :param base_url: Base URL of the container registry + :type base_url: str + :param username: Username for to access the container registry + :type username: str + :param password: Password for to access the container registry + :type password: str + :param repository: Repository name (image name) + :type repository: str + :param tag: Image tag + :type tag: str + :param platform: Platform (windows or linux) + :type platform: str + """ + + _attribute_map = { + 'base_url': {'key': 'baseUrl', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'repository': {'key': 'repository', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'platform': {'key': 'platform', 'type': 'str'}, + } + + def __init__(self, *, base_url: str=None, username: str=None, password: str=None, repository: str=None, tag: str=None, platform: str=None, **kwargs) -> None: + super(ValidateContainerSettingsRequest, self).__init__(**kwargs) + self.base_url = base_url + self.username = username + self.password = password + self.repository = repository + self.tag = tag + self.platform = platform diff --git a/azure-mgmt-web/azure/mgmt/web/models/validate_request.py b/azure-mgmt-web/azure/mgmt/web/models/validate_request.py index 6d1deca2bc5e..dd69fc30ccb5 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/validate_request.py +++ b/azure-mgmt-web/azure/mgmt/web/models/validate_request.py @@ -35,7 +35,7 @@ class ValidateRequest(Model): :param is_spot: true if App Service plan is for Spot instances; otherwise, false. :type is_spot: bool - :param capacity: Target capacity of the App Service plan (number of VM's). + :param capacity: Target capacity of the App Service plan (number of VMs). :type capacity: int :param hosting_environment: Name of App Service Environment where app or App Service plan should be created. diff --git a/azure-mgmt-web/azure/mgmt/web/models/validate_request_py3.py b/azure-mgmt-web/azure/mgmt/web/models/validate_request_py3.py index 848236c53bd2..864ec706c9c7 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/validate_request_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/validate_request_py3.py @@ -35,7 +35,7 @@ class ValidateRequest(Model): :param is_spot: true if App Service plan is for Spot instances; otherwise, false. :type is_spot: bool - :param capacity: Target capacity of the App Service plan (number of VM's). + :param capacity: Target capacity of the App Service plan (number of VMs). :type capacity: int :param hosting_environment: Name of App Service Environment where app or App Service plan should be created. 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/models/web_site_management_client_enums.py b/azure-mgmt-web/azure/mgmt/web/models/web_site_management_client_enums.py index ab38e3030187..c68a6aedf877 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/web_site_management_client_enums.py +++ b/azure-mgmt-web/azure/mgmt/web/models/web_site_management_client_enums.py @@ -200,6 +200,15 @@ class SiteAvailabilityState(str, Enum): disaster_recovery_mode = "DisasterRecoveryMode" +class RedundancyMode(str, Enum): + + none = "None" + manual = "Manual" + failover = "Failover" + active_active = "ActiveActive" + geo_redundant = "GeoRedundant" + + class StatusOptions(str, Enum): ready = "Ready" @@ -544,3 +553,5 @@ class SkuName(str, Enum): dynamic = "Dynamic" isolated = "Isolated" premium_v2 = "PremiumV2" + elastic_premium = "ElasticPremium" + elastic_isolated = "ElasticIsolated" diff --git a/azure-mgmt-web/azure/mgmt/web/operations/app_service_certificate_orders_operations.py b/azure-mgmt-web/azure/mgmt/web/operations/app_service_certificate_orders_operations.py index a9e97191b87f..c4ad927b1b5b 100644 --- a/azure-mgmt-web/azure/mgmt/web/operations/app_service_certificate_orders_operations.py +++ b/azure-mgmt-web/azure/mgmt/web/operations/app_service_certificate_orders_operations.py @@ -355,8 +355,8 @@ def create_or_update( :type resource_group_name: str :param certificate_order_name: Name of the certificate order. :type certificate_order_name: str - :param certificate_distinguished_name: Distinguished name to to use - for the certificate order. + :param certificate_distinguished_name: Distinguished name to use for + the certificate order. :type certificate_distinguished_name: ~azure.mgmt.web.models.AppServiceCertificateOrder :param dict custom_headers: headers that will be added to the request @@ -468,8 +468,8 @@ def update( :type resource_group_name: str :param certificate_order_name: Name of the certificate order. :type certificate_order_name: str - :param certificate_distinguished_name: Distinguished name to to use - for the certificate order. + :param certificate_distinguished_name: Distinguished name to use for + the certificate order. :type certificate_distinguished_name: ~azure.mgmt.web.models.AppServiceCertificateOrderPatchResource :param dict custom_headers: headers that will be added to the request diff --git a/azure-mgmt-web/azure/mgmt/web/operations/app_service_plans_operations.py b/azure-mgmt-web/azure/mgmt/web/operations/app_service_plans_operations.py index e9089ba1c008..678402b79e06 100644 --- a/azure-mgmt-web/azure/mgmt/web/operations/app_service_plans_operations.py +++ b/azure-mgmt-web/azure/mgmt/web/operations/app_service_plans_operations.py @@ -41,9 +41,9 @@ def __init__(self, client, config, serializer, deserializer): def list( self, detailed=None, custom_headers=None, raw=False, **operation_config): - """Get all App Service plans for a subcription. + """Get all App Service plans for a subscription. - Get all App Service plans for a subcription. + Get all App Service plans for a subscription. :param detailed: Specify true to return all App Service plan properties. The default is false, which returns a @@ -1035,9 +1035,9 @@ def internal_paging(next_link=None, raw=False): def list_metrics( self, resource_group_name, name, details=None, filter=None, custom_headers=None, raw=False, **operation_config): - """Get metrics for an App Serice plan. + """Get metrics for an App Service plan. - Get metrics for an App Serice plan. + Get metrics for an App Service plan. :param resource_group_name: Name of the resource group to which the resource belongs. @@ -1129,7 +1129,7 @@ def restart_web_apps( :type resource_group_name: str :param name: Name of the App Service plan. :type name: str - :param soft_restart: Specify true to performa a soft + :param soft_restart: Specify true to perform a soft restart, applies the configuration settings and restarts the apps if necessary. The default is false, which always restarts and reprovisions the apps @@ -1270,9 +1270,9 @@ def internal_paging(next_link=None, raw=False): def get_server_farm_skus( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Gets all selectable sku's for a given App Service Plan. + """Gets all selectable SKUs for a given App Service Plan. - Gets all selectable sku's for a given App Service Plan. + Gets all selectable SKUs for a given App Service Plan. :param resource_group_name: Name of the resource group to which the resource belongs. diff --git a/azure-mgmt-web/azure/mgmt/web/operations/certificates_operations.py b/azure-mgmt-web/azure/mgmt/web/operations/certificates_operations.py index 8784295f79b5..c6f8977ac099 100644 --- a/azure-mgmt-web/azure/mgmt/web/operations/certificates_operations.py +++ b/azure-mgmt-web/azure/mgmt/web/operations/certificates_operations.py @@ -23,7 +23,7 @@ class CertificatesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: API Version. Constant value: "2018-02-01". + :ivar api_version: API Version. Constant value: "2018-11-01". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-02-01" + self.api_version = "2018-11-01" self.config = config diff --git a/azure-mgmt-web/azure/mgmt/web/operations/provider_operations.py b/azure-mgmt-web/azure/mgmt/web/operations/provider_operations.py index 19430e11b82f..884a432121a4 100644 --- a/azure-mgmt-web/azure/mgmt/web/operations/provider_operations.py +++ b/azure-mgmt-web/azure/mgmt/web/operations/provider_operations.py @@ -42,7 +42,8 @@ def get_available_stacks( Get available application frameworks and their versions. - :param os_type_selected: Possible values include: 'Windows', 'Linux' + :param os_type_selected: Possible values include: 'Windows', 'Linux', + 'WindowsFunctions', 'LinuxFunctions' :type os_type_selected: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -170,7 +171,8 @@ def get_available_stacks_on_prem( Get available application frameworks and their versions. - :param os_type_selected: Possible values include: 'Windows', 'Linux' + :param os_type_selected: Possible values include: 'Windows', 'Linux', + 'WindowsFunctions', 'LinuxFunctions' :type os_type_selected: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the diff --git a/azure-mgmt-web/azure/mgmt/web/operations/recommendations_operations.py b/azure-mgmt-web/azure/mgmt/web/operations/recommendations_operations.py index b9a3f4e147d2..4dccc9a08024 100644 --- a/azure-mgmt-web/azure/mgmt/web/operations/recommendations_operations.py +++ b/azure-mgmt-web/azure/mgmt/web/operations/recommendations_operations.py @@ -218,6 +218,435 @@ def disable_recommendation_for_subscription( return client_raw_response disable_recommendation_for_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/{name}/disable'} + def list_history_for_hosting_environment( + self, resource_group_name, hosting_environment_name, expired_only=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Get past recommendations for an app, optionally specified by the time + range. + + Get past recommendations for an app, optionally specified by the time + range. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the hosting environment. + :type hosting_environment_name: str + :param expired_only: Specify false to return all + recommendations. The default is true, which returns only + expired recommendations. + :type expired_only: bool + :param filter: Filter is specified by using OData syntax. Example: + $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain + eq duration'[PT1H|PT1M|P1D] + :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 Recommendation + :rtype: + ~azure.mgmt.web.models.RecommendationPaged[~azure.mgmt.web.models.Recommendation] + :raises: + :class:`DefaultErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_history_for_hosting_environment.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\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_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 expired_only is not None: + query_parameters['expiredOnly'] = self._serialize.query("expired_only", expired_only, '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 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.RecommendationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RecommendationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_history_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendationHistory'} + + def list_recommended_rules_for_hosting_environment( + self, resource_group_name, hosting_environment_name, featured=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Get all recommendations for an app. + + Get all recommendations for an app. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the app. + :type hosting_environment_name: str + :param featured: Specify true to return only the most + critical recommendations. The default is false, which + returns all recommendations. + :type featured: bool + :param filter: Return only channels specified in the filter. Filter is + specified by using OData syntax. Example: $filter=channel eq 'Api' or + channel eq 'Notification' + :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 Recommendation + :rtype: + ~azure.mgmt.web.models.RecommendationPaged[~azure.mgmt.web.models.Recommendation] + :raises: + :class:`DefaultErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_recommended_rules_for_hosting_environment.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\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_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 featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, '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 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.RecommendationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RecommendationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_recommended_rules_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations'} + + def disable_all_for_hosting_environment( + self, resource_group_name, environment_name, hosting_environment_name, custom_headers=None, raw=False, **operation_config): + """Disable all recommendations for an app. + + Disable all recommendations for an app. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param environment_name: Name of the app. + :type environment_name: str + :param hosting_environment_name: + :type hosting_environment_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.disable_all_for_hosting_environment.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\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_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['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + 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 + disable_all_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/disable'} + + def reset_all_filters_for_hosting_environment( + self, resource_group_name, environment_name, hosting_environment_name, custom_headers=None, raw=False, **operation_config): + """Reset all recommendation opt-out settings for an app. + + Reset all recommendation opt-out settings for an app. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param environment_name: Name of the app. + :type environment_name: str + :param hosting_environment_name: + :type hosting_environment_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.reset_all_filters_for_hosting_environment.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\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_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['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + 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 + reset_all_filters_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/reset'} + + def get_rule_details_by_hosting_environment( + self, resource_group_name, hosting_environment_name, name, update_seen=None, recommendation_id=None, custom_headers=None, raw=False, **operation_config): + """Get a recommendation rule for an app. + + Get a recommendation rule for an app. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the hosting environment. + :type hosting_environment_name: str + :param name: Name of the recommendation. + :type name: str + :param update_seen: Specify true to update the last-seen + timestamp of the recommendation object. + :type update_seen: bool + :param recommendation_id: The GUID of the recommendation object if you + query an expired one. You don't need to specify it to query an active + entry. + :type recommendation_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: RecommendationRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.RecommendationRule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.get_rule_details_by_hosting_environment.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\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + '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 update_seen is not None: + query_parameters['updateSeen'] = self._serialize.query("update_seen", update_seen, 'bool') + if recommendation_id is not None: + query_parameters['recommendationId'] = self._serialize.query("recommendation_id", recommendation_id, '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: + 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('RecommendationRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_rule_details_by_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}'} + + def disable_recommendation_for_hosting_environment( + self, resource_group_name, environment_name, name, hosting_environment_name, custom_headers=None, raw=False, **operation_config): + """Disables the specific rule for a web site permanently. + + Disables the specific rule for a web site permanently. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param environment_name: Site name + :type environment_name: str + :param name: Rule name + :type name: str + :param hosting_environment_name: + :type hosting_environment_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.disable_recommendation_for_hosting_environment.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'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_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['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + 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.post(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 + disable_recommendation_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}/disable'} + def list_history_for_web_app( self, resource_group_name, site_name, expired_only=None, filter=None, custom_headers=None, raw=False, **operation_config): """Get past recommendations for an app, optionally specified by the time @@ -517,7 +946,7 @@ def get_rule_details_by_web_app( :param update_seen: Specify true to update the last-seen timestamp of the recommendation object. :type update_seen: bool - :param recommendation_id: The GUID of the recommedation object if you + :param recommendation_id: The GUID of the recommendation object if you query an expired one. You don't need to specify it to query an active entry. :type recommendation_id: str 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 16fba6036b43..9b5d7b3e5d0b 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 @@ -2530,11 +2530,13 @@ def update_slot_configuration_names( return deserialized update_slot_configuration_names.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames'} - def get_swift_virtual_network_connection( + def get_configuration( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Gets a Swift Virtual Network connection. + """Gets the configuration of an app, such as platform version and bitness, + default documents, virtual applications, Always On, etc. - Gets a Swift Virtual Network connection. + Gets the configuration of an app, such as platform version and bitness, + default documents, virtual applications, Always On, etc. :param resource_group_name: Name of the resource group to which the resource belongs. @@ -2546,14 +2548,14 @@ def get_swift_virtual_network_connection( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: SwiftVirtualNetwork or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.SwiftVirtualNetwork or + :return: SiteConfigResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.SiteConfigResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_swift_virtual_network_connection.metadata['url'] + url = self.get_configuration.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'), @@ -2585,48 +2587,42 @@ def get_swift_virtual_network_connection( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SwiftVirtualNetwork', response) + deserialized = self._deserialize('SiteConfigResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/virtualNetwork'} + get_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} - def create_or_update_swift_virtual_network_connection( - 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. + def create_or_update_configuration( + self, resource_group_name, name, site_config, custom_headers=None, raw=False, **operation_config): + """Updates the configuration of an app. - 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. + Updates the configuration 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 connection_envelope: Properties of the Virtual Network - connection. See example. - :type connection_envelope: ~azure.mgmt.web.models.SwiftVirtualNetwork + :param site_config: JSON representation of a SiteConfig object. See + example. + :type site_config: ~azure.mgmt.web.models.SiteConfigResource :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 + :return: SiteConfigResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.SiteConfigResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.create_or_update_swift_virtual_network_connection.metadata['url'] + url = self.create_or_update_configuration.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'), @@ -2650,7 +2646,7 @@ def create_or_update_swift_virtual_network_connection( 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') + body_content = self._serialize.body(site_config, 'SiteConfigResource') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -2662,39 +2658,42 @@ def create_or_update_swift_virtual_network_connection( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SwiftVirtualNetwork', response) + deserialized = self._deserialize('SiteConfigResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/virtualNetwork'} + create_or_update_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} - def delete_swift_virtual_network( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Deletes a Swift Virtual Network connection from an app (or deployment - slot). + def update_configuration( + self, resource_group_name, name, site_config, custom_headers=None, raw=False, **operation_config): + """Updates the configuration of an app. - Deletes a Swift Virtual Network connection from an app (or deployment - slot). + Updates the configuration 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 site_config: JSON representation of a SiteConfig object. See + example. + :type site_config: ~azure.mgmt.web.models.SiteConfigResource :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: SiteConfigResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.SiteConfigResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_swift_virtual_network.metadata['url'] + url = self.update_configuration.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'), @@ -2708,6 +2707,8 @@ def delete_swift_virtual_network( # 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: @@ -2715,110 +2716,117 @@ def delete_swift_virtual_network( 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(site_config, 'SiteConfigResource') + # Construct and send request - request = self._client.delete(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, 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('SiteConfigResource', response) if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete_swift_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/virtualNetwork'} - def update_swift_virtual_network_connection( - 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. + return deserialized + update_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} - 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 list_configuration_snapshot_info( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets a list of web app configuration snapshots identifiers. Each + element of the list contains a timestamp and the ID of the snapshot. + + Gets a list of web app configuration snapshots identifiers. Each + element of the list contains a timestamp and the ID of the snapshot. :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 + :return: An iterator like instance of SiteConfigurationSnapshotInfo + :rtype: + ~azure.mgmt.web.models.SiteConfigurationSnapshotInfoPaged[~azure.mgmt.web.models.SiteConfigurationSnapshotInfo] :raises: :class:`DefaultErrorResponseException` """ - # Construct URL - url = self.update_swift_virtual_network_connection.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) + def internal_paging(next_link=None, raw=False): - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if not next_link: + # Construct URL + url = self.list_configuration_snapshot_info.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 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 parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - # Construct body - body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + else: + url = next_link + query_parameters = {} - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - 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') - if response.status_code not in [200]: - raise models.DefaultErrorResponseException(self._deserialize, response) + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) - deserialized = None + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) - if response.status_code == 200: - deserialized = self._deserialize('SwiftVirtualNetwork', response) + return response + + # Deserialize response + deserialized = models.SiteConfigurationSnapshotInfoPaged(internal_paging, self._deserialize.dependencies) if raw: - client_raw_response = ClientRawResponse(deserialized, response) + header_dict = {} + client_raw_response = models.SiteConfigurationSnapshotInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - update_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/virtualNetwork'} + list_configuration_snapshot_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots'} - def get_configuration( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Gets the configuration of an app, such as platform version and bitness, - default documents, virtual applications, Always On, etc. + def get_configuration_snapshot( + self, resource_group_name, name, snapshot_id, custom_headers=None, raw=False, **operation_config): + """Gets a snapshot of the configuration of an app at a previous point in + time. - Gets the configuration of an app, such as platform version and bitness, - default documents, virtual applications, Always On, etc. + Gets a snapshot of the configuration of an app at a previous point in + time. :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 snapshot_id: The ID of the snapshot to read. + :type snapshot_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 @@ -2831,10 +2839,11 @@ def get_configuration( :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_configuration.metadata['url'] + url = self.get_configuration_snapshot.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'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2870,38 +2879,36 @@ def get_configuration( return client_raw_response return deserialized - get_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} + get_configuration_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}'} - def create_or_update_configuration( - self, resource_group_name, name, site_config, custom_headers=None, raw=False, **operation_config): - """Updates the configuration of an app. + def recover_site_configuration_snapshot( + self, resource_group_name, name, snapshot_id, custom_headers=None, raw=False, **operation_config): + """Reverts the configuration of an app to a previous snapshot. - Updates the configuration of an app. + Reverts the configuration of an app to a previous snapshot. :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 site_config: JSON representation of a SiteConfig object. See - example. - :type site_config: ~azure.mgmt.web.models.SiteConfigResource + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_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: SiteConfigResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.SiteConfigResource 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.create_or_update_configuration.metadata['url'] + url = self.recover_site_configuration_snapshot.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'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2912,8 +2919,6 @@ def create_or_update_configuration( # 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: @@ -2921,55 +2926,47 @@ def create_or_update_configuration( 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(site_config, 'SiteConfigResource') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + 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('SiteConfigResource', response) + if response.status_code not in [204]: + 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 + recover_site_configuration_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}/recover'} - return deserialized - create_or_update_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} - - def update_configuration( - self, resource_group_name, name, site_config, custom_headers=None, raw=False, **operation_config): - """Updates the configuration of an app. + def get_web_site_container_logs( + self, resource_group_name, name, custom_headers=None, raw=False, callback=None, **operation_config): + """Gets the last lines of docker logs for the given site. - Updates the configuration of an app. + Gets the last lines of docker logs for the given 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: Name of web app. :type name: str - :param site_config: JSON representation of a SiteConfig object. See - example. - :type site_config: ~azure.mgmt.web.models.SiteConfigResource :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response + :param callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] :param operation_config: :ref:`Operation configuration overrides`. - :return: SiteConfigResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.SiteConfigResource or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` """ # Construct URL - url = self.update_configuration.metadata['url'] + url = self.get_web_site_container_logs.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'), @@ -2983,8 +2980,7 @@ def update_configuration( # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/octet-stream' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -2992,49 +2988,115 @@ def update_configuration( 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(site_config, 'SiteConfigResource') + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=True, **operation_config) + + 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 response.status_code == 200: + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_web_site_container_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs'} + + def get_container_logs_zip( + self, resource_group_name, name, custom_headers=None, raw=False, callback=None, **operation_config): + """Gets the ZIP archived docker log files for the given site. + + Gets the ZIP archived docker log files for the given site. + + :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 dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_container_logs_zip.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 headers + header_parameters = {} + header_parameters['Accept'] = 'application/zip' + 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.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=True, **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 response.status_code == 200: - deserialized = self._deserialize('SiteConfigResource', response) + deserialized = self._client.stream_download(response, callback) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} + get_container_logs_zip.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download'} - def list_configuration_snapshot_info( + def list_continuous_web_jobs( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Gets a list of web app configuration snapshots identifiers. Each - element of the list contains a timestamp and the ID of the snapshot. + """List continuous web jobs for an app, or a deployment slot. - Gets a list of web app configuration snapshots identifiers. Each - element of the list contains a timestamp and the ID of the snapshot. + List continuous web jobs for an app, or a deployment slot. :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: Site 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 SiteConfigurationSnapshotInfo + :return: An iterator like instance of ContinuousWebJob :rtype: - ~azure.mgmt.web.models.SiteConfigurationSnapshotInfoPaged[~azure.mgmt.web.models.SiteConfigurationSnapshotInfo] + ~azure.mgmt.web.models.ContinuousWebJobPaged[~azure.mgmt.web.models.ContinuousWebJob] :raises: :class:`DefaultErrorResponseException` """ @@ -3042,7 +3104,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = self.list_configuration_snapshot_info.metadata['url'] + url = self.list_continuous_web_jobs.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'), @@ -3078,48 +3140,45 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.SiteConfigurationSnapshotInfoPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.ContinuousWebJobPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.SiteConfigurationSnapshotInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.ContinuousWebJobPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_configuration_snapshot_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots'} + list_continuous_web_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs'} - def get_configuration_snapshot( - self, resource_group_name, name, snapshot_id, custom_headers=None, raw=False, **operation_config): - """Gets a snapshot of the configuration of an app at a previous point in - time. + def get_continuous_web_job( + self, resource_group_name, name, web_job_name, custom_headers=None, raw=False, **operation_config): + """Gets a continuous web job by its ID for an app, or a deployment slot. - Gets a snapshot of the configuration of an app at a previous point in - time. + Gets a continuous web job by its ID for an app, or a deployment slot. :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: Site name. :type name: str - :param snapshot_id: The ID of the snapshot to read. - :type snapshot_id: str + :param web_job_name: Name of Web Job. + :type web_job_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: SiteConfigResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.SiteConfigResource or + :return: ContinuousWebJob or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.ContinuousWebJob or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` + :raises: :class:`CloudError` """ # Construct URL - url = self.get_configuration_snapshot.metadata['url'] + url = self.get_continuous_web_job.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'), - 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3142,34 +3201,36 @@ def get_configuration_snapshot( 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, 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('SiteConfigResource', response) + deserialized = self._deserialize('ContinuousWebJob', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_configuration_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}'} + get_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'} - def recover_site_configuration_snapshot( - self, resource_group_name, name, snapshot_id, custom_headers=None, raw=False, **operation_config): - """Reverts the configuration of an app to a previous snapshot. + def delete_continuous_web_job( + self, resource_group_name, name, web_job_name, custom_headers=None, raw=False, **operation_config): + """Delete a continuous web job by its ID for an app, or a deployment slot. - Reverts the configuration of an app to a previous snapshot. + Delete a continuous web job by its ID for an app, or a deployment slot. :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: Site name. :type name: str - :param snapshot_id: The ID of the snapshot to read. - :type snapshot_id: str + :param web_job_name: Name of Web Job. + :type web_job_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 @@ -3180,11 +3241,11 @@ def recover_site_configuration_snapshot( :raises: :class:`CloudError` """ # Construct URL - url = self.recover_site_configuration_snapshot.metadata['url'] + url = self.delete_continuous_web_job.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'), - 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3203,10 +3264,10 @@ def recover_site_configuration_snapshot( 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 [204]: + if response.status_code not in [200, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -3214,38 +3275,36 @@ def recover_site_configuration_snapshot( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - recover_site_configuration_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}/recover'} + delete_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'} - def get_web_site_container_logs( - self, resource_group_name, name, custom_headers=None, raw=False, callback=None, **operation_config): - """Gets the last lines of docker logs for the given site. + def start_continuous_web_job( + self, resource_group_name, name, web_job_name, custom_headers=None, raw=False, **operation_config): + """Start a continuous web job for an app, or a deployment slot. - Gets the last lines of docker logs for the given site. + Start a continuous web job for an app, or a deployment slot. :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: Site name. :type name: str + :param web_job_name: Name of Web Job. + :type web_job_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 callback: When specified, will be called with each chunk of - data that is streamed. The callback should take two arguments, the - bytes of the current chunk of data and the response object. If the - data is uploading, response will be None. - :type callback: Callable[Bytes, response=None] :param operation_config: :ref:`Operation configuration overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get_web_site_container_logs.metadata['url'] + url = self.start_continuous_web_job.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'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3256,7 +3315,6 @@ def get_web_site_container_logs( # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/octet-stream' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -3266,55 +3324,46 @@ def get_web_site_container_logs( # Construct and send request request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=True, **operation_config) + 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 - deserialized = None - - if response.status_code == 200: - deserialized = self._client.stream_download(response, callback) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + start_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start'} - return deserialized - get_web_site_container_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs'} - - def get_container_logs_zip( - self, resource_group_name, name, custom_headers=None, raw=False, callback=None, **operation_config): - """Gets the ZIP archived docker log files for the given site. + def stop_continuous_web_job( + self, resource_group_name, name, web_job_name, custom_headers=None, raw=False, **operation_config): + """Stop a continuous web job for an app, or a deployment slot. - Gets the ZIP archived docker log files for the given site. + Stop a continuous web job for an app, or a deployment slot. :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: Site name. :type name: str + :param web_job_name: Name of Web Job. + :type web_job_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 callback: When specified, will be called with each chunk of - data that is streamed. The callback should take two arguments, the - bytes of the current chunk of data and the response object. If the - data is uploading, response will be None. - :type callback: Callable[Bytes, response=None] :param operation_config: :ref:`Operation configuration overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get_container_logs_zip.metadata['url'] + url = self.stop_continuous_web_job.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'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3325,7 +3374,6 @@ def get_container_logs_zip( # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/zip' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -3335,44 +3383,37 @@ def get_container_logs_zip( # Construct and send request request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=True, **operation_config) + 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 - deserialized = None - - if response.status_code == 200: - deserialized = self._client.stream_download(response, callback) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + stop_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop'} - return deserialized - get_container_logs_zip.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download'} - - def list_continuous_web_jobs( + def list_deployments( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """List continuous web jobs for an app, or a deployment slot. + """List deployments for an app, or a deployment slot. - List continuous web jobs for an app, or a deployment slot. + List deployments for an app, or a deployment slot. :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 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 ContinuousWebJob + :return: An iterator like instance of Deployment :rtype: - ~azure.mgmt.web.models.ContinuousWebJobPaged[~azure.mgmt.web.models.ContinuousWebJob] + ~azure.mgmt.web.models.DeploymentPaged[~azure.mgmt.web.models.Deployment] :raises: :class:`DefaultErrorResponseException` """ @@ -3380,7 +3421,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = self.list_continuous_web_jobs.metadata['url'] + url = self.list_deployments.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'), @@ -3416,45 +3457,46 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.ContinuousWebJobPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.DeploymentPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.ContinuousWebJobPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.DeploymentPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_continuous_web_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs'} + list_deployments.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments'} - def get_continuous_web_job( - self, resource_group_name, name, web_job_name, custom_headers=None, raw=False, **operation_config): - """Gets a continuous web job by its ID for an app, or a deployment slot. + def get_deployment( + self, resource_group_name, name, id, custom_headers=None, raw=False, **operation_config): + """Get a deployment by its ID for an app, or a deployment slot. - Gets a continuous web job by its ID for an app, or a deployment slot. + Get a deployment by its ID for an app, or a deployment slot. :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 web_job_name: Name of Web Job. - :type web_job_name: str + :param id: Deployment ID. + :type 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: ContinuousWebJob or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.ContinuousWebJob or + :return: Deployment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.Deployment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_continuous_web_job.metadata['url'] + url = self.get_deployment.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'), - 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'id': self._serialize.url("id", id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3477,51 +3519,53 @@ def get_continuous_web_job( 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('ContinuousWebJob', response) + deserialized = self._deserialize('Deployment', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'} + get_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} - def delete_continuous_web_job( - self, resource_group_name, name, web_job_name, custom_headers=None, raw=False, **operation_config): - """Delete a continuous web job by its ID for an app, or a deployment slot. + def create_deployment( + self, resource_group_name, name, id, deployment, custom_headers=None, raw=False, **operation_config): + """Create a deployment for an app, or a deployment slot. - Delete a continuous web job by its ID for an app, or a deployment slot. + Create a deployment for an app, or a deployment slot. :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 web_job_name: Name of Web Job. - :type web_job_name: str + :param id: ID of an existing deployment. + :type id: str + :param deployment: Deployment details. + :type deployment: ~azure.mgmt.web.models.Deployment :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: Deployment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.Deployment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_continuous_web_job.metadata['url'] + url = self.create_deployment.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'), - 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'id': self._serialize.url("id", id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3532,6 +3576,8 @@ def delete_continuous_web_job( # 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: @@ -3539,33 +3585,41 @@ def delete_continuous_web_job( 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(deployment, 'Deployment') + # Construct and send request - request = self._client.delete(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, 204]: - 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('Deployment', response) if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'} - def start_continuous_web_job( - self, resource_group_name, name, web_job_name, custom_headers=None, raw=False, **operation_config): - """Start a continuous web job for an app, or a deployment slot. + return deserialized + create_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} - Start a continuous web job for an app, or a deployment slot. + def delete_deployment( + self, resource_group_name, name, id, custom_headers=None, raw=False, **operation_config): + """Delete a deployment by its ID for an app, or a deployment slot. + + Delete a deployment by its ID for an app, or a deployment slot. :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 web_job_name: Name of Web Job. - :type web_job_name: str + :param id: Deployment ID. + :type 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 @@ -3576,11 +3630,11 @@ def start_continuous_web_job( :raises: :class:`CloudError` """ # Construct URL - url = self.start_continuous_web_job.metadata['url'] + url = self.delete_deployment.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'), - 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'id': self._serialize.url("id", id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3599,10 +3653,10 @@ def start_continuous_web_job( 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, 404]: + if response.status_code not in [200, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -3610,36 +3664,42 @@ def start_continuous_web_job( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - start_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start'} + delete_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} - def stop_continuous_web_job( - self, resource_group_name, name, web_job_name, custom_headers=None, raw=False, **operation_config): - """Stop a continuous web job for an app, or a deployment slot. + def list_deployment_log( + self, resource_group_name, name, id, custom_headers=None, raw=False, **operation_config): + """List deployment log for specific deployment for an app, or a deployment + slot. - Stop a continuous web job for an app, or a deployment slot. + List deployment log for specific deployment for an app, or a deployment + slot. :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 web_job_name: Name of Web Job. - :type web_job_name: str + :param id: The ID of a specific deployment. This is the value of the + name property in the JSON response from "GET + /api/sites/{siteName}/deployments". + :type 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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :return: Deployment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.Deployment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.stop_continuous_web_job.metadata['url'] + url = self.list_deployment_log.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'), - 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'id': self._serialize.url("id", id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3650,6 +3710,7 @@ def stop_continuous_web_job( # 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: @@ -3658,65 +3719,145 @@ def stop_continuous_web_job( 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, 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('Deployment', response) if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - stop_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop'} - def list_deployments( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """List deployments for an app, or a deployment slot. + return deserialized + list_deployment_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log'} - List deployments for an app, or a deployment slot. + def discover_backup( + self, resource_group_name, name, request, custom_headers=None, raw=False, **operation_config): + """Discovers an existing app backup that can be restored from a blob in + Azure storage. Use this to get information about the databases stored + in a backup. + + Discovers an existing app backup that can be restored from a blob in + Azure storage. Use this to get information about the databases stored + in a backup. :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 request: A RestoreRequest object that includes Azure storage + URL and blog name for discovery of backup. + :type request: ~azure.mgmt.web.models.RestoreRequest :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 Deployment - :rtype: - ~azure.mgmt.web.models.DeploymentPaged[~azure.mgmt.web.models.Deployment] + :return: RestoreRequest or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.RestoreRequest or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_deployments.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 URL + url = self.discover_backup.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) - else: - url = next_link - query_parameters = {} + # 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: + # 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(request, 'RestoreRequest') + + # Construct and send request + request = self._client.post(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('RestoreRequest', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + discover_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup'} + + def list_domain_ownership_identifiers( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Lists ownership identifiers for domain associated with web app. + + Lists ownership identifiers for domain associated with 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 the 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 + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Identifier + :rtype: + ~azure.mgmt.web.models.IdentifierPaged[~azure.mgmt.web.models.Identifier] + :raises: + :class:`DefaultErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_domain_ownership_identifiers.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) @@ -3733,46 +3874,47 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.DeploymentPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.IdentifierPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.DeploymentPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.IdentifierPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_deployments.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments'} + list_domain_ownership_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers'} - def get_deployment( - self, resource_group_name, name, id, custom_headers=None, raw=False, **operation_config): - """Get a deployment by its ID for an app, or a deployment slot. + def get_domain_ownership_identifier( + self, resource_group_name, name, domain_ownership_identifier_name, custom_headers=None, raw=False, **operation_config): + """Get domain ownership identifier for web app. - Get a deployment by its ID for an app, or a deployment slot. + Get domain ownership identifier 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 the app. :type name: str - :param id: Deployment ID. - :type id: str + :param domain_ownership_identifier_name: Name of domain ownership + identifier. + :type domain_ownership_identifier_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: Deployment or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.Deployment or + :return: Identifier or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.Identifier or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_deployment.metadata['url'] + url = self.get_domain_ownership_identifier.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'), - 'id': self._serialize.url("id", id, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3801,47 +3943,54 @@ def get_deployment( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Deployment', response) + deserialized = self._deserialize('Identifier', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} + get_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} - def create_deployment( - self, resource_group_name, name, id, deployment, custom_headers=None, raw=False, **operation_config): - """Create a deployment for an app, or a deployment slot. + def create_or_update_domain_ownership_identifier( + self, resource_group_name, name, domain_ownership_identifier_name, kind=None, identifier_id=None, custom_headers=None, raw=False, **operation_config): + """Creates a domain ownership identifier for web app, or updates an + existing ownership identifier. - Create a deployment for an app, or a deployment slot. + Creates a domain ownership identifier for web app, or updates an + existing ownership identifier. :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 id: ID of an existing deployment. - :type id: str - :param deployment: Deployment details. - :type deployment: ~azure.mgmt.web.models.Deployment + :param domain_ownership_identifier_name: Name of domain ownership + identifier. + :type domain_ownership_identifier_name: str + :param kind: Kind of resource. + :type kind: str + :param identifier_id: String representation of the identity. + :type identifier_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: Deployment or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.Deployment or + :return: Identifier or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.Identifier or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ + domain_ownership_identifier = models.Identifier(kind=kind, identifier_id=identifier_id) + # Construct URL - url = self.create_deployment.metadata['url'] + url = self.create_or_update_domain_ownership_identifier.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'), - 'id': self._serialize.url("id", id, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3862,7 +4011,7 @@ def create_deployment( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(deployment, 'Deployment') + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -3874,28 +4023,29 @@ def create_deployment( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Deployment', response) + deserialized = self._deserialize('Identifier', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} + create_or_update_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} - def delete_deployment( - self, resource_group_name, name, id, custom_headers=None, raw=False, **operation_config): - """Delete a deployment by its ID for an app, or a deployment slot. + def delete_domain_ownership_identifier( + self, resource_group_name, name, domain_ownership_identifier_name, custom_headers=None, raw=False, **operation_config): + """Deletes a domain ownership identifier for a web app. - Delete a deployment by its ID for an app, or a deployment slot. + Deletes a domain ownership identifier for a 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 the app. :type name: str - :param id: Deployment ID. - :type id: str + :param domain_ownership_identifier_name: Name of domain ownership + identifier. + :type domain_ownership_identifier_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 @@ -3906,11 +4056,11 @@ def delete_deployment( :raises: :class:`CloudError` """ # Construct URL - url = self.delete_deployment.metadata['url'] + url = self.delete_domain_ownership_identifier.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'), - 'id': self._serialize.url("id", id, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3940,42 +4090,47 @@ def delete_deployment( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} + delete_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} - def list_deployment_log( - self, resource_group_name, name, id, custom_headers=None, raw=False, **operation_config): - """List deployment log for specific deployment for an app, or a deployment - slot. + def update_domain_ownership_identifier( + self, resource_group_name, name, domain_ownership_identifier_name, kind=None, identifier_id=None, custom_headers=None, raw=False, **operation_config): + """Creates a domain ownership identifier for web app, or updates an + existing ownership identifier. - List deployment log for specific deployment for an app, or a deployment - slot. + Creates a domain ownership identifier for web app, or updates an + existing ownership identifier. :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 id: The ID of a specific deployment. This is the value of the - name property in the JSON response from "GET - /api/sites/{siteName}/deployments". - :type id: str + :param domain_ownership_identifier_name: Name of domain ownership + identifier. + :type domain_ownership_identifier_name: str + :param kind: Kind of resource. + :type kind: str + :param identifier_id: String representation of the identity. + :type identifier_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: Deployment or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.Deployment or + :return: Identifier or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.Identifier or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ + domain_ownership_identifier = models.Identifier(kind=kind, identifier_id=identifier_id) + # Construct URL - url = self.list_deployment_log.metadata['url'] + url = self.update_domain_ownership_identifier.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'), - 'id': self._serialize.url("id", id, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3987,6 +4142,7 @@ def list_deployment_log( # 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: @@ -3994,8 +4150,11 @@ def list_deployment_log( 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(domain_ownership_identifier, 'Identifier') + # 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]: @@ -4004,46 +4163,39 @@ def list_deployment_log( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Deployment', response) + deserialized = self._deserialize('Identifier', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_deployment_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log'} + update_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} - def discover_backup( - self, resource_group_name, name, request, custom_headers=None, raw=False, **operation_config): - """Discovers an existing app backup that can be restored from a blob in - Azure storage. Use this to get information about the databases stored - in a backup. + def get_ms_deploy_status( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Get the status of the last MSDeploy operation. - Discovers an existing app backup that can be restored from a blob in - Azure storage. Use this to get information about the databases stored - in a backup. + Get the status of the last MSDeploy operation. :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 request: A RestoreRequest object that includes Azure storage - URL and blog name for discovery of backup. - :type request: ~azure.mgmt.web.models.RestoreRequest :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: RestoreRequest or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.RestoreRequest or + :return: MSDeployStatus or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.MSDeployStatus or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.discover_backup.metadata['url'] + url = self.get_ms_deploy_status.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'), @@ -4058,7 +4210,6 @@ def discover_backup( # 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: @@ -4066,11 +4217,8 @@ def discover_backup( 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(request, 'RestoreRequest') - # Construct and send request - request = self._client.post(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]: @@ -4079,42 +4227,209 @@ def discover_backup( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('RestoreRequest', response) + deserialized = self._deserialize('MSDeployStatus', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - discover_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup'} + get_ms_deploy_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} - def list_domain_ownership_identifiers( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Lists ownership identifiers for domain associated with web app. - Lists ownership identifiers for domain associated with web app. + def _create_ms_deploy_operation_initial( + self, resource_group_name, name, ms_deploy, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_ms_deploy_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'), + '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(ms_deploy, 'MSDeploy') + + # 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 [201, 409]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_ms_deploy_operation( + self, resource_group_name, name, ms_deploy, custom_headers=None, raw=False, polling=True, **operation_config): + """Invoke the MSDeploy web app extension. + + Invoke the MSDeploy web app extension. :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 ms_deploy: Details of MSDeploy operation + :type ms_deploy: ~azure.mgmt.web.models.MSDeploy + :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 MSDeployStatus or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.MSDeployStatus] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.MSDeployStatus]] + :raises: :class:`CloudError` + """ + raw_result = self._create_ms_deploy_operation_initial( + resource_group_name=resource_group_name, + name=name, + ms_deploy=ms_deploy, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('MSDeployStatus', 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) + create_ms_deploy_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} + + def get_ms_deploy_log( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Get the MSDeploy Log for the last MSDeploy operation. + + Get the MSDeploy Log for the last MSDeploy operation. + + :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 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 Identifier + :return: MSDeployLog or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.MSDeployLog or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_ms_deploy_log.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 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('MSDeployLog', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_ms_deploy_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log'} + + def list_functions( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """List the functions for a web site, or a deployment slot. + + List the functions for a web site, or a deployment slot. + + :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 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 FunctionEnvelope :rtype: - ~azure.mgmt.web.models.IdentifierPaged[~azure.mgmt.web.models.Identifier] - :raises: - :class:`DefaultErrorResponseException` + ~azure.mgmt.web.models.FunctionEnvelopePaged[~azure.mgmt.web.models.FunctionEnvelope] + :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = self.list_domain_ownership_identifiers.metadata['url'] + url = self.list_functions.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'), @@ -4144,53 +4459,50 @@ 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]: - raise models.DefaultErrorResponseException(self._deserialize, response) + 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.IdentifierPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.FunctionEnvelopePaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.IdentifierPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.FunctionEnvelopePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_domain_ownership_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers'} + list_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions'} - def get_domain_ownership_identifier( - self, resource_group_name, name, domain_ownership_identifier_name, custom_headers=None, raw=False, **operation_config): - """Get domain ownership identifier for web app. + def get_functions_admin_token( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Fetch a short lived token that can be exchanged for a master key. - Get domain ownership identifier for web app. + Fetch a short lived token that can be exchanged for a master key. :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 domain_ownership_identifier_name: Name of domain ownership - identifier. - :type domain_ownership_identifier_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: Identifier or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.Identifier 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_domain_ownership_identifier.metadata['url'] + url = self.get_functions_admin_token.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'), - 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -4219,54 +4531,44 @@ def get_domain_ownership_identifier( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Identifier', response) + deserialized = self._deserialize('str', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} + get_functions_admin_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token'} - def create_or_update_domain_ownership_identifier( - self, resource_group_name, name, domain_ownership_identifier_name, kind=None, identifier_id=None, custom_headers=None, raw=False, **operation_config): - """Creates a domain ownership identifier for web app, or updates an - existing ownership identifier. + def get_function( + self, resource_group_name, name, function_name, custom_headers=None, raw=False, **operation_config): + """Get function information by its ID for web site, or a deployment slot. - Creates a domain ownership identifier for web app, or updates an - existing ownership identifier. + Get function information by its ID for web site, or a deployment slot. :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: Site name. :type name: str - :param domain_ownership_identifier_name: Name of domain ownership - identifier. - :type domain_ownership_identifier_name: str - :param kind: Kind of resource. - :type kind: str - :param identifier_id: String representation of the identity. - :type identifier_id: str + :param function_name: Function name. + :type function_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: Identifier or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.Identifier or + :return: FunctionEnvelope or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.FunctionEnvelope or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` + :raises: :class:`CloudError` """ - domain_ownership_identifier = models.Identifier(kind=kind, identifier_id=identifier_id) - # Construct URL - url = self.create_or_update_domain_ownership_identifier.metadata['url'] + url = self.get_function.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'), - 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -4278,7 +4580,6 @@ def create_or_update_domain_ownership_identifier( # 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: @@ -4286,57 +4587,36 @@ def create_or_update_domain_ownership_identifier( 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(domain_ownership_identifier, 'Identifier') - # 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]: - raise models.DefaultErrorResponseException(self._deserialize, response) + 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('Identifier', response) + deserialized = self._deserialize('FunctionEnvelope', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} - - def delete_domain_ownership_identifier( - self, resource_group_name, name, domain_ownership_identifier_name, custom_headers=None, raw=False, **operation_config): - """Deletes a domain ownership identifier for a web app. + get_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} - Deletes a domain ownership identifier for a 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 the app. - :type name: str - :param domain_ownership_identifier_name: Name of domain ownership - identifier. - :type domain_ownership_identifier_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` - """ + def _create_function_initial( + self, resource_group_name, name, function_name, function_envelope, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.delete_domain_ownership_identifier.metadata['url'] + url = self.create_function.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'), - 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -4347,6 +4627,8 @@ def delete_domain_ownership_identifier( # 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: @@ -4354,59 +4636,112 @@ def delete_domain_ownership_identifier( 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(function_envelope, 'FunctionEnvelope') + # Construct and send request - request = self._client.delete(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, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if response.status_code not in [201]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('FunctionEnvelope', response) if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} - def update_domain_ownership_identifier( - self, resource_group_name, name, domain_ownership_identifier_name, kind=None, identifier_id=None, custom_headers=None, raw=False, **operation_config): - """Creates a domain ownership identifier for web app, or updates an - existing ownership identifier. + return deserialized - Creates a domain ownership identifier for web app, or updates an - existing ownership identifier. + def create_function( + self, resource_group_name, name, function_name, function_envelope, custom_headers=None, raw=False, polling=True, **operation_config): + """Create function for web site, or a deployment slot. + + Create function for web site, or a deployment slot. :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: Site name. :type name: str - :param domain_ownership_identifier_name: Name of domain ownership - identifier. - :type domain_ownership_identifier_name: str - :param kind: Kind of resource. - :type kind: str - :param identifier_id: String representation of the identity. - :type identifier_id: str + :param function_name: Function name. + :type function_name: str + :param function_envelope: Function details. + :type function_envelope: ~azure.mgmt.web.models.FunctionEnvelope + :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 FunctionEnvelope or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.FunctionEnvelope] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.FunctionEnvelope]] + :raises: + :class:`DefaultErrorResponseException` + """ + raw_result = self._create_function_initial( + resource_group_name=resource_group_name, + name=name, + function_name=function_name, + function_envelope=function_envelope, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('FunctionEnvelope', 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) + create_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} + + def delete_function( + self, resource_group_name, name, function_name, custom_headers=None, raw=False, **operation_config): + """Delete a function for web site, or a deployment slot. + + Delete a function for web site, or a deployment slot. + + :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 function_name: Function name. + :type function_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: Identifier or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.Identifier or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` """ - domain_ownership_identifier = models.Identifier(kind=kind, identifier_id=identifier_id) - # Construct URL - url = self.update_domain_ownership_identifier.metadata['url'] + url = self.delete_function.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'), - 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -4417,8 +4752,6 @@ def update_domain_ownership_identifier( # 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: @@ -4426,55 +4759,52 @@ def update_domain_ownership_identifier( 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(domain_ownership_identifier, 'Identifier') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) + 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('Identifier', response) + if response.status_code not in [204, 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_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} - return deserialized - update_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} - - def get_ms_deploy_status( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Get the status of the last MSDeploy operation. + def list_function_secrets( + self, resource_group_name, name, function_name, custom_headers=None, raw=False, **operation_config): + """Get function secrets for a function in a web site, or a deployment + slot. - Get the status of the last MSDeploy operation. + Get function secrets for a function in a web site, or a deployment + slot. :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: Site name. :type name: str + :param function_name: Function name. + :type function_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: MSDeployStatus or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.MSDeployStatus or + :return: FunctionSecrets or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.FunctionSecrets or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_ms_deploy_status.metadata['url'] + url = self.list_function_secrets.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'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -4494,7 +4824,7 @@ def get_ms_deploy_status( 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]: @@ -4503,209 +4833,42 @@ def get_ms_deploy_status( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('MSDeployStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_ms_deploy_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} - - - def _create_ms_deploy_operation_initial( - self, resource_group_name, name, ms_deploy, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_ms_deploy_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'), - '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(ms_deploy, 'MSDeploy') - - # 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 [201, 409]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('MSDeployStatus', response) + deserialized = self._deserialize('FunctionSecrets', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized + list_function_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets'} - def create_ms_deploy_operation( - self, resource_group_name, name, ms_deploy, custom_headers=None, raw=False, polling=True, **operation_config): - """Invoke the MSDeploy web app extension. + def list_host_name_bindings( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Get hostname bindings for an app or a deployment slot. - Invoke the MSDeploy web app extension. + Get hostname bindings for an app or a deployment slot. :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 ms_deploy: Details of MSDeploy operation - :type ms_deploy: ~azure.mgmt.web.models.MSDeploy - :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 MSDeployStatus or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.MSDeployStatus] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.MSDeployStatus]] - :raises: :class:`CloudError` - """ - raw_result = self._create_ms_deploy_operation_initial( - resource_group_name=resource_group_name, - name=name, - ms_deploy=ms_deploy, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('MSDeployStatus', 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) - create_ms_deploy_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} - - def get_ms_deploy_log( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Get the MSDeploy Log for the last MSDeploy operation. - - Get the MSDeploy Log for the last MSDeploy operation. - - :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 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: MSDeployLog or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.MSDeployLog or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_ms_deploy_log.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 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('MSDeployLog', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_ms_deploy_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log'} - - def list_functions( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """List the functions for a web site, or a deployment slot. - - List the functions for a web site, or a deployment slot. - - :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 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 FunctionEnvelope + :return: An iterator like instance of HostNameBinding :rtype: - ~azure.mgmt.web.models.FunctionEnvelopePaged[~azure.mgmt.web.models.FunctionEnvelope] - :raises: :class:`CloudError` + ~azure.mgmt.web.models.HostNameBindingPaged[~azure.mgmt.web.models.HostNameBinding] + :raises: + :class:`DefaultErrorResponseException` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = self.list_functions.metadata['url'] + url = self.list_host_name_bindings.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'), @@ -4735,50 +4898,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.FunctionEnvelopePaged(internal_paging, self._deserialize.dependencies) + deserialized = models.HostNameBindingPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.FunctionEnvelopePaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.HostNameBindingPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions'} + list_host_name_bindings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings'} - def get_functions_admin_token( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Fetch a short lived token that can be exchanged for a master key. + def get_host_name_binding( + self, resource_group_name, name, host_name, custom_headers=None, raw=False, **operation_config): + """Get the named hostname binding for an app (or deployment slot, if + specified). - Fetch a short lived token that can be exchanged for a master key. + Get the named hostname binding 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 web app. + :param name: Name of the app. :type name: str + :param host_name: Hostname in the hostname binding. + :type host_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: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse + :return: HostNameBinding or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.HostNameBinding or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_functions_admin_token.metadata['url'] + url = self.get_host_name_binding.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'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -4807,44 +4974,48 @@ def get_functions_admin_token( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('str', response) + deserialized = self._deserialize('HostNameBinding', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_functions_admin_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token'} + get_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} - def get_function( - self, resource_group_name, name, function_name, custom_headers=None, raw=False, **operation_config): - """Get function information by its ID for web site, or a deployment slot. + def create_or_update_host_name_binding( + self, resource_group_name, name, host_name, host_name_binding, custom_headers=None, raw=False, **operation_config): + """Creates a hostname binding for an app. - Get function information by its ID for web site, or a deployment slot. + Creates a hostname binding for an app. :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 function_name: Function name. - :type function_name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :param host_name_binding: Binding details. This is the JSON + representation of a HostNameBinding object. + :type host_name_binding: ~azure.mgmt.web.models.HostNameBinding :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: FunctionEnvelope or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.FunctionEnvelope or + :return: HostNameBinding or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.HostNameBinding or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_function.metadata['url'] + url = self.create_or_update_host_name_binding.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'), - 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -4856,6 +5027,7 @@ def get_function( # 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: @@ -4863,36 +5035,56 @@ def get_function( 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(host_name_binding, 'HostNameBinding') + # 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, 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('FunctionEnvelope', response) + deserialized = self._deserialize('HostNameBinding', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} + create_or_update_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} + def delete_host_name_binding( + self, resource_group_name, name, host_name, custom_headers=None, raw=False, **operation_config): + """Deletes a hostname binding for an app. - def _create_function_initial( - self, resource_group_name, name, function_name, function_envelope, custom_headers=None, raw=False, **operation_config): + Deletes a hostname binding for 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 host_name: Hostname in the hostname binding. + :type host_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.create_function.metadata['url'] + url = self.delete_host_name_binding.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'), - 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -4903,8 +5095,6 @@ def _create_function_initial( # 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: @@ -4912,97 +5102,183 @@ def _create_function_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(function_envelope, 'FunctionEnvelope') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [201]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('FunctionEnvelope', response) + if response.status_code not in [200, 204]: + 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_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} + + def get_hybrid_connection( + self, resource_group_name, name, namespace_name, relay_name, custom_headers=None, raw=False, **operation_config): + """Retrieves a specific Service Bus Hybrid Connection used by this Web + App. + + Retrieves a specific Service Bus Hybrid Connection used by this Web + App. + + :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 namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_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: HybridConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.HybridConnection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.get_hybrid_connection.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'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_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('HybridConnection', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized + get_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} - def create_function( - self, resource_group_name, name, function_name, function_envelope, custom_headers=None, raw=False, polling=True, **operation_config): - """Create function for web site, or a deployment slot. + def create_or_update_hybrid_connection( + self, resource_group_name, name, namespace_name, relay_name, connection_envelope, custom_headers=None, raw=False, **operation_config): + """Creates a new Hybrid Connection using a Service Bus relay. - Create function for web site, or a deployment slot. + Creates a new Hybrid Connection using a Service Bus relay. :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: The name of the web app. :type name: str - :param function_name: Function name. - :type function_name: str - :param function_envelope: Function details. - :type function_envelope: ~azure.mgmt.web.models.FunctionEnvelope + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.models.HybridConnection :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 FunctionEnvelope or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.FunctionEnvelope] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.FunctionEnvelope]] + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: HybridConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.HybridConnection or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ - raw_result = self._create_function_initial( - resource_group_name=resource_group_name, - name=name, - function_name=function_name, - function_envelope=function_envelope, - custom_headers=custom_headers, - raw=True, - **operation_config - ) + # Construct URL + url = self.create_or_update_hybrid_connection.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'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) - def get_long_running_output(response): - deserialized = self._deserialize('FunctionEnvelope', response) + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + # 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') - return deserialized + # Construct body + body_content = self._serialize.body(connection_envelope, 'HybridConnection') - 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) - create_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) - def delete_function( - self, resource_group_name, name, function_name, custom_headers=None, raw=False, **operation_config): - """Delete a function for web site, or a deployment slot. + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) - Delete a function for web site, or a deployment slot. + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('HybridConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} + + def delete_hybrid_connection( + self, resource_group_name, name, namespace_name, relay_name, custom_headers=None, raw=False, **operation_config): + """Removes a Hybrid Connection from this site. + + Removes a Hybrid Connection from this site. :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: The name of the web app. :type name: str - :param function_name: Function name. - :type function_name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_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 @@ -5013,11 +5289,12 @@ def delete_function( :raises: :class:`CloudError` """ # Construct URL - url = self.delete_function.metadata['url'] + url = self.delete_hybrid_connection.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'), - 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -5039,7 +5316,7 @@ def delete_function( request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204, 404]: + if response.status_code not in [200, 404]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -5047,40 +5324,43 @@ def delete_function( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} + delete_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} - def list_function_secrets( - self, resource_group_name, name, function_name, custom_headers=None, raw=False, **operation_config): - """Get function secrets for a function in a web site, or a deployment - slot. + def update_hybrid_connection( + self, resource_group_name, name, namespace_name, relay_name, connection_envelope, custom_headers=None, raw=False, **operation_config): + """Creates a new Hybrid Connection using a Service Bus relay. - Get function secrets for a function in a web site, or a deployment - slot. + Creates a new Hybrid Connection using a Service Bus relay. :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: The name of the web app. :type name: str - :param function_name: Function name. - :type function_name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.models.HybridConnection :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: HybridConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.HybridConnection or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.list_function_secrets.metadata['url'] + url = self.update_hybrid_connection.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'), - 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -5092,6 +5372,7 @@ def list_function_secrets( # 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: @@ -5099,8 +5380,11 @@ def list_function_secrets( 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, 'HybridConnection') + # 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]: @@ -5109,119 +5393,48 @@ def list_function_secrets( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('FunctionSecrets', response) + deserialized = self._deserialize('HybridConnection', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_function_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets'} + update_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} - def list_host_name_bindings( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Get hostname bindings for an app or a deployment slot. + def list_hybrid_connection_keys( + self, resource_group_name, name, namespace_name, relay_name, custom_headers=None, raw=False, **operation_config): + """Gets the send key name and value for a Hybrid Connection. - Get hostname bindings for an app or a deployment slot. + Gets the send key name and value for a Hybrid 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. + :param name: The name of the web app. :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_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 HostNameBinding - :rtype: - ~azure.mgmt.web.models.HostNameBindingPaged[~azure.mgmt.web.models.HostNameBinding] - :raises: - :class:`DefaultErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_host_name_bindings.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.HostNameBindingPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.HostNameBindingPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_host_name_bindings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings'} - - def get_host_name_binding( - self, resource_group_name, name, host_name, custom_headers=None, raw=False, **operation_config): - """Get the named hostname binding for an app (or deployment slot, if - specified). - - Get the named hostname binding 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 host_name: Hostname in the hostname binding. - :type host_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: HostNameBinding or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.HostNameBinding or + :return: HybridConnectionKey or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.HybridConnectionKey or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_host_name_binding.metadata['url'] + url = self.list_hybrid_connection_keys.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'), - 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -5241,7 +5454,7 @@ def get_host_name_binding( 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]: @@ -5250,48 +5463,42 @@ def get_host_name_binding( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('HostNameBinding', response) + deserialized = self._deserialize('HybridConnectionKey', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} + list_hybrid_connection_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'} - def create_or_update_host_name_binding( - self, resource_group_name, name, host_name, host_name_binding, custom_headers=None, raw=False, **operation_config): - """Creates a hostname binding for an app. + def list_hybrid_connections( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Retrieves all Service Bus Hybrid Connections used by this Web App. - Creates a hostname binding for an app. + Retrieves all Service Bus Hybrid Connections used by this 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 the app. + :param name: The name of the web app. :type name: str - :param host_name: Hostname in the hostname binding. - :type host_name: str - :param host_name_binding: Binding details. This is the JSON - representation of a HostNameBinding object. - :type host_name_binding: ~azure.mgmt.web.models.HostNameBinding :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: HostNameBinding or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.HostNameBinding or + :return: HybridConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.HybridConnection or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.create_or_update_host_name_binding.metadata['url'] + url = self.list_hybrid_connections.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'), - 'hostName': self._serialize.url("host_name", host_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -5303,7 +5510,6 @@ def create_or_update_host_name_binding( # 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: @@ -5311,11 +5517,8 @@ def create_or_update_host_name_binding( 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(host_name_binding, 'HostNameBinding') - # 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]: @@ -5324,43 +5527,44 @@ def create_or_update_host_name_binding( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('HostNameBinding', response) + deserialized = self._deserialize('HybridConnection', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} + list_hybrid_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays'} - def delete_host_name_binding( - self, resource_group_name, name, host_name, custom_headers=None, raw=False, **operation_config): - """Deletes a hostname binding for an app. + def list_relay_service_connections( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets hybrid connections configured for an app (or deployment slot, if + specified). - Deletes a hostname binding for an app. + Gets hybrid connections configured 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 host_name: Hostname in the hostname binding. - :type host_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: RelayServiceConnectionEntity or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.RelayServiceConnectionEntity or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_host_name_binding.metadata['url'] + url = self.list_relay_service_connections.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'), - 'hostName': self._serialize.url("host_name", host_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -5371,6 +5575,7 @@ def delete_host_name_binding( # 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: @@ -5379,54 +5584,54 @@ def delete_host_name_binding( 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, 204]: - 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('RelayServiceConnectionEntity', response) if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} - def get_hybrid_connection( - self, resource_group_name, name, namespace_name, relay_name, custom_headers=None, raw=False, **operation_config): - """Retrieves a specific Service Bus Hybrid Connection used by this Web - App. + return deserialized + list_relay_service_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection'} - Retrieves a specific Service Bus Hybrid Connection used by this Web - App. + def get_relay_service_connection( + self, resource_group_name, name, entity_name, custom_headers=None, raw=False, **operation_config): + """Gets a hybrid connection configuration by its name. + + Gets a hybrid connection configuration by its name. :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 namespace_name: The namespace for this hybrid connection. - :type namespace_name: str - :param relay_name: The relay name for this hybrid connection. - :type relay_name: str + :param entity_name: Name of the hybrid connection. + :type entity_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: HybridConnection or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.HybridConnection or + :return: RelayServiceConnectionEntity or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.RelayServiceConnectionEntity or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_hybrid_connection.metadata['url'] + url = self.get_relay_service_connection.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'), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), - 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -5455,50 +5660,51 @@ def get_hybrid_connection( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('HybridConnection', response) + deserialized = self._deserialize('RelayServiceConnectionEntity', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} + get_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} - def create_or_update_hybrid_connection( - self, resource_group_name, name, namespace_name, relay_name, connection_envelope, custom_headers=None, raw=False, **operation_config): - """Creates a new Hybrid Connection using a Service Bus relay. + def create_or_update_relay_service_connection( + self, resource_group_name, name, entity_name, connection_envelope, custom_headers=None, raw=False, **operation_config): + """Creates a new hybrid connection configuration (PUT), or updates an + existing one (PATCH). - Creates a new Hybrid Connection using a Service Bus relay. + Creates a new hybrid connection configuration (PUT), or updates an + existing one (PATCH). :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 namespace_name: The namespace for this hybrid connection. - :type namespace_name: str - :param relay_name: The relay name for this hybrid connection. - :type relay_name: str - :param connection_envelope: The details of the hybrid connection. - :type connection_envelope: ~azure.mgmt.web.models.HybridConnection + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param connection_envelope: Details of the hybrid connection + configuration. + :type connection_envelope: + ~azure.mgmt.web.models.RelayServiceConnectionEntity :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: HybridConnection or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.HybridConnection or + :return: RelayServiceConnectionEntity or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.RelayServiceConnectionEntity or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.create_or_update_hybrid_connection.metadata['url'] + url = self.create_or_update_relay_service_connection.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'), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), - 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -5519,7 +5725,7 @@ def create_or_update_hybrid_connection( 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, 'HybridConnection') + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -5531,30 +5737,28 @@ def create_or_update_hybrid_connection( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('HybridConnection', response) + deserialized = self._deserialize('RelayServiceConnectionEntity', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} + create_or_update_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} - def delete_hybrid_connection( - self, resource_group_name, name, namespace_name, relay_name, custom_headers=None, raw=False, **operation_config): - """Removes a Hybrid Connection from this site. + def delete_relay_service_connection( + self, resource_group_name, name, entity_name, custom_headers=None, raw=False, **operation_config): + """Deletes a relay service connection by its name. - Removes a Hybrid Connection from this site. + Deletes a relay service connection by its name. :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 namespace_name: The namespace for this hybrid connection. - :type namespace_name: str - :param relay_name: The relay name for this hybrid connection. - :type relay_name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_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 @@ -5565,12 +5769,11 @@ def delete_hybrid_connection( :raises: :class:`CloudError` """ # Construct URL - url = self.delete_hybrid_connection.metadata['url'] + url = self.delete_relay_service_connection.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'), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), - 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -5600,43 +5803,44 @@ def delete_hybrid_connection( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} + delete_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} - def update_hybrid_connection( - self, resource_group_name, name, namespace_name, relay_name, connection_envelope, custom_headers=None, raw=False, **operation_config): - """Creates a new Hybrid Connection using a Service Bus relay. + def update_relay_service_connection( + self, resource_group_name, name, entity_name, connection_envelope, custom_headers=None, raw=False, **operation_config): + """Creates a new hybrid connection configuration (PUT), or updates an + existing one (PATCH). - Creates a new Hybrid Connection using a Service Bus relay. + Creates a new hybrid connection configuration (PUT), or updates an + existing one (PATCH). :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 namespace_name: The namespace for this hybrid connection. - :type namespace_name: str - :param relay_name: The relay name for this hybrid connection. - :type relay_name: str - :param connection_envelope: The details of the hybrid connection. - :type connection_envelope: ~azure.mgmt.web.models.HybridConnection + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param connection_envelope: Details of the hybrid connection + configuration. + :type connection_envelope: + ~azure.mgmt.web.models.RelayServiceConnectionEntity :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: HybridConnection or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.HybridConnection or + :return: RelayServiceConnectionEntity or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.RelayServiceConnectionEntity or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.update_hybrid_connection.metadata['url'] + url = self.update_relay_service_connection.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'), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), - 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -5657,7 +5861,7 @@ def update_hybrid_connection( 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, 'HybridConnection') + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') # Construct and send request request = self._client.patch(url, query_parameters, header_parameters, body_content) @@ -5669,112 +5873,117 @@ def update_hybrid_connection( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('HybridConnection', response) + deserialized = self._deserialize('RelayServiceConnectionEntity', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} + update_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} - def list_hybrid_connection_keys( - self, resource_group_name, name, namespace_name, relay_name, custom_headers=None, raw=False, **operation_config): - """Gets the send key name and value for a Hybrid Connection. + def list_instance_identifiers( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets all scale-out instances of an app. - Gets the send key name and value for a Hybrid Connection. + Gets all scale-out instances of an app. :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 namespace_name: The namespace for this hybrid connection. - :type namespace_name: str - :param relay_name: The relay name for this hybrid connection. - :type relay_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: HybridConnectionKey or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.HybridConnectionKey or - ~msrest.pipeline.ClientRawResponse + :return: An iterator like instance of SiteInstance + :rtype: + ~azure.mgmt.web.models.SiteInstancePaged[~azure.mgmt.web.models.SiteInstance] :raises: :class:`DefaultErrorResponseException` """ - # Construct URL - url = self.list_hybrid_connection_keys.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'), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), - 'relayName': self._serialize.url("relay_name", relay_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) + def internal_paging(next_link=None, raw=False): - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if not next_link: + # Construct URL + url = self.list_instance_identifiers.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 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 parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + else: + url = next_link + query_parameters = {} - if response.status_code not in [200]: - raise models.DefaultErrorResponseException(self._deserialize, response) + # 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') - deserialized = None + # 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 == 200: - deserialized = self._deserialize('HybridConnectionKey', response) + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.SiteInstancePaged(internal_paging, self._deserialize.dependencies) if raw: - client_raw_response = ClientRawResponse(deserialized, response) + header_dict = {} + client_raw_response = models.SiteInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_hybrid_connection_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'} + list_instance_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances'} - def list_hybrid_connections( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Retrieves all Service Bus Hybrid Connections used by this Web App. + def get_instance_ms_deploy_status( + self, resource_group_name, name, instance_id, custom_headers=None, raw=False, **operation_config): + """Get the status of the last MSDeploy operation. - Retrieves all Service Bus Hybrid Connections used by this Web App. + Get the status of the last MSDeploy operation. :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 web app. :type name: str + :param instance_id: ID of web app instance. + :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: HybridConnection or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.HybridConnection or + :return: MSDeployStatus or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.MSDeployStatus or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.list_hybrid_connections.metadata['url'] + url = self.get_instance_ms_deploy_status.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'), + '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) @@ -5803,44 +6012,24 @@ def list_hybrid_connections( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('HybridConnection', response) + deserialized = self._deserialize('MSDeployStatus', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_hybrid_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays'} - - def list_relay_service_connections( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Gets hybrid connections configured for an app (or deployment slot, if - specified). + get_instance_ms_deploy_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} - Gets hybrid connections configured 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 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: RelayServiceConnectionEntity or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.RelayServiceConnectionEntity or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` - """ + def _create_instance_ms_deploy_operation_initial( + self, resource_group_name, name, instance_id, ms_deploy, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.list_relay_service_connections.metadata['url'] + url = self.create_instance_ms_deploy_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'), + '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) @@ -5852,6 +6041,7 @@ def list_relay_service_connections( # 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: @@ -5859,128 +6049,114 @@ def list_relay_service_connections( 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(ms_deploy, 'MSDeploy') + # 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]: - raise models.DefaultErrorResponseException(self._deserialize, response) + if response.status_code not in [201, 409]: + 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('RelayServiceConnectionEntity', response) + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_relay_service_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection'} - def get_relay_service_connection( - self, resource_group_name, name, entity_name, custom_headers=None, raw=False, **operation_config): - """Gets a hybrid connection configuration by its name. + def create_instance_ms_deploy_operation( + self, resource_group_name, name, instance_id, ms_deploy, custom_headers=None, raw=False, polling=True, **operation_config): + """Invoke the MSDeploy web app extension. - Gets a hybrid connection configuration by its name. + Invoke the MSDeploy web app extension. :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 entity_name: Name of the hybrid connection. - :type entity_name: str + :param instance_id: ID of web app instance. + :type instance_id: str + :param ms_deploy: Details of MSDeploy operation + :type ms_deploy: ~azure.mgmt.web.models.MSDeploy :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: RelayServiceConnectionEntity or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.RelayServiceConnectionEntity or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` + :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 MSDeployStatus or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.MSDeployStatus] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.MSDeployStatus]] + :raises: :class:`CloudError` """ - # Construct URL - url = self.get_relay_service_connection.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'), - 'entityName': self._serialize.url("entity_name", entity_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) + raw_result = self._create_instance_ms_deploy_operation_initial( + resource_group_name=resource_group_name, + name=name, + instance_id=instance_id, + ms_deploy=ms_deploy, + custom_headers=custom_headers, + raw=True, + **operation_config + ) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + def get_long_running_output(response): + deserialized = self._deserialize('MSDeployStatus', response) - # 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('RelayServiceConnectionEntity', response) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + return deserialized - return deserialized - get_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} + 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) + create_instance_ms_deploy_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} - def create_or_update_relay_service_connection( - self, resource_group_name, name, entity_name, connection_envelope, custom_headers=None, raw=False, **operation_config): - """Creates a new hybrid connection configuration (PUT), or updates an - existing one (PATCH). + def get_instance_ms_deploy_log( + self, resource_group_name, name, instance_id, custom_headers=None, raw=False, **operation_config): + """Get the MSDeploy Log for the last MSDeploy operation. - Creates a new hybrid connection configuration (PUT), or updates an - existing one (PATCH). + Get the MSDeploy Log for the last MSDeploy operation. :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 entity_name: Name of the hybrid connection configuration. - :type entity_name: str - :param connection_envelope: Details of the hybrid connection - configuration. - :type connection_envelope: - ~azure.mgmt.web.models.RelayServiceConnectionEntity + :param instance_id: ID of web app instance. + :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: RelayServiceConnectionEntity or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.RelayServiceConnectionEntity or + :return: MSDeployLog or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.MSDeployLog or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` + :raises: :class:`CloudError` """ # Construct URL - url = self.create_or_update_relay_service_connection.metadata['url'] + url = self.get_instance_ms_deploy_log.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'), - 'entityName': self._serialize.url("entity_name", entity_name, '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) @@ -5992,7 +6168,6 @@ def create_or_update_relay_service_connection( # 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: @@ -6000,123 +6175,143 @@ def create_or_update_relay_service_connection( 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, 'RelayServiceConnectionEntity') - # 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]: - raise models.DefaultErrorResponseException(self._deserialize, response) + 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('RelayServiceConnectionEntity', response) + deserialized = self._deserialize('MSDeployLog', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} + get_instance_ms_deploy_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log'} - def delete_relay_service_connection( - self, resource_group_name, name, entity_name, custom_headers=None, raw=False, **operation_config): - """Deletes a relay service connection by its name. + def list_instance_processes( + self, resource_group_name, name, instance_id, custom_headers=None, raw=False, **operation_config): + """Get list of processes for a web site, or a deployment slot, or for a + specific scaled-out instance in a web site. - Deletes a relay service connection by its name. + Get list of processes for a web site, or a deployment slot, or 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: Name of the app. + :param name: Site name. :type name: str - :param entity_name: Name of the hybrid connection configuration. - :type entity_name: 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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: An iterator like instance of ProcessInfo + :rtype: + ~azure.mgmt.web.models.ProcessInfoPaged[~azure.mgmt.web.models.ProcessInfo] :raises: :class:`CloudError` """ - # Construct URL - url = self.delete_relay_service_connection.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'), - 'entityName': self._serialize.url("entity_name", entity_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) + def internal_paging(next_link=None, raw=False): - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if not next_link: + # Construct URL + url = self.list_instance_processes.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'), + '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 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 parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + else: + url = next_link + query_parameters = {} - if response.status_code not in [200, 404]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + # 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.ProcessInfoPaged(internal_paging, self._deserialize.dependencies) if raw: - client_raw_response = ClientRawResponse(None, response) + header_dict = {} + client_raw_response = models.ProcessInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response - delete_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} - def update_relay_service_connection( - self, resource_group_name, name, entity_name, connection_envelope, custom_headers=None, raw=False, **operation_config): - """Creates a new hybrid connection configuration (PUT), or updates an - existing one (PATCH). + return deserialized + list_instance_processes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes'} - Creates a new hybrid connection configuration (PUT), or updates an - existing one (PATCH). + def get_instance_process( + self, resource_group_name, name, process_id, instance_id, custom_headers=None, raw=False, **operation_config): + """Get process information by its ID for a specific scaled-out instance in + a web site. + + Get process information 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: Name of the app. + :param name: Site name. :type name: str - :param entity_name: Name of the hybrid connection configuration. - :type entity_name: str - :param connection_envelope: Details of the hybrid connection - configuration. - :type connection_envelope: - ~azure.mgmt.web.models.RelayServiceConnectionEntity + :param process_id: PID. + :type process_id: 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: RelayServiceConnectionEntity or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.RelayServiceConnectionEntity or + :return: ProcessInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.ProcessInfo or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` + :raises: :class:`CloudError` """ # Construct URL - url = self.update_relay_service_connection.metadata['url'] + url = self.get_instance_process.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'), - 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'processId': self._serialize.url("process_id", process_id, '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) @@ -6128,7 +6323,6 @@ def update_relay_service_connection( # 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: @@ -6136,175 +6330,61 @@ def update_relay_service_connection( 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, 'RelayServiceConnectionEntity') - # Construct and send request - request = self._client.patch(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]: - raise models.DefaultErrorResponseException(self._deserialize, response) + 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('RelayServiceConnectionEntity', response) + deserialized = self._deserialize('ProcessInfo', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} + get_instance_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'} - def list_instance_identifiers( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Gets all scale-out instances of an app. + def delete_instance_process( + self, resource_group_name, name, process_id, instance_id, custom_headers=None, raw=False, **operation_config): + """Terminate a process by its ID for a web site, or a deployment slot, or + specific scaled-out instance in a web site. - Gets all scale-out instances of an app. + Terminate a process by its ID for a web site, or a deployment slot, or + 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: Name of the app. + :param name: Site name. :type name: str + :param process_id: PID. + :type process_id: 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 SiteInstance - :rtype: - ~azure.mgmt.web.models.SiteInstancePaged[~azure.mgmt.web.models.SiteInstance] - :raises: - :class:`DefaultErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_instance_identifiers.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.SiteInstancePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.SiteInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_instance_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances'} - - def get_instance_ms_deploy_status( - self, resource_group_name, name, instance_id, custom_headers=None, raw=False, **operation_config): - """Get the status of the last MSDeploy operation. - - Get the status of the last MSDeploy operation. - - :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 instance_id: ID of web app instance. - :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: MSDeployStatus or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.MSDeployStatus 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_instance_ms_deploy_status.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'), - '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]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('MSDeployStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_instance_ms_deploy_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} - - - def _create_instance_ms_deploy_operation_initial( - self, resource_group_name, name, instance_id, ms_deploy, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_instance_ms_deploy_operation.metadata['url'] + url = self.delete_instance_process.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'), 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -6316,8 +6396,6 @@ def _create_instance_ms_deploy_operation_initial( # 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: @@ -6325,113 +6403,59 @@ def _create_instance_ms_deploy_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(ms_deploy, 'MSDeploy') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [201, 409]: + if response.status_code not in [204, 404]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('MSDeployStatus', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete_instance_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'} - return deserialized - - def create_instance_ms_deploy_operation( - self, resource_group_name, name, instance_id, ms_deploy, custom_headers=None, raw=False, polling=True, **operation_config): - """Invoke the MSDeploy web app extension. - - Invoke the MSDeploy web app extension. - - :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 instance_id: ID of web app instance. - :type instance_id: str - :param ms_deploy: Details of MSDeploy operation - :type ms_deploy: ~azure.mgmt.web.models.MSDeploy - :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 MSDeployStatus or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.MSDeployStatus] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.MSDeployStatus]] - :raises: :class:`CloudError` - """ - raw_result = self._create_instance_ms_deploy_operation_initial( - resource_group_name=resource_group_name, - name=name, - instance_id=instance_id, - ms_deploy=ms_deploy, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('MSDeployStatus', 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) - create_instance_ms_deploy_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} - - def get_instance_ms_deploy_log( - self, resource_group_name, name, instance_id, custom_headers=None, raw=False, **operation_config): - """Get the MSDeploy Log for the last MSDeploy operation. + def get_instance_process_dump( + self, resource_group_name, name, process_id, instance_id, custom_headers=None, raw=False, callback=None, **operation_config): + """Get a memory dump of a process by its ID for a specific scaled-out + instance in a web site. - Get the MSDeploy Log for the last MSDeploy operation. + Get a memory dump of 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: Name of web app. + :param name: Site name. :type name: str - :param instance_id: ID of web app instance. + :param process_id: PID. + :type process_id: 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 callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] :param operation_config: :ref:`Operation configuration overrides`. - :return: MSDeployLog or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.MSDeployLog or - ~msrest.pipeline.ClientRawResponse + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get_instance_ms_deploy_log.metadata['url'] + url = self.get_instance_process_dump.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'), 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -6453,7 +6477,7 @@ def get_instance_ms_deploy_log( # Construct and send request request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + response = self._client.send(request, stream=True, **operation_config) if response.status_code not in [200, 404]: exp = CloudError(response) @@ -6463,28 +6487,30 @@ def get_instance_ms_deploy_log( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('MSDeployLog', response) + deserialized = self._client.stream_download(response, callback) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_instance_ms_deploy_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log'} + get_instance_process_dump.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump'} - def list_instance_processes( - self, resource_group_name, name, instance_id, custom_headers=None, raw=False, **operation_config): - """Get list of processes for a web site, or a deployment slot, or for a - specific scaled-out instance in a web site. + def list_instance_process_modules( + self, resource_group_name, name, process_id, instance_id, custom_headers=None, raw=False, **operation_config): + """List module information for a process by its ID for a specific + scaled-out instance in a web site. - Get list of processes for a web site, or a deployment slot, or for a - specific scaled-out instance in a web site. + List module information for 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 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". @@ -6494,19 +6520,20 @@ def list_instance_processes( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of ProcessInfo + :return: An iterator like instance of ProcessModuleInfo :rtype: - ~azure.mgmt.web.models.ProcessInfoPaged[~azure.mgmt.web.models.ProcessInfo] + ~azure.mgmt.web.models.ProcessModuleInfoPaged[~azure.mgmt.web.models.ProcessModuleInfo] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = self.list_instance_processes.metadata['url'] + url = self.list_instance_process_modules.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'), 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -6542,18 +6569,18 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.ProcessInfoPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.ProcessModuleInfoPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.ProcessInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.ProcessModuleInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_instance_processes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes'} + list_instance_process_modules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules'} - def get_instance_process( - self, resource_group_name, name, process_id, instance_id, custom_headers=None, raw=False, **operation_config): + def get_instance_process_module( + self, resource_group_name, name, process_id, base_address, instance_id, custom_headers=None, raw=False, **operation_config): """Get process information by its ID for a specific scaled-out instance in a web site. @@ -6567,6 +6594,8 @@ def get_instance_process( :type name: str :param process_id: PID. :type process_id: str + :param base_address: Module base address. + :type base_address: 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". @@ -6576,17 +6605,18 @@ def get_instance_process( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: ProcessInfo or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.ProcessInfo or + :return: ProcessModuleInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.ProcessModuleInfo or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get_instance_process.metadata['url'] + url = self.get_instance_process_module.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'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -6618,21 +6648,104 @@ def get_instance_process( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ProcessInfo', response) + deserialized = self._deserialize('ProcessModuleInfo', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_instance_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'} + get_instance_process_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'} - def delete_instance_process( + def list_instance_process_threads( self, resource_group_name, name, process_id, instance_id, custom_headers=None, raw=False, **operation_config): - """Terminate a process by its ID for a web site, or a deployment slot, or + """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 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.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'), + '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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads'} + + def get_instance_process_thread( + self, resource_group_name, name, process_id, thread_id, 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. - Terminate a process by its ID for a web site, or a deployment slot, or + 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 @@ -6642,6 +6755,8 @@ def delete_instance_process( :type name: str :param process_id: PID. :type process_id: str + :param thread_id: TID. + :type thread_id: 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". @@ -6651,16 +6766,18 @@ def delete_instance_process( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: ProcessThreadInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.ProcessThreadInfo or + ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.delete_instance_process.metadata['url'] + url = self.get_instance_process_thread.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'), 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -6672,6 +6789,7 @@ def delete_instance_process( # 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: @@ -6680,59 +6798,55 @@ def delete_instance_process( 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 [204, 404]: + 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(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete_instance_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'} - def get_instance_process_dump( - self, resource_group_name, name, process_id, instance_id, custom_headers=None, raw=False, callback=None, **operation_config): - """Get a memory dump of a process by its ID for a specific scaled-out - instance in a web site. + return deserialized + get_instance_process_thread.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads/{threadId}'} - Get a memory dump of a process by its ID for a specific scaled-out - instance in a web site. + def is_cloneable( + self, resource_group_name, name, 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: Site name. + :param name: Name of the app. :type name: str - :param process_id: PID. - :type process_id: 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 callback: When specified, will be called with each chunk of - data that is streamed. The callback should take two arguments, the - bytes of the current chunk of data and the response object. If the - data is uploading, response will be None. - :type callback: Callable[Bytes, response=None] :param operation_config: :ref:`Operation configuration overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: Generator or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :return: SiteCloneability or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.SiteCloneability or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_instance_process_dump.metadata['url'] + url = self.is_cloneable.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'), - '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) @@ -6752,65 +6866,120 @@ def get_instance_process_dump( 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=True, **operation_config) + 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, 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._client.stream_download(response, callback) + deserialized = self._deserialize('SiteCloneability', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_instance_process_dump.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump'} + is_cloneable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable'} - def list_instance_process_modules( - self, resource_group_name, name, process_id, instance_id, custom_headers=None, raw=False, **operation_config): - """List module information for a process by its ID for a specific - scaled-out instance in a web site. + def list_sync_function_triggers( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """This is to allow calling via powershell and ARM template. - List module information for a process by its ID for a specific - scaled-out instance in a web site. + 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: Site name. + :param name: Name of the app. :type name: str - :param process_id: PID. - :type process_id: 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 ProcessModuleInfo + :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.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 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus'} + + def list_metric_definitions( + self, resource_group_name, name, 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 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.ProcessModuleInfoPaged[~azure.mgmt.web.models.ProcessModuleInfo] - :raises: :class:`CloudError` + ~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_instance_process_modules.metadata['url'] + url = self.list_metric_definitions.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'), - '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) @@ -6837,63 +7006,223 @@ 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.ProcessModuleInfoPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.ResourceMetricDefinitionPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.ProcessModuleInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.ResourceMetricDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_instance_process_modules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules'} + list_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/metricdefinitions'} - def get_instance_process_module( - self, resource_group_name, name, process_id, base_address, instance_id, custom_headers=None, raw=False, **operation_config): - """Get process information by its ID for a specific scaled-out instance in - a web site. + def list_metrics( + self, resource_group_name, name, details=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Gets performance metrics of an app (or deployment slot, if specified). - Get process information 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: Name of the app. + :type name: 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` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_metrics.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 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 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.ResourceMetricPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ResourceMetricPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/metrics'} + + + def _migrate_storage_initial( + self, subscription_name, resource_group_name, name, migration_options, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.migrate_storage.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['subscriptionName'] = self._serialize.query("subscription_name", subscription_name, '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: + 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(migration_options, 'StorageMigrationOptions') + + # 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('StorageMigrationResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def migrate_storage( + self, subscription_name, resource_group_name, name, migration_options, custom_headers=None, raw=False, polling=True, **operation_config): + """Restores a web app. + + Restores a web app. + + :param subscription_name: Azure subscription. + :type subscription_name: str + :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 migration_options: Migration migrationOptions. + :type migration_options: + ~azure.mgmt.web.models.StorageMigrationOptions + :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 + StorageMigrationResponse or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.StorageMigrationResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.StorageMigrationResponse]] + :raises: + :class:`DefaultErrorResponseException` + """ + raw_result = self._migrate_storage_initial( + subscription_name=subscription_name, + resource_group_name=resource_group_name, + name=name, + migration_options=migration_options, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('StorageMigrationResponse', 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) + migrate_storage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate'} - :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 base_address: Module base address. - :type base_address: 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: ProcessModuleInfo or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.ProcessModuleInfo or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + + def _migrate_my_sql_initial( + self, resource_group_name, name, migration_request_envelope, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.get_instance_process_module.metadata['url'] + url = self.migrate_my_sql.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'), - 'baseAddress': self._serialize.url("base_address", base_address, '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) @@ -6905,6 +7234,7 @@ def get_instance_process_module( # 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: @@ -6912,149 +7242,175 @@ def get_instance_process_module( 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(migration_request_envelope, 'MigrateMySqlRequest') + # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters, body_content) 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('ProcessModuleInfo', response) + deserialized = self._deserialize('Operation', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_instance_process_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'} - def list_instance_process_threads( - self, resource_group_name, name, process_id, 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 migrate_my_sql( + self, resource_group_name, name, migration_request_envelope, custom_headers=None, raw=False, polling=True, **operation_config): + """Migrates a local (in-app) MySql database to a remote MySql database. - List the threads in a process by its ID for a specific scaled-out - instance in a web site. + Migrates a local (in-app) MySql database to a remote MySql database. :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 migration_request_envelope: MySql migration options. + :type migration_request_envelope: + ~azure.mgmt.web.models.MigrateMySqlRequest + :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 Operation or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.Operation] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.Operation]] + :raises: + :class:`DefaultErrorResponseException` + """ + raw_result = self._migrate_my_sql_initial( + resource_group_name=resource_group_name, + name=name, + migration_request_envelope=migration_request_envelope, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Operation', 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) + migrate_my_sql.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql'} + + def get_migrate_my_sql_status( + self, resource_group_name, name, 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. + + 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: Name of web app. :type name: str - :param process_id: PID. - :type process_id: 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` + :return: MigrateMySqlStatus or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.MigrateMySqlStatus or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_instance_process_threads.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'), - '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 URL + url = self.get_migrate_my_sql_status.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) - else: - url = next_link - query_parameters = {} + # 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 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) + # 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 + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) - return response + deserialized = None - # Deserialize response - deserialized = models.ProcessThreadInfoPaged(internal_paging, self._deserialize.dependencies) + if response.status_code == 200: + deserialized = self._deserialize('MigrateMySqlStatus', response) if raw: - header_dict = {} - client_raw_response = models.ProcessThreadInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_instance_process_threads.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads'} + get_migrate_my_sql_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status'} - def get_instance_process_thread( - self, resource_group_name, name, process_id, thread_id, 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_swift_virtual_network_connection( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets a Swift Virtual Network connection. - Get thread information by Thread ID for a specific process, in a - specific scaled-out instance in a web site. + 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: Site name. + :param name: Name of the app. :type name: str - :param process_id: PID. - :type process_id: str - :param thread_id: TID. - :type thread_id: 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: 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.get_instance_process_thread.metadata['url'] + url = self.get_swift_virtual_network_connection.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'), - '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) @@ -7077,49 +7433,54 @@ def get_instance_process_thread( 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('SwiftVirtualNetwork', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_instance_process_thread.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads/{threadId}'} + get_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} - def is_cloneable( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Shows whether an app can be cloned to another resource group or - subscription. + def create_or_update_swift_virtual_network_connection( + 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. - Shows whether an app can be cloned to another resource group or - subscription. + 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 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.metadata['url'] + url = self.create_or_update_swift_virtual_network_connection.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'), @@ -7134,6 +7495,7 @@ def is_cloneable( # 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: @@ -7141,8 +7503,11 @@ def is_cloneable( 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]: @@ -7151,20 +7516,22 @@ def is_cloneable( 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable'} + create_or_update_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} - def list_sync_function_triggers( + def delete_swift_virtual_network( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """This is to allow calling via powershell and ARM template. + """Deletes a Swift Virtual Network connection from an app (or deployment + slot). - This is to allow calling via powershell and ARM template. + 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. @@ -7176,14 +7543,12 @@ def list_sync_function_triggers( 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` + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` """ # Construct URL - url = self.list_sync_function_triggers.metadata['url'] + url = self.delete_swift_virtual_network.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'), @@ -7197,7 +7562,6 @@ def list_sync_function_triggers( # 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: @@ -7206,204 +7570,210 @@ def list_sync_function_triggers( 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('FunctionSecrets', 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_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} - return deserialized - list_sync_function_triggers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus'} - - def list_metric_definitions( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Gets all metric definitions of an app (or deployment slot, if - specified). + def update_swift_virtual_network_connection( + 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 all metric definitions of an app (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 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: An iterator like instance of ResourceMetricDefinition - :rtype: - ~azure.mgmt.web.models.ResourceMetricDefinitionPaged[~azure.mgmt.web.models.ResourceMetricDefinition] + :return: SwiftVirtualNetwork or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.SwiftVirtualNetwork or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_metric_definitions.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 URL + url = self.update_swift_virtual_network_connection.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 = {} + 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' + 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 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 body + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + # Construct and send request + 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]: - 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.ResourceMetricDefinitionPaged(internal_paging, self._deserialize.dependencies) + if response.status_code == 200: + deserialized = self._deserialize('SwiftVirtualNetwork', response) if raw: - header_dict = {} - client_raw_response = models.ResourceMetricDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/metricdefinitions'} + update_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} - def list_metrics( - self, resource_group_name, name, details=None, filter=None, custom_headers=None, raw=False, **operation_config): - """Gets performance metrics of an app (or deployment slot, if specified). + 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). - Gets performance metrics of an app (or deployment slot, if specified). + 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: Name of the app. :type name: 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 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: An iterator like instance of ResourceMetric - :rtype: - ~azure.mgmt.web.models.ResourceMetricPaged[~azure.mgmt.web.models.ResourceMetric] - :raises: - :class:`DefaultErrorResponseException` + :return: NetworkFeatures or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.NetworkFeatures 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.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 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') + # Construct 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) - else: - url = next_link - query_parameters = {} + # 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 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) + # 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, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - return response + deserialized = None - # Deserialize response - deserialized = models.ResourceMetricPaged(internal_paging, self._deserialize.dependencies) + if response.status_code == 200: + deserialized = self._deserialize('NetworkFeatures', response) if raw: - header_dict = {} - client_raw_response = models.ResourceMetricPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/metrics'} + 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). - def _migrate_storage_initial( - self, subscription_name, resource_group_name, name, migration_options, custom_headers=None, raw=False, **operation_config): + 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` + """ # Construct URL - url = self.migrate_storage.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'), + '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 = {} - query_parameters['subscriptionName'] = self._serialize.query("subscription_name", subscription_name, '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: @@ -7411,91 +7781,107 @@ def _migrate_storage_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(migration_options, 'StorageMigrationOptions') - # 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]: + if response.status_code not in [200, 202]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('StorageMigrationResponse', 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_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}'} - def migrate_storage( - self, subscription_name, resource_group_name, name, migration_options, custom_headers=None, raw=False, polling=True, **operation_config): - """Restores a web app. + 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). - Restores a web app. + Start capturing network packets for the site (To be deprecated). - :param subscription_name: Azure subscription. - :type subscription_name: str :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: The name of the web app. :type name: str - :param migration_options: Migration migrationOptions. - :type migration_options: - ~azure.mgmt.web.models.StorageMigrationOptions + :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 - StorageMigrationResponse or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.StorageMigrationResponse] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.StorageMigrationResponse]] + :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` """ - raw_result = self._migrate_storage_initial( - subscription_name=subscription_name, - resource_group_name=resource_group_name, - name=name, - migration_options=migration_options, - custom_headers=custom_headers, - raw=True, - **operation_config - ) + # Construct 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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) - def get_long_running_output(response): - deserialized = self._deserialize('StorageMigrationResponse', response) + # 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') - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + # 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') - return deserialized + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) - 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) - migrate_storage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate'} + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) + deserialized = None - def _migrate_my_sql_initial( - self, resource_group_name, name, migration_request_envelope, custom_headers=None, raw=False, **operation_config): + if response.status_code == 200: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + start_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start'} + + + 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.migrate_my_sql.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'), @@ -7505,12 +7891,17 @@ def _migrate_my_sql_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: @@ -7518,20 +7909,19 @@ def _migrate_my_sql_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(migration_request_envelope, 'MigrateMySqlRequest') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) + 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('Operation', response) + deserialized = self._deserialize('[NetworkTrace]', response) + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -7539,45 +7929,50 @@ def _migrate_my_sql_initial( return deserialized - def migrate_my_sql( - self, resource_group_name, name, migration_request_envelope, custom_headers=None, raw=False, polling=True, **operation_config): - """Migrates a local (in-app) MySql database to a remote MySql database. + 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. - Migrates a local (in-app) MySql database to a remote MySql database. + 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: Name of web app. + :param name: The name of the web app. :type name: str - :param migration_request_envelope: MySql migration options. - :type migration_request_envelope: - ~azure.mgmt.web.models.MigrateMySqlRequest + :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 Operation or - ClientRawResponse if raw==True + :return: An instance of LROPoller that returns list or + ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.Operation] + ~msrestazure.azure_operation.AzureOperationPoller[list[~azure.mgmt.web.models.NetworkTrace]] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.Operation]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[list[~azure.mgmt.web.models.NetworkTrace]]] :raises: :class:`DefaultErrorResponseException` """ - raw_result = self._migrate_my_sql_initial( + raw_result = self._start_web_site_network_trace_operation_initial( resource_group_name=resource_group_name, name=name, - migration_request_envelope=migration_request_envelope, + 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('Operation', response) + deserialized = self._deserialize('[NetworkTrace]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -7592,34 +7987,30 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - migrate_my_sql.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql'} + start_web_site_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation'} - def get_migrate_my_sql_status( + def stop_web_site_network_trace( self, resource_group_name, name, 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. + """Stop ongoing capturing network packets for the site. - Returns the status of MySql in app migration, if one is active, and - whether or not MySql in app is enabled. + 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 web 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 deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: MigrateMySqlStatus or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.MigrateMySqlStatus 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_migrate_my_sql_status.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'), @@ -7633,7 +8024,6 @@ def get_migrate_my_sql_status( # 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: @@ -7642,56 +8032,51 @@ def get_migrate_my_sql_status( 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) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('MigrateMySqlStatus', response) + if response.status_code not in [200, 204]: + 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 + stop_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop'} - 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_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 all network features used by the app (or deployment slot, if - specified). + 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 view: The type of view. This can either be "summary" or - "detailed". - :type view: 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: NetworkFeatures or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.NetworkFeatures or + :return: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.web.models.NetworkTrace] or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.list_network_features.metadata['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'), - 'view': self._serialize.url("view", view, '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) @@ -7714,67 +8099,59 @@ 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('[NetworkTrace]', 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_network_traces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}'} - 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. + 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). - Start capturing network packets for the site. + 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: 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 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: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse + :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.start_web_site_network_trace.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) # 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 @@ -7788,50 +8165,58 @@ 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.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('str', 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 - start_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start'} + get_network_trace_operation_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}'} - 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 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). - Stop ongoing capturing network packets for the site. + 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: The name of the 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: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse + :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.stop_web_site_network_trace.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) @@ -7851,7 +8236,7 @@ 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]: @@ -7860,14 +8245,14 @@ def stop_web_site_network_trace( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('str', response) + deserialized = self._deserialize('[NetworkTrace]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - stop_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop'} + get_network_traces_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}'} def generate_new_site_publishing_password( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): @@ -12598,11 +12983,13 @@ def list_site_push_settings_slot( return deserialized list_site_push_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings/list'} - def get_swift_virtual_network_connection_slot( + def get_configuration_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Gets a Swift Virtual Network connection. + """Gets the configuration of an app, such as platform version and bitness, + default documents, virtual applications, Always On, etc. - Gets a Swift Virtual Network connection. + Gets the configuration of an app, such as platform version and bitness, + default documents, virtual applications, Always On, etc. :param resource_group_name: Name of the resource group to which the resource belongs. @@ -12610,21 +12997,21 @@ def get_swift_virtual_network_connection_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 a gateway for the production slot's Virtual Network. + the API will return configuration 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: SwiftVirtualNetwork or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.SwiftVirtualNetwork or + :return: SiteConfigResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.SiteConfigResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_swift_virtual_network_connection_slot.metadata['url'] + url = self.get_configuration_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'), @@ -12657,51 +13044,45 @@ def get_swift_virtual_network_connection_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SwiftVirtualNetwork', response) + deserialized = self._deserialize('SiteConfigResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_swift_virtual_network_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/virtualNetwork'} + get_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} - def create_or_update_swift_virtual_network_connection_slot( - 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. + def create_or_update_configuration_slot( + self, resource_group_name, name, site_config, slot, custom_headers=None, raw=False, **operation_config): + """Updates the configuration of an app. - 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. + Updates the configuration 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 connection_envelope: Properties of the Virtual Network - connection. See example. - :type connection_envelope: ~azure.mgmt.web.models.SwiftVirtualNetwork + :param site_config: JSON representation of a SiteConfig object. See + example. + :type site_config: ~azure.mgmt.web.models.SiteConfigResource :param slot: Name of the deployment slot. If a slot is not specified, - the API will add or update connections for the production slot. + the API will update configuration 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: SwiftVirtualNetwork or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.SwiftVirtualNetwork or + :return: SiteConfigResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.SiteConfigResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.create_or_update_swift_virtual_network_connection_slot.metadata['url'] + url = self.create_or_update_configuration_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'), @@ -12726,7 +13107,7 @@ def create_or_update_swift_virtual_network_connection_slot( 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') + body_content = self._serialize.body(site_config, 'SiteConfigResource') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -12738,42 +13119,45 @@ def create_or_update_swift_virtual_network_connection_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SwiftVirtualNetwork', response) + deserialized = self._deserialize('SiteConfigResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update_swift_virtual_network_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/virtualNetwork'} + create_or_update_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} - def delete_swift_virtual_network_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Deletes a Swift Virtual Network connection from an app (or deployment - slot). + def update_configuration_slot( + self, resource_group_name, name, site_config, slot, custom_headers=None, raw=False, **operation_config): + """Updates the configuration of an app. - Deletes a Swift Virtual Network connection from an app (or deployment - slot). + Updates the configuration 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 site_config: JSON representation of a SiteConfig object. See + example. + :type site_config: ~azure.mgmt.web.models.SiteConfigResource :param slot: Name of the deployment slot. If a slot is not specified, - the API will delete the connection for the production slot. + the API will update configuration 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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :return: SiteConfigResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.SiteConfigResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_swift_virtual_network_slot.metadata['url'] + url = self.update_configuration_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'), @@ -12788,6 +13172,8 @@ def delete_swift_virtual_network_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: @@ -12795,59 +13181,141 @@ def delete_swift_virtual_network_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(site_config, 'SiteConfigResource') + # Construct and send request - request = self._client.delete(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, 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('SiteConfigResource', response) if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete_swift_virtual_network_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/virtualNetwork'} - def update_swift_virtual_network_connection_slot( - 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. + return deserialized + update_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} - 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 list_configuration_snapshot_info_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Gets a list of web app configuration snapshots identifiers. Each + element of the list contains a timestamp and the ID of the snapshot. + + Gets a list of web app configuration snapshots identifiers. Each + element of the list contains a timestamp and the ID of the snapshot. :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 add or update connections for the production slot. + the API will return configuration 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: SwiftVirtualNetwork or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.SwiftVirtualNetwork or + :return: An iterator like instance of SiteConfigurationSnapshotInfo + :rtype: + ~azure.mgmt.web.models.SiteConfigurationSnapshotInfoPaged[~azure.mgmt.web.models.SiteConfigurationSnapshotInfo] + :raises: + :class:`DefaultErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_configuration_snapshot_info_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.SiteConfigurationSnapshotInfoPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SiteConfigurationSnapshotInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_configuration_snapshot_info_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots'} + + def get_configuration_snapshot_slot( + self, resource_group_name, name, snapshot_id, slot, custom_headers=None, raw=False, **operation_config): + """Gets a snapshot of the configuration of an app at a previous point in + time. + + Gets a snapshot of the configuration of an app at a previous point in + time. + + :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 snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :param slot: Name of the deployment slot. If a slot is not specified, + the API will return configuration 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: SiteConfigResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.SiteConfigResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.update_swift_virtual_network_connection_slot.metadata['url'] + url = self.get_configuration_snapshot_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'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -12860,7 +13328,6 @@ def update_swift_virtual_network_connection_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: @@ -12868,11 +13335,8 @@ def update_swift_virtual_network_connection_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.patch(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]: @@ -12881,28 +13345,28 @@ def update_swift_virtual_network_connection_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SwiftVirtualNetwork', response) + deserialized = self._deserialize('SiteConfigResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update_swift_virtual_network_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/virtualNetwork'} + get_configuration_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}'} - def get_configuration_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Gets the configuration of an app, such as platform version and bitness, - default documents, virtual applications, Always On, etc. + def recover_site_configuration_snapshot_slot( + self, resource_group_name, name, snapshot_id, slot, custom_headers=None, raw=False, **operation_config): + """Reverts the configuration of an app to a previous snapshot. - Gets the configuration of an app, such as platform version and bitness, - default documents, virtual applications, Always On, etc. + Reverts the configuration of an app to a previous snapshot. :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 snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str :param slot: Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. :type slot: str @@ -12911,17 +13375,16 @@ def get_configuration_slot( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: SiteConfigResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.SiteConfigResource 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_configuration_slot.metadata['url'] + url = self.recover_site_configuration_snapshot_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'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -12933,7 +13396,6 @@ def get_configuration_slot( # 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: @@ -12942,54 +13404,49 @@ def get_configuration_slot( 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) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('SiteConfigResource', response) + if response.status_code not in [204]: + 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 + recover_site_configuration_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}/recover'} - return deserialized - get_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} - - def create_or_update_configuration_slot( - self, resource_group_name, name, site_config, slot, custom_headers=None, raw=False, **operation_config): - """Updates the configuration of an app. + def get_web_site_container_logs_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, callback=None, **operation_config): + """Gets the last lines of docker logs for the given site. - Updates the configuration of an app. + Gets the last lines of docker logs for the given 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: Name of web app. :type name: str - :param site_config: JSON representation of a SiteConfig object. See - example. - :type site_config: ~azure.mgmt.web.models.SiteConfigResource - :param slot: Name of the deployment slot. If a slot is not specified, - the API will update configuration for the production slot. + :param slot: Name of web app slot. If not specified then will default + to 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 callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] :param operation_config: :ref:`Operation configuration overrides`. - :return: SiteConfigResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.SiteConfigResource or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` """ # Construct URL - url = self.create_or_update_configuration_slot.metadata['url'] + url = self.get_web_site_container_logs_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'), @@ -13004,8 +13461,7 @@ def create_or_update_configuration_slot( # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/octet-stream' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -13013,58 +13469,57 @@ def create_or_update_configuration_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(site_config, 'SiteConfigResource') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=True, **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 response.status_code == 200: - deserialized = self._deserialize('SiteConfigResource', response) + deserialized = self._client.stream_download(response, callback) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} + get_web_site_container_logs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs'} - def update_configuration_slot( - self, resource_group_name, name, site_config, slot, custom_headers=None, raw=False, **operation_config): - """Updates the configuration of an app. + def get_container_logs_zip_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, callback=None, **operation_config): + """Gets the ZIP archived docker log files for the given site. - Updates the configuration of an app. + Gets the ZIP archived docker log files for the given 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: Name of web app. :type name: str - :param site_config: JSON representation of a SiteConfig object. See - example. - :type site_config: ~azure.mgmt.web.models.SiteConfigResource - :param slot: Name of the deployment slot. If a slot is not specified, - the API will update configuration for the production slot. + :param slot: Name of web app slot. If not specified then will default + to 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 callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] :param operation_config: :ref:`Operation configuration overrides`. - :return: SiteConfigResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.SiteConfigResource or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` """ # Construct URL - url = self.update_configuration_slot.metadata['url'] + url = self.get_container_logs_zip_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'), @@ -13079,8 +13534,7 @@ def update_configuration_slot( # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/zip' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -13088,52 +13542,49 @@ def update_configuration_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(site_config, 'SiteConfigResource') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=True, **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 response.status_code == 200: - deserialized = self._deserialize('SiteConfigResource', response) + deserialized = self._client.stream_download(response, callback) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} + get_container_logs_zip_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download'} - def list_configuration_snapshot_info_slot( + def list_continuous_web_jobs_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Gets a list of web app configuration snapshots identifiers. Each - element of the list contains a timestamp and the ID of the snapshot. + """List continuous web jobs for an app, or a deployment slot. - Gets a list of web app configuration snapshots identifiers. Each - element of the list contains a timestamp and the ID of the snapshot. + List continuous web jobs for an app, or a deployment slot. :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: Site name. :type name: str :param slot: Name of the deployment slot. If a slot is not specified, - the API will return configuration for the production slot. + the API deletes a deployment 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: An iterator like instance of SiteConfigurationSnapshotInfo + :return: An iterator like instance of ContinuousWebJob :rtype: - ~azure.mgmt.web.models.SiteConfigurationSnapshotInfoPaged[~azure.mgmt.web.models.SiteConfigurationSnapshotInfo] + ~azure.mgmt.web.models.ContinuousWebJobPaged[~azure.mgmt.web.models.ContinuousWebJob] :raises: :class:`DefaultErrorResponseException` """ @@ -13141,7 +13592,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = self.list_configuration_snapshot_info_slot.metadata['url'] + url = self.list_continuous_web_jobs_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'), @@ -13178,51 +13629,48 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.SiteConfigurationSnapshotInfoPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.ContinuousWebJobPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.SiteConfigurationSnapshotInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.ContinuousWebJobPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_configuration_snapshot_info_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots'} + list_continuous_web_jobs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs'} - def get_configuration_snapshot_slot( - self, resource_group_name, name, snapshot_id, slot, custom_headers=None, raw=False, **operation_config): - """Gets a snapshot of the configuration of an app at a previous point in - time. + def get_continuous_web_job_slot( + self, resource_group_name, name, web_job_name, slot, custom_headers=None, raw=False, **operation_config): + """Gets a continuous web job by its ID for an app, or a deployment slot. - Gets a snapshot of the configuration of an app at a previous point in - time. + Gets a continuous web job by its ID for an app, or a deployment slot. :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: Site name. :type name: str - :param snapshot_id: The ID of the snapshot to read. - :type snapshot_id: str + :param web_job_name: Name of Web Job. + :type web_job_name: str :param slot: Name of the deployment slot. If a slot is not specified, - the API will return configuration for the production slot. + the API deletes a deployment 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: SiteConfigResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.SiteConfigResource or + :return: ContinuousWebJob or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.ContinuousWebJob or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` + :raises: :class:`CloudError` """ # Construct URL - url = self.get_configuration_snapshot_slot.metadata['url'] + url = self.get_continuous_web_job_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'), - 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -13246,36 +13694,38 @@ def get_configuration_snapshot_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]: - raise models.DefaultErrorResponseException(self._deserialize, response) + 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('SiteConfigResource', response) + deserialized = self._deserialize('ContinuousWebJob', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_configuration_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}'} + get_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'} - def recover_site_configuration_snapshot_slot( - self, resource_group_name, name, snapshot_id, slot, custom_headers=None, raw=False, **operation_config): - """Reverts the configuration of an app to a previous snapshot. + def delete_continuous_web_job_slot( + self, resource_group_name, name, web_job_name, slot, custom_headers=None, raw=False, **operation_config): + """Delete a continuous web job by its ID for an app, or a deployment slot. - Reverts the configuration of an app to a previous snapshot. + Delete a continuous web job by its ID for an app, or a deployment slot. :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: Site name. :type name: str - :param snapshot_id: The ID of the snapshot to read. - :type snapshot_id: str + :param web_job_name: Name of Web Job. + :type web_job_name: str :param slot: Name of the deployment slot. If a slot is not specified, - the API will return configuration for the production slot. + the API deletes a deployment 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 @@ -13287,11 +13737,11 @@ def recover_site_configuration_snapshot_slot( :raises: :class:`CloudError` """ # Construct URL - url = self.recover_site_configuration_snapshot_slot.metadata['url'] + url = self.delete_continuous_web_job_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'), - 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -13311,10 +13761,10 @@ def recover_site_configuration_snapshot_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.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -13322,41 +13772,39 @@ def recover_site_configuration_snapshot_slot( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - recover_site_configuration_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}/recover'} + delete_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'} - def get_web_site_container_logs_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, callback=None, **operation_config): - """Gets the last lines of docker logs for the given site. + def start_continuous_web_job_slot( + self, resource_group_name, name, web_job_name, slot, custom_headers=None, raw=False, **operation_config): + """Start a continuous web job for an app, or a deployment slot. - Gets the last lines of docker logs for the given site. + Start a continuous web job for an app, or a deployment slot. :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: Site name. :type name: str - :param slot: Name of web app slot. If not specified then will default - to production slot. + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, + the API deletes a deployment 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 callback: When specified, will be called with each chunk of - data that is streamed. The callback should take two arguments, the - bytes of the current chunk of data and the response object. If the - data is uploading, response will be None. - :type callback: Callable[Bytes, response=None] :param operation_config: :ref:`Operation configuration overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get_web_site_container_logs_slot.metadata['url'] + url = self.start_continuous_web_job_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'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -13368,7 +13816,6 @@ def get_web_site_container_logs_slot( # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/octet-stream' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -13378,58 +13825,49 @@ def get_web_site_container_logs_slot( # Construct and send request request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=True, **operation_config) + 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 - deserialized = None - - if response.status_code == 200: - deserialized = self._client.stream_download(response, callback) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + start_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/start'} - return deserialized - get_web_site_container_logs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs'} - - def get_container_logs_zip_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, callback=None, **operation_config): - """Gets the ZIP archived docker log files for the given site. + def stop_continuous_web_job_slot( + self, resource_group_name, name, web_job_name, slot, custom_headers=None, raw=False, **operation_config): + """Stop a continuous web job for an app, or a deployment slot. - Gets the ZIP archived docker log files for the given site. + Stop a continuous web job for an app, or a deployment slot. :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: Site name. :type name: str - :param slot: Name of web app slot. If not specified then will default - to production slot. + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, + the API deletes a deployment 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 callback: When specified, will be called with each chunk of - data that is streamed. The callback should take two arguments, the - bytes of the current chunk of data and the response object. If the - data is uploading, response will be None. - :type callback: Callable[Bytes, response=None] :param operation_config: :ref:`Operation configuration overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get_container_logs_zip_slot.metadata['url'] + url = self.stop_continuous_web_job_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'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -13441,7 +13879,6 @@ def get_container_logs_zip_slot( # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/zip' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -13451,47 +13888,40 @@ def get_container_logs_zip_slot( # Construct and send request request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=True, **operation_config) + 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 - deserialized = None - - if response.status_code == 200: - deserialized = self._client.stream_download(response, callback) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + stop_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/stop'} - return deserialized - get_container_logs_zip_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download'} - - def list_continuous_web_jobs_slot( + def list_deployments_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """List continuous web jobs for an app, or a deployment slot. + """List deployments for an app, or a deployment slot. - List continuous web jobs for an app, or a deployment slot. + List deployments for an app, or a deployment slot. :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 slot: Name of the deployment slot. If a slot is not specified, - the API deletes a deployment for the production slot. + the API returns deployments 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: An iterator like instance of ContinuousWebJob + :return: An iterator like instance of Deployment :rtype: - ~azure.mgmt.web.models.ContinuousWebJobPaged[~azure.mgmt.web.models.ContinuousWebJob] + ~azure.mgmt.web.models.DeploymentPaged[~azure.mgmt.web.models.Deployment] :raises: :class:`DefaultErrorResponseException` """ @@ -13499,7 +13929,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = self.list_continuous_web_jobs_slot.metadata['url'] + url = self.list_deployments_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'), @@ -13536,48 +13966,49 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.ContinuousWebJobPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.DeploymentPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.ContinuousWebJobPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.DeploymentPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_continuous_web_jobs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs'} + list_deployments_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments'} - def get_continuous_web_job_slot( - self, resource_group_name, name, web_job_name, slot, custom_headers=None, raw=False, **operation_config): - """Gets a continuous web job by its ID for an app, or a deployment slot. + def get_deployment_slot( + self, resource_group_name, name, id, slot, custom_headers=None, raw=False, **operation_config): + """Get a deployment by its ID for an app, or a deployment slot. - Gets a continuous web job by its ID for an app, or a deployment slot. + Get a deployment by its ID for an app, or a deployment slot. :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 web_job_name: Name of Web Job. - :type web_job_name: str + :param id: Deployment ID. + :type id: str :param slot: Name of the deployment slot. If a slot is not specified, - the API deletes a deployment for the production slot. + the API gets a deployment 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: ContinuousWebJob or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.ContinuousWebJob or + :return: Deployment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.Deployment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_continuous_web_job_slot.metadata['url'] + url = self.get_deployment_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'), - 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'id': self._serialize.url("id", id, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -13601,36 +14032,111 @@ def get_continuous_web_job_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('ContinuousWebJob', response) + deserialized = self._deserialize('Deployment', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'} + get_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} - def delete_continuous_web_job_slot( - self, resource_group_name, name, web_job_name, slot, custom_headers=None, raw=False, **operation_config): - """Delete a continuous web job by its ID for an app, or a deployment slot. + def create_deployment_slot( + self, resource_group_name, name, id, slot, deployment, custom_headers=None, raw=False, **operation_config): + """Create a deployment for an app, or a deployment slot. - Delete a continuous web job by its ID for an app, or a deployment slot. + Create a deployment for an app, or a deployment slot. :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 web_job_name: Name of Web Job. - :type web_job_name: str + :param id: ID of an existing deployment. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, + the API creates a deployment for the production slot. + :type slot: str + :param deployment: Deployment details. + :type deployment: ~azure.mgmt.web.models.Deployment + :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: Deployment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.Deployment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.create_deployment_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'), + 'id': self._serialize.url("id", id, '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' + 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(deployment, 'Deployment') + + # 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('Deployment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} + + def delete_deployment_slot( + self, resource_group_name, name, id, slot, custom_headers=None, raw=False, **operation_config): + """Delete a deployment by its ID for an app, or a deployment slot. + + Delete a deployment by its ID for an app, or a deployment slot. + + :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 id: Deployment ID. + :type id: str :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. :type slot: str @@ -13644,11 +14150,11 @@ def delete_continuous_web_job_slot( :raises: :class:`CloudError` """ # Construct URL - url = self.delete_continuous_web_job_slot.metadata['url'] + url = self.delete_deployment_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'), - 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'id': self._serialize.url("id", id, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -13679,39 +14185,45 @@ def delete_continuous_web_job_slot( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'} + delete_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} - def start_continuous_web_job_slot( - self, resource_group_name, name, web_job_name, slot, custom_headers=None, raw=False, **operation_config): - """Start a continuous web job for an app, or a deployment slot. + def list_deployment_log_slot( + self, resource_group_name, name, id, slot, custom_headers=None, raw=False, **operation_config): + """List deployment log for specific deployment for an app, or a deployment + slot. - Start a continuous web job for an app, or a deployment slot. + List deployment log for specific deployment for an app, or a deployment + slot. :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 web_job_name: Name of Web Job. - :type web_job_name: str + :param id: The ID of a specific deployment. This is the value of the + name property in the JSON response from "GET + /api/sites/{siteName}/deployments". + :type id: str :param slot: Name of the deployment slot. If a slot is not specified, - the API deletes a deployment for the production slot. + the API returns deployments 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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :return: Deployment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.Deployment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.start_continuous_web_job_slot.metadata['url'] + url = self.list_deployment_log_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'), - 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'id': self._serialize.url("id", id, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -13723,6 +14235,7 @@ def start_continuous_web_job_slot( # 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: @@ -13731,50 +14244,61 @@ def start_continuous_web_job_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, 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('Deployment', response) if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - start_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/start'} - def stop_continuous_web_job_slot( - self, resource_group_name, name, web_job_name, slot, custom_headers=None, raw=False, **operation_config): - """Stop a continuous web job for an app, or a deployment slot. + return deserialized + list_deployment_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log'} - Stop a continuous web job for an app, or a deployment slot. + def discover_backup_slot( + self, resource_group_name, name, request, slot, custom_headers=None, raw=False, **operation_config): + """Discovers an existing app backup that can be restored from a blob in + Azure storage. Use this to get information about the databases stored + in a backup. + + Discovers an existing app backup that can be restored from a blob in + Azure storage. Use this to get information about the databases stored + in a backup. :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 web_job_name: Name of Web Job. - :type web_job_name: str + :param request: A RestoreRequest object that includes Azure storage + URL and blog name for discovery of backup. + :type request: ~azure.mgmt.web.models.RestoreRequest :param slot: Name of the deployment slot. If a slot is not specified, - the API deletes a deployment for the production slot. + the API will perform discovery 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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :return: RestoreRequest or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.RestoreRequest or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.stop_continuous_web_job_slot.metadata['url'] + url = self.discover_backup_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'), - 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -13786,6 +14310,8 @@ def stop_continuous_web_job_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: @@ -13793,25 +14319,33 @@ def stop_continuous_web_job_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(request, 'RestoreRequest') + # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters, body_content) 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('RestoreRequest', response) if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - stop_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/stop'} - def list_deployments_slot( + return deserialized + discover_backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup'} + + def list_domain_ownership_identifiers_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """List deployments for an app, or a deployment slot. + """Lists ownership identifiers for domain associated with web app. - List deployments for an app, or a deployment slot. + Lists ownership identifiers for domain associated with web app. :param resource_group_name: Name of the resource group to which the resource belongs. @@ -13819,16 +14353,16 @@ def list_deployments_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 returns deployments for the production slot. + the API will delete the binding 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: An iterator like instance of Deployment + :return: An iterator like instance of Identifier :rtype: - ~azure.mgmt.web.models.DeploymentPaged[~azure.mgmt.web.models.Deployment] + ~azure.mgmt.web.models.IdentifierPaged[~azure.mgmt.web.models.Identifier] :raises: :class:`DefaultErrorResponseException` """ @@ -13836,7 +14370,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = self.list_deployments_slot.metadata['url'] + url = self.list_domain_ownership_identifiers_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'), @@ -13873,49 +14407,204 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.DeploymentPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.IdentifierPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.DeploymentPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.IdentifierPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_deployments_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments'} + list_domain_ownership_identifiers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers'} - def get_deployment_slot( - self, resource_group_name, name, id, slot, custom_headers=None, raw=False, **operation_config): - """Get a deployment by its ID for an app, or a deployment slot. + def get_domain_ownership_identifier_slot( + self, resource_group_name, name, domain_ownership_identifier_name, slot, custom_headers=None, raw=False, **operation_config): + """Get domain ownership identifier for web app. - Get a deployment by its ID for an app, or a deployment slot. + Get domain ownership identifier 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 the app. :type name: str - :param id: Deployment ID. - :type id: str + :param domain_ownership_identifier_name: Name of domain ownership + identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, + the API will delete the binding 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: Identifier or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.Identifier or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.get_domain_ownership_identifier_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'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_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.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('Identifier', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} + + def create_or_update_domain_ownership_identifier_slot( + self, resource_group_name, name, domain_ownership_identifier_name, slot, kind=None, identifier_id=None, custom_headers=None, raw=False, **operation_config): + """Creates a domain ownership identifier for web app, or updates an + existing ownership identifier. + + Creates a domain ownership identifier for web app, or updates an + existing ownership identifier. + + :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 domain_ownership_identifier_name: Name of domain ownership + identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, + the API will delete the binding for the production slot. + :type slot: str + :param kind: Kind of resource. + :type kind: str + :param identifier_id: String representation of the identity. + :type identifier_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: Identifier or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.Identifier or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + domain_ownership_identifier = models.Identifier(kind=kind, identifier_id=identifier_id) + + # Construct URL + url = self.create_or_update_domain_ownership_identifier_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'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_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' + 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(domain_ownership_identifier, 'Identifier') + + # 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('Identifier', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} + + def delete_domain_ownership_identifier_slot( + self, resource_group_name, name, domain_ownership_identifier_name, slot, custom_headers=None, raw=False, **operation_config): + """Deletes a domain ownership identifier for a web app. + + Deletes a domain ownership identifier for a 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 the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership + identifier. + :type domain_ownership_identifier_name: str :param slot: Name of the deployment slot. If a slot is not specified, - the API gets a deployment for the production slot. + the API will delete the binding 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: Deployment or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.Deployment 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_deployment_slot.metadata['url'] + url = self.delete_domain_ownership_identifier_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'), - 'id': self._serialize.url("id", id, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -13927,7 +14616,6 @@ def get_deployment_slot( # 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: @@ -13936,59 +14624,61 @@ def get_deployment_slot( 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.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('Deployment', response) + if response.status_code not in [200, 204]: + 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_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} - return deserialized - get_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} - - def create_deployment_slot( - self, resource_group_name, name, id, slot, deployment, custom_headers=None, raw=False, **operation_config): - """Create a deployment for an app, or a deployment slot. + def update_domain_ownership_identifier_slot( + self, resource_group_name, name, domain_ownership_identifier_name, slot, kind=None, identifier_id=None, custom_headers=None, raw=False, **operation_config): + """Creates a domain ownership identifier for web app, or updates an + existing ownership identifier. - Create a deployment for an app, or a deployment slot. + Creates a domain ownership identifier for web app, or updates an + existing ownership identifier. :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 id: ID of an existing deployment. - :type id: str + :param domain_ownership_identifier_name: Name of domain ownership + identifier. + :type domain_ownership_identifier_name: str :param slot: Name of the deployment slot. If a slot is not specified, - the API creates a deployment for the production slot. + the API will delete the binding for the production slot. :type slot: str - :param deployment: Deployment details. - :type deployment: ~azure.mgmt.web.models.Deployment + :param kind: Kind of resource. + :type kind: str + :param identifier_id: String representation of the identity. + :type identifier_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: Deployment or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.Deployment or + :return: Identifier or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.Identifier or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ + domain_ownership_identifier = models.Identifier(kind=kind, identifier_id=identifier_id) + # Construct URL - url = self.create_deployment_slot.metadata['url'] + url = self.update_domain_ownership_identifier_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'), - 'id': self._serialize.url("id", id, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -14010,10 +14700,10 @@ def create_deployment_slot( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(deployment, 'Deployment') + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + 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]: @@ -14022,46 +14712,45 @@ def create_deployment_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Deployment', response) + deserialized = self._deserialize('Identifier', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} + update_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} - def delete_deployment_slot( - self, resource_group_name, name, id, slot, custom_headers=None, raw=False, **operation_config): - """Delete a deployment by its ID for an app, or a deployment slot. + def get_ms_deploy_status_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Get the status of the last MSDeploy operation. - Delete a deployment by its ID for an app, or a deployment slot. + Get the status of the last MSDeploy operation. :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 id: Deployment ID. - :type id: str - :param slot: Name of the deployment slot. If a slot is not specified, - the API deletes a deployment for the production slot. + :param slot: Name of web app slot. If not specified then will default + to 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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :return: MSDeployStatus or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.MSDeployStatus or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_deployment_slot.metadata['url'] + url = self.get_ms_deploy_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'), - 'id': self._serialize.url("id", id, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -14073,6 +14762,7 @@ def delete_deployment_slot( # 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: @@ -14081,56 +14771,32 @@ def delete_deployment_slot( 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, 204]: - 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('MSDeployStatus', response) if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} - def list_deployment_log_slot( - self, resource_group_name, name, id, slot, custom_headers=None, raw=False, **operation_config): - """List deployment log for specific deployment for an app, or a deployment - slot. + return deserialized + get_ms_deploy_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} - List deployment log for specific deployment for an app, or a deployment - slot. - :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 id: The ID of a specific deployment. This is the value of the - name property in the JSON response from "GET - /api/sites/{siteName}/deployments". - :type 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 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: Deployment or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.Deployment or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` - """ + def _create_ms_deploy_operation_slot_initial( + self, resource_group_name, name, slot, ms_deploy, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.list_deployment_log_slot.metadata['url'] + url = self.create_ms_deploy_operation_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'), - 'id': self._serialize.url("id", id, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -14143,6 +14809,7 @@ def list_deployment_log_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: @@ -14150,59 +14817,112 @@ def list_deployment_log_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(ms_deploy, 'MSDeploy') + # 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]: - raise models.DefaultErrorResponseException(self._deserialize, response) + if response.status_code not in [201, 409]: + 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('Deployment', response) + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_deployment_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log'} - def discover_backup_slot( - self, resource_group_name, name, request, slot, custom_headers=None, raw=False, **operation_config): - """Discovers an existing app backup that can be restored from a blob in - Azure storage. Use this to get information about the databases stored - in a backup. + def create_ms_deploy_operation_slot( + self, resource_group_name, name, slot, ms_deploy, custom_headers=None, raw=False, polling=True, **operation_config): + """Invoke the MSDeploy web app extension. - Discovers an existing app backup that can be restored from a blob in - Azure storage. Use this to get information about the databases stored - in a backup. + Invoke the MSDeploy web app extension. :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 request: A RestoreRequest object that includes Azure storage - URL and blog name for discovery of backup. - :type request: ~azure.mgmt.web.models.RestoreRequest - :param slot: Name of the deployment slot. If a slot is not specified, - the API will perform discovery for the production slot. + :param slot: Name of web app slot. If not specified then will default + to production slot. + :type slot: str + :param ms_deploy: Details of MSDeploy operation + :type ms_deploy: ~azure.mgmt.web.models.MSDeploy + :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 MSDeployStatus or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.MSDeployStatus] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.MSDeployStatus]] + :raises: :class:`CloudError` + """ + raw_result = self._create_ms_deploy_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + ms_deploy=ms_deploy, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('MSDeployStatus', 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) + create_ms_deploy_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} + + def get_ms_deploy_log_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Get the MSDeploy Log for the last MSDeploy operation. + + Get the MSDeploy Log for the last MSDeploy operation. + + :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 slot: Name of web app slot. If not specified then will default + to 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: RestoreRequest or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.RestoreRequest or + overrides`. + :return: MSDeployLog or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.MSDeployLog or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` + :raises: :class:`CloudError` """ # Construct URL - url = self.discover_backup_slot.metadata['url'] + url = self.get_ms_deploy_log_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'), @@ -14218,7 +14938,6 @@ def discover_backup_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: @@ -14226,58 +14945,56 @@ def discover_backup_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(request, 'RestoreRequest') - # Construct and send request - request = self._client.post(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]: - raise models.DefaultErrorResponseException(self._deserialize, response) + 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('RestoreRequest', response) + deserialized = self._deserialize('MSDeployLog', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - discover_backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup'} + get_ms_deploy_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log'} - def list_domain_ownership_identifiers_slot( + def list_instance_functions_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Lists ownership identifiers for domain associated with web app. + """List the functions for a web site, or a deployment slot. - Lists ownership identifiers for domain associated with web app. + List the functions for a web site, or a deployment slot. :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: Site name. :type name: str :param slot: Name of the deployment slot. If a slot is not specified, - the API will delete the binding for the production slot. + the API deletes a deployment 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: An iterator like instance of Identifier + :return: An iterator like instance of FunctionEnvelope :rtype: - ~azure.mgmt.web.models.IdentifierPaged[~azure.mgmt.web.models.Identifier] - :raises: - :class:`DefaultErrorResponseException` + ~azure.mgmt.web.models.FunctionEnvelopePaged[~azure.mgmt.web.models.FunctionEnvelope] + :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = self.list_domain_ownership_identifiers_slot.metadata['url'] + url = self.list_instance_functions_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'), @@ -14308,56 +15025,53 @@ 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]: - raise models.DefaultErrorResponseException(self._deserialize, response) + 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.IdentifierPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.FunctionEnvelopePaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.IdentifierPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.FunctionEnvelopePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_domain_ownership_identifiers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers'} + list_instance_functions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions'} - def get_domain_ownership_identifier_slot( - self, resource_group_name, name, domain_ownership_identifier_name, slot, custom_headers=None, raw=False, **operation_config): - """Get domain ownership identifier for web app. + def get_functions_admin_token_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Fetch a short lived token that can be exchanged for a master key. - Get domain ownership identifier for web app. + Fetch a short lived token that can be exchanged for a master key. :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 domain_ownership_identifier_name: Name of domain ownership - identifier. - :type domain_ownership_identifier_name: str - :param slot: Name of the deployment slot. If a slot is not specified, - the API will delete the binding for the production slot. + :param slot: Name of web app slot. If not specified then will default + to 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: Identifier or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.Identifier 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_domain_ownership_identifier_slot.metadata['url'] + url = self.get_functions_admin_token_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'), - 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -14387,57 +15101,96 @@ def get_domain_ownership_identifier_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Identifier', response) + deserialized = self._deserialize('str', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} + get_functions_admin_token_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token'} - def create_or_update_domain_ownership_identifier_slot( - self, resource_group_name, name, domain_ownership_identifier_name, slot, kind=None, identifier_id=None, custom_headers=None, raw=False, **operation_config): - """Creates a domain ownership identifier for web app, or updates an - existing ownership identifier. + def get_instance_function_slot( + self, resource_group_name, name, function_name, slot, custom_headers=None, raw=False, **operation_config): + """Get function information by its ID for web site, or a deployment slot. - Creates a domain ownership identifier for web app, or updates an - existing ownership identifier. + Get function information by its ID for web site, or a deployment slot. :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: Site name. :type name: str - :param domain_ownership_identifier_name: Name of domain ownership - identifier. - :type domain_ownership_identifier_name: str + :param function_name: Function name. + :type function_name: str :param slot: Name of the deployment slot. If a slot is not specified, - the API will delete the binding for the production slot. + the API deletes a deployment for the production slot. :type slot: str - :param kind: Kind of resource. - :type kind: str - :param identifier_id: String representation of the identity. - :type identifier_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: Identifier or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.Identifier or + :return: FunctionEnvelope or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.FunctionEnvelope or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` + :raises: :class:`CloudError` """ - domain_ownership_identifier = models.Identifier(kind=kind, identifier_id=identifier_id) + # Construct URL + url = self.get_instance_function_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'), + 'functionName': self._serialize.url("function_name", function_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.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('FunctionEnvelope', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} + + def _create_instance_function_slot_initial( + self, resource_group_name, name, function_name, slot, function_envelope, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.create_or_update_domain_ownership_identifier_slot.metadata['url'] + url = self.create_instance_function_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'), - 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -14459,43 +15212,102 @@ def create_or_update_domain_ownership_identifier_slot( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content = self._serialize.body(function_envelope, 'FunctionEnvelope') # 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]: + if response.status_code not in [201]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Identifier', response) + if response.status_code == 201: + deserialized = self._deserialize('FunctionEnvelope', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} - def delete_domain_ownership_identifier_slot( - self, resource_group_name, name, domain_ownership_identifier_name, slot, custom_headers=None, raw=False, **operation_config): - """Deletes a domain ownership identifier for a web app. + def create_instance_function_slot( + self, resource_group_name, name, function_name, slot, function_envelope, custom_headers=None, raw=False, polling=True, **operation_config): + """Create function for web site, or a deployment slot. - Deletes a domain ownership identifier for a web app. + Create function for web site, or a deployment slot. :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: Site name. :type name: str - :param domain_ownership_identifier_name: Name of domain ownership - identifier. - :type domain_ownership_identifier_name: str + :param function_name: Function name. + :type function_name: str :param slot: Name of the deployment slot. If a slot is not specified, - the API will delete the binding for the production slot. + the API deletes a deployment for the production slot. + :type slot: str + :param function_envelope: Function details. + :type function_envelope: ~azure.mgmt.web.models.FunctionEnvelope + :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 FunctionEnvelope or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.FunctionEnvelope] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.FunctionEnvelope]] + :raises: + :class:`DefaultErrorResponseException` + """ + raw_result = self._create_instance_function_slot_initial( + resource_group_name=resource_group_name, + name=name, + function_name=function_name, + slot=slot, + function_envelope=function_envelope, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('FunctionEnvelope', 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) + create_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} + + def delete_instance_function_slot( + self, resource_group_name, name, function_name, slot, custom_headers=None, raw=False, **operation_config): + """Delete a function for web site, or a deployment slot. + + Delete a function for web site, or a deployment slot. + + :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 function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. If a slot is not specified, + the API deletes a deployment 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 @@ -14507,11 +15319,11 @@ def delete_domain_ownership_identifier_slot( :raises: :class:`CloudError` """ # Construct URL - url = self.delete_domain_ownership_identifier_slot.metadata['url'] + url = self.delete_instance_function_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'), - 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -14534,7 +15346,7 @@ def delete_domain_ownership_identifier_slot( 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, 204]: + if response.status_code not in [204, 404]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -14542,50 +15354,43 @@ def delete_domain_ownership_identifier_slot( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} + delete_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} - def update_domain_ownership_identifier_slot( - self, resource_group_name, name, domain_ownership_identifier_name, slot, kind=None, identifier_id=None, custom_headers=None, raw=False, **operation_config): - """Creates a domain ownership identifier for web app, or updates an - existing ownership identifier. + def list_function_secrets_slot( + self, resource_group_name, name, function_name, slot, custom_headers=None, raw=False, **operation_config): + """Get function secrets for a function in a web site, or a deployment + slot. - Creates a domain ownership identifier for web app, or updates an - existing ownership identifier. + Get function secrets for a function in a web site, or a deployment + slot. :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: Site name. :type name: str - :param domain_ownership_identifier_name: Name of domain ownership - identifier. - :type domain_ownership_identifier_name: str + :param function_name: Function name. + :type function_name: str :param slot: Name of the deployment slot. If a slot is not specified, - the API will delete the binding for the production slot. + the API deletes a deployment for the production slot. :type slot: str - :param kind: Kind of resource. - :type kind: str - :param identifier_id: String representation of the identity. - :type identifier_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: Identifier or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.Identifier or + :return: FunctionSecrets or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.FunctionSecrets or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ - domain_ownership_identifier = models.Identifier(kind=kind, identifier_id=identifier_id) - # Construct URL - url = self.update_domain_ownership_identifier_slot.metadata['url'] + url = self.list_function_secrets_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'), - 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -14598,7 +15403,6 @@ def update_domain_ownership_identifier_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: @@ -14606,11 +15410,8 @@ def update_domain_ownership_identifier_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(domain_ownership_identifier, 'Identifier') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) + 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]: @@ -14619,46 +15420,127 @@ def update_domain_ownership_identifier_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Identifier', response) + deserialized = self._deserialize('FunctionSecrets', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} + list_function_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets'} - def get_ms_deploy_status_slot( + def list_host_name_bindings_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Get the status of the last MSDeploy operation. + """Get hostname bindings for an app or a deployment slot. - Get the status of the last MSDeploy operation. + Get hostname bindings for an app or a deployment slot. :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 web app slot. If not specified then will default - to production slot. + :param slot: Name of the deployment slot. If a slot is not specified, + the API gets hostname bindings 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: MSDeployStatus or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.MSDeployStatus or + :return: An iterator like instance of HostNameBinding + :rtype: + ~azure.mgmt.web.models.HostNameBindingPaged[~azure.mgmt.web.models.HostNameBinding] + :raises: + :class:`DefaultErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_host_name_bindings_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.HostNameBindingPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.HostNameBindingPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_host_name_bindings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings'} + + def get_host_name_binding_slot( + self, resource_group_name, name, slot, host_name, custom_headers=None, raw=False, **operation_config): + """Get the named hostname binding for an app (or deployment slot, if + specified). + + Get the named hostname binding 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 slot: Name of the deployment slot. If a slot is not specified, + the API the named binding for the production slot. + :type slot: str + :param host_name: Hostname in the hostname binding. + :type host_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: HostNameBinding or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.HostNameBinding or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_ms_deploy_status_slot.metadata['url'] + url = self.get_host_name_binding_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'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -14687,23 +15569,51 @@ def get_ms_deploy_status_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('MSDeployStatus', response) + deserialized = self._deserialize('HostNameBinding', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_ms_deploy_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} + get_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} + def create_or_update_host_name_binding_slot( + self, resource_group_name, name, host_name, host_name_binding, slot, custom_headers=None, raw=False, **operation_config): + """Creates a hostname binding for an app. - def _create_ms_deploy_operation_slot_initial( - self, resource_group_name, name, slot, ms_deploy, custom_headers=None, raw=False, **operation_config): + Creates a hostname binding for 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 host_name: Hostname in the hostname binding. + :type host_name: str + :param host_name_binding: Binding details. This is the JSON + representation of a HostNameBinding object. + :type host_name_binding: ~azure.mgmt.web.models.HostNameBinding + :param slot: Name of the deployment slot. If a slot is not specified, + the API will create a binding 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: HostNameBinding or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.HostNameBinding or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ # Construct URL - url = self.create_ms_deploy_operation_slot.metadata['url'] + url = self.create_or_update_host_name_binding_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'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -14717,123 +15627,67 @@ def _create_ms_deploy_operation_slot_initial( 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(ms_deploy, 'MSDeploy') - - # 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 [201, 409]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('MSDeployStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_ms_deploy_operation_slot( - self, resource_group_name, name, slot, ms_deploy, custom_headers=None, raw=False, polling=True, **operation_config): - """Invoke the MSDeploy web app extension. - - Invoke the MSDeploy web app extension. - - :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 slot: Name of web app slot. If not specified then will default - to production slot. - :type slot: str - :param ms_deploy: Details of MSDeploy operation - :type ms_deploy: ~azure.mgmt.web.models.MSDeploy - :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 MSDeployStatus or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.MSDeployStatus] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.MSDeployStatus]] - :raises: :class:`CloudError` - """ - raw_result = self._create_ms_deploy_operation_slot_initial( - resource_group_name=resource_group_name, - name=name, - slot=slot, - ms_deploy=ms_deploy, - custom_headers=custom_headers, - raw=True, - **operation_config - ) + 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') - def get_long_running_output(response): - deserialized = self._deserialize('MSDeployStatus', response) + # Construct body + body_content = self._serialize.body(host_name_binding, 'HostNameBinding') - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) - return deserialized + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) - 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) - create_ms_deploy_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} + deserialized = None - def get_ms_deploy_log_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Get the MSDeploy Log for the last MSDeploy operation. + if response.status_code == 200: + deserialized = self._deserialize('HostNameBinding', response) - Get the MSDeploy Log for the last MSDeploy operation. + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} + + def delete_host_name_binding_slot( + self, resource_group_name, name, slot, host_name, custom_headers=None, raw=False, **operation_config): + """Deletes a hostname binding for an app. + + Deletes a hostname binding for 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 web app. + :param name: Name of the app. :type name: str - :param slot: Name of web app slot. If not specified then will default - to production slot. + :param slot: Name of the deployment slot. If a slot is not specified, + the API will delete the binding for the production slot. :type slot: str + :param host_name: Hostname in the hostname binding. + :type host_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: MSDeployLog or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.MSDeployLog or - ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get_ms_deploy_log_slot.metadata['url'] + url = self.delete_host_name_binding_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'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -14844,7 +15698,6 @@ def get_ms_deploy_log_slot( # 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: @@ -14853,132 +15706,131 @@ def get_ms_deploy_log_slot( 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.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 404]: + 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 response.status_code == 200: - deserialized = self._deserialize('MSDeployLog', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} - return deserialized - get_ms_deploy_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log'} - - def list_instance_functions_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """List the functions for a web site, or a deployment slot. + def get_hybrid_connection_slot( + self, resource_group_name, name, namespace_name, relay_name, slot, custom_headers=None, raw=False, **operation_config): + """Retrieves a specific Service Bus Hybrid Connection used by this Web + App. - List the functions for a web site, or a deployment slot. + Retrieves a specific Service Bus Hybrid Connection used by this Web + App. :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: The name of the web app. :type name: str - :param slot: Name of the deployment slot. If a slot is not specified, - the API deletes a deployment for the production slot. + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. :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 FunctionEnvelope - :rtype: - ~azure.mgmt.web.models.FunctionEnvelopePaged[~azure.mgmt.web.models.FunctionEnvelope] - :raises: :class:`CloudError` + :return: HybridConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.HybridConnection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_instance_functions_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 URL + url = self.get_hybrid_connection_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'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_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) - else: - url = next_link - query_parameters = {} + # 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 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) + # 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 + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) - return response + deserialized = None - # Deserialize response - deserialized = models.FunctionEnvelopePaged(internal_paging, self._deserialize.dependencies) + if response.status_code == 200: + deserialized = self._deserialize('HybridConnection', response) if raw: - header_dict = {} - client_raw_response = models.FunctionEnvelopePaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_instance_functions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions'} + get_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} - def get_functions_admin_token_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Fetch a short lived token that can be exchanged for a master key. + def create_or_update_hybrid_connection_slot( + self, resource_group_name, name, namespace_name, relay_name, connection_envelope, slot, custom_headers=None, raw=False, **operation_config): + """Creates a new Hybrid Connection using a Service Bus relay. - Fetch a short lived token that can be exchanged for a master key. + Creates a new Hybrid Connection using a Service Bus relay. :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: The name of the web app. :type name: str - :param slot: Name of web app slot. If not specified then will default - to production slot. + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.models.HybridConnection + :param slot: The name of the slot for the web app. :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: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse + :return: HybridConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.HybridConnection or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_functions_admin_token_slot.metadata['url'] + url = self.create_or_update_hybrid_connection_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'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -14991,6 +15843,7 @@ def get_functions_admin_token_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: @@ -14998,8 +15851,11 @@ def get_functions_admin_token_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, 'HybridConnection') + # 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]: @@ -15008,47 +15864,48 @@ def get_functions_admin_token_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('str', response) + deserialized = self._deserialize('HybridConnection', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_functions_admin_token_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token'} + create_or_update_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} - def get_instance_function_slot( - self, resource_group_name, name, function_name, slot, custom_headers=None, raw=False, **operation_config): - """Get function information by its ID for web site, or a deployment slot. + def delete_hybrid_connection_slot( + self, resource_group_name, name, namespace_name, relay_name, slot, custom_headers=None, raw=False, **operation_config): + """Removes a Hybrid Connection from this site. - Get function information by its ID for web site, or a deployment slot. + Removes a Hybrid Connection from this site. :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: The name of the web app. :type name: str - :param function_name: Function name. - :type function_name: str - :param slot: Name of the deployment slot. If a slot is not specified, - the API deletes a deployment for the production slot. + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. :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: FunctionEnvelope or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.FunctionEnvelope or - ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get_instance_function_slot.metadata['url'] + url = self.delete_hybrid_connection_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'), - 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -15060,7 +15917,6 @@ def get_instance_function_slot( # 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: @@ -15069,7 +15925,7 @@ def get_instance_function_slot( 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.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 404]: @@ -15077,27 +15933,48 @@ def get_instance_function_slot( exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('FunctionEnvelope', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} - return deserialized - get_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} + def update_hybrid_connection_slot( + self, resource_group_name, name, namespace_name, relay_name, connection_envelope, slot, custom_headers=None, raw=False, **operation_config): + """Creates a new Hybrid Connection using a Service Bus relay. + Creates a new Hybrid Connection using a Service Bus relay. - def _create_instance_function_slot_initial( - self, resource_group_name, name, function_name, slot, function_envelope, 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: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.models.HybridConnection + :param slot: The name of the slot for the web app. + :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: HybridConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.HybridConnection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ # Construct URL - url = self.create_instance_function_slot.metadata['url'] + url = self.update_hybrid_connection_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'), - 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -15119,118 +15996,62 @@ def _create_instance_function_slot_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(function_envelope, 'FunctionEnvelope') + body_content = self._serialize.body(connection_envelope, 'HybridConnection') # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + 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 [201]: + if response.status_code not in [200]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('FunctionEnvelope', response) + if response.status_code == 200: + deserialized = self._deserialize('HybridConnection', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized + update_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} - def create_instance_function_slot( - self, resource_group_name, name, function_name, slot, function_envelope, custom_headers=None, raw=False, polling=True, **operation_config): - """Create function for web site, or a deployment slot. - - Create function for web site, or a deployment slot. - - :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 function_name: Function name. - :type function_name: str - :param slot: Name of the deployment slot. If a slot is not specified, - the API deletes a deployment for the production slot. - :type slot: str - :param function_envelope: Function details. - :type function_envelope: ~azure.mgmt.web.models.FunctionEnvelope - :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 FunctionEnvelope or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.FunctionEnvelope] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.FunctionEnvelope]] - :raises: - :class:`DefaultErrorResponseException` - """ - raw_result = self._create_instance_function_slot_initial( - resource_group_name=resource_group_name, - name=name, - function_name=function_name, - slot=slot, - function_envelope=function_envelope, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('FunctionEnvelope', 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) - create_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} - - def delete_instance_function_slot( - self, resource_group_name, name, function_name, slot, custom_headers=None, raw=False, **operation_config): - """Delete a function for web site, or a deployment slot. + def list_hybrid_connection_keys_slot( + self, resource_group_name, name, namespace_name, relay_name, slot, custom_headers=None, raw=False, **operation_config): + """Gets the send key name and value for a Hybrid Connection. - Delete a function for web site, or a deployment slot. + Gets the send key name and value for a Hybrid Connection. :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: The name of the web app. :type name: str - :param function_name: Function name. - :type function_name: str - :param slot: Name of the deployment slot. If a slot is not specified, - the API deletes a deployment for the production slot. + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. :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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :return: HybridConnectionKey or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.HybridConnectionKey or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_instance_function_slot.metadata['url'] + url = self.list_hybrid_connection_keys_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'), - 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -15242,6 +16063,7 @@ def delete_instance_function_slot( # 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: @@ -15250,54 +16072,53 @@ def delete_instance_function_slot( 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.post(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204, 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('HybridConnectionKey', response) if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} - def list_function_secrets_slot( - self, resource_group_name, name, function_name, slot, custom_headers=None, raw=False, **operation_config): - """Get function secrets for a function in a web site, or a deployment - slot. + return deserialized + list_hybrid_connection_keys_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'} - Get function secrets for a function in a web site, or a deployment - slot. + def list_hybrid_connections_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Retrieves all Service Bus Hybrid Connections used by this Web App. + + Retrieves all Service Bus Hybrid Connections used by this Web App. :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: The name of the web app. :type name: str - :param function_name: Function name. - :type function_name: str - :param slot: Name of the deployment slot. If a slot is not specified, - the API deletes a deployment for the production slot. + :param slot: The name of the slot for the web app. :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: HybridConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.HybridConnection or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.list_function_secrets_slot.metadata['url'] + url = self.list_hybrid_connections_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'), - 'functionName': self._serialize.url("function_name", function_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -15318,7 +16139,7 @@ def list_function_secrets_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]: @@ -15327,20 +16148,22 @@ def list_function_secrets_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('FunctionSecrets', response) + deserialized = self._deserialize('HybridConnection', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_function_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets'} + list_hybrid_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays'} - def list_host_name_bindings_slot( + def list_relay_service_connections_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Get hostname bindings for an app or a deployment slot. + """Gets hybrid connections configured for an app (or deployment slot, if + specified). - Get hostname bindings for an app or a deployment slot. + Gets hybrid connections configured for an app (or deployment slot, if + specified). :param resource_group_name: Name of the resource group to which the resource belongs. @@ -15348,106 +16171,96 @@ def list_host_name_bindings_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 gets hostname bindings for the production slot. + the API will get hybrid 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: An iterator like instance of HostNameBinding - :rtype: - ~azure.mgmt.web.models.HostNameBindingPaged[~azure.mgmt.web.models.HostNameBinding] + :return: RelayServiceConnectionEntity or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.RelayServiceConnectionEntity or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_host_name_bindings_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 URL + url = self.list_relay_service_connections_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) - else: - url = next_link - query_parameters = {} + # 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 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) + # 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.HostNameBindingPaged(internal_paging, self._deserialize.dependencies) + if response.status_code == 200: + deserialized = self._deserialize('RelayServiceConnectionEntity', response) if raw: - header_dict = {} - client_raw_response = models.HostNameBindingPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_host_name_bindings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings'} + list_relay_service_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection'} - def get_host_name_binding_slot( - self, resource_group_name, name, slot, host_name, custom_headers=None, raw=False, **operation_config): - """Get the named hostname binding for an app (or deployment slot, if - specified). + def get_relay_service_connection_slot( + self, resource_group_name, name, entity_name, slot, custom_headers=None, raw=False, **operation_config): + """Gets a hybrid connection configuration by its name. - Get the named hostname binding for an app (or deployment slot, if - specified). + Gets a hybrid connection configuration by its name. :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 entity_name: Name of the hybrid connection. + :type entity_name: str :param slot: Name of the deployment slot. If a slot is not specified, - the API the named binding for the production slot. + the API will get a hybrid connection for the production slot. :type slot: str - :param host_name: Hostname in the hostname binding. - :type host_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: HostNameBinding or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.HostNameBinding or + :return: RelayServiceConnectionEntity or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.RelayServiceConnectionEntity or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_host_name_binding_slot.metadata['url'] + url = self.get_relay_service_connection_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'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), - 'hostName': self._serialize.url("host_name", host_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -15476,51 +16289,55 @@ def get_host_name_binding_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('HostNameBinding', response) + deserialized = self._deserialize('RelayServiceConnectionEntity', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} + get_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} - def create_or_update_host_name_binding_slot( - self, resource_group_name, name, host_name, host_name_binding, slot, custom_headers=None, raw=False, **operation_config): - """Creates a hostname binding for an app. + def create_or_update_relay_service_connection_slot( + self, resource_group_name, name, entity_name, connection_envelope, slot, custom_headers=None, raw=False, **operation_config): + """Creates a new hybrid connection configuration (PUT), or updates an + existing one (PATCH). - Creates a hostname binding for an app. + Creates a new hybrid connection configuration (PUT), or updates an + existing one (PATCH). :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 host_name: Hostname in the hostname binding. - :type host_name: str - :param host_name_binding: Binding details. This is the JSON - representation of a HostNameBinding object. - :type host_name_binding: ~azure.mgmt.web.models.HostNameBinding + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param connection_envelope: Details of the hybrid connection + configuration. + :type connection_envelope: + ~azure.mgmt.web.models.RelayServiceConnectionEntity :param slot: Name of the deployment slot. If a slot is not specified, - the API will create a binding for the production slot. + the API will create or update a hybrid connection 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: HostNameBinding or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.HostNameBinding or + :return: RelayServiceConnectionEntity or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.RelayServiceConnectionEntity or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.create_or_update_host_name_binding_slot.metadata['url'] + url = self.create_or_update_relay_service_connection_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'), - 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -15542,7 +16359,7 @@ def create_or_update_host_name_binding_slot( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(host_name_binding, 'HostNameBinding') + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -15554,31 +16371,31 @@ def create_or_update_host_name_binding_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('HostNameBinding', response) + deserialized = self._deserialize('RelayServiceConnectionEntity', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} + create_or_update_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} - def delete_host_name_binding_slot( - self, resource_group_name, name, slot, host_name, custom_headers=None, raw=False, **operation_config): - """Deletes a hostname binding for an app. + def delete_relay_service_connection_slot( + self, resource_group_name, name, entity_name, slot, custom_headers=None, raw=False, **operation_config): + """Deletes a relay service connection by its name. - Deletes a hostname binding for an app. + Deletes a relay service connection by its name. :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 entity_name: Name of the hybrid connection configuration. + :type entity_name: str :param slot: Name of the deployment slot. If a slot is not specified, - the API will delete the binding for the production slot. + the API will delete a hybrid connection for the production slot. :type slot: str - :param host_name: Hostname in the hostname binding. - :type host_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 @@ -15589,12 +16406,12 @@ def delete_host_name_binding_slot( :raises: :class:`CloudError` """ # Construct URL - url = self.delete_host_name_binding_slot.metadata['url'] + url = self.delete_relay_service_connection_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'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), - 'hostName': self._serialize.url("host_name", host_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -15616,7 +16433,7 @@ def delete_host_name_binding_slot( 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, 204]: + if response.status_code not in [200, 404]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -15624,45 +16441,48 @@ def delete_host_name_binding_slot( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} + delete_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} - def get_hybrid_connection_slot( - self, resource_group_name, name, namespace_name, relay_name, slot, custom_headers=None, raw=False, **operation_config): - """Retrieves a specific Service Bus Hybrid Connection used by this Web - App. + def update_relay_service_connection_slot( + self, resource_group_name, name, entity_name, connection_envelope, slot, custom_headers=None, raw=False, **operation_config): + """Creates a new hybrid connection configuration (PUT), or updates an + existing one (PATCH). - Retrieves a specific Service Bus Hybrid Connection used by this Web - App. + Creates a new hybrid connection configuration (PUT), or updates an + existing one (PATCH). :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 namespace_name: The namespace for this hybrid connection. - :type namespace_name: str - :param relay_name: The relay name for this hybrid connection. - :type relay_name: str - :param slot: The name of the slot for the web app. + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param connection_envelope: Details of the hybrid connection + configuration. + :type connection_envelope: + ~azure.mgmt.web.models.RelayServiceConnectionEntity + :param slot: Name of the deployment slot. If a slot is not specified, + the API will create or update a hybrid connection 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: HybridConnection or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.HybridConnection or + :return: RelayServiceConnectionEntity or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.RelayServiceConnectionEntity or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_hybrid_connection_slot.metadata['url'] + url = self.update_relay_service_connection_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'), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), - 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -15675,6 +16495,7 @@ def get_hybrid_connection_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: @@ -15682,8 +16503,11 @@ def get_hybrid_connection_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, 'RelayServiceConnectionEntity') + # 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]: @@ -15692,128 +16516,125 @@ def get_hybrid_connection_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('HybridConnection', response) + deserialized = self._deserialize('RelayServiceConnectionEntity', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} + update_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} - def create_or_update_hybrid_connection_slot( - self, resource_group_name, name, namespace_name, relay_name, connection_envelope, slot, custom_headers=None, raw=False, **operation_config): - """Creates a new Hybrid Connection using a Service Bus relay. + def list_instance_identifiers_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Gets all scale-out instances of an app. - Creates a new Hybrid Connection using a Service Bus relay. + Gets all scale-out instances of an app. :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 namespace_name: The namespace for this hybrid connection. - :type namespace_name: str - :param relay_name: The relay name for this hybrid connection. - :type relay_name: str - :param connection_envelope: The details of the hybrid connection. - :type connection_envelope: ~azure.mgmt.web.models.HybridConnection - :param slot: The name of the slot for the web app. + :param slot: Name of the deployment slot. If a slot is not specified, + the API gets the production slot instances. :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: HybridConnection or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.HybridConnection or - ~msrest.pipeline.ClientRawResponse + :return: An iterator like instance of SiteInstance + :rtype: + ~azure.mgmt.web.models.SiteInstancePaged[~azure.mgmt.web.models.SiteInstance] :raises: :class:`DefaultErrorResponseException` """ - # Construct URL - url = self.create_or_update_hybrid_connection_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'), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), - 'relayName': self._serialize.url("relay_name", relay_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) + def internal_paging(next_link=None, raw=False): - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if not next_link: + # Construct URL + url = self.list_instance_identifiers_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 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 parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - # Construct body - body_content = self._serialize.body(connection_envelope, 'HybridConnection') + else: + url = next_link + query_parameters = {} - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - 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') - if response.status_code not in [200]: - raise models.DefaultErrorResponseException(self._deserialize, response) + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) - deserialized = None + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) - if response.status_code == 200: - deserialized = self._deserialize('HybridConnection', response) + return response + + # Deserialize response + deserialized = models.SiteInstancePaged(internal_paging, self._deserialize.dependencies) if raw: - client_raw_response = ClientRawResponse(deserialized, response) + header_dict = {} + client_raw_response = models.SiteInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - create_or_update_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} + list_instance_identifiers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances'} - def delete_hybrid_connection_slot( - self, resource_group_name, name, namespace_name, relay_name, slot, custom_headers=None, raw=False, **operation_config): - """Removes a Hybrid Connection from this site. + def get_instance_ms_deploy_status_slot( + self, resource_group_name, name, slot, instance_id, custom_headers=None, raw=False, **operation_config): + """Get the status of the last MSDeploy operation. - Removes a Hybrid Connection from this site. + Get the status of the last MSDeploy operation. :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 web app. :type name: str - :param namespace_name: The namespace for this hybrid connection. - :type namespace_name: str - :param relay_name: The relay name for this hybrid connection. - :type relay_name: str - :param slot: The name of the slot for the web app. + :param slot: Name of web app slot. If not specified then will default + to production slot. :type slot: str + :param instance_id: ID of web app instance. + :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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :return: MSDeployStatus or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.MSDeployStatus or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_hybrid_connection_slot.metadata['url'] + url = self.get_instance_ms_deploy_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'), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), - 'relayName': self._serialize.url("relay_name", relay_name, '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) @@ -15824,6 +16645,7 @@ def delete_hybrid_connection_slot( # 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: @@ -15832,57 +16654,34 @@ def delete_hybrid_connection_slot( 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, 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('MSDeployStatus', response) if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} - def update_hybrid_connection_slot( - self, resource_group_name, name, namespace_name, relay_name, connection_envelope, slot, custom_headers=None, raw=False, **operation_config): - """Creates a new Hybrid Connection using a Service Bus relay. + return deserialized + get_instance_ms_deploy_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} - Creates a new Hybrid Connection using a Service Bus relay. - :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 namespace_name: The namespace for this hybrid connection. - :type namespace_name: str - :param relay_name: The relay name for this hybrid connection. - :type relay_name: str - :param connection_envelope: The details of the hybrid connection. - :type connection_envelope: ~azure.mgmt.web.models.HybridConnection - :param slot: The name of the slot for the web app. - :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: HybridConnection or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.HybridConnection or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` - """ + def _create_instance_ms_deploy_operation_slot_initial( + self, resource_group_name, name, slot, instance_id, ms_deploy, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.update_hybrid_connection_slot.metadata['url'] + url = self.create_instance_ms_deploy_operation_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'), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), - 'relayName': self._serialize.url("relay_name", relay_name, '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) @@ -15903,63 +16702,121 @@ def update_hybrid_connection_slot( 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, 'HybridConnection') + body_content = self._serialize.body(ms_deploy, 'MSDeploy') # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) + 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) + if response.status_code not in [201, 409]: + 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('HybridConnection', response) + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} - def list_hybrid_connection_keys_slot( - self, resource_group_name, name, namespace_name, relay_name, slot, custom_headers=None, raw=False, **operation_config): - """Gets the send key name and value for a Hybrid Connection. + def create_instance_ms_deploy_operation_slot( + self, resource_group_name, name, slot, instance_id, ms_deploy, custom_headers=None, raw=False, polling=True, **operation_config): + """Invoke the MSDeploy web app extension. - Gets the send key name and value for a Hybrid Connection. + Invoke the MSDeploy web app extension. :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 web app. :type name: str - :param namespace_name: The namespace for this hybrid connection. - :type namespace_name: str - :param relay_name: The relay name for this hybrid connection. - :type relay_name: str - :param slot: The name of the slot for the web app. + :param slot: Name of web app slot. If not specified then will default + to production slot. + :type slot: str + :param instance_id: ID of web app instance. + :type instance_id: str + :param ms_deploy: Details of MSDeploy operation + :type ms_deploy: ~azure.mgmt.web.models.MSDeploy + :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 MSDeployStatus or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.MSDeployStatus] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.MSDeployStatus]] + :raises: :class:`CloudError` + """ + raw_result = self._create_instance_ms_deploy_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + instance_id=instance_id, + ms_deploy=ms_deploy, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('MSDeployStatus', 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) + create_instance_ms_deploy_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} + + def get_instance_ms_deploy_log_slot( + self, resource_group_name, name, slot, instance_id, custom_headers=None, raw=False, **operation_config): + """Get the MSDeploy Log for the last MSDeploy operation. + + Get the MSDeploy Log for the last MSDeploy operation. + + :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 slot: Name of web app slot. If not specified then will default + to production slot. :type slot: str + :param instance_id: ID of web app instance. + :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: HybridConnectionKey or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.HybridConnectionKey or + :return: MSDeployLog or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.MSDeployLog or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` + :raises: :class:`CloudError` """ # Construct URL - url = self.list_hybrid_connection_keys_slot.metadata['url'] + url = self.get_instance_ms_deploy_log_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'), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), - 'relayName': self._serialize.url("relay_name", relay_name, '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) @@ -15979,124 +16836,150 @@ def list_hybrid_connection_keys_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]: - raise models.DefaultErrorResponseException(self._deserialize, response) + 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('HybridConnectionKey', response) + deserialized = self._deserialize('MSDeployLog', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_hybrid_connection_keys_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'} + get_instance_ms_deploy_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log'} - def list_hybrid_connections_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Retrieves all Service Bus Hybrid Connections used by this Web App. + def list_instance_processes_slot( + self, resource_group_name, name, slot, instance_id, custom_headers=None, raw=False, **operation_config): + """Get list of processes for a web site, or a deployment slot, or for a + specific scaled-out instance in a web site. - Retrieves all Service Bus Hybrid Connections used by this Web App. + Get list of processes for a web site, or a deployment slot, or 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: The name of the web app. + :param name: Site name. :type name: str - :param slot: The name of the slot for the web app. + :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: HybridConnection or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.HybridConnection or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` + :return: An iterator like instance of ProcessInfo + :rtype: + ~azure.mgmt.web.models.ProcessInfoPaged[~azure.mgmt.web.models.ProcessInfo] + :raises: :class:`CloudError` """ - # Construct URL - url = self.list_hybrid_connections_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) + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_instance_processes_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'), + '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 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 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) + # 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, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - deserialized = None + return response - if response.status_code == 200: - deserialized = self._deserialize('HybridConnection', response) + # Deserialize response + deserialized = models.ProcessInfoPaged(internal_paging, self._deserialize.dependencies) if raw: - client_raw_response = ClientRawResponse(deserialized, response) + header_dict = {} + client_raw_response = models.ProcessInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_hybrid_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays'} + list_instance_processes_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes'} - def list_relay_service_connections_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Gets hybrid connections configured for an app (or deployment slot, if - specified). + def get_instance_process_slot( + self, resource_group_name, name, process_id, slot, instance_id, custom_headers=None, raw=False, **operation_config): + """Get process information by its ID for a specific scaled-out instance in + a web site. - Gets hybrid connections configured for an app (or deployment slot, if - specified). + Get process information 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: Name of the app. + :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 will get hybrid connections for the production slot. + 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: RelayServiceConnectionEntity or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.RelayServiceConnectionEntity or + :return: ProcessInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.ProcessInfo or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` + :raises: :class:`CloudError` """ # Construct URL - url = self.list_relay_service_connections_slot.metadata['url'] + url = self.get_instance_process_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) @@ -16119,55 +17002,62 @@ def list_relay_service_connections_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]: - raise models.DefaultErrorResponseException(self._deserialize, response) + 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('RelayServiceConnectionEntity', response) + deserialized = self._deserialize('ProcessInfo', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_relay_service_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection'} + get_instance_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'} - def get_relay_service_connection_slot( - self, resource_group_name, name, entity_name, slot, custom_headers=None, raw=False, **operation_config): - """Gets a hybrid connection configuration by its name. + def delete_instance_process_slot( + self, resource_group_name, name, process_id, slot, instance_id, custom_headers=None, raw=False, **operation_config): + """Terminate a process by its ID for a web site, or a deployment slot, or + specific scaled-out instance in a web site. - Gets a hybrid connection configuration by its name. + Terminate a process by its ID for a web site, or a deployment slot, or + 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: Name of the app. + :param name: Site name. :type name: str - :param entity_name: Name of the hybrid connection. - :type entity_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 will get a hybrid connection for the production slot. + 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: RelayServiceConnectionEntity or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.RelayServiceConnectionEntity 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_relay_service_connection_slot.metadata['url'] + url = self.delete_instance_process_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'), - 'entityName': self._serialize.url("entity_name", entity_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) @@ -16178,7 +17068,6 @@ def get_relay_service_connection_slot( # 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: @@ -16187,65 +17076,63 @@ def get_relay_service_connection_slot( 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.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('RelayServiceConnectionEntity', response) + if response.status_code not in [204, 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_instance_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'} - return deserialized - get_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} - - def create_or_update_relay_service_connection_slot( - self, resource_group_name, name, entity_name, connection_envelope, slot, custom_headers=None, raw=False, **operation_config): - """Creates a new hybrid connection configuration (PUT), or updates an - existing one (PATCH). + def get_instance_process_dump_slot( + self, resource_group_name, name, process_id, slot, instance_id, custom_headers=None, raw=False, callback=None, **operation_config): + """Get a memory dump of a process by its ID for a specific scaled-out + instance in a web site. - Creates a new hybrid connection configuration (PUT), or updates an - existing one (PATCH). + Get a memory dump of 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: Name of the app. + :param name: Site name. :type name: str - :param entity_name: Name of the hybrid connection configuration. - :type entity_name: str - :param connection_envelope: Details of the hybrid connection - configuration. - :type connection_envelope: - ~azure.mgmt.web.models.RelayServiceConnectionEntity + :param process_id: PID. + :type process_id: str :param slot: Name of the deployment slot. If a slot is not specified, - the API will create or update a hybrid connection for the production - slot. + 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 callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] :param operation_config: :ref:`Operation configuration overrides`. - :return: RelayServiceConnectionEntity or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.RelayServiceConnectionEntity or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` """ # Construct URL - url = self.create_or_update_relay_service_connection_slot.metadata['url'] + url = self.get_instance_process_dump_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'), - 'entityName': self._serialize.url("entity_name", entity_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) @@ -16257,7 +17144,6 @@ def create_or_update_relay_service_connection_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: @@ -16265,132 +17151,157 @@ def create_or_update_relay_service_connection_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, 'RelayServiceConnectionEntity') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=True, **operation_config) - if response.status_code not in [200]: - raise models.DefaultErrorResponseException(self._deserialize, response) + 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('RelayServiceConnectionEntity', response) + deserialized = self._client.stream_download(response, callback) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} + get_instance_process_dump_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump'} - def delete_relay_service_connection_slot( - self, resource_group_name, name, entity_name, slot, custom_headers=None, raw=False, **operation_config): - """Deletes a relay service connection by its name. + def list_instance_process_modules_slot( + self, resource_group_name, name, process_id, slot, instance_id, custom_headers=None, raw=False, **operation_config): + """List module information for a process by its ID for a specific + scaled-out instance in a web site. - Deletes a relay service connection by its name. + List module information for 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: Name of the app. + :param name: Site name. :type name: str - :param entity_name: Name of the hybrid connection configuration. - :type entity_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 will delete a hybrid connection for the production slot. + 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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: An iterator like instance of ProcessModuleInfo + :rtype: + ~azure.mgmt.web.models.ProcessModuleInfoPaged[~azure.mgmt.web.models.ProcessModuleInfo] :raises: :class:`CloudError` """ - # Construct URL - url = self.delete_relay_service_connection_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'), - 'entityName': self._serialize.url("entity_name", entity_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) + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_instance_process_modules_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') + # 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') + else: + url = next_link + query_parameters = {} - # Construct and send request - request = self._client.delete(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') - if response.status_code not in [200, 404]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + # 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.ProcessModuleInfoPaged(internal_paging, self._deserialize.dependencies) if raw: - client_raw_response = ClientRawResponse(None, response) + header_dict = {} + client_raw_response = models.ProcessModuleInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response - delete_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} - def update_relay_service_connection_slot( - self, resource_group_name, name, entity_name, connection_envelope, slot, custom_headers=None, raw=False, **operation_config): - """Creates a new hybrid connection configuration (PUT), or updates an - existing one (PATCH). + return deserialized + list_instance_process_modules_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules'} - Creates a new hybrid connection configuration (PUT), or updates an - existing one (PATCH). + def get_instance_process_module_slot( + self, resource_group_name, name, process_id, base_address, slot, instance_id, custom_headers=None, raw=False, **operation_config): + """Get process information by its ID for a specific scaled-out instance in + a web site. + + Get process information 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: Name of the app. + :param name: Site name. :type name: str - :param entity_name: Name of the hybrid connection configuration. - :type entity_name: str - :param connection_envelope: Details of the hybrid connection - configuration. - :type connection_envelope: - ~azure.mgmt.web.models.RelayServiceConnectionEntity + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str :param slot: Name of the deployment slot. If a slot is not specified, - the API will create or update a hybrid connection for the production - slot. + 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: RelayServiceConnectionEntity or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.RelayServiceConnectionEntity or + :return: ProcessModuleInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.ProcessModuleInfo or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` + :raises: :class:`CloudError` """ # Construct URL - url = self.update_relay_service_connection_slot.metadata['url'] + url = self.get_instance_process_module_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'), - 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, '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) @@ -16402,7 +17313,6 @@ def update_relay_service_connection_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: @@ -16410,62 +17320,70 @@ def update_relay_service_connection_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, 'RelayServiceConnectionEntity') - # Construct and send request - request = self._client.patch(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]: - raise models.DefaultErrorResponseException(self._deserialize, response) + 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('RelayServiceConnectionEntity', response) + deserialized = self._deserialize('ProcessModuleInfo', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} + 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_identifiers_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Gets all scale-out instances of an app. + 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. - Gets all scale-out instances of an app. + 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: Name of the app. + :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 gets the production slot instances. + 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 SiteInstance + :return: An iterator like instance of ProcessThreadInfo :rtype: - ~azure.mgmt.web.models.SiteInstancePaged[~azure.mgmt.web.models.SiteInstance] - :raises: - :class:`DefaultErrorResponseException` + ~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_identifiers_slot.metadata['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) @@ -16492,54 +17410,65 @@ 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]: - raise models.DefaultErrorResponseException(self._deserialize, response) + 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.SiteInstancePaged(internal_paging, self._deserialize.dependencies) + deserialized = models.ProcessThreadInfoPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.SiteInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.ProcessThreadInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_instance_identifiers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances'} + 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_ms_deploy_status_slot( - self, resource_group_name, name, slot, instance_id, custom_headers=None, raw=False, **operation_config): - """Get the status of the last MSDeploy operation. + 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 the status of the last MSDeploy operation. + 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: Name of web app. + :param name: Site name. :type name: str - :param slot: Name of web app slot. If not specified then will default - to production slot. + :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 web app instance. + :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: MSDeployStatus or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.MSDeployStatus or + :return: ProcessThreadInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.ProcessThreadInfo or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` + :raises: :class:`CloudError` """ # Construct URL - url = self.get_instance_ms_deploy_status_slot.metadata['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') @@ -16564,31 +17493,56 @@ def get_instance_ms_deploy_status_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]: - raise models.DefaultErrorResponseException(self._deserialize, response) + 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('MSDeployStatus', response) + deserialized = self._deserialize('ProcessThreadInfo', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_instance_ms_deploy_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} + 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. - def _create_instance_ms_deploy_operation_slot_initial( - self, resource_group_name, name, slot, instance_id, ms_deploy, custom_headers=None, raw=False, **operation_config): + 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.create_instance_ms_deploy_operation_slot.metadata['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'), - '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) @@ -16600,7 +17554,6 @@ def _create_instance_ms_deploy_operation_slot_initial( # 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: @@ -16608,122 +17561,56 @@ def _create_instance_ms_deploy_operation_slot_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(ms_deploy, 'MSDeploy') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + request = self._client.post(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [201, 409]: - 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 == 201: - deserialized = self._deserialize('MSDeployStatus', response) + 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 create_instance_ms_deploy_operation_slot( - self, resource_group_name, name, slot, instance_id, ms_deploy, custom_headers=None, raw=False, polling=True, **operation_config): - """Invoke the MSDeploy web app extension. - - Invoke the MSDeploy web app extension. - - :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 slot: Name of web app slot. If not specified then will default - to production slot. - :type slot: str - :param instance_id: ID of web app instance. - :type instance_id: str - :param ms_deploy: Details of MSDeploy operation - :type ms_deploy: ~azure.mgmt.web.models.MSDeploy - :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 MSDeployStatus or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.MSDeployStatus] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.MSDeployStatus]] - :raises: :class:`CloudError` - """ - raw_result = self._create_instance_ms_deploy_operation_slot_initial( - resource_group_name=resource_group_name, - name=name, - slot=slot, - instance_id=instance_id, - ms_deploy=ms_deploy, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('MSDeployStatus', 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) - create_instance_ms_deploy_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} - - def get_instance_ms_deploy_log_slot( - self, resource_group_name, name, slot, instance_id, custom_headers=None, raw=False, **operation_config): - """Get the MSDeploy Log for the last MSDeploy operation. + 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. - Get the MSDeploy Log for the last MSDeploy operation. + 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 web app. + :param name: Name of the app. :type name: str - :param slot: Name of web app slot. If not specified then will default - to production slot. + :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 instance_id: ID of web app instance. - :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: MSDeployLog or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.MSDeployLog or + :return: FunctionSecrets or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.FunctionSecrets or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_instance_ms_deploy_log_slot.metadata['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'), - '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) @@ -16743,66 +17630,60 @@ def get_instance_ms_deploy_log_slot( 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, 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('MSDeployLog', response) + deserialized = self._deserialize('FunctionSecrets', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_instance_ms_deploy_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log'} + list_sync_function_triggers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus'} - def list_instance_processes_slot( - self, resource_group_name, name, slot, instance_id, custom_headers=None, raw=False, **operation_config): - """Get list of processes for a web site, or a deployment slot, or for a - specific scaled-out instance in a web site. + 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). - Get list of processes for a web site, or a deployment slot, or for a - specific scaled-out instance in a web site. + 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: Site name. + :param name: Name of the app. :type name: 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 metric definitions 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 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 ProcessInfo + :return: An iterator like instance of ResourceMetricDefinition :rtype: - ~azure.mgmt.web.models.ProcessInfoPaged[~azure.mgmt.web.models.ProcessInfo] - :raises: :class:`CloudError` + ~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_instance_processes_slot.metadata['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'), - '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) @@ -16829,64 +17710,143 @@ 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.ProcessInfoPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.ResourceMetricDefinitionPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.ProcessInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.ResourceMetricDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_instance_processes_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes'} + list_metric_definitions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metricdefinitions'} - def get_instance_process_slot( - self, resource_group_name, name, process_id, slot, instance_id, custom_headers=None, raw=False, **operation_config): - """Get process information 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). - Get process information 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: ProcessInfo or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.ProcessInfo or + :return: An iterator like instance of ResourceMetric + :rtype: + ~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_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 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.ResourceMetricPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ResourceMetricPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + 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. + + 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: Name of web app. + :type name: str + :param slot: Name of the deployment 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 ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_instance_process_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'), '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) @@ -16909,62 +17869,52 @@ def get_instance_process_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('ProcessInfo', response) + deserialized = self._deserialize('MigrateMySqlStatus', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_instance_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'} + get_migrate_my_sql_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status'} - def delete_instance_process_slot( - self, resource_group_name, name, process_id, slot, instance_id, custom_headers=None, raw=False, **operation_config): - """Terminate a process by its ID for a web site, or a deployment slot, or - specific scaled-out instance in a web site. + def get_swift_virtual_network_connection_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Gets a Swift Virtual Network connection. - Terminate a process by its ID for a web site, or a deployment slot, or - specific scaled-out instance in a web site. + 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: 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 a gateway for the production slot's Virtual Network. :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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :return: SwiftVirtualNetwork or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.SwiftVirtualNetwork or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_instance_process_slot.metadata['url'] + url = self.get_swift_virtual_network_connection_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) @@ -16975,6 +17925,7 @@ def delete_instance_process_slot( # 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: @@ -16983,63 +17934,64 @@ def delete_instance_process_slot( 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 [204, 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('SwiftVirtualNetwork', response) if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete_instance_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'} - def get_instance_process_dump_slot( - self, resource_group_name, name, process_id, slot, instance_id, custom_headers=None, raw=False, callback=None, **operation_config): - """Get a memory dump of a process by its ID for a specific scaled-out - instance in a web site. + return deserialized + get_swift_virtual_network_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} - Get a memory dump of a process by its ID for a specific scaled-out - instance in a web site. + def create_or_update_swift_virtual_network_connection_slot( + 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. + + 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: Site name. + :param name: Name of the app. :type name: str - :param process_id: PID. - :type process_id: 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 returns deployments for the production slot. + the API will add or update connections 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 callback: When specified, will be called with each chunk of - data that is streamed. The callback should take two arguments, the - bytes of the current chunk of data and the response object. If the - data is uploading, response will be None. - :type callback: Callable[Bytes, response=None] :param operation_config: :ref:`Operation configuration overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: Generator or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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_instance_process_dump_slot.metadata['url'] + url = self.create_or_update_swift_virtual_network_connection_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) @@ -17051,6 +18003,7 @@ def get_instance_process_dump_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: @@ -17058,157 +18011,130 @@ def get_instance_process_dump_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) - response = self._client.send(request, stream=True, **operation_config) + 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, 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._client.stream_download(response, callback) + deserialized = self._deserialize('SwiftVirtualNetwork', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_instance_process_dump_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump'} + create_or_update_swift_virtual_network_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} - def list_instance_process_modules_slot( - self, resource_group_name, name, process_id, slot, instance_id, custom_headers=None, raw=False, **operation_config): - """List module information for a process by its ID for a specific - scaled-out instance in a web site. + def delete_swift_virtual_network_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Deletes a Swift Virtual Network connection from an app (or deployment + slot). - List module information for a process by its ID for a specific - scaled-out instance in a web site. + 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: 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 delete the connection 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 ProcessModuleInfo - :rtype: - ~azure.mgmt.web.models.ProcessModuleInfoPaged[~azure.mgmt.web.models.ProcessModuleInfo] + :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_instance_process_modules_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 URL + url = self.delete_swift_virtual_network_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 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, 404]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + # 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.ProcessModuleInfoPaged(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.ProcessModuleInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete_swift_virtual_network_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} - return deserialized - list_instance_process_modules_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules'} - - def get_instance_process_module_slot( - self, resource_group_name, name, process_id, base_address, slot, instance_id, custom_headers=None, raw=False, **operation_config): - """Get process information by its ID for a specific scaled-out instance in - a web site. + def update_swift_virtual_network_connection_slot( + 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. - Get process information by its ID for a specific scaled-out instance in - a web site. + 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: Site name. + :param name: Name of the app. :type name: str - :param process_id: PID. - :type process_id: str - :param base_address: Module base address. - :type base_address: 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 returns deployments for the production slot. + the API will add or update connections 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: ProcessModuleInfo or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.ProcessModuleInfo 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.get_instance_process_module_slot.metadata['url'] + url = self.update_swift_virtual_network_connection_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'), - 'baseAddress': self._serialize.url("base_address", base_address, '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) @@ -17220,6 +18146,7 @@ def get_instance_process_module_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: @@ -17227,157 +18154,64 @@ def get_instance_process_module_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, 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('ProcessModuleInfo', response) + deserialized = self._deserialize('SwiftVirtualNetwork', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) 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}'} - - 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'} + update_swift_virtual_network_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} - 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 list_network_features_slot( + self, resource_group_name, name, view, slot, custom_headers=None, raw=False, **operation_config): + """Gets all network features used by the app (or deployment slot, if + specified). - Get thread information by Thread ID for a specific process, in a - specific scaled-out instance in a web 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: Site name. + :param name: Name of the app. :type name: str - :param process_id: PID. - :type process_id: str - :param thread_id: TID. - :type thread_id: str + :param view: The type of view. This can either be "summary" or + "detailed". + :type view: 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 network features 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 + :return: NetworkFeatures or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.NetworkFeatures or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get_instance_process_thread_slot.metadata['url'] + url = self.list_network_features_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'), + 'view': self._serialize.url("view", view, '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) @@ -17408,47 +18242,50 @@ def get_instance_process_thread_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ProcessThreadInfo', response) + deserialized = self._deserialize('NetworkFeatures', 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}'} + list_network_features_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}'} - 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. + def get_network_trace_operation_slot( + self, resource_group_name, name, operation_id, slot, custom_headers=None, raw=False, **operation_config): + """Gets a named operation for a network trace capturing (or deployment + slot, if specified). - Shows whether an app can be cloned to another resource group or - subscription. + 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 slot: Name of the deployment slot. By default, this API returns - information on the production slot. + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, + the API will get an operation 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: SiteCloneability or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.SiteCloneability 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.is_cloneable_slot.metadata['url'] + url = self.get_network_trace_operation_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'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -17469,51 +18306,57 @@ 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]: + if response.status_code not in [200, 202]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SiteCloneability', 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 - is_cloneable_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable'} + get_network_trace_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/operationresults/{operationId}'} - 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 start_web_site_network_trace_slot( + self, resource_group_name, name, slot, 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). - This is to allow calling via powershell and ARM template. + 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 slot: Name of the deployment slot. If a slot is not specified, - the API will restore a backup of the production slot. + :param slot: The name of the slot for this web app. :type slot: 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: FunctionSecrets or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.FunctionSecrets or - ~msrest.pipeline.ClientRawResponse + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.list_sync_function_triggers_slot.metadata['url'] + url = self.start_web_site_network_trace_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'), @@ -17524,6 +18367,12 @@ def list_sync_function_triggers_slot( # 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 @@ -17546,210 +18395,155 @@ def list_sync_function_triggers_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('FunctionSecrets', response) + deserialized = self._deserialize('str', 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) + start_web_site_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/start'} - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - else: - url = next_link - query_parameters = {} + def _start_web_site_network_trace_operation_slot_initial( + self, resource_group_name, name, slot, duration_in_seconds=None, max_frame_length=None, sas_url=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.start_web_site_network_trace_operation_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 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 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 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') - if response.status_code not in [200]: - raise models.DefaultErrorResponseException(self._deserialize, response) + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) - return response + if response.status_code not in [200, 202]: + raise models.DefaultErrorResponseException(self._deserialize, response) - # Deserialize response - deserialized = models.ResourceMetricDefinitionPaged(internal_paging, self._deserialize.dependencies) + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', response) + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', response) if raw: - header_dict = {} - client_raw_response = models.ResourceMetricDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) 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). + def start_web_site_network_trace_operation_slot( + self, resource_group_name, name, slot, 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. - Gets performance metrics of an app (or deployment slot, if specified). + 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: Name of the app. + :param name: The name of the web 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. + :param slot: The name of the slot for this web app. :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 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: An iterator like instance of ResourceMetric + :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: - ~azure.mgmt.web.models.ResourceMetricPaged[~azure.mgmt.web.models.ResourceMetric] + ~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` """ - 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 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) + raw_result = self._start_web_site_network_trace_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + custom_headers=custom_headers, + raw=True, + **operation_config + ) - return response + def get_long_running_output(response): + deserialized = self._deserialize('[NetworkTrace]', response) - # Deserialize response - deserialized = models.ResourceMetricPaged(internal_paging, self._deserialize.dependencies) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response - if raw: - header_dict = {} - client_raw_response = models.ResourceMetricPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + return deserialized - return deserialized - list_metrics_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metrics'} + 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_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation'} - def get_migrate_my_sql_status_slot( + def stop_web_site_network_trace_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. + """Stop ongoing capturing network packets for the site. - Returns the status of MySql in app migration, if one is active, and - whether or not MySql in app is enabled. + 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 web app. + :param name: The name of the web app. :type name: str - :param slot: Name of the deployment slot. + :param slot: The name of the slot for this web app. :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 - ~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_migrate_my_sql_status_slot.metadata['url'] + url = self.stop_web_site_network_trace_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'), @@ -17764,7 +18558,6 @@ def get_migrate_my_sql_status_slot( # 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: @@ -17773,59 +18566,54 @@ def get_migrate_my_sql_status_slot( 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) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('MigrateMySqlStatus', response) + if response.status_code not in [200, 204]: + 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 + stop_web_site_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/stop'} - return deserialized - get_migrate_my_sql_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status'} - - def list_network_features_slot( - self, resource_group_name, name, view, slot, custom_headers=None, raw=False, **operation_config): - """Gets all network features used by the app (or deployment slot, if - specified). + def get_network_traces_slot( + self, resource_group_name, name, operation_id, slot, custom_headers=None, raw=False, **operation_config): + """Gets a named operation for a network trace capturing (or deployment + slot, if specified). - Gets all network features used by the app (or deployment slot, if - specified). + 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 view: The type of view. This can either be "summary" or - "detailed". - :type view: str + :param operation_id: GUID of the operation. + :type operation_id: str :param slot: Name of the deployment slot. If a slot is not specified, - the API will get network features for the production slot. + the API will get an operation 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: NetworkFeatures or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.NetworkFeatures or + :return: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.web.models.NetworkTrace] or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`DefaultErrorResponseException` """ # Construct URL - url = self.list_network_features_slot.metadata['url'] + url = self.get_network_traces_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'), - 'view': self._serialize.url("view", view, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -17849,57 +18637,56 @@ def list_network_features_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('NetworkFeatures', response) + deserialized = self._deserialize('[NetworkTrace]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_network_features_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}'} + get_network_traces_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/{operationId}'} - def start_web_site_network_trace_slot( - self, resource_group_name, name, slot, 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. + def get_network_trace_operation_slot_v2( + self, resource_group_name, name, operation_id, slot, custom_headers=None, raw=False, **operation_config): + """Gets a named operation for a network trace capturing (or deployment + slot, if specified). - Start capturing network packets for the site. + 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: The name of the web app. + :param name: Name of the app. :type name: str - :param slot: The name of the slot for this web app. + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, + the API will get an operation for the production slot. :type slot: 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 + :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.start_web_site_network_trace_slot.metadata['url'] + url = self.get_network_trace_operation_slot_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'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -17907,12 +18694,6 @@ def start_web_site_network_trace_slot( # 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 @@ -17926,52 +18707,61 @@ def start_web_site_network_trace_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]: + if response.status_code not in [200, 202]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('str', 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 - start_web_site_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/start'} + get_network_trace_operation_slot_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/current/operationresults/{operationId}'} - def stop_web_site_network_trace_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Stop ongoing capturing network packets for the site. + def get_network_traces_slot_v2( + self, resource_group_name, name, operation_id, slot, custom_headers=None, raw=False, **operation_config): + """Gets a named operation for a network trace capturing (or deployment + slot, if specified). - Stop ongoing capturing network packets for the site. + 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: The name of the web app. + :param name: Name of the app. :type name: str - :param slot: The name of the slot for this web app. + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, + the API will get an operation 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: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse + :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.stop_web_site_network_trace_slot.metadata['url'] + url = self.get_network_traces_slot_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'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -17992,7 +18782,7 @@ def stop_web_site_network_trace_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]: @@ -18001,14 +18791,14 @@ def stop_web_site_network_trace_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('str', response) + deserialized = self._deserialize('[NetworkTrace]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - stop_web_site_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/stop'} + get_network_traces_slot_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/{operationId}'} def generate_new_site_publishing_password_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): @@ -20718,6 +21508,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. @@ -21038,18 +21903,194 @@ def update_source_control_slot( if response.status_code == 202: deserialized = self._deserialize('SiteSourceControl', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} + + def start_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Starts an app (or deployment slot, if specified). + + Starts 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 start 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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.start_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 = {} + 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]: + 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 + start_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start'} + + + def _start_network_trace_slot_initial( + self, resource_group_name, name, slot, duration_in_seconds=None, max_frame_length=None, sas_url=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.start_network_trace_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 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: + 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, 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 + + def start_network_trace_slot( + self, resource_group_name, name, slot, 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 slot: The name of the slot for this web app. + :type slot: 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_network_trace_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + 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 - return deserialized - update_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} + 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_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace'} - def start_slot( + def stop_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Starts an app (or deployment slot, if specified). + """Stops an app (or deployment slot, if specified). - Starts an app (or deployment slot, if specified). + Stops an app (or deployment slot, if specified). :param resource_group_name: Name of the resource group to which the resource belongs. @@ -21057,7 +22098,7 @@ def start_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 start the production slot. + the API will stop 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 @@ -21069,7 +22110,7 @@ def start_slot( :raises: :class:`CloudError` """ # Construct URL - url = self.start_slot.metadata['url'] + url = self.stop_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'), @@ -21103,21 +22144,20 @@ def start_slot( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - start_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start'} + stop_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop'} - def stop_slot( + def stop_network_trace_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Stops an app (or deployment slot, if specified). + """Stop ongoing capturing network packets for the site. - Stops 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 slot: Name of the deployment slot. If a slot is not specified, - the API will stop the production slot. + :param slot: The name of the slot for this web app. :type slot: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -21129,7 +22169,7 @@ def stop_slot( :raises: :class:`CloudError` """ # Construct URL - url = self.stop_slot.metadata['url'] + url = self.stop_network_trace_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'), @@ -21155,7 +22195,7 @@ def stop_slot( 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, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -21163,7 +22203,7 @@ def stop_slot( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - stop_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop'} + stop_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stopNetworkTrace'} def sync_repository_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): @@ -22811,6 +23851,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. @@ -23173,6 +24285,118 @@ def start( return client_raw_response start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/start'} + + def _start_network_trace_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.start_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'), + '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 + 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, 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 + + def start_network_trace( + 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_network_trace_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_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace'} + def stop( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): """Stops an app (or deployment slot, if specified). @@ -23229,6 +24453,62 @@ def stop( return client_raw_response stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stop'} + def stop_network_trace( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Stop ongoing capturing network packets for the site. + + 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: 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 + 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.stop_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'), + '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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + 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 + stop_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stopNetworkTrace'} + def sync_repository( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): """Sync web app repository. diff --git a/azure-mgmt-web/azure/mgmt/web/version.py b/azure-mgmt-web/azure/mgmt/web/version.py index 57866fdf17d0..641190369164 100644 --- a/azure-mgmt-web/azure/mgmt/web/version.py +++ b/azure-mgmt-web/azure/mgmt/web/version.py @@ -9,5 +9,4 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.40.0" - +VERSION = "0.41.0" diff --git a/azure-mgmt-web/azure/mgmt/web/web_site_management_client.py b/azure-mgmt-web/azure/mgmt/web/web_site_management_client.py index 5574e1ff74b6..21afaf5e11a6 100644 --- a/azure-mgmt-web/azure/mgmt/web/web_site_management_client.py +++ b/azure-mgmt-web/azure/mgmt/web/web_site_management_client.py @@ -119,7 +119,6 @@ def __init__( super(WebSiteManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2018-02-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -169,12 +168,14 @@ def get_publishing_user( :raises: :class:`DefaultErrorResponseException` """ + api_version = "2018-02-01" + # Construct URL url = self.get_publishing_user.metadata['url'] # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -224,12 +225,14 @@ def update_publishing_user( :raises: :class:`DefaultErrorResponseException` """ + api_version = "2018-02-01" + # Construct URL url = self.update_publishing_user.metadata['url'] # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -281,6 +284,8 @@ def list_source_controls( :raises: :class:`DefaultErrorResponseException` """ + api_version = "2018-02-01" + def internal_paging(next_link=None, raw=False): if not next_link: @@ -289,7 +294,7 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') else: url = next_link @@ -344,6 +349,8 @@ def get_source_control( :raises: :class:`DefaultErrorResponseException` """ + api_version = "2018-02-01" + # Construct URL url = self.get_source_control.metadata['url'] path_format_arguments = { @@ -353,7 +360,7 @@ def get_source_control( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -405,6 +412,8 @@ def update_source_control( :raises: :class:`DefaultErrorResponseException` """ + api_version = "2018-02-01" + # Construct URL url = self.update_source_control.metadata['url'] path_format_arguments = { @@ -414,7 +423,7 @@ def update_source_control( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -470,6 +479,8 @@ def list_billing_meters( :raises: :class:`DefaultErrorResponseException` """ + api_version = "2018-02-01" + def internal_paging(next_link=None, raw=False): if not next_link: @@ -486,7 +497,7 @@ def internal_paging(next_link=None, raw=False): query_parameters['billingLocation'] = self._serialize.query("billing_location", billing_location, 'str') if os_type is not None: query_parameters['osType'] = self._serialize.query("os_type", os_type, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') else: url = next_link @@ -550,6 +561,8 @@ def check_name_availability( """ request = models.ResourceNameAvailabilityRequest(name=name, type=type, is_fqdn=is_fqdn) + api_version = "2018-02-01" + # Construct URL url = self.check_name_availability.metadata['url'] path_format_arguments = { @@ -559,7 +572,7 @@ def check_name_availability( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -611,6 +624,8 @@ def get_subscription_deployment_locations( :raises: :class:`DefaultErrorResponseException` """ + api_version = "2018-02-01" + # Construct URL url = self.get_subscription_deployment_locations.metadata['url'] path_format_arguments = { @@ -620,7 +635,7 @@ def get_subscription_deployment_locations( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -652,14 +667,14 @@ def get_subscription_deployment_locations( get_subscription_deployment_locations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/deploymentLocations'} def list_geo_regions( - self, sku=None, linux_workers_enabled=None, xenon_workers_enabled=None, custom_headers=None, raw=False, **operation_config): + self, sku=None, linux_workers_enabled=None, xenon_workers_enabled=None, linux_dynamic_workers_enabled=None, custom_headers=None, raw=False, **operation_config): """Get a list of available geographical regions. Get a list of available geographical regions. :param sku: Name of SKU used to filter the regions. Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', 'Dynamic', - 'Isolated', 'PremiumV2' + 'Isolated', 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' :type sku: str or ~azure.mgmt.web.models.SkuName :param linux_workers_enabled: Specify true if you want to filter to only regions that support Linux workers. @@ -667,6 +682,9 @@ def list_geo_regions( :param xenon_workers_enabled: Specify true if you want to filter to only regions that support Xenon workers. :type xenon_workers_enabled: bool + :param linux_dynamic_workers_enabled: Specify true if you + want to filter to only regions that support Linux Consumption Workers. + :type linux_dynamic_workers_enabled: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -678,6 +696,8 @@ def list_geo_regions( :raises: :class:`DefaultErrorResponseException` """ + api_version = "2018-02-01" + def internal_paging(next_link=None, raw=False): if not next_link: @@ -696,7 +716,9 @@ def internal_paging(next_link=None, raw=False): query_parameters['linuxWorkersEnabled'] = self._serialize.query("linux_workers_enabled", linux_workers_enabled, 'bool') if xenon_workers_enabled is not None: query_parameters['xenonWorkersEnabled'] = self._serialize.query("xenon_workers_enabled", xenon_workers_enabled, 'bool') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if linux_dynamic_workers_enabled is not None: + query_parameters['linuxDynamicWorkersEnabled'] = self._serialize.query("linux_dynamic_workers_enabled", linux_dynamic_workers_enabled, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') else: url = next_link @@ -753,6 +775,8 @@ def list_site_identifiers_assigned_to_host_name( """ name_identifier = models.NameIdentifier(name=name) + api_version = "2018-02-01" + def internal_paging(next_link=None, raw=False): if not next_link: @@ -765,7 +789,7 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') else: url = next_link @@ -822,6 +846,8 @@ def list_premier_add_on_offers( :raises: :class:`DefaultErrorResponseException` """ + api_version = "2018-02-01" + def internal_paging(next_link=None, raw=False): if not next_link: @@ -834,7 +860,7 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') else: url = next_link @@ -887,6 +913,8 @@ def list_skus( :raises: :class:`DefaultErrorResponseException` """ + api_version = "2018-02-01" + # Construct URL url = self.list_skus.metadata['url'] path_format_arguments = { @@ -896,7 +924,7 @@ def list_skus( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -948,6 +976,8 @@ def verify_hosting_environment_vnet( :raises: :class:`DefaultErrorResponseException` """ + api_version = "2018-02-01" + # Construct URL url = self.verify_hosting_environment_vnet.metadata['url'] path_format_arguments = { @@ -957,7 +987,7 @@ def verify_hosting_environment_vnet( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -1016,6 +1046,8 @@ def move( """ move_resource_envelope = models.CsmMoveResourceEnvelope(target_resource_group=target_resource_group, resources=resources) + api_version = "2018-02-01" + # Construct URL url = self.move.metadata['url'] path_format_arguments = { @@ -1026,7 +1058,7 @@ def move( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -1077,6 +1109,8 @@ def validate( :raises: :class:`DefaultErrorResponseException` """ + api_version = "2018-02-01" + # Construct URL url = self.validate.metadata['url'] path_format_arguments = { @@ -1087,7 +1121,7 @@ def validate( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -1122,6 +1156,75 @@ def validate( return deserialized validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate'} + def validate_container_settings( + self, validate_container_settings_request, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Validate if the container settings are correct. + + Validate if the container settings are correct. + + :param validate_container_settings_request: + :type validate_container_settings_request: + ~azure.mgmt.web.models.ValidateContainerSettingsRequest + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_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: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + api_version = "2018-02-01" + + # Construct URL + url = self.validate_container_settings.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\._\(\)]+[^\.]$'), + '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("api_version", 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(validate_container_settings_request, 'ValidateContainerSettingsRequest') + + # Construct and send request + request = self._client.post(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('object', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + validate_container_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validateContainerSettings'} + def validate_move( self, resource_group_name, target_resource_group=None, resources=None, custom_headers=None, raw=False, **operation_config): """Validate whether a resource can be moved. @@ -1146,6 +1249,8 @@ def validate_move( """ move_resource_envelope = models.CsmMoveResourceEnvelope(target_resource_group=target_resource_group, resources=resources) + api_version = "2018-02-01" + # Construct URL url = self.validate_move.metadata['url'] path_format_arguments = { @@ -1156,7 +1261,7 @@ def validate_move( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {}