From 87f5cbff8b8de98a9517392d5afe7493d1d241a0 Mon Sep 17 00:00:00 2001 From: Zim Kalinowski Date: Sat, 12 Oct 2019 08:45:45 +0000 Subject: [PATCH] removed old web_site_management_client --- .../mgmt/web/web_site_management_client.py | 1291 ----------------- 1 file changed, 1291 deletions(-) delete mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/web_site_management_client.py diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/web_site_management_client.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/web_site_management_client.py deleted file mode 100644 index 21afaf5e11a6..000000000000 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/web_site_management_client.py +++ /dev/null @@ -1,1291 +0,0 @@ -# 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.service_client import SDKClient -from msrest import Serializer, Deserializer -from msrestazure import AzureConfiguration -from .version import VERSION -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling -import uuid -from .operations.app_service_certificate_orders_operations import AppServiceCertificateOrdersOperations -from .operations.certificate_registration_provider_operations import CertificateRegistrationProviderOperations -from .operations.domains_operations import DomainsOperations -from .operations.top_level_domains_operations import TopLevelDomainsOperations -from .operations.domain_registration_provider_operations import DomainRegistrationProviderOperations -from .operations.certificates_operations import CertificatesOperations -from .operations.deleted_web_apps_operations import DeletedWebAppsOperations -from .operations.diagnostics_operations import DiagnosticsOperations -from .operations.provider_operations import ProviderOperations -from .operations.recommendations_operations import RecommendationsOperations -from .operations.web_apps_operations import WebAppsOperations -from .operations.app_service_environments_operations import AppServiceEnvironmentsOperations -from .operations.app_service_plans_operations import AppServicePlansOperations -from .operations.resource_health_metadata_operations import ResourceHealthMetadataOperations -from . import models - - -class WebSiteManagementClientConfiguration(AzureConfiguration): - """Configuration for WebSiteManagementClient - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Your Azure subscription ID. This is a - GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' - - super(WebSiteManagementClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-web/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id - - -class WebSiteManagementClient(SDKClient): - """WebSite Management Client - - :ivar config: Configuration for client. - :vartype config: WebSiteManagementClientConfiguration - - :ivar app_service_certificate_orders: AppServiceCertificateOrders operations - :vartype app_service_certificate_orders: azure.mgmt.web.operations.AppServiceCertificateOrdersOperations - :ivar certificate_registration_provider: CertificateRegistrationProvider operations - :vartype certificate_registration_provider: azure.mgmt.web.operations.CertificateRegistrationProviderOperations - :ivar domains: Domains operations - :vartype domains: azure.mgmt.web.operations.DomainsOperations - :ivar top_level_domains: TopLevelDomains operations - :vartype top_level_domains: azure.mgmt.web.operations.TopLevelDomainsOperations - :ivar domain_registration_provider: DomainRegistrationProvider operations - :vartype domain_registration_provider: azure.mgmt.web.operations.DomainRegistrationProviderOperations - :ivar certificates: Certificates operations - :vartype certificates: azure.mgmt.web.operations.CertificatesOperations - :ivar deleted_web_apps: DeletedWebApps operations - :vartype deleted_web_apps: azure.mgmt.web.operations.DeletedWebAppsOperations - :ivar diagnostics: Diagnostics operations - :vartype diagnostics: azure.mgmt.web.operations.DiagnosticsOperations - :ivar provider: Provider operations - :vartype provider: azure.mgmt.web.operations.ProviderOperations - :ivar recommendations: Recommendations operations - :vartype recommendations: azure.mgmt.web.operations.RecommendationsOperations - :ivar web_apps: WebApps operations - :vartype web_apps: azure.mgmt.web.operations.WebAppsOperations - :ivar app_service_environments: AppServiceEnvironments operations - :vartype app_service_environments: azure.mgmt.web.operations.AppServiceEnvironmentsOperations - :ivar app_service_plans: AppServicePlans operations - :vartype app_service_plans: azure.mgmt.web.operations.AppServicePlansOperations - :ivar resource_health_metadata: ResourceHealthMetadata operations - :vartype resource_health_metadata: azure.mgmt.web.operations.ResourceHealthMetadataOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Your Azure subscription ID. This is a - GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = WebSiteManagementClientConfiguration(credentials, subscription_id, base_url) - 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._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.app_service_certificate_orders = AppServiceCertificateOrdersOperations( - self._client, self.config, self._serialize, self._deserialize) - self.certificate_registration_provider = CertificateRegistrationProviderOperations( - self._client, self.config, self._serialize, self._deserialize) - self.domains = DomainsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.top_level_domains = TopLevelDomainsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.domain_registration_provider = DomainRegistrationProviderOperations( - self._client, self.config, self._serialize, self._deserialize) - self.certificates = CertificatesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.deleted_web_apps = DeletedWebAppsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.diagnostics = DiagnosticsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.provider = ProviderOperations( - self._client, self.config, self._serialize, self._deserialize) - self.recommendations = RecommendationsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.web_apps = WebAppsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.app_service_environments = AppServiceEnvironmentsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.app_service_plans = AppServicePlansOperations( - self._client, self.config, self._serialize, self._deserialize) - self.resource_health_metadata = ResourceHealthMetadataOperations( - self._client, self.config, self._serialize, self._deserialize) - - def get_publishing_user( - self, custom_headers=None, raw=False, **operation_config): - """Gets publishing user. - - Gets publishing user. - - :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: User or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.User or - ~msrest.pipeline.ClientRawResponse - :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("api_version", 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('User', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_publishing_user.metadata = {'url': '/providers/Microsoft.Web/publishingUsers/web'} - - def update_publishing_user( - self, user_details, custom_headers=None, raw=False, **operation_config): - """Updates publishing user. - - Updates publishing user. - - :param user_details: Details of publishing user - :type user_details: ~azure.mgmt.web.models.User - :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: User or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.User or - ~msrest.pipeline.ClientRawResponse - :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("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(user_details, 'User') - - # 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('User', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_publishing_user.metadata = {'url': '/providers/Microsoft.Web/publishingUsers/web'} - - def list_source_controls( - self, custom_headers=None, raw=False, **operation_config): - """Gets the source controls available for Azure websites. - - Gets the source controls available for Azure websites. - - :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 SourceControl - :rtype: - ~azure.mgmt.web.models.SourceControlPaged[~azure.mgmt.web.models.SourceControl] - :raises: - :class:`DefaultErrorResponseException` - """ - api_version = "2018-02-01" - - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_source_controls.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", 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.SourceControlPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.SourceControlPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_source_controls.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols'} - - def get_source_control( - self, source_control_type, custom_headers=None, raw=False, **operation_config): - """Gets source control token. - - Gets source control token. - - :param source_control_type: Type of source control - :type source_control_type: 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: SourceControl or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.SourceControl or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` - """ - api_version = "2018-02-01" - - # Construct URL - url = self.get_source_control.metadata['url'] - path_format_arguments = { - 'sourceControlType': self._serialize.url("source_control_type", source_control_type, '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' - 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('SourceControl', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_source_control.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols/{sourceControlType}'} - - def update_source_control( - self, source_control_type, request_message, custom_headers=None, raw=False, **operation_config): - """Updates source control token. - - Updates source control token. - - :param source_control_type: Type of source control - :type source_control_type: str - :param request_message: Source control token information - :type request_message: ~azure.mgmt.web.models.SourceControl - :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: SourceControl or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.SourceControl or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` - """ - api_version = "2018-02-01" - - # Construct URL - url = self.update_source_control.metadata['url'] - path_format_arguments = { - 'sourceControlType': self._serialize.url("source_control_type", source_control_type, '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(request_message, 'SourceControl') - - # 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('SourceControl', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_source_control.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols/{sourceControlType}'} - - def list_billing_meters( - self, billing_location=None, os_type=None, custom_headers=None, raw=False, **operation_config): - """Gets a list of meters for a given location. - - Gets a list of meters for a given location. - - :param billing_location: Azure Location of billable resource - :type billing_location: str - :param os_type: App Service OS type meters used for - :type os_type: 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 BillingMeter - :rtype: - ~azure.mgmt.web.models.BillingMeterPaged[~azure.mgmt.web.models.BillingMeter] - :raises: - :class:`DefaultErrorResponseException` - """ - api_version = "2018-02-01" - - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_billing_meters.metadata['url'] - path_format_arguments = { - '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 billing_location is not None: - 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("api_version", 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.BillingMeterPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.BillingMeterPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_billing_meters.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters'} - - def check_name_availability( - self, name, type, is_fqdn=None, custom_headers=None, raw=False, **operation_config): - """Check if a resource name is available. - - Check if a resource name is available. - - :param name: Resource name to verify. - :type name: str - :param type: Resource type used for verification. Possible values - include: 'Site', 'Slot', 'HostingEnvironment', 'PublishingUser', - 'Microsoft.Web/sites', 'Microsoft.Web/sites/slots', - 'Microsoft.Web/hostingEnvironments', 'Microsoft.Web/publishingUsers' - :type type: str or ~azure.mgmt.web.models.CheckNameResourceTypes - :param is_fqdn: Is fully qualified domain name. - :type is_fqdn: bool - :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: ResourceNameAvailability or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.ResourceNameAvailability or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` - """ - 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 = { - '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(request, 'ResourceNameAvailabilityRequest') - - # 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('ResourceNameAvailability', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability'} - - def get_subscription_deployment_locations( - self, custom_headers=None, raw=False, **operation_config): - """Gets list of available geo regions plus ministamps. - - Gets list of available geo regions plus ministamps. - - :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: DeploymentLocations or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.DeploymentLocations or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` - """ - api_version = "2018-02-01" - - # Construct URL - url = self.get_subscription_deployment_locations.metadata['url'] - path_format_arguments = { - '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' - 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('DeploymentLocations', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - 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, 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', '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. - :type linux_workers_enabled: bool - :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 - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of GeoRegion - :rtype: - ~azure.mgmt.web.models.GeoRegionPaged[~azure.mgmt.web.models.GeoRegion] - :raises: - :class:`DefaultErrorResponseException` - """ - api_version = "2018-02-01" - - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_geo_regions.metadata['url'] - path_format_arguments = { - '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 sku is not None: - query_parameters['sku'] = self._serialize.query("sku", sku, 'str') - if linux_workers_enabled is not None: - 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') - 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 - 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.GeoRegionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.GeoRegionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_geo_regions.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/geoRegions'} - - def list_site_identifiers_assigned_to_host_name( - self, name=None, custom_headers=None, raw=False, **operation_config): - """List all apps that are assigned to a hostname. - - List all apps that are assigned to a hostname. - - :param name: Name of the object. - :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` - """ - name_identifier = models.NameIdentifier(name=name) - - api_version = "2018-02-01" - - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_site_identifiers_assigned_to_host_name.metadata['url'] - path_format_arguments = { - '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') - - 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 body - body_content = self._serialize.body(name_identifier, 'NameIdentifier') - - # 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) - - return response - - # Deserialize response - deserialized = models.IdentifierPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.IdentifierPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_site_identifiers_assigned_to_host_name.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/listSitesAssignedToHostName'} - - def list_premier_add_on_offers( - self, custom_headers=None, raw=False, **operation_config): - """List all premier add-on offers. - - List all premier add-on offers. - - :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 PremierAddOnOffer - :rtype: - ~azure.mgmt.web.models.PremierAddOnOfferPaged[~azure.mgmt.web.models.PremierAddOnOffer] - :raises: - :class:`DefaultErrorResponseException` - """ - api_version = "2018-02-01" - - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_premier_add_on_offers.metadata['url'] - path_format_arguments = { - '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') - - 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.PremierAddOnOfferPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.PremierAddOnOfferPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_premier_add_on_offers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/premieraddonoffers'} - - def list_skus( - self, custom_headers=None, raw=False, **operation_config): - """List all SKUs. - - List all SKUs. - - :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: SkuInfos or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.SkuInfos or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` - """ - api_version = "2018-02-01" - - # Construct URL - url = self.list_skus.metadata['url'] - path_format_arguments = { - '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' - 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('SkuInfos', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/skus'} - - def verify_hosting_environment_vnet( - self, parameters, custom_headers=None, raw=False, **operation_config): - """Verifies if this VNET is compatible with an App Service Environment by - analyzing the Network Security Group rules. - - Verifies if this VNET is compatible with an App Service Environment by - analyzing the Network Security Group rules. - - :param parameters: VNET information - :type parameters: ~azure.mgmt.web.models.VnetParameters - :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: VnetValidationFailureDetails or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.VnetValidationFailureDetails or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` - """ - api_version = "2018-02-01" - - # Construct URL - url = self.verify_hosting_environment_vnet.metadata['url'] - path_format_arguments = { - '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(parameters, 'VnetParameters') - - # 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('VnetValidationFailureDetails', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - verify_hosting_environment_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/verifyHostingEnvironmentVnet'} - - def move( - self, resource_group_name, target_resource_group=None, resources=None, custom_headers=None, raw=False, **operation_config): - """Move resources between resource groups. - - Move resources between resource groups. - - :param resource_group_name: Name of the resource group to which the - resource belongs. - :type resource_group_name: str - :param target_resource_group: - :type target_resource_group: str - :param resources: - :type resources: list[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` - """ - 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 = { - '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['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(move_resource_envelope, 'CsmMoveResourceEnvelope') - - # 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 [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 - move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources'} - - def validate( - self, resource_group_name, validate_request, custom_headers=None, raw=False, **operation_config): - """Validate if a resource can be created. - - Validate if a resource can be created. - - :param resource_group_name: Name of the resource group to which the - resource belongs. - :type resource_group_name: str - :param validate_request: Request with the resources to validate. - :type validate_request: ~azure.mgmt.web.models.ValidateRequest - :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: ValidateResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.models.ValidateResponse or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` - """ - api_version = "2018-02-01" - - # Construct URL - url = self.validate.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_request, 'ValidateRequest') - - # 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('ValidateResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - 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. - - Validate whether a resource can be moved. - - :param resource_group_name: Name of the resource group to which the - resource belongs. - :type resource_group_name: str - :param target_resource_group: - :type target_resource_group: str - :param resources: - :type resources: list[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` - """ - 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 = { - '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['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(move_resource_envelope, 'CsmMoveResourceEnvelope') - - # 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 [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 - validate_move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/validateMoveResources'}