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 index d0ef02d1872..2d5316eeb5a 100644 --- 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 @@ -353,6 +353,19 @@ def resource_health_metadata(self): raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def static_sites(self): + """Instance depends on the API version: + + * 2019-08-01: :class:`StaticSitesOperations` + """ + api_version = self._get_api_version('static_sites') + if api_version == '2019-08-01': + from .v2019_08_01.operations import StaticSitesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def top_level_domains(self): """Instance depends on the API version: diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/operations/_web_apps_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/operations/_web_apps_operations.py index 27ed4cfeff6..738fbf1fdd2 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/operations/_web_apps_operations.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/operations/_web_apps_operations.py @@ -373,9 +373,8 @@ def delete( :type name: str :param delete_metrics: If true, web app metrics are also deleted. :type delete_metrics: bool - :param delete_empty_server_farm: Specify true if the App Service plan - will be empty after app deletion and you want to delete the empty App - Service plan. By default, the empty App Service plan is not deleted. + :param delete_empty_server_farm: Specify false if you want to keep + empty App Service plan. By default, empty App Service plan is deleted. :type delete_empty_server_farm: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/operations/_web_apps_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/operations/_web_apps_operations.py index 7f2b95ea4dc..0e61cb62ca7 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/operations/_web_apps_operations.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/operations/_web_apps_operations.py @@ -370,9 +370,8 @@ def delete( :type name: str :param delete_metrics: If true, web app metrics are also deleted. :type delete_metrics: bool - :param delete_empty_server_farm: Specify true if the App Service plan - will be empty after app deletion and you want to delete the empty App - Service plan. By default, the empty App Service plan is not deleted. + :param delete_empty_server_farm: Specify false if you want to keep + empty App Service plan. By default, empty App Service plan is deleted. :type delete_empty_server_farm: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/_web_site_management_client.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/_web_site_management_client.py index f57f1278d97..f02d0132faa 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/_web_site_management_client.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/_web_site_management_client.py @@ -25,6 +25,7 @@ from .operations import ProviderOperations from .operations import RecommendationsOperations from .operations import WebAppsOperations +from .operations import StaticSitesOperations from .operations import AppServiceEnvironmentsOperations from .operations import AppServicePlansOperations from .operations import ResourceHealthMetadataOperations @@ -59,6 +60,8 @@ class WebSiteManagementClient(WebSiteManagementClientOperationsMixin, SDKClient) :vartype recommendations: azure.mgmt.web.v2019_08_01.operations.RecommendationsOperations :ivar web_apps: WebApps operations :vartype web_apps: azure.mgmt.web.v2019_08_01.operations.WebAppsOperations + :ivar static_sites: StaticSites operations + :vartype static_sites: azure.mgmt.web.v2019_08_01.operations.StaticSitesOperations :ivar app_service_environments: AppServiceEnvironments operations :vartype app_service_environments: azure.mgmt.web.v2019_08_01.operations.AppServiceEnvironmentsOperations :ivar app_service_plans: AppServicePlans operations @@ -108,6 +111,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.web_apps = WebAppsOperations( self._client, self.config, self._serialize, self._deserialize) + self.static_sites = StaticSitesOperations( + 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( diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/models/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/models/__init__.py index c98bd6b934e..eb2815c7564 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/models/__init__.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/models/__init__.py @@ -116,6 +116,7 @@ from ._models_py3 import HostingEnvironmentDeploymentInfo from ._models_py3 import HostingEnvironmentDiagnostics from ._models_py3 import HostingEnvironmentProfile + from ._models_py3 import HostKeys from ._models_py3 import HostName from ._models_py3 import HostNameBinding from ._models_py3 import HostNameSslState @@ -126,6 +127,7 @@ from ._models_py3 import Identifier from ._models_py3 import InboundEnvironmentEndpoint from ._models_py3 import IpSecurityRestriction + from ._models_py3 import KeyInfo from ._models_py3 import KeyVaultReferenceCollection from ._models_py3 import KeyVaultReferenceResource from ._models_py3 import LocalizableString @@ -212,6 +214,16 @@ from ._models_py3 import StackMajorVersion from ._models_py3 import StackMinorVersion from ._models_py3 import StampCapacity + from ._models_py3 import StaticSiteARMResource + from ._models_py3 import StaticSiteBuildARMResource + from ._models_py3 import StaticSiteBuildProperties + from ._models_py3 import StaticSiteCustomDomainOverviewARMResource + from ._models_py3 import StaticSiteFunctionOverviewARMResource + from ._models_py3 import StaticSitePatchResource + from ._models_py3 import StaticSiteResetPropertiesARMResource + from ._models_py3 import StaticSiteUserARMResource + from ._models_py3 import StaticSiteUserInvitationRequestResource + from ._models_py3 import StaticSiteUserInvitationResponseResource from ._models_py3 import StatusCodesBasedTrigger from ._models_py3 import StorageMigrationOptions from ._models_py3 import StorageMigrationResponse @@ -350,6 +362,7 @@ from ._models import HostingEnvironmentDeploymentInfo from ._models import HostingEnvironmentDiagnostics from ._models import HostingEnvironmentProfile + from ._models import HostKeys from ._models import HostName from ._models import HostNameBinding from ._models import HostNameSslState @@ -360,6 +373,7 @@ from ._models import Identifier from ._models import InboundEnvironmentEndpoint from ._models import IpSecurityRestriction + from ._models import KeyInfo from ._models import KeyVaultReferenceCollection from ._models import KeyVaultReferenceResource from ._models import LocalizableString @@ -446,6 +460,16 @@ from ._models import StackMajorVersion from ._models import StackMinorVersion from ._models import StampCapacity + from ._models import StaticSiteARMResource + from ._models import StaticSiteBuildARMResource + from ._models import StaticSiteBuildProperties + from ._models import StaticSiteCustomDomainOverviewARMResource + from ._models import StaticSiteFunctionOverviewARMResource + from ._models import StaticSitePatchResource + from ._models import StaticSiteResetPropertiesARMResource + from ._models import StaticSiteUserARMResource + from ._models import StaticSiteUserInvitationRequestResource + from ._models import StaticSiteUserInvitationResponseResource from ._models import StatusCodesBasedTrigger from ._models import StorageMigrationOptions from ._models import StorageMigrationResponse @@ -523,6 +547,11 @@ from ._paged_models import SnapshotPaged from ._paged_models import SourceControlPaged from ._paged_models import StampCapacityPaged +from ._paged_models import StaticSiteARMResourcePaged +from ._paged_models import StaticSiteBuildARMResourcePaged +from ._paged_models import StaticSiteCustomDomainOverviewARMResourcePaged +from ._paged_models import StaticSiteFunctionOverviewARMResourcePaged +from ._paged_models import StaticSiteUserARMResourcePaged from ._paged_models import StrPaged from ._paged_models import TldLegalAgreementPaged from ._paged_models import TopLevelDomainPaged @@ -599,6 +628,8 @@ SiteExtensionType, TriggeredWebJobStatus, SiteRuntimeState, + BuildStatus, + TriggerTypes, SkuName, ) @@ -709,6 +740,7 @@ 'HostingEnvironmentDeploymentInfo', 'HostingEnvironmentDiagnostics', 'HostingEnvironmentProfile', + 'HostKeys', 'HostName', 'HostNameBinding', 'HostNameSslState', @@ -719,6 +751,7 @@ 'Identifier', 'InboundEnvironmentEndpoint', 'IpSecurityRestriction', + 'KeyInfo', 'KeyVaultReferenceCollection', 'KeyVaultReferenceResource', 'LocalizableString', @@ -805,6 +838,16 @@ 'StackMajorVersion', 'StackMinorVersion', 'StampCapacity', + 'StaticSiteARMResource', + 'StaticSiteBuildARMResource', + 'StaticSiteBuildProperties', + 'StaticSiteCustomDomainOverviewARMResource', + 'StaticSiteFunctionOverviewARMResource', + 'StaticSitePatchResource', + 'StaticSiteResetPropertiesARMResource', + 'StaticSiteUserARMResource', + 'StaticSiteUserInvitationRequestResource', + 'StaticSiteUserInvitationResponseResource', 'StatusCodesBasedTrigger', 'StorageMigrationOptions', 'StorageMigrationResponse', @@ -878,6 +921,11 @@ 'TriggeredJobHistoryPaged', 'CsmUsageQuotaPaged', 'WebJobPaged', + 'StaticSiteARMResourcePaged', + 'StaticSiteUserARMResourcePaged', + 'StaticSiteBuildARMResourcePaged', + 'StaticSiteFunctionOverviewARMResourcePaged', + 'StaticSiteCustomDomainOverviewARMResourcePaged', 'AppServiceEnvironmentResourcePaged', 'StampCapacityPaged', 'InboundEnvironmentEndpointPaged', @@ -957,5 +1005,7 @@ 'SiteExtensionType', 'TriggeredWebJobStatus', 'SiteRuntimeState', + 'BuildStatus', + 'TriggerTypes', 'SkuName', ] diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/models/_models.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/models/_models.py index 98dd26a6981..af932fc10d9 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/models/_models.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/models/_models.py @@ -5717,6 +5717,30 @@ def __init__(self, **kwargs): self.type = None +class HostKeys(Model): + """Functions host level keys. + + :param master_key: Secret key. + :type master_key: str + :param function_keys: Host level function keys. + :type function_keys: dict[str, str] + :param system_keys: System keys. + :type system_keys: dict[str, str] + """ + + _attribute_map = { + 'master_key': {'key': 'masterKey', 'type': 'str'}, + 'function_keys': {'key': 'functionKeys', 'type': '{str}'}, + 'system_keys': {'key': 'systemKeys', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(HostKeys, self).__init__(**kwargs) + self.master_key = kwargs.get('master_key', None) + self.function_keys = kwargs.get('function_keys', None) + self.system_keys = kwargs.get('system_keys', None) + + class HostName(Model): """Details of a hostname derived from a domain. @@ -6182,6 +6206,26 @@ def __init__(self, **kwargs): self.description = kwargs.get('description', None) +class KeyInfo(Model): + """Function key info. + + :param name: Key name + :type name: str + :param value: Key value + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyInfo, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + class KeyVaultReferenceCollection(ProxyOnlyResource): """Web app key vault reference and status ARM resource. @@ -11128,6 +11172,522 @@ def __init__(self, **kwargs): self.is_linux = kwargs.get('is_linux', None) +class StaticSiteARMResource(Resource): + """Static Site ARM resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :ivar default_hostname: The default autogenerated hostname for the static + site. + :vartype default_hostname: str + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :ivar custom_domains: The custom domains associated with this static site. + :vartype custom_domains: list[str] + :param repository_token: A user's github repository token. This is used to + setup the Github Actions workflow file and API secrets. + :type repository_token: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: + ~azure.mgmt.web.v2019_08_01.models.StaticSiteBuildProperties + :param sku: + :type sku: ~azure.mgmt.web.v2019_08_01.models.SkuDescription + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'default_hostname': {'readonly': True}, + 'custom_domains': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'default_hostname': {'key': 'properties.defaultHostname', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'custom_domains': {'key': 'properties.customDomains', 'type': '[str]'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + } + + def __init__(self, **kwargs): + super(StaticSiteARMResource, self).__init__(**kwargs) + self.default_hostname = None + self.repository_url = kwargs.get('repository_url', None) + self.branch = kwargs.get('branch', None) + self.custom_domains = None + self.repository_token = kwargs.get('repository_token', None) + self.build_properties = kwargs.get('build_properties', None) + self.sku = kwargs.get('sku', None) + + +class StaticSiteBuildARMResource(ProxyOnlyResource): + """Static Site Build ARM resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar build_id: An identifier for the static site build. + :vartype build_id: str + :ivar source_branch: The source branch. + :vartype source_branch: str + :ivar pull_request_title: The title of a pull request that a static site + build is related to. + :vartype pull_request_title: str + :ivar hostname: The hostname for a static site build. + :vartype hostname: str + :ivar created_time_utc: When this build was created. + :vartype created_time_utc: datetime + :ivar last_updated_on: When this build was updated. + :vartype last_updated_on: datetime + :ivar status: The status of the static site build. Possible values + include: 'WaitingForDeployment', 'Uploading', 'Deploying', 'Ready', + 'Failed', 'Deleting', 'Detached' + :vartype status: str or ~azure.mgmt.web.v2019_08_01.models.BuildStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'build_id': {'readonly': True}, + 'source_branch': {'readonly': True}, + 'pull_request_title': {'readonly': True}, + 'hostname': {'readonly': True}, + 'created_time_utc': {'readonly': True}, + 'last_updated_on': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'build_id': {'key': 'properties.buildId', 'type': 'str'}, + 'source_branch': {'key': 'properties.sourceBranch', 'type': 'str'}, + 'pull_request_title': {'key': 'properties.pullRequestTitle', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'created_time_utc': {'key': 'properties.createdTimeUtc', 'type': 'iso-8601'}, + 'last_updated_on': {'key': 'properties.lastUpdatedOn', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StaticSiteBuildARMResource, self).__init__(**kwargs) + self.build_id = None + self.source_branch = None + self.pull_request_title = None + self.hostname = None + self.created_time_utc = None + self.last_updated_on = None + self.status = None + + +class StaticSiteBuildProperties(Model): + """Build properties for the static site. + + :param app_location: The path to the app code within the repository. + :type app_location: str + :param api_location: The path to the api code within the repository. + :type api_location: str + :param app_artifact_location: The path of the app artifacts after + building. + :type app_artifact_location: str + """ + + _attribute_map = { + 'app_location': {'key': 'appLocation', 'type': 'str'}, + 'api_location': {'key': 'apiLocation', 'type': 'str'}, + 'app_artifact_location': {'key': 'appArtifactLocation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StaticSiteBuildProperties, self).__init__(**kwargs) + self.app_location = kwargs.get('app_location', None) + self.api_location = kwargs.get('api_location', None) + self.app_artifact_location = kwargs.get('app_artifact_location', None) + + +class StaticSiteCustomDomainOverviewARMResource(ProxyOnlyResource): + """Static Site Custom Domain Overview ARM resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar domain_name: The domain name for the static site custom domain. + :vartype domain_name: str + :ivar created_on: The date and time on which the custom domain was created + for the static site. + :vartype created_on: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'domain_name': {'readonly': True}, + 'created_on': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'domain_name': {'key': 'properties.domainName', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(StaticSiteCustomDomainOverviewARMResource, self).__init__(**kwargs) + self.domain_name = None + self.created_on = None + + +class StaticSiteFunctionOverviewARMResource(ProxyOnlyResource): + """Static Site Function Overview ARM resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar function_name: The name for the function + :vartype function_name: str + :ivar trigger_type: The trigger type of the function. Possible values + include: 'HttpTrigger', 'Unknown' + :vartype trigger_type: str or + ~azure.mgmt.web.v2019_08_01.models.TriggerTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'function_name': {'readonly': True}, + 'trigger_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'function_name': {'key': 'properties.functionName', 'type': 'str'}, + 'trigger_type': {'key': 'properties.triggerType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StaticSiteFunctionOverviewARMResource, self).__init__(**kwargs) + self.function_name = None + self.trigger_type = None + + +class StaticSitePatchResource(ProxyOnlyResource): + """ARM resource for a static site when patching. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar default_hostname: The default autogenerated hostname for the static + site. + :vartype default_hostname: str + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :ivar custom_domains: The custom domains associated with this static site. + :vartype custom_domains: list[str] + :param repository_token: A user's github repository token. This is used to + setup the Github Actions workflow file and API secrets. + :type repository_token: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: + ~azure.mgmt.web.v2019_08_01.models.StaticSiteBuildProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'default_hostname': {'readonly': True}, + 'custom_domains': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'default_hostname': {'key': 'properties.defaultHostname', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'custom_domains': {'key': 'properties.customDomains', 'type': '[str]'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + } + + def __init__(self, **kwargs): + super(StaticSitePatchResource, self).__init__(**kwargs) + self.default_hostname = None + self.repository_url = kwargs.get('repository_url', None) + self.branch = kwargs.get('branch', None) + self.custom_domains = None + self.repository_token = kwargs.get('repository_token', None) + self.build_properties = kwargs.get('build_properties', None) + + +class StaticSiteResetPropertiesARMResource(ProxyOnlyResource): + """Static Site Reset Properties ARM resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param repository_token: The token which proves admin privileges to the + repository. + :type repository_token: str + :param should_update_repository: Determines whether the repository should + be updated with the new properties. + :type should_update_repository: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'should_update_repository': {'key': 'properties.shouldUpdateRepository', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(StaticSiteResetPropertiesARMResource, self).__init__(**kwargs) + self.repository_token = kwargs.get('repository_token', None) + self.should_update_repository = kwargs.get('should_update_repository', None) + + +class StaticSiteUserARMResource(ProxyOnlyResource): + """Static Site User ARM resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar provider: The identity provider for the static site user. + :vartype provider: str + :ivar user_id: The user id for the static site user. + :vartype user_id: str + :ivar display_name: The display name for the static site user. + :vartype display_name: str + :param roles: The roles for the static site user, in free-form string + format + :type roles: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provider': {'readonly': True}, + 'user_id': {'readonly': True}, + 'display_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StaticSiteUserARMResource, self).__init__(**kwargs) + self.provider = None + self.user_id = None + self.display_name = None + self.roles = kwargs.get('roles', None) + + +class StaticSiteUserInvitationRequestResource(ProxyOnlyResource): + """Static sites user roles invitation resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param domain: The domain name for the static site custom domain. + :type domain: str + :param provider: The identity provider for the static site user. + :type provider: str + :param user_details: The user id for the static site user. + :type user_details: str + :param roles: The roles for the static site user, in free-form string + format + :type roles: str + :param num_hours_to_expiration: The number of hours the sas token stays + valid + :type num_hours_to_expiration: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'domain': {'key': 'properties.domain', 'type': 'str'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'user_details': {'key': 'properties.userDetails', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': 'str'}, + 'num_hours_to_expiration': {'key': 'properties.numHoursToExpiration', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(StaticSiteUserInvitationRequestResource, self).__init__(**kwargs) + self.domain = kwargs.get('domain', None) + self.provider = kwargs.get('provider', None) + self.user_details = kwargs.get('user_details', None) + self.roles = kwargs.get('roles', None) + self.num_hours_to_expiration = kwargs.get('num_hours_to_expiration', None) + + +class StaticSiteUserInvitationResponseResource(ProxyOnlyResource): + """Static sites user roles invitation link resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar expires_on: The expiration time of the invitation + :vartype expires_on: datetime + :ivar invitation_url: The url for the invitation link + :vartype invitation_url: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'expires_on': {'readonly': True}, + 'invitation_url': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'expires_on': {'key': 'properties.expiresOn', 'type': 'iso-8601'}, + 'invitation_url': {'key': 'properties.invitationUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StaticSiteUserInvitationResponseResource, self).__init__(**kwargs) + self.expires_on = None + self.invitation_url = None + + class StatusCodesBasedTrigger(Model): """Trigger based on status code. diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/models/_models_py3.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/models/_models_py3.py index c46371af0eb..f9ba9e5b0e9 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/models/_models_py3.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/models/_models_py3.py @@ -5717,6 +5717,30 @@ def __init__(self, *, id: str=None, **kwargs) -> None: self.type = None +class HostKeys(Model): + """Functions host level keys. + + :param master_key: Secret key. + :type master_key: str + :param function_keys: Host level function keys. + :type function_keys: dict[str, str] + :param system_keys: System keys. + :type system_keys: dict[str, str] + """ + + _attribute_map = { + 'master_key': {'key': 'masterKey', 'type': 'str'}, + 'function_keys': {'key': 'functionKeys', 'type': '{str}'}, + 'system_keys': {'key': 'systemKeys', 'type': '{str}'}, + } + + def __init__(self, *, master_key: str=None, function_keys=None, system_keys=None, **kwargs) -> None: + super(HostKeys, self).__init__(**kwargs) + self.master_key = master_key + self.function_keys = function_keys + self.system_keys = system_keys + + class HostName(Model): """Details of a hostname derived from a domain. @@ -6182,6 +6206,26 @@ def __init__(self, *, ip_address: str=None, subnet_mask: str=None, vnet_subnet_r self.description = description +class KeyInfo(Model): + """Function key info. + + :param name: Key name + :type name: str + :param value: Key value + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, value: str=None, **kwargs) -> None: + super(KeyInfo, self).__init__(**kwargs) + self.name = name + self.value = value + + class KeyVaultReferenceCollection(ProxyOnlyResource): """Web app key vault reference and status ARM resource. @@ -11128,6 +11172,522 @@ def __init__(self, *, name: str=None, available_capacity: int=None, total_capaci self.is_linux = is_linux +class StaticSiteARMResource(Resource): + """Static Site ARM resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :ivar default_hostname: The default autogenerated hostname for the static + site. + :vartype default_hostname: str + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :ivar custom_domains: The custom domains associated with this static site. + :vartype custom_domains: list[str] + :param repository_token: A user's github repository token. This is used to + setup the Github Actions workflow file and API secrets. + :type repository_token: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: + ~azure.mgmt.web.v2019_08_01.models.StaticSiteBuildProperties + :param sku: + :type sku: ~azure.mgmt.web.v2019_08_01.models.SkuDescription + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'default_hostname': {'readonly': True}, + 'custom_domains': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'default_hostname': {'key': 'properties.defaultHostname', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'custom_domains': {'key': 'properties.customDomains', 'type': '[str]'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + } + + def __init__(self, *, location: str, kind: str=None, tags=None, repository_url: str=None, branch: str=None, repository_token: str=None, build_properties=None, sku=None, **kwargs) -> None: + super(StaticSiteARMResource, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.default_hostname = None + self.repository_url = repository_url + self.branch = branch + self.custom_domains = None + self.repository_token = repository_token + self.build_properties = build_properties + self.sku = sku + + +class StaticSiteBuildARMResource(ProxyOnlyResource): + """Static Site Build ARM resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar build_id: An identifier for the static site build. + :vartype build_id: str + :ivar source_branch: The source branch. + :vartype source_branch: str + :ivar pull_request_title: The title of a pull request that a static site + build is related to. + :vartype pull_request_title: str + :ivar hostname: The hostname for a static site build. + :vartype hostname: str + :ivar created_time_utc: When this build was created. + :vartype created_time_utc: datetime + :ivar last_updated_on: When this build was updated. + :vartype last_updated_on: datetime + :ivar status: The status of the static site build. Possible values + include: 'WaitingForDeployment', 'Uploading', 'Deploying', 'Ready', + 'Failed', 'Deleting', 'Detached' + :vartype status: str or ~azure.mgmt.web.v2019_08_01.models.BuildStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'build_id': {'readonly': True}, + 'source_branch': {'readonly': True}, + 'pull_request_title': {'readonly': True}, + 'hostname': {'readonly': True}, + 'created_time_utc': {'readonly': True}, + 'last_updated_on': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'build_id': {'key': 'properties.buildId', 'type': 'str'}, + 'source_branch': {'key': 'properties.sourceBranch', 'type': 'str'}, + 'pull_request_title': {'key': 'properties.pullRequestTitle', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'created_time_utc': {'key': 'properties.createdTimeUtc', 'type': 'iso-8601'}, + 'last_updated_on': {'key': 'properties.lastUpdatedOn', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(StaticSiteBuildARMResource, self).__init__(kind=kind, **kwargs) + self.build_id = None + self.source_branch = None + self.pull_request_title = None + self.hostname = None + self.created_time_utc = None + self.last_updated_on = None + self.status = None + + +class StaticSiteBuildProperties(Model): + """Build properties for the static site. + + :param app_location: The path to the app code within the repository. + :type app_location: str + :param api_location: The path to the api code within the repository. + :type api_location: str + :param app_artifact_location: The path of the app artifacts after + building. + :type app_artifact_location: str + """ + + _attribute_map = { + 'app_location': {'key': 'appLocation', 'type': 'str'}, + 'api_location': {'key': 'apiLocation', 'type': 'str'}, + 'app_artifact_location': {'key': 'appArtifactLocation', 'type': 'str'}, + } + + def __init__(self, *, app_location: str=None, api_location: str=None, app_artifact_location: str=None, **kwargs) -> None: + super(StaticSiteBuildProperties, self).__init__(**kwargs) + self.app_location = app_location + self.api_location = api_location + self.app_artifact_location = app_artifact_location + + +class StaticSiteCustomDomainOverviewARMResource(ProxyOnlyResource): + """Static Site Custom Domain Overview ARM resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar domain_name: The domain name for the static site custom domain. + :vartype domain_name: str + :ivar created_on: The date and time on which the custom domain was created + for the static site. + :vartype created_on: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'domain_name': {'readonly': True}, + 'created_on': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'domain_name': {'key': 'properties.domainName', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(StaticSiteCustomDomainOverviewARMResource, self).__init__(kind=kind, **kwargs) + self.domain_name = None + self.created_on = None + + +class StaticSiteFunctionOverviewARMResource(ProxyOnlyResource): + """Static Site Function Overview ARM resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar function_name: The name for the function + :vartype function_name: str + :ivar trigger_type: The trigger type of the function. Possible values + include: 'HttpTrigger', 'Unknown' + :vartype trigger_type: str or + ~azure.mgmt.web.v2019_08_01.models.TriggerTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'function_name': {'readonly': True}, + 'trigger_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'function_name': {'key': 'properties.functionName', 'type': 'str'}, + 'trigger_type': {'key': 'properties.triggerType', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(StaticSiteFunctionOverviewARMResource, self).__init__(kind=kind, **kwargs) + self.function_name = None + self.trigger_type = None + + +class StaticSitePatchResource(ProxyOnlyResource): + """ARM resource for a static site when patching. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar default_hostname: The default autogenerated hostname for the static + site. + :vartype default_hostname: str + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :ivar custom_domains: The custom domains associated with this static site. + :vartype custom_domains: list[str] + :param repository_token: A user's github repository token. This is used to + setup the Github Actions workflow file and API secrets. + :type repository_token: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: + ~azure.mgmt.web.v2019_08_01.models.StaticSiteBuildProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'default_hostname': {'readonly': True}, + 'custom_domains': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'default_hostname': {'key': 'properties.defaultHostname', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'custom_domains': {'key': 'properties.customDomains', 'type': '[str]'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + } + + def __init__(self, *, kind: str=None, repository_url: str=None, branch: str=None, repository_token: str=None, build_properties=None, **kwargs) -> None: + super(StaticSitePatchResource, self).__init__(kind=kind, **kwargs) + self.default_hostname = None + self.repository_url = repository_url + self.branch = branch + self.custom_domains = None + self.repository_token = repository_token + self.build_properties = build_properties + + +class StaticSiteResetPropertiesARMResource(ProxyOnlyResource): + """Static Site Reset Properties ARM resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param repository_token: The token which proves admin privileges to the + repository. + :type repository_token: str + :param should_update_repository: Determines whether the repository should + be updated with the new properties. + :type should_update_repository: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'should_update_repository': {'key': 'properties.shouldUpdateRepository', 'type': 'bool'}, + } + + def __init__(self, *, kind: str=None, repository_token: str=None, should_update_repository: bool=None, **kwargs) -> None: + super(StaticSiteResetPropertiesARMResource, self).__init__(kind=kind, **kwargs) + self.repository_token = repository_token + self.should_update_repository = should_update_repository + + +class StaticSiteUserARMResource(ProxyOnlyResource): + """Static Site User ARM resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar provider: The identity provider for the static site user. + :vartype provider: str + :ivar user_id: The user id for the static site user. + :vartype user_id: str + :ivar display_name: The display name for the static site user. + :vartype display_name: str + :param roles: The roles for the static site user, in free-form string + format + :type roles: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provider': {'readonly': True}, + 'user_id': {'readonly': True}, + 'display_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, roles: str=None, **kwargs) -> None: + super(StaticSiteUserARMResource, self).__init__(kind=kind, **kwargs) + self.provider = None + self.user_id = None + self.display_name = None + self.roles = roles + + +class StaticSiteUserInvitationRequestResource(ProxyOnlyResource): + """Static sites user roles invitation resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param domain: The domain name for the static site custom domain. + :type domain: str + :param provider: The identity provider for the static site user. + :type provider: str + :param user_details: The user id for the static site user. + :type user_details: str + :param roles: The roles for the static site user, in free-form string + format + :type roles: str + :param num_hours_to_expiration: The number of hours the sas token stays + valid + :type num_hours_to_expiration: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'domain': {'key': 'properties.domain', 'type': 'str'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'user_details': {'key': 'properties.userDetails', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': 'str'}, + 'num_hours_to_expiration': {'key': 'properties.numHoursToExpiration', 'type': 'int'}, + } + + def __init__(self, *, kind: str=None, domain: str=None, provider: str=None, user_details: str=None, roles: str=None, num_hours_to_expiration: int=None, **kwargs) -> None: + super(StaticSiteUserInvitationRequestResource, self).__init__(kind=kind, **kwargs) + self.domain = domain + self.provider = provider + self.user_details = user_details + self.roles = roles + self.num_hours_to_expiration = num_hours_to_expiration + + +class StaticSiteUserInvitationResponseResource(ProxyOnlyResource): + """Static sites user roles invitation link resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar expires_on: The expiration time of the invitation + :vartype expires_on: datetime + :ivar invitation_url: The url for the invitation link + :vartype invitation_url: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'expires_on': {'readonly': True}, + 'invitation_url': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'expires_on': {'key': 'properties.expiresOn', 'type': 'iso-8601'}, + 'invitation_url': {'key': 'properties.invitationUrl', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(StaticSiteUserInvitationResponseResource, self).__init__(kind=kind, **kwargs) + self.expires_on = None + self.invitation_url = None + + class StatusCodesBasedTrigger(Model): """Trigger based on status code. diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/models/_paged_models.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/models/_paged_models.py index 9a3423d0b96..3f4af4dd589 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/models/_paged_models.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/models/_paged_models.py @@ -558,6 +558,71 @@ class WebJobPaged(Paged): def __init__(self, *args, **kwargs): super(WebJobPaged, self).__init__(*args, **kwargs) +class StaticSiteARMResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`StaticSiteARMResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StaticSiteARMResource]'} + } + + def __init__(self, *args, **kwargs): + + super(StaticSiteARMResourcePaged, self).__init__(*args, **kwargs) +class StaticSiteUserARMResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`StaticSiteUserARMResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StaticSiteUserARMResource]'} + } + + def __init__(self, *args, **kwargs): + + super(StaticSiteUserARMResourcePaged, self).__init__(*args, **kwargs) +class StaticSiteBuildARMResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`StaticSiteBuildARMResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StaticSiteBuildARMResource]'} + } + + def __init__(self, *args, **kwargs): + + super(StaticSiteBuildARMResourcePaged, self).__init__(*args, **kwargs) +class StaticSiteFunctionOverviewARMResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`StaticSiteFunctionOverviewARMResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StaticSiteFunctionOverviewARMResource]'} + } + + def __init__(self, *args, **kwargs): + + super(StaticSiteFunctionOverviewARMResourcePaged, self).__init__(*args, **kwargs) +class StaticSiteCustomDomainOverviewARMResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`StaticSiteCustomDomainOverviewARMResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StaticSiteCustomDomainOverviewARMResource]'} + } + + def __init__(self, *args, **kwargs): + + super(StaticSiteCustomDomainOverviewARMResourcePaged, self).__init__(*args, **kwargs) class AppServiceEnvironmentResourcePaged(Paged): """ A paging container for iterating over a list of :class:`AppServiceEnvironmentResource ` object diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/models/_web_site_management_client_enums.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/models/_web_site_management_client_enums.py index bb8eb4b7cdb..2a5be291a7d 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/models/_web_site_management_client_enums.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/models/_web_site_management_client_enums.py @@ -576,6 +576,23 @@ class SiteRuntimeState(str, Enum): unknown = "UNKNOWN" +class BuildStatus(str, Enum): + + waiting_for_deployment = "WaitingForDeployment" + uploading = "Uploading" + deploying = "Deploying" + ready = "Ready" + failed = "Failed" + deleting = "Deleting" + detached = "Detached" + + +class TriggerTypes(str, Enum): + + http_trigger = "HttpTrigger" + unknown = "Unknown" + + class SkuName(str, Enum): free = "Free" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/operations/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/operations/__init__.py index b77b412497f..b6a3c15dcb7 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/operations/__init__.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/operations/__init__.py @@ -20,6 +20,7 @@ from ._provider_operations import ProviderOperations from ._recommendations_operations import RecommendationsOperations from ._web_apps_operations import WebAppsOperations +from ._static_sites_operations import StaticSitesOperations from ._app_service_environments_operations import AppServiceEnvironmentsOperations from ._app_service_plans_operations import AppServicePlansOperations from ._resource_health_metadata_operations import ResourceHealthMetadataOperations @@ -37,6 +38,7 @@ 'ProviderOperations', 'RecommendationsOperations', 'WebAppsOperations', + 'StaticSitesOperations', 'AppServiceEnvironmentsOperations', 'AppServicePlansOperations', 'ResourceHealthMetadataOperations', diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/operations/_static_sites_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/operations/_static_sites_operations.py new file mode 100644 index 00000000000..a57504878d0 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/operations/_static_sites_operations.py @@ -0,0 +1,1820 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class StaticSitesOperations(object): + """StaticSitesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :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: "2019-08-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-08-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Get all Static Sites for a subscription. + + Description for Get all Static Sites for a subscription. + + :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 StaticSiteARMResource + :rtype: + ~azure.mgmt.web.v2019_08_01.models.StaticSiteARMResourcePaged[~azure.mgmt.web.v2019_08_01.models.StaticSiteARMResource] + :raises: + :class:`DefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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("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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StaticSiteARMResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/staticSites'} + + def get_static_sites_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all static sites in the specified resource group. + + Description for Gets all static sites in the specified resource group. + + :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: An iterator like instance of StaticSiteARMResource + :rtype: + ~azure.mgmt.web.v2019_08_01.models.StaticSiteARMResourcePaged[~azure.mgmt.web.v2019_08_01.models.StaticSiteARMResource] + :raises: + :class:`DefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.get_static_sites_by_resource_group.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("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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StaticSiteARMResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + get_static_sites_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites'} + + def get_static_site( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets the details of a static site. + + Description for Gets the details of a static 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 static site. + :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: StaticSiteARMResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.StaticSiteARMResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.get_static_site.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]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteARMResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} + + def create_or_update_static_site( + self, resource_group_name, name, static_site_envelope, custom_headers=None, raw=False, **operation_config): + """Creates a new static site in an existing resource group, or updates an + existing static site. + + Description for Creates a new static site in an existing resource + group, or updates an existing static 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 static site to create or update. + :type name: str + :param static_site_envelope: A JSON representation of the staticsite + properties. See example. + :type static_site_envelope: + ~azure.mgmt.web.v2019_08_01.models.StaticSiteARMResource + :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: StaticSiteARMResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.StaticSiteARMResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.create_or_update_static_site.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(static_site_envelope, 'StaticSiteARMResource') + + # 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, 202]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteARMResource', response) + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteARMResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} + + def delete_static_site( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Deletes a static site. + + Description for Deletes a static 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 static site to delete. + :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:`DefaultErrorResponseException` + """ + # Construct URL + url = self.delete_static_site.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.delete(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) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} + + def update_static_site( + self, resource_group_name, name, static_site_envelope, custom_headers=None, raw=False, **operation_config): + """Creates a new static site in an existing resource group, or updates an + existing static site. + + Description for Creates a new static site in an existing resource + group, or updates an existing static 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 static site to create or update. + :type name: str + :param static_site_envelope: A JSON representation of the staticsite + properties. See example. + :type static_site_envelope: + ~azure.mgmt.web.v2019_08_01.models.StaticSitePatchResource + :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: StaticSiteARMResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.StaticSiteARMResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.update_static_site.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(static_site_envelope, 'StaticSitePatchResource') + + # 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, 202]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteARMResource', response) + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteARMResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} + + def list_static_site_users( + self, resource_group_name, name, authprovider, custom_headers=None, raw=False, **operation_config): + """Gets the list of users of a static site. + + Description for Gets the list of users of a static 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 static site. + :type name: str + :param authprovider: The auth provider for the users. + :type authprovider: 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 StaticSiteUserARMResource + :rtype: + ~azure.mgmt.web.v2019_08_01.models.StaticSiteUserARMResourcePaged[~azure.mgmt.web.v2019_08_01.models.StaticSiteUserARMResource] + :raises: + :class:`DefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_static_site_users.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'), + 'authprovider': self._serialize.url("authprovider", authprovider, '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.post(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StaticSiteUserARMResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_static_site_users.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/listUsers'} + + def delete_static_site_user( + self, resource_group_name, name, authprovider, userid, custom_headers=None, raw=False, **operation_config): + """Deletes the user entry from the static site. + + Description for Deletes the user entry from the static 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 staticsite. + :type name: str + :param authprovider: The auth provider for this user. + :type authprovider: str + :param userid: The user id of the user. + :type userid: 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:`DefaultErrorResponseException` + """ + # Construct URL + url = self.delete_static_site_user.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'), + 'authprovider': self._serialize.url("authprovider", authprovider, 'str'), + 'userid': self._serialize.url("userid", userid, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_static_site_user.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}'} + + def update_static_site_user( + self, resource_group_name, name, authprovider, userid, kind=None, roles=None, custom_headers=None, raw=False, **operation_config): + """Updates a user entry with the listed roles. + + Description for Updates a user entry with the listed roles. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param authprovider: The auth provider for this user. + :type authprovider: str + :param userid: The user id of the user. + :type userid: str + :param kind: Kind of resource. + :type kind: str + :param roles: The roles for the static site user, in free-form string + format + :type roles: 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: StaticSiteUserARMResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.StaticSiteUserARMResource + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + static_site_user_envelope = models.StaticSiteUserARMResource(kind=kind, roles=roles) + + # Construct URL + url = self.update_static_site_user.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'), + 'authprovider': self._serialize.url("authprovider", authprovider, 'str'), + 'userid': self._serialize.url("userid", userid, '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(static_site_user_envelope, 'StaticSiteUserARMResource') + + # 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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteUserARMResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_static_site_user.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}'} + + def get_static_site_builds( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets all static site builds for a particular static site. + + Description for Gets all static site builds for a particular static + 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 static site. + :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 StaticSiteBuildARMResource + :rtype: + ~azure.mgmt.web.v2019_08_01.models.StaticSiteBuildARMResourcePaged[~azure.mgmt.web.v2019_08_01.models.StaticSiteBuildARMResource] + :raises: + :class:`DefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.get_static_site_builds.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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StaticSiteBuildARMResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + get_static_site_builds.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds'} + + def get_static_site_build( + self, resource_group_name, name, pr_id, custom_headers=None, raw=False, **operation_config): + """Gets the details of a static site build. + + Description for Gets the details of a static site build. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_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: StaticSiteBuildARMResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.StaticSiteBuildARMResource + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.get_static_site_build.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'), + 'prId': self._serialize.url("pr_id", pr_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('StaticSiteBuildARMResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}'} + + def delete_static_site_build( + self, resource_group_name, name, pr_id, custom_headers=None, raw=False, **operation_config): + """Deletes a static site build. + + Description for Deletes a static site build. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_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:`DefaultErrorResponseException` + """ + # Construct URL + url = self.delete_static_site_build.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'), + 'prId': self._serialize.url("pr_id", pr_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 = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}'} + + def create_or_update_static_site_build_function_app_settings( + self, resource_group_name, name, pr_id, kind=None, properties=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates the function app settings of a static site build. + + Description for Creates or updates the function app settings of a + static site build. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :param kind: Kind of resource. + :type kind: str + :param properties: Settings. + :type properties: dict[str, 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: StringDictionary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.StringDictionary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + app_settings = models.StringDictionary(kind=kind, properties=properties) + + # Construct URL + url = self.create_or_update_static_site_build_function_app_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\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_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' + 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(app_settings, 'StringDictionary') + + # 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, 202]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StringDictionary', response) + if response.status_code == 202: + deserialized = self._deserialize('StringDictionary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_static_site_build_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/config/functionappsettings'} + + def list_static_site_build_functions( + self, resource_group_name, name, pr_id, custom_headers=None, raw=False, **operation_config): + """Gets the functions of a particular static site build. + + Description for Gets the functions of a particular static site build. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_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 + StaticSiteFunctionOverviewARMResource + :rtype: + ~azure.mgmt.web.v2019_08_01.models.StaticSiteFunctionOverviewARMResourcePaged[~azure.mgmt.web.v2019_08_01.models.StaticSiteFunctionOverviewARMResource] + :raises: + :class:`DefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_static_site_build_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'), + 'prId': self._serialize.url("pr_id", pr_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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StaticSiteFunctionOverviewARMResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_static_site_build_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/functions'} + + def list_static_site_build_function_app_settings( + self, resource_group_name, name, pr_id, custom_headers=None, raw=False, **operation_config): + """Gets the application settings of a static site. + + Description for Gets the application settings of a static 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 static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_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: StringDictionary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.StringDictionary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.list_static_site_build_function_app_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\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_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.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('StringDictionary', response) + if response.status_code == 202: + deserialized = self._deserialize('StringDictionary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_static_site_build_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/listFunctionAppSettings'} + + def create_or_update_static_site_function_app_settings( + self, resource_group_name, name, kind=None, properties=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates the function app settings of a static site. + + Description for Creates or updates the function app settings of a + static 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 static site. + :type name: str + :param kind: Kind of resource. + :type kind: str + :param properties: Settings. + :type properties: dict[str, 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: StringDictionary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.StringDictionary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + app_settings = models.StringDictionary(kind=kind, properties=properties) + + # Construct URL + url = self.create_or_update_static_site_function_app_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\._\(\)]+[^\.]$'), + '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(app_settings, 'StringDictionary') + + # 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, 202]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StringDictionary', response) + if response.status_code == 202: + deserialized = self._deserialize('StringDictionary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_static_site_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/functionappsettings'} + + def create_user_roles_invitation_link( + self, resource_group_name, name, static_site_user_roles_invitation_envelope, custom_headers=None, raw=False, **operation_config): + """Creates an invitation link for a user with the role. + + Description for Creates an invitation link for a user with the role. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param static_site_user_roles_invitation_envelope: + :type static_site_user_roles_invitation_envelope: + ~azure.mgmt.web.v2019_08_01.models.StaticSiteUserInvitationRequestResource + :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: StaticSiteUserInvitationResponseResource or ClientRawResponse + if raw=true + :rtype: + ~azure.mgmt.web.v2019_08_01.models.StaticSiteUserInvitationResponseResource + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.create_user_roles_invitation_link.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(static_site_user_roles_invitation_envelope, 'StaticSiteUserInvitationRequestResource') + + # 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('StaticSiteUserInvitationResponseResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_user_roles_invitation_link.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/createUserInvitation'} + + def list_static_site_custom_domains( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets all static site custom domains for a particular static site. + + Description for Gets all static site custom domains for a particular + static 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 static site resource to search in. + :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 + StaticSiteCustomDomainOverviewARMResource + :rtype: + ~azure.mgmt.web.v2019_08_01.models.StaticSiteCustomDomainOverviewARMResourcePaged[~azure.mgmt.web.v2019_08_01.models.StaticSiteCustomDomainOverviewARMResource] + :raises: + :class:`DefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_static_site_custom_domains.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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StaticSiteCustomDomainOverviewARMResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_static_site_custom_domains.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains'} + + def create_or_update_static_site_custom_domain( + self, resource_group_name, name, domain_name, custom_headers=None, raw=False, **operation_config): + """Creates a new static site custom domain in an existing resource group + and static site. + + Description for Creates a new static site custom domain in an existing + resource group and static 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 static site. + :type name: str + :param domain_name: The custom domain to create. + :type domain_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: StaticSiteCustomDomainOverviewARMResource or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.web.v2019_08_01.models.StaticSiteCustomDomainOverviewARMResource + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.create_or_update_static_site_custom_domain.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'), + 'domainName': self._serialize.url("domain_name", domain_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.put(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('StaticSiteCustomDomainOverviewARMResource', response) + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteCustomDomainOverviewARMResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_static_site_custom_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}'} + + def delete_static_site_custom_domain( + self, resource_group_name, name, domain_name, custom_headers=None, raw=False, **operation_config): + """Deletes a custom domain. + + Description for Deletes a custom domain. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param domain_name: The custom domain to delete. + :type domain_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:`DefaultErrorResponseException` + """ + # Construct URL + url = self.delete_static_site_custom_domain.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'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_static_site_custom_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}'} + + def validate_custom_domain_can_be_added_to_static_site( + self, resource_group_name, name, domain_name, custom_headers=None, raw=False, **operation_config): + """Validates a particular custom domain can be added to a static site. + + Description for Validates a particular custom domain can be added to a + static 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 static site. + :type name: str + :param domain_name: The custom domain to validate. + :type domain_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:`DefaultErrorResponseException` + """ + # Construct URL + url = self.validate_custom_domain_can_be_added_to_static_site.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'), + 'domainName': self._serialize.url("domain_name", domain_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, 202]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + validate_custom_domain_can_be_added_to_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}/validate'} + + def detach_static_site( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Detaches a static site. + + Description for Detaches a static 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 static site to detach. + :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:`DefaultErrorResponseException` + """ + # Construct URL + url = self.detach_static_site.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, 202]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + detach_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/detach'} + + def list_static_site_functions( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets the functions of a static site. + + Description for Gets the functions of a static 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 static site. + :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 + StaticSiteFunctionOverviewARMResource + :rtype: + ~azure.mgmt.web.v2019_08_01.models.StaticSiteFunctionOverviewARMResourcePaged[~azure.mgmt.web.v2019_08_01.models.StaticSiteFunctionOverviewARMResource] + :raises: + :class:`DefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_static_site_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'), + '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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StaticSiteFunctionOverviewARMResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_static_site_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/functions'} + + def list_static_site_function_app_settings( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets the application settings of a static site. + + Description for Gets the application settings of a static 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 static site. + :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: StringDictionary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.StringDictionary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.list_static_site_function_app_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\._\(\)]+[^\.]$'), + '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, 202]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StringDictionary', response) + if response.status_code == 202: + deserialized = self._deserialize('StringDictionary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_static_site_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listFunctionAppSettings'} + + def list_static_site_secrets( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Lists the secrets for an existing static site. + + Description for Lists the secrets for an existing static 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 static site. + :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: StringDictionary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.StringDictionary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.list_static_site_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'), + '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('StringDictionary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_static_site_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listSecrets'} + + def reset_static_site_api_key( + self, resource_group_name, name, reset_properties_envelope, custom_headers=None, raw=False, **operation_config): + """Resets the api key for an existing static site. + + Description for Resets the api key for an existing static 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 static site. + :type name: str + :param reset_properties_envelope: + :type reset_properties_envelope: + ~azure.mgmt.web.v2019_08_01.models.StaticSiteResetPropertiesARMResource + :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:`DefaultErrorResponseException` + """ + # Construct URL + url = self.reset_static_site_api_key.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['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(reset_properties_envelope, 'StaticSiteResetPropertiesARMResource') + + # 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) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + reset_static_site_api_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/resetapikey'} diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/operations/_web_apps_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/operations/_web_apps_operations.py index 84f27b846c2..6b93b429ec0 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/operations/_web_apps_operations.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/operations/_web_apps_operations.py @@ -371,9 +371,8 @@ def delete( :type name: str :param delete_metrics: If true, web app metrics are also deleted. :type delete_metrics: bool - :param delete_empty_server_farm: Specify true if the App Service plan - will be empty after app deletion and you want to delete the empty App - Service plan. By default, the empty App Service plan is not deleted. + :param delete_empty_server_farm: Specify false if you want to keep + empty App Service plan. By default, empty App Service plan is deleted. :type delete_empty_server_farm: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -4890,38 +4889,45 @@ def delete_function( return client_raw_response delete_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} - 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 create_or_update_function_secret( + self, resource_group_name, name, function_name, key_name, name1=None, value=None, custom_headers=None, raw=False, **operation_config): + """Add or update a function secret. - Description for Get function secrets for a function in a web site, or a - deployment slot. + Description for Add or update a function secret. :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. + :param function_name: The name of the function. :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :param name1: Key name + :type name1: str + :param value: Key value + :type value: 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.v2019_08_01.models.FunctionSecrets or + :return: KeyInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.KeyInfo or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ + key = models.KeyInfo(name=name1, value=value) + # Construct URL - url = self.list_function_secrets.metadata['url'] + url = self.create_or_update_function_secret.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'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -4933,6 +4939,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: @@ -4940,130 +4947,61 @@ 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(key, 'KeyInfo') + # 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]: + if response.status_code not in [200, 201]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('FunctionSecrets', response) + deserialized = self._deserialize('KeyInfo', response) + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', 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 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. - - Description for 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 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 HostNameBinding - :rtype: - ~azure.mgmt.web.v2019_08_01.models.HostNameBindingPaged[~azure.mgmt.web.v2019_08_01.models.HostNameBinding] - :raises: - :class:`DefaultErrorResponseException` - """ - def prepare_request(next_link=None): - 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) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - 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 - header_dict = None - if raw: - header_dict = {} - deserialized = models.HostNameBindingPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_host_name_bindings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings'} + create_or_update_function_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}'} - 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). + def delete_function_secret( + self, resource_group_name, name, function_name, key_name, custom_headers=None, raw=False, **operation_config): + """Delete a function secret. - Description for Get the named hostname binding for an app (or - deployment slot, if specified). + Description for Delete a function secret. :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 host_name: Hostname in the hostname binding. - :type host_name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_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.v2019_08_01.models.HostNameBinding or - ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_host_name_binding.metadata['url'] + url = self.delete_function_secret.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'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -5074,7 +5012,6 @@ def get_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: @@ -5083,57 +5020,48 @@ 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.delete(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 [204, 404]: raise models.DefaultErrorResponseException(self._deserialize, response) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('HostNameBinding', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete_function_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}'} - return deserialized - get_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} - - 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_function_keys( + self, resource_group_name, name, function_name, custom_headers=None, raw=False, **operation_config): + """Get function keys for a function in a web site, or a deployment slot. - Description for Creates a hostname binding for an app. + Description for Get function keys 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 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.v2019_08_01.models.HostNameBinding + :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: HostNameBinding or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.HostNameBinding or + :return: StringDictionary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.StringDictionary or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.create_or_update_host_name_binding.metadata['url'] + url = self.list_function_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'), + '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) @@ -5145,7 +5073,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: @@ -5153,11 +5080,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.post(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -5165,44 +5089,47 @@ def create_or_update_host_name_binding( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('HostNameBinding', response) + deserialized = self._deserialize('StringDictionary', 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_function_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listkeys'} - 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_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. - Description for Deletes a hostname binding for an app. + Description for 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 host_name: Hostname in the hostname binding. - :type host_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: FunctionSecrets or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.FunctionSecrets or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_host_name_binding.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'), - 'hostName': self._serialize.url("host_name", host_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) @@ -5213,6 +5140,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: @@ -5221,52 +5149,50 @@ 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.post(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]: raise models.DefaultErrorResponseException(self._deserialize, response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FunctionSecrets', 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_function_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets'} - Description for Retrieves a specific Service Bus Hybrid Connection used - by this Web App. + def list_host_keys( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Get host secrets for a function app. + + Description for Get host secrets for a function 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: Site name. :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.v2019_08_01.models.HybridConnection or + :return: HostKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.HostKeys or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_hybrid_connection.metadata['url'] + url = self.list_host_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) @@ -5286,7 +5212,7 @@ def get_hybrid_connection( 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]: @@ -5294,52 +5220,42 @@ def get_hybrid_connection( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('HybridConnection', response) + deserialized = self._deserialize('HostKeys', 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}'} + list_host_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listkeys'} - 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 list_sync_status( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """This is to allow calling via powershell and ARM template. - Description for Creates a new Hybrid Connection using a Service Bus - relay. + Description for 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: 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.v2019_08_01.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: HybridConnection or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.HybridConnection or - ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.create_or_update_hybrid_connection.metadata['url'] + url = self.list_sync_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'), - '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) @@ -5350,8 +5266,6 @@ def create_or_update_hybrid_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: @@ -5359,42 +5273,30 @@ def create_or_update_hybrid_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, 'HybridConnection') - # 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]: + if response.status_code not in [204]: 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) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + list_sync_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listsyncstatus'} - 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. + def sync_functions( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Syncs function trigger metadata to the management database. - Description for Removes a Hybrid Connection from this site. + Description for Syncs function trigger metadata to the management + database. :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 @@ -5406,12 +5308,10 @@ def delete_hybrid_connection( :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_hybrid_connection.metadata['url'] + url = self.sync_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'), - '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) @@ -5430,54 +5330,56 @@ def delete_hybrid_connection( 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 [200, 404]: + if response.status_code not in [204]: raise models.DefaultErrorResponseException(self._deserialize, response) 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}'} + sync_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/sync'} - 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 create_or_update_host_secret( + self, resource_group_name, name, key_type, key_name, name1=None, value=None, custom_headers=None, raw=False, **operation_config): + """Add or update a host level secret. - Description for Creates a new Hybrid Connection using a Service Bus - relay. + Description for Add or update a host level secret. :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 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.v2019_08_01.models.HybridConnection + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :param name1: Key name + :type name1: str + :param value: Key value + :type value: 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.v2019_08_01.models.HybridConnection or + :return: KeyInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.KeyInfo or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ + key = models.KeyInfo(name=name1, value=value) + # Construct URL - url = self.update_hybrid_connection.metadata['url'] + url = self.create_or_update_host_secret.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'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -5498,54 +5400,60 @@ 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(key, 'KeyInfo') # 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]: + if response.status_code not in [200, 201]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('HybridConnection', response) + deserialized = self._deserialize('KeyInfo', response) + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', 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}'} + create_or_update_host_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}'} - 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 delete_host_secret( + self, resource_group_name, name, key_type, key_name, custom_headers=None, raw=False, **operation_config): + """Delete a host level secret. - Description for Retrieves all Service Bus Hybrid Connections used by - this Web App. + Description for Delete a host level secret. :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 key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_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.v2019_08_01.models.HybridConnection or - ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.list_hybrid_connections.metadata['url'] + url = self.delete_host_secret.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'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -5556,7 +5464,6 @@ def list_hybrid_connections( # 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: @@ -5565,30 +5472,22 @@ def list_hybrid_connections( 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]: + if response.status_code not in [204, 404]: 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) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete_host_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}'} - return deserialized - list_hybrid_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays'} - - def list_relay_service_connections( + def list_host_name_bindings( 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 hostname bindings for an app or a deployment slot. - Description for Gets hybrid connections configured for an app (or - deployment slot, if specified). + Description for Get hostname bindings for an app or a deployment slot. :param resource_group_name: Name of the resource group to which the resource belongs. @@ -5600,85 +5499,96 @@ def list_relay_service_connections( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: RelayServiceConnectionEntity or ClientRawResponse if raw=true + :return: An iterator like instance of HostNameBinding :rtype: - ~azure.mgmt.web.v2019_08_01.models.RelayServiceConnectionEntity or - ~msrest.pipeline.ClientRawResponse + ~azure.mgmt.web.v2019_08_01.models.HostNameBindingPaged[~azure.mgmt.web.v2019_08_01.models.HostNameBinding] :raises: :class:`DefaultErrorResponseException` """ - # Construct 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'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) + def prepare_request(next_link=None): + 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') + # 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') + else: + url = next_link + query_parameters = {} - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - 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) + return request - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('RelayServiceConnectionEntity', response) + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + header_dict = {} + deserialized = models.HostNameBindingPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_relay_service_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection'} + list_host_name_bindings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings'} - 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 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). - Description for Gets a hybrid connection configuration by its name. + Description for 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 entity_name: Name of the hybrid connection. - :type entity_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: RelayServiceConnectionEntity or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.web.v2019_08_01.models.RelayServiceConnectionEntity or + :return: HostNameBinding or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.HostNameBinding or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_relay_service_connection.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'), - 'entityName': self._serialize.url("entity_name", entity_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) @@ -5706,52 +5616,49 @@ def get_relay_service_connection( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('RelayServiceConnectionEntity', response) + deserialized = self._deserialize('HostNameBinding', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} + get_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} - 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 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. - Description for Creates a new hybrid connection configuration (PUT), or - updates an existing one (PATCH). + Description for 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 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.v2019_08_01.models.RelayServiceConnectionEntity + :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.v2019_08_01.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: RelayServiceConnectionEntity or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.web.v2019_08_01.models.RelayServiceConnectionEntity or + :return: HostNameBinding or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.HostNameBinding or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.create_or_update_relay_service_connection.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'), - 'entityName': self._serialize.url("entity_name", entity_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) @@ -5772,7 +5679,7 @@ def create_or_update_relay_service_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, 'RelayServiceConnectionEntity') + body_content = self._serialize.body(host_name_binding, 'HostNameBinding') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -5783,28 +5690,28 @@ def create_or_update_relay_service_connection( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('RelayServiceConnectionEntity', response) + deserialized = self._deserialize('HostNameBinding', 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}'} + create_or_update_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} - 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 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. - Description for Deletes a relay service connection by its name. + Description for 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 entity_name: Name of the hybrid connection configuration. - :type entity_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 @@ -5816,11 +5723,11 @@ def delete_relay_service_connection( :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_relay_service_connection.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'), - 'entityName': self._serialize.url("entity_name", entity_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) @@ -5842,51 +5749,49 @@ def delete_relay_service_connection( 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]: raise models.DefaultErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} + delete_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} - 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). + 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. - Description for Creates a new hybrid connection configuration (PUT), or - updates an existing one (PATCH). + Description for 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: Name of the app. + :param name: The name of the 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.v2019_08_01.models.RelayServiceConnectionEntity + :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: RelayServiceConnectionEntity or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.web.v2019_08_01.models.RelayServiceConnectionEntity or + :return: HybridConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.HybridConnection or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.update_relay_service_connection.metadata['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'), - 'entityName': self._serialize.url("entity_name", entity_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) @@ -5898,7 +5803,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: @@ -5906,11 +5810,8 @@ 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]: @@ -5918,119 +5819,124 @@ def update_relay_service_connection( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('RelayServiceConnectionEntity', response) + deserialized = self._deserialize('HybridConnection', 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_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} - 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 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. - Description for Gets all scale-out instances of an app. + Description for 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 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 connection_envelope: The details of the hybrid connection. + :type connection_envelope: + ~azure.mgmt.web.v2019_08_01.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: An iterator like instance of SiteInstance - :rtype: - ~azure.mgmt.web.v2019_08_01.models.SiteInstancePaged[~azure.mgmt.web.v2019_08_01.models.SiteInstance] + :return: HybridConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.HybridConnection or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ - def prepare_request(next_link=None): - 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 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) - # 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.get(url, query_parameters, header_parameters) - return request + # 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') - def internal_paging(next_link=None): - request = prepare_request(next_link) + # Construct body + body_content = self._serialize.body(connection_envelope, 'HybridConnection') - response = self._client.send(request, stream=False, **operation_config) + # 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) + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) - return response + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('HybridConnection', response) - # Deserialize response - header_dict = None if raw: - header_dict = {} - deserialized = models.SiteInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response return deserialized - list_instance_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances'} + create_or_update_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} - def get_instance_info( - self, resource_group_name, name, instance_id, custom_headers=None, raw=False, **operation_config): - """Gets all scale-out instances of an app. + 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. - Description for Gets all scale-out instances of an app. + Description for 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: Name of the app. + :param name: The name of the web app. :type name: str - :param instance_id: - :type instance_id: 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: WebSiteInstanceStatus or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.WebSiteInstanceStatus or - ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_instance_info.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'), - 'instanceId': self._serialize.url("instance_id", instance_id, '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) @@ -6041,7 +5947,6 @@ def get_instance_info( # 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: @@ -6050,53 +5955,54 @@ def get_instance_info( 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]: + if response.status_code not in [200, 404]: raise models.DefaultErrorResponseException(self._deserialize, response) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('WebSiteInstanceStatus', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + 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}'} - return deserialized - get_instance_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}'} - - 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. + 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. - Description for Get the status of the last MSDeploy operation. + Description for 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 instance_id: ID of web app instance. - :type instance_id: 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.v2019_08_01.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: MSDeployStatus or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.MSDeployStatus or + :return: HybridConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.HybridConnection or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_instance_ms_deploy_status.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'), - 'instanceId': self._serialize.url("instance_id", instance_id, '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) @@ -6108,6 +6014,7 @@ def get_instance_ms_deploy_status( # 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: @@ -6115,8 +6022,11 @@ def get_instance_ms_deploy_status( 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.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -6124,24 +6034,43 @@ def get_instance_ms_deploy_status( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('MSDeployStatus', response) + deserialized = self._deserialize('HybridConnection', 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'} + update_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} + 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 _create_instance_ms_deploy_operation_initial( - self, resource_group_name, name, instance_id, ms_deploy, custom_headers=None, raw=False, **operation_config): + Description for 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: 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: HybridConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.HybridConnection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ # Construct URL - url = self.create_instance_ms_deploy_operation.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'), - '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) @@ -6153,7 +6082,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: @@ -6161,114 +6089,54 @@ 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.get(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 [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('HybridConnection', 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 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. - - Description for 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.v2019_08_01.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.v2019_08_01.models.MSDeployStatus] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.v2019_08_01.models.MSDeployStatus]] - :raises: - :class:`DefaultErrorResponseException` - """ - 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 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). - Description for Get the MSDeploy Log for the last MSDeploy operation. + Description for 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 web app. + :param name: Name of the 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: MSDeployLog or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.MSDeployLog or + :return: RelayServiceConnectionEntity or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.web.v2019_08_01.models.RelayServiceConnectionEntity or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_instance_ms_deploy_log.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'), - '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) @@ -6291,138 +6159,51 @@ def get_instance_ms_deploy_log( 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]: + 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('RelayServiceConnectionEntity', response) 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'} + list_relay_service_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection'} - 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 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. - Description for Get list of processes for a web site, or a deployment - slot, or for a specific scaled-out instance in a web site. + Description for 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: Site name. + :param name: Name of the app. :type 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 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: An iterator like instance of ProcessInfo + :return: RelayServiceConnectionEntity or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.web.v2019_08_01.models.ProcessInfoPaged[~azure.mgmt.web.v2019_08_01.models.ProcessInfo] - :raises: - :class:`DefaultErrorResponseException` - """ - def prepare_request(next_link=None): - 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 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) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 404]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ProcessInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_instance_processes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes'} - - 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. - - Description for 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: 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: ProcessInfo or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.ProcessInfo or + ~azure.mgmt.web.v2019_08_01.models.RelayServiceConnectionEntity or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_instance_process.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'), - 'processId': self._serialize.url("process_id", process_id, 'str'), - 'instanceId': self._serialize.url("instance_id", instance_id, '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) @@ -6445,56 +6226,57 @@ def get_instance_process( 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]: + 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('RelayServiceConnectionEntity', 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_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} - 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. + 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). - Description for Terminate a process by its ID for a web site, or a - deployment slot, or specific scaled-out instance in a web site. + Description for 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: 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 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.v2019_08_01.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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: RelayServiceConnectionEntity or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.web.v2019_08_01.models.RelayServiceConnectionEntity or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_instance_process.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'), - 'processId': self._serialize.url("process_id", process_id, 'str'), - 'instanceId': self._serialize.url("instance_id", instance_id, '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) @@ -6505,6 +6287,8 @@ def delete_instance_process( # 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: @@ -6512,59 +6296,56 @@ def delete_instance_process( 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.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 [204, 404]: + 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_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 + create_or_update_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} - Description for Get a memory dump of a process by its ID for a specific - scaled-out instance in a web 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. + + Description for 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: 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 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 - :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:`DefaultErrorResponseException` """ # Construct URL - url = self.get_instance_process_dump.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'), - 'processId': self._serialize.url("process_id", process_id, 'str'), - 'instanceId': self._serialize.url("instance_id", instance_id, '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) @@ -6575,7 +6356,6 @@ def get_instance_process_dump( # 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: @@ -6584,145 +6364,54 @@ 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 404]: raise models.DefaultErrorResponseException(self._deserialize, response) - 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 + delete_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} - return deserialized - get_instance_process_dump.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump'} - - 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 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). - Description for List module information for a process by its ID for a - specific scaled-out instance in a web site. + Description for 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: 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 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.v2019_08_01.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: An iterator like instance of ProcessModuleInfo + :return: RelayServiceConnectionEntity or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.web.v2019_08_01.models.ProcessModuleInfoPaged[~azure.mgmt.web.v2019_08_01.models.ProcessModuleInfo] - :raises: - :class:`DefaultErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct 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') - } - 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) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 404]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ProcessModuleInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_instance_process_modules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules'} - - 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. - - Description for 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: 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.v2019_08_01.models.ProcessModuleInfo or + ~azure.mgmt.web.v2019_08_01.models.RelayServiceConnectionEntity or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_instance_process_module.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'), - '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'), + '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) @@ -6734,6 +6423,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: @@ -6741,63 +6431,56 @@ 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(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, 404]: + 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('RelayServiceConnectionEntity', 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}'} + update_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} - 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 list_instance_identifiers( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets all scale-out instances of an app. - Description for List the threads in a process by its ID for a specific - scaled-out instance in a web site. + Description for 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: 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 ProcessThreadInfo + :return: An iterator like instance of SiteInstance :rtype: - ~azure.mgmt.web.v2019_08_01.models.ProcessThreadInfoPaged[~azure.mgmt.web.v2019_08_01.models.ProcessThreadInfo] + ~azure.mgmt.web.v2019_08_01.models.SiteInstancePaged[~azure.mgmt.web.v2019_08_01.models.SiteInstance] :raises: :class:`DefaultErrorResponseException` """ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_instance_process_threads.metadata['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'), - '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) @@ -6829,7 +6512,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 404]: + if response.status_code not in [200]: raise models.DefaultErrorResponseException(self._deserialize, response) return response @@ -6838,40 +6521,41 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.ProcessThreadInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.SiteInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_instance_process_threads.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads'} + list_instance_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances'} - 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 get_instance_info( + self, resource_group_name, name, instance_id, custom_headers=None, raw=False, **operation_config): + """Gets all scale-out instances of an app. - Description for Shows whether an app can be cloned to another resource - group or subscription. + Description for 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: Name of the app. :type name: str + :param instance_id: + :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: SiteCloneability or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.SiteCloneability or + :return: WebSiteInstanceStatus or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.WebSiteInstanceStatus or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.is_cloneable.metadata['url'] + url = self.get_instance_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'), + '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) @@ -6891,7 +6575,7 @@ def is_cloneable( 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]: @@ -6899,117 +6583,45 @@ def is_cloneable( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SiteCloneability', response) + deserialized = self._deserialize('WebSiteInstanceStatus', 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'} + get_instance_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}'} - def list_site_backups( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Gets existing backups of an 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. - Description for Gets existing backups of an app. + Description for 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. - :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 BackupItem - :rtype: - ~azure.mgmt.web.v2019_08_01.models.BackupItemPaged[~azure.mgmt.web.v2019_08_01.models.BackupItem] - :raises: - :class:`DefaultErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_site_backups.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.post(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - 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 - header_dict = None - if raw: - header_dict = {} - deserialized = models.BackupItemPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_site_backups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listbackups'} - - 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. - - Description for This is to allow calling via powershell and ARM - template. - - :param resource_group_name: Name of the resource group to which the - resource belongs. - :type resource_group_name: str - :param name: Name of the app. + :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: FunctionSecrets or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.FunctionSecrets or + :return: MSDeployStatus or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.MSDeployStatus or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.list_sync_function_triggers.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) @@ -7029,7 +6641,7 @@ 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.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -7037,30 +6649,30 @@ def list_sync_function_triggers( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('FunctionSecrets', response) + deserialized = self._deserialize('MSDeployStatus', 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'} + get_instance_ms_deploy_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} - def _migrate_storage_initial( - self, subscription_name, resource_group_name, name, migration_options, custom_headers=None, raw=False, **operation_config): + 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.migrate_storage.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) # 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 @@ -7075,19 +6687,19 @@ def _migrate_storage_initial( 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') + 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 [200]: + if response.status_code not in [201, 409]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('StorageMigrationResponse', response) + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -7095,49 +6707,47 @@ def _migrate_storage_initial( 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. + 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. - Description for Restores a web app. + Description for Invoke the MSDeploy web app extension. - :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.v2019_08_01.models.StorageMigrationOptions + :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.v2019_08_01.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 - StorageMigrationResponse or - ClientRawResponse if raw==True + :return: An instance of LROPoller that returns MSDeployStatus or + ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.v2019_08_01.models.StorageMigrationResponse] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.v2019_08_01.models.MSDeployStatus] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.v2019_08_01.models.StorageMigrationResponse]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.v2019_08_01.models.MSDeployStatus]] :raises: :class:`DefaultErrorResponseException` """ - raw_result = self._migrate_storage_initial( - subscription_name=subscription_name, + raw_result = self._create_instance_ms_deploy_operation_initial( resource_group_name=resource_group_name, name=name, - migration_options=migration_options, + 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('StorageMigrationResponse', response) + deserialized = self._deserialize('MSDeployStatus', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -7152,16 +6762,38 @@ 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_storage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate'} + 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 _migrate_my_sql_initial( - self, resource_group_name, name, migration_request_envelope, custom_headers=None, raw=False, **operation_config): + Description for 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 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.v2019_08_01.models.MSDeployLog or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ # Construct URL - url = self.migrate_my_sql.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'), + '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) @@ -7173,7 +6805,6 @@ def _migrate_my_sql_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: @@ -7181,112 +6812,142 @@ 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.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, 404]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Operation', response) + deserialized = self._deserialize('MSDeployLog', response) 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'} - 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 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. - Description for Migrates a local (in-app) MySql database to a remote - MySql database. + Description for 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 web app. + :param name: Site name. :type name: str - :param migration_request_envelope: MySql migration options. - :type migration_request_envelope: - ~azure.mgmt.web.v2019_08_01.models.MigrateMySqlRequest + :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: 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 + :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 :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.v2019_08_01.models.Operation] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.v2019_08_01.models.Operation]] + ~azure.mgmt.web.v2019_08_01.models.ProcessInfoPaged[~azure.mgmt.web.v2019_08_01.models.ProcessInfo] :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) + def prepare_request(next_link=None): + 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) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - return deserialized + else: + url = next_link + query_parameters = {} - 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'} + # 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') - 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. + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request - Description for Returns the status of MySql in app migration, if one is - active, and whether or not MySql in app is enabled. + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ProcessInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_instance_processes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes'} + + 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. + + Description for 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 web 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: MigrateMySqlStatus or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.MigrateMySqlStatus or + :return: ProcessInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.ProcessInfo or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_migrate_my_sql_status.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'), + '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) @@ -7309,47 +6970,56 @@ def get_migrate_my_sql_status( 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, 404]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('MigrateMySqlStatus', response) + deserialized = self._deserialize('ProcessInfo', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_migrate_my_sql_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status'} + get_instance_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'} - def get_swift_virtual_network_connection( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Gets a Swift Virtual Network connection. + 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. - Description for Gets a Swift Virtual Network connection. + Description for 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: SwiftVirtualNetwork or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.SwiftVirtualNetwork or - ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_swift_virtual_network_connection.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') } url = self._client.format_url(url, **path_format_arguments) @@ -7360,7 +7030,6 @@ def get_swift_virtual_network_connection( # 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: @@ -7369,61 +7038,58 @@ def get_swift_virtual_network_connection( 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]: + if response.status_code not in [204, 404]: raise models.DefaultErrorResponseException(self._deserialize, response) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('SwiftVirtualNetwork', 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 - get_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} - - 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 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. - Description for 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. + Description for 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 connection_envelope: Properties of the Virtual Network - connection. See example. - :type connection_envelope: - ~azure.mgmt.web.v2019_08_01.models.SwiftVirtualNetwork + :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: SwiftVirtualNetwork or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.SwiftVirtualNetwork or - ~msrest.pipeline.ClientRawResponse + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.create_or_update_swift_virtual_network_connection.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') } url = self._client.format_url(url, **path_format_arguments) @@ -7435,7 +7101,6 @@ def create_or_update_swift_virtual_network_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: @@ -7443,122 +7108,146 @@ def create_or_update_swift_virtual_network_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, 'SwiftVirtualNetwork') - # 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]: + if response.status_code not in [200, 404]: raise models.DefaultErrorResponseException(self._deserialize, response) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('SwiftVirtualNetwork', 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_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} + get_instance_process_dump.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump'} - 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 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. - Description for Deletes a Swift Virtual Network connection from an app - (or deployment slot). + Description for 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 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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: An iterator like instance of ProcessModuleInfo + :rtype: + ~azure.mgmt.web.v2019_08_01.models.ProcessModuleInfoPaged[~azure.mgmt.web.v2019_08_01.models.ProcessModuleInfo] :raises: :class:`DefaultErrorResponseException` """ - # Construct 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'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) + def prepare_request(next_link=None): + if not next_link: + # Construct 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') + } + 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]: - raise models.DefaultErrorResponseException(self._deserialize, response) + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request - if raw: - 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'} + def internal_paging(next_link=None): + request = prepare_request(next_link) - 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. + response = self._client.send(request, stream=False, **operation_config) - Description for 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. + if response.status_code not in [200, 404]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ProcessModuleInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_instance_process_modules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules'} + + 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. + + Description for 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 connection_envelope: Properties of the Virtual Network - connection. See example. - :type connection_envelope: - ~azure.mgmt.web.v2019_08_01.models.SwiftVirtualNetwork + :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: SwiftVirtualNetwork or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.SwiftVirtualNetwork or + :return: ProcessModuleInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.ProcessModuleInfo or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.update_swift_virtual_network_connection.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') } url = self._client.format_url(url, **path_format_arguments) @@ -7570,7 +7259,6 @@ def update_swift_virtual_network_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: @@ -7578,128 +7266,137 @@ def update_swift_virtual_network_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, '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]: + if response.status_code not in [200, 404]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SwiftVirtualNetwork', response) + deserialized = self._deserialize('ProcessModuleInfo', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} + get_instance_process_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'} - 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 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. - Description for Gets all network features used by the app (or - deployment slot, if specified). + Description for 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 view: The type of view. This can either be "summary" or - "detailed". - :type view: 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: NetworkFeatures or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.NetworkFeatures or - ~msrest.pipeline.ClientRawResponse + :return: An iterator like instance of ProcessThreadInfo + :rtype: + ~azure.mgmt.web.v2019_08_01.models.ProcessThreadInfoPaged[~azure.mgmt.web.v2019_08_01.models.ProcessThreadInfo] :raises: :class:`DefaultErrorResponseException` """ - # 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) + def prepare_request(next_link=None): + 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 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') + else: + url = next_link + query_parameters = {} - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - if response.status_code not in [200, 404]: - raise models.DefaultErrorResponseException(self._deserialize, response) + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('NetworkFeatures', response) + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + # Deserialize response + header_dict = None if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + header_dict = {} + deserialized = models.ProcessThreadInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_network_features.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}'} + list_instance_process_threads.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads'} - 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 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. - Description for Gets a named operation for a network trace capturing - (or deployment slot, if specified). + Description for 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 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.v2019_08_01.models.NetworkTrace] or + :return: SiteCloneability or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.SiteCloneability or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_network_trace_operation.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'), - '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) @@ -7719,73 +7416,134 @@ def get_network_trace_operation( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 202]: + if response.status_code not in [200]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('[NetworkTrace]', response) - if response.status_code == 202: - deserialized = self._deserialize('[NetworkTrace]', response) + deserialized = self._deserialize('SiteCloneability', 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}'} + is_cloneable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable'} - def start_web_site_network_trace( - self, resource_group_name, name, duration_in_seconds=None, max_frame_length=None, sas_url=None, custom_headers=None, raw=False, **operation_config): - """Start capturing network packets for the site (To be deprecated). + def list_site_backups( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets existing backups of an app. - Description for Start capturing network packets for the site (To be - deprecated). + Description for Gets existing backups 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 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: An iterator like instance of BackupItem + :rtype: + ~azure.mgmt.web.v2019_08_01.models.BackupItemPaged[~azure.mgmt.web.v2019_08_01.models.BackupItem] :raises: :class:`DefaultErrorResponseException` """ - # 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 prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_site_backups.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 parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - # Construct headers + 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.post(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.BackupItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_site_backups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listbackups'} + + 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. + + Description for This is to allow calling via powershell and ARM + template. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param 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.v2019_08_01.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: @@ -7804,20 +7562,20 @@ def start_web_site_network_trace( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('str', response) + deserialized = self._deserialize('FunctionSecrets', 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'} + list_sync_function_triggers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus'} - 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): + def _migrate_storage_initial( + self, subscription_name, resource_group_name, name, migration_options, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.start_web_site_network_trace_operation.metadata['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'), @@ -7827,17 +7585,13 @@ def _start_web_site_network_trace_operation_initial( # Construct parameters query_parameters = {} - if duration_in_seconds is not None: - query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') - if max_frame_length is not None: - query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') - if sas_url is not None: - query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['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: @@ -7845,19 +7599,20 @@ def _start_web_site_network_trace_operation_initial( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + # Construct body + body_content = self._serialize.body(migration_options, 'StorageMigrationOptions') + # 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, 202]: + if response.status_code not in [200]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('[NetworkTrace]', response) - if response.status_code == 202: - deserialized = self._deserialize('[NetworkTrace]', response) + deserialized = self._deserialize('StorageMigrationResponse', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -7865,50 +7620,49 @@ def _start_web_site_network_trace_operation_initial( return deserialized - 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. + 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. - Description for Start capturing network packets for the site. + Description for 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: The name of the web app. + :param name: Name of 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 migration_options: Migration migrationOptions. + :type migration_options: + ~azure.mgmt.web.v2019_08_01.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 list or - ClientRawResponse if raw==True + :return: An instance of LROPoller that returns + StorageMigrationResponse or + ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[list[~azure.mgmt.web.v2019_08_01.models.NetworkTrace]] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.v2019_08_01.models.StorageMigrationResponse] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[list[~azure.mgmt.web.v2019_08_01.models.NetworkTrace]]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.v2019_08_01.models.StorageMigrationResponse]] :raises: :class:`DefaultErrorResponseException` """ - raw_result = self._start_web_site_network_trace_operation_initial( + raw_result = self._migrate_storage_initial( + subscription_name=subscription_name, resource_group_name=resource_group_name, name=name, - duration_in_seconds=duration_in_seconds, - max_frame_length=max_frame_length, - sas_url=sas_url, + migration_options=migration_options, custom_headers=custom_headers, raw=True, **operation_config ) def get_long_running_output(response): - deserialized = self._deserialize('[NetworkTrace]', response) + deserialized = self._deserialize('StorageMigrationResponse', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -7923,95 +7677,16 @@ 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) - start_web_site_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation'} - - def stop_web_site_network_trace( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Stop ongoing capturing network packets for the site. - - Description for 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:`DefaultErrorResponseException` - """ - # Construct 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'), - '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]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - if raw: - 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'} - - 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). + migrate_storage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate'} - Description for 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.v2019_08_01.models.NetworkTrace] or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` - """ + 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_network_traces.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'), - '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) @@ -8023,6 +7698,7 @@ def get_network_traces( # 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: @@ -8030,56 +7706,112 @@ def get_network_traces( 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]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None + if response.status_code == 200: - deserialized = self._deserialize('[NetworkTrace]', response) + deserialized = self._deserialize('Operation', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_network_traces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}'} - def get_network_trace_operation_v2( - self, resource_group_name, name, operation_id, custom_headers=None, raw=False, **operation_config): - """Gets a named operation for a network trace capturing (or deployment - slot, if specified). + def 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. - Description for Gets a named operation for a network trace capturing - (or deployment slot, if specified). + Description for 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: Name of the app. + :param name: Name of web 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 + :param migration_request_envelope: MySql migration options. + :type migration_request_envelope: + ~azure.mgmt.web.v2019_08_01.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.v2019_08_01.models.Operation] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.v2019_08_01.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. + + Description for 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 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.v2019_08_01.models.NetworkTrace] or + :return: MigrateMySqlStatus or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.MigrateMySqlStatus or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_network_trace_operation_v2.metadata['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'), - '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) @@ -8102,54 +7834,47 @@ def get_network_trace_operation_v2( 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, 202]: + if response.status_code not in [200]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('[NetworkTrace]', response) - if response.status_code == 202: - deserialized = self._deserialize('[NetworkTrace]', response) + deserialized = self._deserialize('MigrateMySqlStatus', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_network_trace_operation_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}'} + get_migrate_my_sql_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status'} - 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). + def get_swift_virtual_network_connection( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets a Swift Virtual Network connection. - Description for Gets a named operation for a network trace capturing - (or deployment slot, if specified). + Description for Gets a Swift Virtual Network connection. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param name: Name of the app. :type name: str - :param 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.v2019_08_01.models.NetworkTrace] or + :return: SwiftVirtualNetwork or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.SwiftVirtualNetwork or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_network_traces_v2.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'), - '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) @@ -8177,40 +7902,50 @@ def get_network_traces_v2( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('[NetworkTrace]', response) + deserialized = self._deserialize('SwiftVirtualNetwork', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_network_traces_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}'} + get_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} - def generate_new_site_publishing_password( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Generates a new publishing password for an app (or deployment slot, if - specified). + 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. - Description for Generates a new publishing password for an app (or - deployment slot, if specified). + Description for 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.v2019_08_01.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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: SwiftVirtualNetwork or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.SwiftVirtualNetwork or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.generate_new_site_publishing_password.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'), @@ -8224,6 +7959,8 @@ def generate_new_site_publishing_password( # 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: @@ -8231,123 +7968,52 @@ def generate_new_site_publishing_password( 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, 204]: + if response.status_code not in [200]: raise models.DefaultErrorResponseException(self._deserialize, response) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - generate_new_site_publishing_password.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword'} - - def list_perf_mon_counters( - self, resource_group_name, name, filter=None, custom_headers=None, raw=False, **operation_config): - """Gets perfmon counters for web app. - - Description for Gets perfmon counters for web app. - - :param resource_group_name: Name of the resource group to which the - resource belongs. - :type resource_group_name: str - :param name: Name of web app. - :type name: str - :param filter: Return only usages/metrics specified in the filter. - Filter conforms to odata syntax. Example: $filter=(startTime eq - 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain - eq duration'[Hour|Minute|Day]'. - :type filter: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of PerfMonResponse - :rtype: - ~azure.mgmt.web.v2019_08_01.models.PerfMonResponsePaged[~azure.mgmt.web.v2019_08_01.models.PerfMonResponse] - :raises: - :class:`DefaultErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_perf_mon_counters.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), - 'name': self._serialize.url("name", name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - return response + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SwiftVirtualNetwork', response) - # Deserialize response - header_dict = None if raw: - header_dict = {} - deserialized = models.PerfMonResponsePaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response return deserialized - list_perf_mon_counters.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters'} + create_or_update_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} - def get_site_php_error_log_flag( + def delete_swift_virtual_network( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Gets web app's event logs. + """Deletes a Swift Virtual Network connection from an app (or deployment + slot). - Description for Gets web app's event logs. + Description for 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: Name of web app. + :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: SitePhpErrorLogFlag or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.SitePhpErrorLogFlag or - ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_site_php_error_log_flag.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'), @@ -8361,7 +8027,6 @@ def get_site_php_error_log_flag( # 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: @@ -8370,47 +8035,52 @@ def get_site_php_error_log_flag( 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]: + if response.status_code not in [200, 404]: raise models.DefaultErrorResponseException(self._deserialize, response) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('SitePhpErrorLogFlag', response) - 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 - get_site_php_error_log_flag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging'} - - def list_premier_add_ons( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Gets the premier add-ons of an app. + def 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. - Description for Gets the premier add-ons of an app. + Description for 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.v2019_08_01.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: PremierAddOn or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.PremierAddOn or + :return: SwiftVirtualNetwork or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.SwiftVirtualNetwork or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.list_premier_add_ons.metadata['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'), @@ -8425,6 +8095,7 @@ def list_premier_add_ons( # 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: @@ -8432,8 +8103,11 @@ def list_premier_add_ons( 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]: @@ -8441,45 +8115,48 @@ def list_premier_add_ons( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('PremierAddOn', response) + deserialized = self._deserialize('SwiftVirtualNetwork', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_premier_add_ons.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons'} + update_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} - def get_premier_add_on( - self, resource_group_name, name, premier_add_on_name, custom_headers=None, raw=False, **operation_config): - """Gets a named add-on of an app. + def 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). - Description for Gets a named add-on of an app. + Description for 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 premier_add_on_name: Add-on name. - :type premier_add_on_name: str + :param view: The type of view. This can either be "summary" or + "detailed". + :type view: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: PremierAddOn or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.PremierAddOn or + :return: NetworkFeatures or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.NetworkFeatures or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_premier_add_on.metadata['url'] + url = self.list_network_features.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), - 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_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) @@ -8502,53 +8179,52 @@ def get_premier_add_on( 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, 404]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('PremierAddOn', response) + deserialized = self._deserialize('NetworkFeatures', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} + list_network_features.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}'} - def add_premier_add_on( - self, resource_group_name, name, premier_add_on_name, premier_add_on, custom_headers=None, raw=False, **operation_config): - """Updates a named add-on of an app. + def get_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). - Description for Updates a named add-on of an app. + Description for 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 premier_add_on_name: Add-on name. - :type premier_add_on_name: str - :param premier_add_on: A JSON representation of the edited premier - add-on. - :type premier_add_on: ~azure.mgmt.web.v2019_08_01.models.PremierAddOn + :param operation_id: GUID of the operation. + :type operation_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: PremierAddOn or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.PremierAddOn or + :return: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.web.v2019_08_01.models.NetworkTrace] or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.add_premier_add_on.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'), - 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_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) @@ -8560,7 +8236,6 @@ def add_premier_add_on( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -8568,66 +8243,76 @@ def add_premier_add_on( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - # Construct body - body_content = self._serialize.body(premier_add_on, 'PremierAddOn') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('PremierAddOn', 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 - add_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} + get_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}'} - def delete_premier_add_on( - self, resource_group_name, name, premier_add_on_name, custom_headers=None, raw=False, **operation_config): - """Delete a premier add-on from an app. + def 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). - Description for Delete a premier add-on from an app. + Description for 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 premier_add_on_name: Add-on name. - :type premier_add_on_name: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_premier_add_on.metadata['url'] + url = self.start_web_site_network_trace.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), - 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} + 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: @@ -8636,63 +8321,48 @@ def delete_premier_add_on( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) + request = self._client.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('str', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} - def update_premier_add_on( - self, resource_group_name, name, premier_add_on_name, premier_add_on, custom_headers=None, raw=False, **operation_config): - """Updates a named add-on of an app. + return deserialized + start_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start'} - Description for Updates a named add-on of an app. - :param resource_group_name: Name of the resource group to which the - resource belongs. - :type resource_group_name: str - :param name: Name of the app. - :type name: str - :param premier_add_on_name: Add-on name. - :type premier_add_on_name: str - :param premier_add_on: A JSON representation of the edited premier - add-on. - :type premier_add_on: - ~azure.mgmt.web.v2019_08_01.models.PremierAddOnPatchResource - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: PremierAddOn or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.PremierAddOn or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` - """ + def _start_web_site_network_trace_operation_initial( + self, resource_group_name, name, duration_in_seconds=None, max_frame_length=None, sas_url=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.update_premier_add_on.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'), - 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} + 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: @@ -8700,123 +8370,173 @@ def update_premier_add_on( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - # Construct body - body_content = self._serialize.body(premier_add_on, 'PremierAddOnPatchResource') - # 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]: + if response.status_code not in [200, 202]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None + if response.status_code == 200: - deserialized = self._deserialize('PremierAddOn', 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 - update_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} - def get_private_access( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Gets data around private site access enablement and authorized Virtual - Networks that can access the site. + 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. - Description for Gets data around private site access enablement and - authorized Virtual Networks that can access the site. + Description for 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: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: PrivateAccess or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.PrivateAccess or - ~msrest.pipeline.ClientRawResponse + :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.v2019_08_01.models.NetworkTrace]] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[list[~azure.mgmt.web.v2019_08_01.models.NetworkTrace]]] :raises: :class:`DefaultErrorResponseException` """ - # Construct URL - url = self.get_private_access.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) + raw_result = self._start_web_site_network_trace_operation_initial( + resource_group_name=resource_group_name, + name=name, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + custom_headers=custom_headers, + raw=True, + **operation_config + ) - # 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('[NetworkTrace]', 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 raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start_web_site_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation'} + + def stop_web_site_network_trace( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Stop ongoing capturing network packets for the site. + + Description for 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:`DefaultErrorResponseException` + """ + # Construct 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'), + '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.get(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 204]: raise models.DefaultErrorResponseException(self._deserialize, response) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PrivateAccess', response) - 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_private_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'} - - def put_private_access_vnet( - self, resource_group_name, name, access, custom_headers=None, raw=False, **operation_config): - """Sets data around private site access enablement and authorized Virtual - Networks that can access the site. + 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). - Description for Sets data around private site access enablement and - authorized Virtual Networks that can access the site. + Description for 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 access: The information for the private access - :type access: ~azure.mgmt.web.v2019_08_01.models.PrivateAccess + :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: PrivateAccess or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.PrivateAccess or + :return: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.web.v2019_08_01.models.NetworkTrace] or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.put_private_access_vnet.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'), + '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) @@ -8828,7 +8548,6 @@ def put_private_access_vnet( # 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: @@ -8836,11 +8555,8 @@ def put_private_access_vnet( 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(access, 'PrivateAccess') - # 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]: @@ -8848,123 +8564,117 @@ def put_private_access_vnet( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('PrivateAccess', response) + deserialized = self._deserialize('[NetworkTrace]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - put_private_access_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'} + get_network_traces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}'} - def list_processes( - self, resource_group_name, name, 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 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). - Description for Get list of processes for a web site, or a deployment - slot, or for a specific scaled-out instance in a web site. + Description for 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: Site name. + :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: An iterator like instance of ProcessInfo - :rtype: - ~azure.mgmt.web.v2019_08_01.models.ProcessInfoPaged[~azure.mgmt.web.v2019_08_01.models.ProcessInfo] + :return: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.web.v2019_08_01.models.NetworkTrace] or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_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'), - '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.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 and send request - request = self._client.get(url, query_parameters, header_parameters) - return request + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - def internal_paging(next_link=None): - request = prepare_request(next_link) + # 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') - 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]: - raise models.DefaultErrorResponseException(self._deserialize, response) + if response.status_code not in [200, 202]: + raise models.DefaultErrorResponseException(self._deserialize, response) - return response + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', response) + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', response) - # Deserialize response - header_dict = None if raw: - header_dict = {} - deserialized = models.ProcessInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response return deserialized - list_processes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes'} + get_network_trace_operation_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}'} - def get_process( - self, resource_group_name, name, process_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 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). - Description for Get process information by its ID for a specific - scaled-out instance in a web site. + Description for 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: Site name. + :param name: Name of the app. :type name: str - :param process_id: PID. - :type process_id: 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: ProcessInfo or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.ProcessInfo or + :return: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.web.v2019_08_01.models.NetworkTrace] or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_process.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'), - 'processId': self._serialize.url("process_id", process_id, '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) @@ -8987,35 +8697,33 @@ def get_process( 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]: + 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('[NetworkTrace]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'} + get_network_traces_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}'} - def delete_process( - self, resource_group_name, name, process_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 generate_new_site_publishing_password( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Generates a new publishing password for an app (or deployment slot, if + specified). - Description for Terminate a process by its ID for a web site, or a - deployment slot, or specific scaled-out instance in a web site. + Description for Generates a new publishing password for an app (or + deployment slot, if specified). :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str - :param name: Site name. + :param name: Name of the app. :type name: str - :param process_id: PID. - :type process_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 @@ -9027,11 +8735,10 @@ def delete_process( :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_process.metadata['url'] + url = self.generate_new_site_publishing_password.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), - 'processId': self._serialize.url("process_id", process_id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -9050,127 +8757,59 @@ def delete_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.post(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, 204]: raise models.DefaultErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'} - - def get_process_dump( - self, resource_group_name, name, process_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. - - Description for 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: Site name. - :type name: str - :param process_id: PID. - :type process_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:`DefaultErrorResponseException` - """ - # Construct URL - url = self.get_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'), - '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=True, **operation_config) - - if response.status_code not in [200, 404]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - deserialized = self._client.stream_download(response, callback) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_process_dump.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump'} + generate_new_site_publishing_password.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword'} - def list_process_modules( - self, resource_group_name, name, process_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_perf_mon_counters( + self, resource_group_name, name, filter=None, custom_headers=None, raw=False, **operation_config): + """Gets perfmon counters for web app. - Description for List module information for a process by its ID for a - specific scaled-out instance in a web site. + Description for Gets perfmon counters for web app. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str - :param name: Site name. + :param name: Name of web app. :type name: str - :param process_id: PID. - :type process_id: str + :param filter: Return only usages/metrics specified in the filter. + Filter conforms to odata syntax. Example: $filter=(startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain + eq duration'[Hour|Minute|Day]'. + :type filter: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of ProcessModuleInfo + :return: An iterator like instance of PerfMonResponse :rtype: - ~azure.mgmt.web.v2019_08_01.models.ProcessModuleInfoPaged[~azure.mgmt.web.v2019_08_01.models.ProcessModuleInfo] + ~azure.mgmt.web.v2019_08_01.models.PerfMonResponsePaged[~azure.mgmt.web.v2019_08_01.models.PerfMonResponse] :raises: :class:`DefaultErrorResponseException` """ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_process_modules.metadata['url'] + url = self.list_perf_mon_counters.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), - 'processId': self._serialize.url("process_id", process_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 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: @@ -9196,7 +8835,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 404]: + if response.status_code not in [200]: raise models.DefaultErrorResponseException(self._deserialize, response) return response @@ -9205,46 +8844,38 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.ProcessModuleInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.PerfMonResponsePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_process_modules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules'} + list_perf_mon_counters.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters'} - def get_process_module( - self, resource_group_name, name, process_id, base_address, custom_headers=None, raw=False, **operation_config): - """Get process information by its ID for a specific scaled-out instance in - a web site. + def get_site_php_error_log_flag( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets web app's event logs. - Description for Get process information by its ID for a specific - scaled-out instance in a web site. + Description for Gets web app's event logs. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str - :param name: Site name. + :param name: Name of web app. :type name: str - :param process_id: PID. - :type process_id: str - :param base_address: Module base address. - :type base_address: 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.v2019_08_01.models.ProcessModuleInfo or + :return: SitePhpErrorLogFlag or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.SitePhpErrorLogFlag or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_process_module.metadata['url'] + url = self.get_site_php_error_log_flag.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), - 'processId': self._serialize.url("process_id", process_id, 'str'), - 'baseAddress': self._serialize.url("base_address", base_address, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -9267,206 +8898,113 @@ def get_process_module( 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]: + 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('SitePhpErrorLogFlag', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_process_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}'} + get_site_php_error_log_flag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging'} - def list_process_threads( - self, resource_group_name, name, process_id, custom_headers=None, raw=False, **operation_config): - """List the threads in a process by its ID for a specific scaled-out - instance in a web site. + def list_premier_add_ons( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets the premier add-ons of an app. - Description for List the threads in a process by its ID for a specific - scaled-out instance in a web site. + Description for Gets the premier add-ons of an app. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str - :param name: Site name. + :param name: Name of the app. :type name: str - :param process_id: PID. - :type process_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.v2019_08_01.models.ProcessThreadInfoPaged[~azure.mgmt.web.v2019_08_01.models.ProcessThreadInfo] + :return: PremierAddOn or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.PremierAddOn or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_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'), - '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.list_premier_add_ons.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + '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) - return request + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - def internal_paging(next_link=None): - request = prepare_request(next_link) + # 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') - 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]: - raise models.DefaultErrorResponseException(self._deserialize, response) + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) - return response + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PremierAddOn', response) - # Deserialize response - header_dict = None if raw: - header_dict = {} - deserialized = models.ProcessThreadInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response return deserialized - list_process_threads.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads'} + list_premier_add_ons.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons'} - def list_public_certificates( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Get public certificates for an app or a deployment slot. + def get_premier_add_on( + self, resource_group_name, name, premier_add_on_name, custom_headers=None, raw=False, **operation_config): + """Gets a named add-on of an app. - Description for Get public certificates for an app or a deployment - slot. + Description for Gets a named add-on of an app. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param name: Name of the app. :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of PublicCertificate - :rtype: - ~azure.mgmt.web.v2019_08_01.models.PublicCertificatePaged[~azure.mgmt.web.v2019_08_01.models.PublicCertificate] - :raises: - :class:`DefaultErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_public_certificates.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) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - 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 - header_dict = None - if raw: - header_dict = {} - deserialized = models.PublicCertificatePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_public_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates'} - - def get_public_certificate( - self, resource_group_name, name, public_certificate_name, custom_headers=None, raw=False, **operation_config): - """Get the named public certificate for an app (or deployment slot, if - specified). - - Description for Get the named public certificate 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 public_certificate_name: Public certificate name. - :type public_certificate_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: PublicCertificate or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.PublicCertificate or - ~msrest.pipeline.ClientRawResponse + :return: PremierAddOn or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.PremierAddOn or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_public_certificate.metadata['url'] + url = self.get_premier_add_on.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), - 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -9494,49 +9032,48 @@ def get_public_certificate( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('PublicCertificate', response) + deserialized = self._deserialize('PremierAddOn', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} + get_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} - def create_or_update_public_certificate( - self, resource_group_name, name, public_certificate_name, public_certificate, custom_headers=None, raw=False, **operation_config): - """Creates a hostname binding for an app. + def add_premier_add_on( + self, resource_group_name, name, premier_add_on_name, premier_add_on, custom_headers=None, raw=False, **operation_config): + """Updates a named add-on of an app. - Description for Creates a hostname binding for an app. + Description for Updates a named add-on of an app. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param name: Name of the app. :type name: str - :param public_certificate_name: Public certificate name. - :type public_certificate_name: str - :param public_certificate: Public certificate details. This is the - JSON representation of a PublicCertificate object. - :type public_certificate: - ~azure.mgmt.web.v2019_08_01.models.PublicCertificate + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param premier_add_on: A JSON representation of the edited premier + add-on. + :type premier_add_on: ~azure.mgmt.web.v2019_08_01.models.PremierAddOn :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: PublicCertificate or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.PublicCertificate or + :return: PremierAddOn or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.PremierAddOn or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.create_or_update_public_certificate.metadata['url'] + url = self.add_premier_add_on.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), - 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -9557,7 +9094,7 @@ def create_or_update_public_certificate( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(public_certificate, 'PublicCertificate') + body_content = self._serialize.body(premier_add_on, 'PremierAddOn') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -9568,28 +9105,28 @@ def create_or_update_public_certificate( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('PublicCertificate', response) + deserialized = self._deserialize('PremierAddOn', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} + add_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} - def delete_public_certificate( - self, resource_group_name, name, public_certificate_name, custom_headers=None, raw=False, **operation_config): - """Deletes a hostname binding for an app. + def delete_premier_add_on( + self, resource_group_name, name, premier_add_on_name, custom_headers=None, raw=False, **operation_config): + """Delete a premier add-on from an app. - Description for Deletes a hostname binding for an app. + Description for Delete a premier add-on from an app. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param name: Name of the app. :type name: str - :param public_certificate_name: Public certificate name. - :type public_certificate_name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -9601,11 +9138,11 @@ def delete_public_certificate( :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_public_certificate.metadata['url'] + url = self.delete_premier_add_on.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), - 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -9627,58 +9164,48 @@ def delete_public_certificate( 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]: raise models.DefaultErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} + delete_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} - def list_publishing_profile_xml_with_secrets( - self, resource_group_name, name, format=None, include_disaster_recovery_endpoints=None, custom_headers=None, raw=False, callback=None, **operation_config): - """Gets the publishing profile for an app (or deployment slot, if - specified). + def update_premier_add_on( + self, resource_group_name, name, premier_add_on_name, premier_add_on, custom_headers=None, raw=False, **operation_config): + """Updates a named add-on of an app. - Description for Gets the publishing profile for an app (or deployment - slot, if specified). + Description for Updates a named add-on of an app. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param name: Name of the app. :type name: str - :param format: Name of the format. Valid values are: - FileZilla3 - WebDeploy -- default - Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' - :type format: str or - ~azure.mgmt.web.v2019_08_01.models.PublishingProfileFormat - :param include_disaster_recovery_endpoints: Include the - DisasterRecover endpoint if true - :type include_disaster_recovery_endpoints: bool + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param premier_add_on: A JSON representation of the edited premier + add-on. + :type premier_add_on: + ~azure.mgmt.web.v2019_08_01.models.PremierAddOnPatchResource :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: PremierAddOn or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.PremierAddOn or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ - publishing_profile_options = models.CsmPublishingProfileOptions(format=format, include_disaster_recovery_endpoints=include_disaster_recovery_endpoints) - # Construct URL - url = self.list_publishing_profile_xml_with_secrets.metadata['url'] + url = self.update_premier_add_on.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -9689,7 +9216,7 @@ def list_publishing_profile_xml_with_secrets( # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + 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()) @@ -9699,49 +9226,52 @@ def list_publishing_profile_xml_with_secrets( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(publishing_profile_options, 'CsmPublishingProfileOptions') + body_content = self._serialize.body(premier_add_on, 'PremierAddOnPatchResource') # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=True, **operation_config) + 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) - deserialized = self._client.stream_download(response, callback) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PremierAddOn', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_publishing_profile_xml_with_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml'} + update_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} - def reset_production_slot_config( + def get_private_access( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Resets the configuration settings of the current slot if they were - previously modified by calling the API with POST. + """Gets data around private site access enablement and authorized Virtual + Networks that can access the site. - Description for Resets the configuration settings of the current slot - if they were previously modified by calling the API with POST. + Description for Gets data around private site access enablement and + authorized Virtual Networks that can access the site. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str - :param name: Name of the app. + :param name: The name of the web app. :type name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: PrivateAccess or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.PrivateAccess or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.reset_production_slot_config.metadata['url'] + url = self.get_private_access.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'), @@ -9755,6 +9285,7 @@ def reset_production_slot_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: @@ -9763,48 +9294,51 @@ def reset_production_slot_config( 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) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateAccess', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - reset_production_slot_config.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig'} - def restart( - self, resource_group_name, name, soft_restart=None, synchronous=None, custom_headers=None, raw=False, **operation_config): - """Restarts an app (or deployment slot, if specified). + return deserialized + get_private_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'} - Description for Restarts an app (or deployment slot, if specified). + def put_private_access_vnet( + self, resource_group_name, name, access, custom_headers=None, raw=False, **operation_config): + """Sets data around private site access enablement and authorized Virtual + Networks that can access the site. + + Description for Sets data around private site access enablement and + authorized Virtual Networks that can access 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 soft_restart: Specify true to apply the configuration settings - and restarts the app only if necessary. By default, the API always - restarts and reprovisions the app. - :type soft_restart: bool - :param synchronous: Specify true to block until the app is restarted. - By default, it is set to false, and the API responds immediately - (asynchronous). - :type synchronous: bool + :param access: The information for the private access + :type access: ~azure.mgmt.web.v2019_08_01.models.PrivateAccess :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: PrivateAccess or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.PrivateAccess or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.restart.metadata['url'] + url = self.put_private_access_vnet.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'), @@ -9814,14 +9348,12 @@ def restart( # Construct parameters query_parameters = {} - if soft_restart is not None: - query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') - if synchronous is not None: - query_parameters['synchronous'] = self._serialize.query("synchronous", synchronous, 'bool') 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: @@ -9829,26 +9361,1431 @@ def restart( 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(access, 'PrivateAccess') + # 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]: raise models.DefaultErrorResponseException(self._deserialize, response) - if raw: + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateAccess', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + put_private_access_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'} + + def list_processes( + self, resource_group_name, name, 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. + + Description for 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: 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 ProcessInfo + :rtype: + ~azure.mgmt.web.v2019_08_01.models.ProcessInfoPaged[~azure.mgmt.web.v2019_08_01.models.ProcessInfo] + :raises: + :class:`DefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_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'), + '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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ProcessInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_processes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes'} + + def get_process( + self, resource_group_name, name, process_id, custom_headers=None, raw=False, **operation_config): + """Get process information by its ID for a specific scaled-out instance in + a web site. + + Description for 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: Site name. + :type name: str + :param process_id: PID. + :type process_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: ProcessInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.ProcessInfo or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.get_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'), + '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]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'} + + def delete_process( + self, resource_group_name, name, process_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. + + Description for 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: Site name. + :type name: str + :param process_id: PID. + :type process_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:`DefaultErrorResponseException` + """ + # Construct URL + url = self.delete_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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'} + + def get_process_dump( + self, resource_group_name, name, process_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. + + Description for 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: Site name. + :type name: str + :param process_id: PID. + :type process_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:`DefaultErrorResponseException` + """ + # Construct URL + url = self.get_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'), + '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=True, **operation_config) + + if response.status_code not in [200, 404]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_process_dump.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump'} + + def list_process_modules( + self, resource_group_name, name, process_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. + + Description for 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 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.v2019_08_01.models.ProcessModuleInfoPaged[~azure.mgmt.web.v2019_08_01.models.ProcessModuleInfo] + :raises: + :class:`DefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_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'), + '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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ProcessModuleInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_process_modules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules'} + + def get_process_module( + self, resource_group_name, name, process_id, base_address, custom_headers=None, raw=False, **operation_config): + """Get process information by its ID for a specific scaled-out instance in + a web site. + + Description for 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: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: 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.v2019_08_01.models.ProcessModuleInfo or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.get_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'), + '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]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessModuleInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_process_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}'} + + def list_process_threads( + self, resource_group_name, name, process_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. + + Description for 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 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.v2019_08_01.models.ProcessThreadInfoPaged[~azure.mgmt.web.v2019_08_01.models.ProcessThreadInfo] + :raises: + :class:`DefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_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'), + '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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ProcessThreadInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_process_threads.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads'} + + def list_public_certificates( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Get public certificates for an app or a deployment slot. + + Description for Get public certificates 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 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 PublicCertificate + :rtype: + ~azure.mgmt.web.v2019_08_01.models.PublicCertificatePaged[~azure.mgmt.web.v2019_08_01.models.PublicCertificate] + :raises: + :class:`DefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_public_certificates.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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.PublicCertificatePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_public_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates'} + + def get_public_certificate( + self, resource_group_name, name, public_certificate_name, custom_headers=None, raw=False, **operation_config): + """Get the named public certificate for an app (or deployment slot, if + specified). + + Description for Get the named public certificate 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 public_certificate_name: Public certificate name. + :type public_certificate_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: PublicCertificate or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.PublicCertificate or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.get_public_certificate.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'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_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('PublicCertificate', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} + + def create_or_update_public_certificate( + self, resource_group_name, name, public_certificate_name, public_certificate, custom_headers=None, raw=False, **operation_config): + """Creates a hostname binding for an app. + + Description for 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 public_certificate_name: Public certificate name. + :type public_certificate_name: str + :param public_certificate: Public certificate details. This is the + JSON representation of a PublicCertificate object. + :type public_certificate: + ~azure.mgmt.web.v2019_08_01.models.PublicCertificate + :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: PublicCertificate or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.PublicCertificate or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.create_or_update_public_certificate.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'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_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(public_certificate, 'PublicCertificate') + + # 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('PublicCertificate', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} + + def delete_public_certificate( + self, resource_group_name, name, public_certificate_name, custom_headers=None, raw=False, **operation_config): + """Deletes a hostname binding for an app. + + Description for 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 public_certificate_name: Public certificate name. + :type public_certificate_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:`DefaultErrorResponseException` + """ + # Construct URL + url = self.delete_public_certificate.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'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} + + def list_publishing_profile_xml_with_secrets( + self, resource_group_name, name, format=None, include_disaster_recovery_endpoints=None, custom_headers=None, raw=False, callback=None, **operation_config): + """Gets the publishing profile for an app (or deployment slot, if + specified). + + Description for Gets the publishing profile 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 format: Name of the format. Valid values are: + FileZilla3 + WebDeploy -- default + Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + :type format: str or + ~azure.mgmt.web.v2019_08_01.models.PublishingProfileFormat + :param include_disaster_recovery_endpoints: Include the + DisasterRecover endpoint if true + :type include_disaster_recovery_endpoints: 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 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:`DefaultErrorResponseException` + """ + publishing_profile_options = models.CsmPublishingProfileOptions(format=format, include_disaster_recovery_endpoints=include_disaster_recovery_endpoints) + + # Construct URL + url = self.list_publishing_profile_xml_with_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'), + '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/xml' + 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(publishing_profile_options, 'CsmPublishingProfileOptions') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=True, **operation_config) + + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_publishing_profile_xml_with_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml'} + + def reset_production_slot_config( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Resets the configuration settings of the current slot if they were + previously modified by calling the API with POST. + + Description for Resets the configuration settings of the current slot + if they were previously modified by calling the API with POST. + + :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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.reset_production_slot_config.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]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + reset_production_slot_config.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig'} + + def restart( + self, resource_group_name, name, soft_restart=None, synchronous=None, custom_headers=None, raw=False, **operation_config): + """Restarts an app (or deployment slot, if specified). + + Description for Restarts 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 soft_restart: Specify true to apply the configuration settings + and restarts the app only if necessary. By default, the API always + restarts and reprovisions the app. + :type soft_restart: bool + :param synchronous: Specify true to block until the app is restarted. + By default, it is set to false, and the API responds immediately + (asynchronous). + :type synchronous: 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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.restart.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 soft_restart is not None: + query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') + if synchronous is not None: + query_parameters['synchronous'] = self._serialize.query("synchronous", synchronous, 'bool') + 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]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart'} + + + def _restore_from_backup_blob_initial( + self, resource_group_name, name, request, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.restore_from_backup_blob.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['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, 202]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def restore_from_backup_blob( + self, resource_group_name, name, request, custom_headers=None, raw=False, polling=True, **operation_config): + """Restores an app from a backup blob in Azure Storage. + + Description for Restores an app from a backup blob in Azure Storage. + + :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: Information on restore request . + :type request: ~azure.mgmt.web.v2019_08_01.models.RestoreRequest + :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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`DefaultErrorResponseException` + """ + raw_result = self._restore_from_backup_blob_initial( + resource_group_name=resource_group_name, + name=name, + request=request, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_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) + restore_from_backup_blob.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob'} + + + def _restore_from_deleted_app_initial( + self, resource_group_name, name, restore_request, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.restore_from_deleted_app.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['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(restore_request, 'DeletedAppRestoreRequest') + + # 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, 202]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def restore_from_deleted_app( + self, resource_group_name, name, restore_request, custom_headers=None, raw=False, polling=True, **operation_config): + """Restores a deleted web app to this web app. + + Description for Restores a deleted web app to 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 web app. + :type name: str + :param restore_request: Deleted web app restore information. + :type restore_request: + ~azure.mgmt.web.v2019_08_01.models.DeletedAppRestoreRequest + :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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`DefaultErrorResponseException` + """ + raw_result = self._restore_from_deleted_app_initial( + resource_group_name=resource_group_name, + name=name, + restore_request=restore_request, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_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) + restore_from_deleted_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp'} + + + def _restore_snapshot_initial( + self, resource_group_name, name, restore_request, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.restore_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'), + '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['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(restore_request, 'SnapshotRestoreRequest') + + # 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, 202]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart'} + def restore_snapshot( + self, resource_group_name, name, restore_request, custom_headers=None, raw=False, polling=True, **operation_config): + """Restores a web app from a snapshot. + + Description for Restores a web app from a snapshot. + + :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 restore_request: Snapshot restore settings. Snapshot + information can be obtained by calling GetDeletedSites or + GetSiteSnapshots API. + :type restore_request: + ~azure.mgmt.web.v2019_08_01.models.SnapshotRestoreRequest + :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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`DefaultErrorResponseException` + """ + raw_result = self._restore_snapshot_initial( + resource_group_name=resource_group_name, + name=name, + restore_request=restore_request, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_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) + restore_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot'} + + def list_site_extensions( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Get list of siteextensions for a web site, or a deployment slot. + + Description for Get list of siteextensions 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 SiteExtensionInfo + :rtype: + ~azure.mgmt.web.v2019_08_01.models.SiteExtensionInfoPaged[~azure.mgmt.web.v2019_08_01.models.SiteExtensionInfo] + :raises: + :class:`DefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_site_extensions.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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SiteExtensionInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_site_extensions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions'} + + def get_site_extension( + self, resource_group_name, name, site_extension_id, custom_headers=None, raw=False, **operation_config): + """Get site extension information by its ID for a web site, or a + deployment slot. + + Description for Get site extension information by its ID 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 site_extension_id: Site extension name. + :type site_extension_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: SiteExtensionInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.SiteExtensionInfo or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.get_site_extension.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'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} - def _restore_from_backup_blob_initial( - self, resource_group_name, name, request, custom_headers=None, raw=False, **operation_config): + + def _install_site_extension_initial( + self, resource_group_name, name, site_extension_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.restore_from_backup_blob.metadata['url'] + url = self.install_site_extension.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'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -9859,7 +10796,7 @@ def _restore_from_backup_blob_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -9867,59 +10804,72 @@ def _restore_from_backup_blob_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(request, 'RestoreRequest') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) + request = self._client.put(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 202]: + if response.status_code not in [200, 201, 429]: raise models.DefaultErrorResponseException(self._deserialize, response) + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', response) + if response.status_code == 201: + deserialized = self._deserialize('SiteExtensionInfo', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - def restore_from_backup_blob( - self, resource_group_name, name, request, custom_headers=None, raw=False, polling=True, **operation_config): - """Restores an app from a backup blob in Azure Storage. + return deserialized - Description for Restores an app from a backup blob in Azure Storage. + def install_site_extension( + self, resource_group_name, name, site_extension_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Install site extension on a web site, or a deployment slot. + + Description for Install site extension on 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 request: Information on restore request . - :type request: ~azure.mgmt.web.v2019_08_01.models.RestoreRequest + :param site_extension_id: Site extension name. + :type site_extension_id: 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 None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :return: An instance of LROPoller that returns SiteExtensionInfo or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.v2019_08_01.models.SiteExtensionInfo] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.v2019_08_01.models.SiteExtensionInfo]] :raises: :class:`DefaultErrorResponseException` """ - raw_result = self._restore_from_backup_blob_initial( + raw_result = self._install_site_extension_initial( resource_group_name=resource_group_name, name=name, - request=request, + site_extension_id=site_extension_id, custom_headers=custom_headers, raw=True, **operation_config ) def get_long_running_output(response): + deserialized = self._deserialize('SiteExtensionInfo', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + 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) @@ -9927,16 +10877,38 @@ 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) - restore_from_backup_blob.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob'} + install_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} + def delete_site_extension( + self, resource_group_name, name, site_extension_id, custom_headers=None, raw=False, **operation_config): + """Remove a site extension from a web site, or a deployment slot. - def _restore_from_deleted_app_initial( - self, resource_group_name, name, restore_request, custom_headers=None, raw=False, **operation_config): + Description for Remove a site extension from 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 site_extension_id: Site extension name. + :type site_extension_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:`DefaultErrorResponseException` + """ # Construct URL - url = self.restore_from_deleted_app.metadata['url'] + url = self.delete_site_extension.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'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -9947,7 +10919,6 @@ def _restore_from_deleted_app_initial( # 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: @@ -9955,74 +10926,25 @@ def _restore_from_deleted_app_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(restore_request, 'DeletedAppRestoreRequest') - # Construct and send request - request = self._client.post(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, 202]: + if response.status_code not in [204, 404]: raise models.DefaultErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} - def restore_from_deleted_app( - self, resource_group_name, name, restore_request, custom_headers=None, raw=False, polling=True, **operation_config): - """Restores a deleted web app to this web app. - - Description for Restores a deleted web app to 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 web app. - :type name: str - :param restore_request: Deleted web app restore information. - :type restore_request: - ~azure.mgmt.web.v2019_08_01.models.DeletedAppRestoreRequest - :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 None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`DefaultErrorResponseException` - """ - raw_result = self._restore_from_deleted_app_initial( - resource_group_name=resource_group_name, - name=name, - restore_request=restore_request, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_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) - restore_from_deleted_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp'} + def _copy_production_slot_initial( + self, resource_group_name, name, target_slot, site_config, custom_headers=None, raw=False, **operation_config): + copy_slot_entity = models.CsmCopySlotEntity(target_slot=target_slot, site_config=site_config) - def _restore_snapshot_initial( - self, resource_group_name, name, restore_request, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.restore_snapshot.metadata['url'] + url = self.copy_production_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'), @@ -10045,7 +10967,7 @@ def _restore_snapshot_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(restore_request, 'SnapshotRestoreRequest') + body_content = self._serialize.body(copy_slot_entity, 'CsmCopySlotEntity') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) @@ -10058,22 +10980,27 @@ def _restore_snapshot_initial( client_raw_response = ClientRawResponse(None, response) return client_raw_response - def restore_snapshot( - self, resource_group_name, name, restore_request, custom_headers=None, raw=False, polling=True, **operation_config): - """Restores a web app from a snapshot. + def copy_production_slot( + self, resource_group_name, name, target_slot, site_config, custom_headers=None, raw=False, polling=True, **operation_config): + """Copies a deployment slot to another deployment slot of an app. - Description for Restores a web app from a snapshot. + Description for Copies a deployment slot to another deployment slot 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 web app. + :param name: Name of the app. :type name: str - :param restore_request: Snapshot restore settings. Snapshot - information can be obtained by calling GetDeletedSites or - GetSiteSnapshots API. - :type restore_request: - ~azure.mgmt.web.v2019_08_01.models.SnapshotRestoreRequest + :param target_slot: Destination deployment slot during copy operation. + :type target_slot: str + :param site_config: The site object which will be merged with the + source slot site + to produce new destination slot site object. + null to just copy source slot content. Otherwise a + Site + object with properties to override source slot site. + :type site_config: ~azure.mgmt.web.v2019_08_01.models.SiteConfig :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 @@ -10086,10 +11013,11 @@ def restore_snapshot( :raises: :class:`DefaultErrorResponseException` """ - raw_result = self._restore_snapshot_initial( + raw_result = self._copy_production_slot_initial( resource_group_name=resource_group_name, name=name, - restore_request=restore_request, + target_slot=target_slot, + site_config=site_config, custom_headers=custom_headers, raw=True, **operation_config @@ -10107,35 +11035,34 @@ 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) - restore_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot'} + copy_production_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotcopy'} - def list_site_extensions( + def list_slots( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Get list of siteextensions for a web site, or a deployment slot. + """Gets an app's deployment slots. - Description for Get list of siteextensions for a web site, or a - deployment slot. + Description for Gets an app's deployment slots. :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 SiteExtensionInfo + :return: An iterator like instance of Site :rtype: - ~azure.mgmt.web.v2019_08_01.models.SiteExtensionInfoPaged[~azure.mgmt.web.v2019_08_01.models.SiteExtensionInfo] + ~azure.mgmt.web.v2019_08_01.models.SitePaged[~azure.mgmt.web.v2019_08_01.models.Site] :raises: :class:`DefaultErrorResponseException` """ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_site_extensions.metadata['url'] + url = self.list_slots.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'), @@ -10170,7 +11097,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 404]: + if response.status_code not in [200]: raise models.DefaultErrorResponseException(self._deserialize, response) return response @@ -10179,43 +11106,42 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.SiteExtensionInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.SitePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_site_extensions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions'} + list_slots.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots'} - def get_site_extension( - self, resource_group_name, name, site_extension_id, custom_headers=None, raw=False, **operation_config): - """Get site extension information by its ID for a web site, or a - deployment slot. + def get_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Gets the details of a web, mobile, or API app. - Description for Get site extension information by its ID for a web - site, or a deployment slot. + Description for Gets the details of a web, mobile, or API 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 site_extension_id: Site extension name. - :type site_extension_id: str + :param slot: Name of the deployment slot. By default, this API returns + 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: SiteExtensionInfo or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.SiteExtensionInfo or + :return: Site or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.Site or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_site_extension.metadata['url'] + url = self.get_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'), - 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_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) @@ -10243,24 +11169,24 @@ def get_site_extension( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SiteExtensionInfo', response) + deserialized = self._deserialize('Site', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} + get_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} - def _install_site_extension_initial( - self, resource_group_name, name, site_extension_id, custom_headers=None, raw=False, **operation_config): + def _create_or_update_slot_initial( + self, resource_group_name, name, site_envelope, slot, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.install_site_extension.metadata['url'] + url = self.create_or_update_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'), - 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_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) @@ -10272,6 +11198,7 @@ def _install_site_extension_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: @@ -10279,19 +11206,22 @@ def _install_site_extension_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(site_envelope, 'Site') + # Construct and send request - request = self._client.put(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, 201, 429]: + if response.status_code not in [200, 202]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SiteExtensionInfo', response) - if response.status_code == 201: - deserialized = self._deserialize('SiteExtensionInfo', response) + deserialized = self._deserialize('Site', response) + if response.status_code == 202: + deserialized = self._deserialize('Site', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -10299,45 +11229,52 @@ def _install_site_extension_initial( return deserialized - def install_site_extension( - self, resource_group_name, name, site_extension_id, custom_headers=None, raw=False, polling=True, **operation_config): - """Install site extension on a web site, or a deployment slot. + def create_or_update_slot( + self, resource_group_name, name, site_envelope, slot, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new web, mobile, or API app in an existing resource group, or + updates an existing app. - Description for Install site extension on a web site, or a deployment - slot. + Description for Creates a new web, mobile, or API app in an existing + resource group, or updates an existing 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: Unique name of the app to create or update. To create or + update a deployment slot, use the {slot} parameter. :type name: str - :param site_extension_id: Site extension name. - :type site_extension_id: str + :param site_envelope: A JSON representation of the app properties. See + example. + :type site_envelope: ~azure.mgmt.web.v2019_08_01.models.Site + :param slot: Name of the deployment slot to create or update. By + default, this API attempts to create or modify the production slot. + :type slot: 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 SiteExtensionInfo or - ClientRawResponse if raw==True + :return: An instance of LROPoller that returns Site or + ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.v2019_08_01.models.SiteExtensionInfo] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.v2019_08_01.models.Site] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.v2019_08_01.models.SiteExtensionInfo]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.v2019_08_01.models.Site]] :raises: :class:`DefaultErrorResponseException` """ - raw_result = self._install_site_extension_initial( + raw_result = self._create_or_update_slot_initial( resource_group_name=resource_group_name, name=name, - site_extension_id=site_extension_id, + site_envelope=site_envelope, + slot=slot, custom_headers=custom_headers, raw=True, **operation_config ) def get_long_running_output(response): - deserialized = self._deserialize('SiteExtensionInfo', response) + deserialized = self._deserialize('Site', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -10352,22 +11289,29 @@ 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) - install_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} + create_or_update_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} - def delete_site_extension( - self, resource_group_name, name, site_extension_id, custom_headers=None, raw=False, **operation_config): - """Remove a site extension from a web site, or a deployment slot. + def delete_slot( + self, resource_group_name, name, slot, delete_metrics=None, delete_empty_server_farm=None, custom_headers=None, raw=False, **operation_config): + """Deletes a web, mobile, or API app, or one of the deployment slots. - Description for Remove a site extension from a web site, or a - deployment slot. + Description for Deletes a web, mobile, or API app, or one of the + deployment slots. :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 to delete. :type name: str - :param site_extension_id: Site extension name. - :type site_extension_id: str + :param slot: Name of the deployment slot to delete. By default, the + API deletes the production slot. + :type slot: str + :param delete_metrics: If true, web app metrics are also deleted. + :type delete_metrics: bool + :param delete_empty_server_farm: Specify true if the App Service plan + will be empty after app deletion and you want to delete the empty App + Service plan. By default, the empty App Service plan is not deleted. + :type delete_empty_server_farm: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -10379,17 +11323,21 @@ def delete_site_extension( :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_site_extension.metadata['url'] + url = self.delete_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'), - 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_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 = {} + if delete_metrics is not None: + query_parameters['deleteMetrics'] = self._serialize.query("delete_metrics", delete_metrics, 'bool') + if delete_empty_server_farm is not None: + query_parameters['deleteEmptyServerFarm'] = self._serialize.query("delete_empty_server_farm", delete_empty_server_farm, 'bool') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers @@ -10405,24 +11353,52 @@ def delete_site_extension( 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, 204, 404]: raise models.DefaultErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} + delete_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} + def update_slot( + self, resource_group_name, name, site_envelope, slot, custom_headers=None, raw=False, **operation_config): + """Creates a new web, mobile, or API app in an existing resource group, or + updates an existing app. - def _copy_production_slot_initial( - self, resource_group_name, name, target_slot, site_config, custom_headers=None, raw=False, **operation_config): - copy_slot_entity = models.CsmCopySlotEntity(target_slot=target_slot, site_config=site_config) + Description for Creates a new web, mobile, or API app in an existing + resource group, or updates an existing app. + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or + update a deployment slot, use the {slot} parameter. + :type name: str + :param site_envelope: A JSON representation of the app properties. See + example. + :type site_envelope: + ~azure.mgmt.web.v2019_08_01.models.SitePatchResource + :param slot: Name of the deployment slot to create or update. By + default, this API attempts to create or modify 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: Site or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.Site or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ # Construct URL - url = self.copy_production_slot.metadata['url'] + url = self.update_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) @@ -10433,6 +11409,7 @@ def _copy_production_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()) @@ -10442,177 +11419,135 @@ def _copy_production_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(copy_slot_entity, 'CsmCopySlotEntity') + body_content = self._serialize.body(site_envelope, 'SitePatchResource') # Construct and send request - request = self._client.post(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, 202]: raise models.DefaultErrorResponseException(self._deserialize, response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Site', response) + if response.status_code == 202: + deserialized = self._deserialize('Site', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - def copy_production_slot( - self, resource_group_name, name, target_slot, site_config, custom_headers=None, raw=False, polling=True, **operation_config): - """Copies a deployment slot to another deployment slot of an app. - - Description for Copies a deployment slot to another deployment slot 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 target_slot: Destination deployment slot during copy operation. - :type target_slot: str - :param site_config: The site object which will be merged with the - source slot site - to produce new destination slot site object. - null to just copy source slot content. Otherwise a - Site - object with properties to override source slot site. - :type site_config: ~azure.mgmt.web.v2019_08_01.models.SiteConfig - :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 None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`DefaultErrorResponseException` - """ - raw_result = self._copy_production_slot_initial( - resource_group_name=resource_group_name, - name=name, - target_slot=target_slot, - site_config=site_config, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_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) - copy_production_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotcopy'} + return deserialized + update_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} - def list_slots( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Gets an app's deployment slots. + def analyze_custom_hostname_slot( + self, resource_group_name, name, slot, host_name=None, custom_headers=None, raw=False, **operation_config): + """Analyze a custom hostname. - Description for Gets an app's deployment slots. + Description for Analyze a custom hostname. :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 slot: Name of web app slot. If not specified then will default + to production slot. + :type slot: str + :param host_name: Custom hostname. + :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: An iterator like instance of Site - :rtype: - ~azure.mgmt.web.v2019_08_01.models.SitePaged[~azure.mgmt.web.v2019_08_01.models.Site] - :raises: - :class:`DefaultErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_slots.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') + :return: CustomHostnameAnalysisResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.web.v2019_08_01.models.CustomHostnameAnalysisResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.analyze_custom_hostname_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) - return request + # Construct parameters + query_parameters = {} + if host_name is not None: + query_parameters['hostName'] = self._serialize.query("host_name", host_name, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - def internal_paging(next_link=None): - request = prepare_request(next_link) + # 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') - 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 + if response.status_code == 200: + deserialized = self._deserialize('CustomHostnameAnalysisResult', response) - # Deserialize response - header_dict = None if raw: - header_dict = {} - deserialized = models.SitePaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response return deserialized - list_slots.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots'} + analyze_custom_hostname_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/analyzeCustomHostname'} - def get_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Gets the details of a web, mobile, or API app. + def apply_slot_configuration_slot( + self, resource_group_name, name, slot, target_slot, preserve_vnet, custom_headers=None, raw=False, **operation_config): + """Applies the configuration settings from the target slot onto the + current slot. - Description for Gets the details of a web, mobile, or API app. + Description for Applies the configuration settings from the target slot + onto the current 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 slot: Name of the deployment slot. By default, this API returns - the production slot. + :param slot: Name of the source slot. If a slot is not specified, the + production slot is used as the source slot. :type slot: str + :param target_slot: Destination deployment slot during swap operation. + :type target_slot: str + :param preserve_vnet: true to preserve Virtual Network to + the slot during swap; otherwise, false. + :type preserve_vnet: 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: Site or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.Site or - ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ + slot_swap_entity = models.CsmSlotEntity(target_slot=target_slot, preserve_vnet=preserve_vnet) + # Construct URL - url = self.get_slot.metadata['url'] + url = self.apply_slot_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'), @@ -10627,7 +11562,7 @@ def get_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: @@ -10635,29 +11570,51 @@ def get_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(slot_swap_entity, 'CsmSlotEntity') + # 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]: + if response.status_code not in [200]: raise models.DefaultErrorResponseException(self._deserialize, response) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Site', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + apply_slot_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig'} - return deserialized - get_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} + def backup_slot( + self, resource_group_name, name, request, slot, custom_headers=None, raw=False, **operation_config): + """Creates a backup of an app. + Description for Creates a backup of an app. - def _create_or_update_slot_initial( - self, resource_group_name, name, site_envelope, slot, custom_headers=None, raw=False, **operation_config): + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: Backup configuration. You can use the JSON response + from the POST action as input here. + :type request: ~azure.mgmt.web.v2019_08_01.models.BackupRequest + :param slot: Name of the deployment slot. If a slot is not specified, + the API will create a backup 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: BackupItem or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.BackupItem or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ # Construct URL - url = self.create_or_update_slot.metadata['url'] + url = self.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'), @@ -10682,126 +11639,137 @@ def _create_or_update_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(site_envelope, 'Site') + body_content = self._serialize.body(request, 'BackupRequest') # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + 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, 202]: + if response.status_code not in [200]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Site', response) - if response.status_code == 202: - deserialized = self._deserialize('Site', response) + deserialized = self._deserialize('BackupItem', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized + backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup'} - def create_or_update_slot( - self, resource_group_name, name, site_envelope, slot, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates a new web, mobile, or API app in an existing resource group, or - updates an existing app. + def list_backups_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Gets existing backups of an app. - Description for Creates a new web, mobile, or API app in an existing - resource group, or updates an existing app. + Description for Gets existing backups of an app. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str - :param name: Unique name of the app to create or update. To create or - update a deployment slot, use the {slot} parameter. + :param name: Name of the app. :type name: str - :param site_envelope: A JSON representation of the app properties. See - example. - :type site_envelope: ~azure.mgmt.web.v2019_08_01.models.Site - :param slot: Name of the deployment slot to create or update. By - default, this API attempts to create or modify the production slot. + :param slot: Name of the deployment slot. If a slot is not specified, + the API will get backups of the production slot. :type slot: 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 Site or - ClientRawResponse if raw==True + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of BackupItem :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.v2019_08_01.models.Site] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.v2019_08_01.models.Site]] + ~azure.mgmt.web.v2019_08_01.models.BackupItemPaged[~azure.mgmt.web.v2019_08_01.models.BackupItem] :raises: :class:`DefaultErrorResponseException` """ - raw_result = self._create_or_update_slot_initial( - resource_group_name=resource_group_name, - name=name, - site_envelope=site_envelope, - slot=slot, - custom_headers=custom_headers, - raw=True, - **operation_config - ) + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_backups_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 get_long_running_output(response): - deserialized = self._deserialize('Site', 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 + else: + url = next_link + query_parameters = {} - return deserialized + # 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') - 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_or_update_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request - def delete_slot( - self, resource_group_name, name, slot, delete_metrics=None, delete_empty_server_farm=None, custom_headers=None, raw=False, **operation_config): - """Deletes a web, mobile, or API app, or one of the deployment slots. + def internal_paging(next_link=None): + request = prepare_request(next_link) - Description for Deletes a web, mobile, or API app, or one of the - deployment slots. + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.BackupItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_backups_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups'} + + def get_backup_status_slot( + self, resource_group_name, name, backup_id, slot, custom_headers=None, raw=False, **operation_config): + """Gets a backup of an app by its ID. + + Description for Gets a backup of an app by its ID. :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 to delete. + :param name: Name of the app. :type name: str - :param slot: Name of the deployment slot to delete. By default, the - API deletes the production slot. + :param backup_id: ID of the backup. + :type backup_id: str + :param slot: Name of the deployment slot. If a slot is not specified, + the API will get a backup of the production slot. :type slot: str - :param delete_metrics: If true, web app metrics are also deleted. - :type delete_metrics: bool - :param delete_empty_server_farm: Specify true if the App Service plan - will be empty after app deletion and you want to delete the empty App - Service plan. By default, the empty App Service plan is not deleted. - :type delete_empty_server_farm: 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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: BackupItem or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.BackupItem or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_slot.metadata['url'] + url = self.get_backup_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'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -10809,14 +11777,11 @@ def delete_slot( # Construct parameters query_parameters = {} - if delete_metrics is not None: - query_parameters['deleteMetrics'] = self._serialize.query("delete_metrics", delete_metrics, 'bool') - if delete_empty_server_farm is not None: - query_parameters['deleteEmptyServerFarm'] = self._serialize.query("delete_empty_server_farm", delete_empty_server_farm, 'bool') 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: @@ -10825,54 +11790,55 @@ def delete_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, 404]: + if response.status_code not in [200]: raise models.DefaultErrorResponseException(self._deserialize, response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BackupItem', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} - def update_slot( - self, resource_group_name, name, site_envelope, slot, custom_headers=None, raw=False, **operation_config): - """Creates a new web, mobile, or API app in an existing resource group, or - updates an existing app. + return deserialized + get_backup_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}'} - Description for Creates a new web, mobile, or API app in an existing - resource group, or updates an existing app. + def delete_backup_slot( + self, resource_group_name, name, backup_id, slot, custom_headers=None, raw=False, **operation_config): + """Deletes a backup of an app by its ID. + + Description for Deletes a backup of an app by its ID. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str - :param name: Unique name of the app to create or update. To create or - update a deployment slot, use the {slot} parameter. + :param name: Name of the app. :type name: str - :param site_envelope: A JSON representation of the app properties. See - example. - :type site_envelope: - ~azure.mgmt.web.v2019_08_01.models.SitePatchResource - :param slot: Name of the deployment slot to create or update. By - default, this API attempts to create or modify the production slot. + :param backup_id: ID of the backup. + :type backup_id: str + :param slot: Name of the deployment slot. If a slot is not specified, + the API will delete a backup of the production slot. :type slot: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: Site or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.Site or - ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.update_slot.metadata['url'] + url = self.delete_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'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -10884,8 +11850,6 @@ def update_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: @@ -10893,62 +11857,59 @@ def update_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_envelope, 'SitePatchResource') - # 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, 202]: + if response.status_code not in [200, 404]: raise models.DefaultErrorResponseException(self._deserialize, response) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Site', response) - if response.status_code == 202: - deserialized = self._deserialize('Site', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete_backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}'} - return deserialized - update_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} - - def analyze_custom_hostname_slot( - self, resource_group_name, name, slot, host_name=None, custom_headers=None, raw=False, **operation_config): - """Analyze a custom hostname. + def list_backup_status_secrets_slot( + self, resource_group_name, name, backup_id, request, slot, custom_headers=None, raw=False, **operation_config): + """Gets status of a web app backup that may be in progress, including + secrets associated with the backup, such as the Azure Storage SAS URL. + Also can be used to update the SAS URL for the backup if a new URL is + passed in the request body. - Description for Analyze a custom hostname. + Description for Gets status of a web app backup that may be in + progress, including secrets associated with the backup, such as the + Azure Storage SAS URL. Also can be used to update the SAS URL for the + backup if a new URL is passed in the request body. :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 backup_id: ID of backup. + :type backup_id: str + :param request: Information on backup request. + :type request: ~azure.mgmt.web.v2019_08_01.models.BackupRequest :param slot: Name of web app slot. If not specified then will default to production slot. :type slot: str - :param host_name: Custom hostname. - :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: CustomHostnameAnalysisResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.web.v2019_08_01.models.CustomHostnameAnalysisResult or + :return: BackupItem or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.BackupItem or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.analyze_custom_hostname_slot.metadata['url'] + url = self.list_backup_status_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'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -10956,13 +11917,12 @@ def analyze_custom_hostname_slot( # Construct parameters query_parameters = {} - if host_name is not None: - query_parameters['hostName'] = self._serialize.query("host_name", host_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: @@ -10970,8 +11930,11 @@ def analyze_custom_hostname_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, 'BackupRequest') + # 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]: @@ -10979,53 +11942,24 @@ def analyze_custom_hostname_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('CustomHostnameAnalysisResult', response) + deserialized = self._deserialize('BackupItem', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - analyze_custom_hostname_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/analyzeCustomHostname'} - - def apply_slot_configuration_slot( - self, resource_group_name, name, slot, target_slot, preserve_vnet, custom_headers=None, raw=False, **operation_config): - """Applies the configuration settings from the target slot onto the - current slot. - - Description for Applies the configuration settings from the target slot - onto the current slot. + list_backup_status_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list'} - :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 source slot. If a slot is not specified, the - production slot is used as the source slot. - :type slot: str - :param target_slot: Destination deployment slot during swap operation. - :type target_slot: str - :param preserve_vnet: true to preserve Virtual Network to - the slot during swap; otherwise, false. - :type preserve_vnet: 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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` - """ - slot_swap_entity = models.CsmSlotEntity(target_slot=target_slot, preserve_vnet=preserve_vnet) + def _restore_slot_initial( + self, resource_group_name, name, backup_id, request, slot, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.apply_slot_configuration_slot.metadata['url'] + url = self.restore_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'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -11046,99 +11980,81 @@ def apply_slot_configuration_slot( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + 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]: + if response.status_code not in [200, 202]: raise models.DefaultErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - apply_slot_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig'} - def backup_slot( - self, resource_group_name, name, request, slot, custom_headers=None, raw=False, **operation_config): - """Creates a backup of an app. + def restore_slot( + self, resource_group_name, name, backup_id, request, slot, custom_headers=None, raw=False, polling=True, **operation_config): + """Restores a specific backup to another app (or deployment slot, if + specified). - Description for Creates a backup of an app. + Description for Restores a specific backup to another 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 request: Backup configuration. You can use the JSON response - from the POST action as input here. - :type request: ~azure.mgmt.web.v2019_08_01.models.BackupRequest + :param backup_id: ID of the backup. + :type backup_id: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2019_08_01.models.RestoreRequest :param slot: Name of the deployment slot. If a slot is not specified, - the API will create a backup for the production slot. + the API will restore a backup of the production slot. :type slot: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: BackupItem or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.BackupItem or - ~msrest.pipeline.ClientRawResponse + :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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`DefaultErrorResponseException` """ - # Construct URL - url = self.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'), - '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(request, 'BackupRequest') - - # 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('BackupItem', response) + raw_result = self._restore_slot_initial( + resource_group_name=resource_group_name, + name=name, + backup_id=backup_id, + request=request, + slot=slot, + custom_headers=custom_headers, + raw=True, + **operation_config + ) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response - return deserialized - backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup'} + 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) + restore_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore'} - def list_backups_slot( + def list_configurations_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Gets existing backups of an app. + """List the configurations of an app. - Description for Gets existing backups of an app. + Description for List the configurations of an app. :param resource_group_name: Name of the resource group to which the resource belongs. @@ -11146,23 +12062,23 @@ def list_backups_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 backups of 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: An iterator like instance of BackupItem + :return: An iterator like instance of SiteConfigResource :rtype: - ~azure.mgmt.web.v2019_08_01.models.BackupItemPaged[~azure.mgmt.web.v2019_08_01.models.BackupItem] + ~azure.mgmt.web.v2019_08_01.models.SiteConfigResourcePaged[~azure.mgmt.web.v2019_08_01.models.SiteConfigResource] :raises: :class:`DefaultErrorResponseException` """ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_backups_slot.metadata['url'] + url = self.list_configurations_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'), @@ -11207,44 +12123,47 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.BackupItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.SiteConfigResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_backups_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups'} + list_configurations_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config'} - def get_backup_status_slot( - self, resource_group_name, name, backup_id, slot, custom_headers=None, raw=False, **operation_config): - """Gets a backup of an app by its ID. + def update_application_settings_slot( + self, resource_group_name, name, slot, kind=None, properties=None, custom_headers=None, raw=False, **operation_config): + """Replaces the application settings of an app. - Description for Gets a backup of an app by its ID. + Description for Replaces the application settings 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 backup_id: ID of the backup. - :type backup_id: str :param slot: Name of the deployment slot. If a slot is not specified, - the API will get a backup of the production slot. + the API will update the application settings for the production slot. :type slot: str + :param kind: Kind of resource. + :type kind: str + :param properties: Settings. + :type properties: dict[str, 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: BackupItem or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.BackupItem or + :return: StringDictionary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.StringDictionary or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ + app_settings = models.StringDictionary(kind=kind, properties=properties) + # Construct URL - url = self.get_backup_status_slot.metadata['url'] + url = self.update_application_settings_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'), - 'backupId': self._serialize.url("backup_id", backup_id, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -11257,6 +12176,7 @@ def get_backup_status_slot( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -11264,8 +12184,11 @@ def get_backup_status_slot( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + # Construct body + body_content = self._serialize.body(app_settings, 'StringDictionary') + # 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]: @@ -11273,47 +12196,45 @@ def get_backup_status_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('BackupItem', response) + deserialized = self._deserialize('StringDictionary', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_backup_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}'} + update_application_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings'} - def delete_backup_slot( - self, resource_group_name, name, backup_id, slot, custom_headers=None, raw=False, **operation_config): - """Deletes a backup of an app by its ID. + def list_application_settings_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Gets the application settings of an app. - Description for Deletes a backup of an app by its ID. + Description for Gets the application settings 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 backup_id: ID of the backup. - :type backup_id: str :param slot: Name of the deployment slot. If a slot is not specified, - the API will delete a backup of the production slot. + the API will get the application settings 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 + :return: StringDictionary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.StringDictionary or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_backup_slot.metadata['url'] + url = self.list_application_settings_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'), - 'backupId': self._serialize.url("backup_id", backup_id, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -11325,6 +12246,7 @@ def delete_backup_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: @@ -11333,38 +12255,39 @@ def delete_backup_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 [200, 404]: + if response.status_code not in [200]: raise models.DefaultErrorResponseException(self._deserialize, response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StringDictionary', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete_backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}'} - def list_backup_status_secrets_slot( - self, resource_group_name, name, backup_id, request, slot, custom_headers=None, raw=False, **operation_config): - """Gets status of a web app backup that may be in progress, including - secrets associated with the backup, such as the Azure Storage SAS URL. - Also can be used to update the SAS URL for the backup if a new URL is - passed in the request body. + return deserialized + list_application_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list'} - Description for Gets status of a web app backup that may be in - progress, including secrets associated with the backup, such as the - Azure Storage SAS URL. Also can be used to update the SAS URL for the - backup if a new URL is passed in the request body. + def update_auth_settings_slot( + self, resource_group_name, name, site_auth_settings, slot, custom_headers=None, raw=False, **operation_config): + """Updates the Authentication / Authorization settings associated with web + app. + + Description for Updates the Authentication / Authorization settings + 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 web app. :type name: str - :param backup_id: ID of backup. - :type backup_id: str - :param request: Information on backup request. - :type request: ~azure.mgmt.web.v2019_08_01.models.BackupRequest + :param site_auth_settings: Auth settings associated with web app. + :type site_auth_settings: + ~azure.mgmt.web.v2019_08_01.models.SiteAuthSettings :param slot: Name of web app slot. If not specified then will default to production slot. :type slot: str @@ -11373,18 +12296,17 @@ def list_backup_status_secrets_slot( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: BackupItem or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.BackupItem or + :return: SiteAuthSettings or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.SiteAuthSettings or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.list_backup_status_secrets_slot.metadata['url'] + url = self.update_auth_settings_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'), - 'backupId': self._serialize.url("backup_id", backup_id, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -11406,10 +12328,10 @@ def list_backup_status_secrets_slot( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(request, 'BackupRequest') + body_content = self._serialize.body(site_auth_settings, 'SiteAuthSettings') # Construct and send request - request = self._client.post(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]: @@ -11417,119 +12339,21 @@ def list_backup_status_secrets_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('BackupItem', response) + deserialized = self._deserialize('SiteAuthSettings', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_backup_status_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list'} - - - def _restore_slot_initial( - self, resource_group_name, name, backup_id, request, slot, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.restore_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'), - 'backupId': self._serialize.url("backup_id", backup_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['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, 202]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def restore_slot( - self, resource_group_name, name, backup_id, request, slot, custom_headers=None, raw=False, polling=True, **operation_config): - """Restores a specific backup to another app (or deployment slot, if - specified). - - Description for Restores a specific backup to another 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 backup_id: ID of the backup. - :type backup_id: str - :param request: Information on restore request . - :type request: ~azure.mgmt.web.v2019_08_01.models.RestoreRequest - :param slot: Name of the deployment slot. If a slot is not specified, - the API will restore a backup of the production slot. - :type slot: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: 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 None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`DefaultErrorResponseException` - """ - raw_result = self._restore_slot_initial( - resource_group_name=resource_group_name, - name=name, - backup_id=backup_id, - request=request, - slot=slot, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_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) - restore_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore'} + update_auth_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings'} - def list_configurations_slot( + def get_auth_settings_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """List the configurations of an app. + """Gets the Authentication/Authorization settings of an app. - Description for List the configurations of an app. + Description for Gets the Authentication/Authorization settings of an + app. :param resource_group_name: Name of the resource group to which the resource belongs. @@ -11537,77 +12361,67 @@ def list_configurations_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 return configuration for the production slot. + the API will get the settings 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 SiteConfigResource - :rtype: - ~azure.mgmt.web.v2019_08_01.models.SiteConfigResourcePaged[~azure.mgmt.web.v2019_08_01.models.SiteConfigResource] + :return: SiteAuthSettings or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.SiteAuthSettings or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_configurations_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 URL + url = self.get_auth_settings_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) - return request + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - def internal_paging(next_link=None): - request = prepare_request(next_link) + # 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') - response = self._client.send(request, stream=False, **operation_config) + # 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) + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) - return response + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SiteAuthSettings', response) - # Deserialize response - header_dict = None if raw: - header_dict = {} - deserialized = models.SiteConfigResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response return deserialized - list_configurations_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config'} + get_auth_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list'} - def update_application_settings_slot( + def update_azure_storage_accounts_slot( self, resource_group_name, name, slot, kind=None, properties=None, custom_headers=None, raw=False, **operation_config): - """Replaces the application settings of an app. + """Updates the Azure storage account configurations of an app. - Description for Replaces the application settings of an app. + Description for Updates the Azure storage account configurations of an + app. :param resource_group_name: Name of the resource group to which the resource belongs. @@ -11615,27 +12429,31 @@ def update_application_settings_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 update the application settings for the production slot. + the API will update the Azure storage account configurations for the + production slot. :type slot: str :param kind: Kind of resource. :type kind: str - :param properties: Settings. - :type properties: dict[str, str] + :param properties: Azure storage accounts. + :type properties: dict[str, + ~azure.mgmt.web.v2019_08_01.models.AzureStorageInfoValue] :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: StringDictionary or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.StringDictionary or - ~msrest.pipeline.ClientRawResponse + :return: AzureStoragePropertyDictionaryResource or ClientRawResponse + if raw=true + :rtype: + ~azure.mgmt.web.v2019_08_01.models.AzureStoragePropertyDictionaryResource + or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ - app_settings = models.StringDictionary(kind=kind, properties=properties) + azure_storage_accounts = models.AzureStoragePropertyDictionaryResource(kind=kind, properties=properties) # Construct URL - url = self.update_application_settings_slot.metadata['url'] + url = self.update_azure_storage_accounts_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'), @@ -11660,7 +12478,7 @@ def update_application_settings_slot( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content = self._serialize.body(azure_storage_accounts, 'AzureStoragePropertyDictionaryResource') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -11671,20 +12489,21 @@ def update_application_settings_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('StringDictionary', response) + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update_application_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings'} + update_azure_storage_accounts_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts'} - def list_application_settings_slot( + def list_azure_storage_accounts_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Gets the application settings of an app. + """Gets the Azure storage account configurations of an app. - Description for Gets the application settings of an app. + Description for Gets the Azure storage account configurations of an + app. :param resource_group_name: Name of the resource group to which the resource belongs. @@ -11692,21 +12511,24 @@ def list_application_settings_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 the application settings for the production slot. + the API will update the Azure storage account configurations 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: StringDictionary or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.StringDictionary or - ~msrest.pipeline.ClientRawResponse + :return: AzureStoragePropertyDictionaryResource or ClientRawResponse + if raw=true + :rtype: + ~azure.mgmt.web.v2019_08_01.models.AzureStoragePropertyDictionaryResource + or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.list_application_settings_slot.metadata['url'] + url = self.list_azure_storage_accounts_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'), @@ -11738,47 +12560,44 @@ def list_application_settings_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('StringDictionary', response) + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_application_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list'} + list_azure_storage_accounts_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts/list'} - def update_auth_settings_slot( - self, resource_group_name, name, site_auth_settings, slot, custom_headers=None, raw=False, **operation_config): - """Updates the Authentication / Authorization settings associated with web - app. + def update_backup_configuration_slot( + self, resource_group_name, name, request, slot, custom_headers=None, raw=False, **operation_config): + """Updates the backup configuration of an app. - Description for Updates the Authentication / Authorization settings - associated with web app. + Description for Updates the backup 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 web app. + :param name: Name of the app. :type name: str - :param site_auth_settings: Auth settings associated with web app. - :type site_auth_settings: - ~azure.mgmt.web.v2019_08_01.models.SiteAuthSettings - :param slot: Name of web app slot. If not specified then will default - to production slot. + :param request: Edited backup configuration. + :type request: ~azure.mgmt.web.v2019_08_01.models.BackupRequest + :param slot: Name of the deployment slot. If a slot is not specified, + the API will update the backup 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: SiteAuthSettings or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.SiteAuthSettings or + :return: BackupRequest or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.BackupRequest or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.update_auth_settings_slot.metadata['url'] + url = self.update_backup_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'), @@ -11803,7 +12622,7 @@ def update_auth_settings_slot( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(site_auth_settings, 'SiteAuthSettings') + body_content = self._serialize.body(request, 'BackupRequest') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -11814,21 +12633,20 @@ def update_auth_settings_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SiteAuthSettings', response) + deserialized = self._deserialize('BackupRequest', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update_auth_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings'} + update_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup'} - def get_auth_settings_slot( + def delete_backup_configuration_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Gets the Authentication/Authorization settings of an app. + """Deletes the backup configuration of an app. - Description for Gets the Authentication/Authorization settings of an - app. + Description for Deletes the backup configuration of an app. :param resource_group_name: Name of the resource group to which the resource belongs. @@ -11836,21 +12654,80 @@ def get_auth_settings_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 the settings for the production slot. + the API will delete the backup 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: SiteAuthSettings or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.SiteAuthSettings or + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.delete_backup_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'), + '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.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) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup'} + + def get_backup_configuration_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Gets the backup configuration of an app. + + Description for Gets the backup 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 slot: Name of the deployment slot. If a slot is not specified, + the API will get the backup 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: BackupRequest or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.BackupRequest or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_auth_settings_slot.metadata['url'] + url = self.get_backup_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'), @@ -11882,53 +12759,49 @@ def get_auth_settings_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SiteAuthSettings', response) + deserialized = self._deserialize('BackupRequest', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_auth_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list'} + get_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list'} - def update_azure_storage_accounts_slot( + def update_connection_strings_slot( self, resource_group_name, name, slot, kind=None, properties=None, custom_headers=None, raw=False, **operation_config): - """Updates the Azure storage account configurations of an app. + """Replaces the connection strings of an app. - Description for Updates the Azure storage account configurations of an - app. + Description for Replaces the connection strings 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 slot: Name of the deployment slot. If a slot is not specified, - the API will update the Azure storage account configurations for the - production slot. + :param slot: Name of the deployment slot. If a slot is not specified, + the API will update the connection settings for the production slot. :type slot: str :param kind: Kind of resource. :type kind: str - :param properties: Azure storage accounts. + :param properties: Connection strings. :type properties: dict[str, - ~azure.mgmt.web.v2019_08_01.models.AzureStorageInfoValue] + ~azure.mgmt.web.v2019_08_01.models.ConnStringValueTypePair] :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: AzureStoragePropertyDictionaryResource or ClientRawResponse - if raw=true - :rtype: - ~azure.mgmt.web.v2019_08_01.models.AzureStoragePropertyDictionaryResource + :return: ConnectionStringDictionary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.ConnectionStringDictionary or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ - azure_storage_accounts = models.AzureStoragePropertyDictionaryResource(kind=kind, properties=properties) + connection_strings = models.ConnectionStringDictionary(kind=kind, properties=properties) # Construct URL - url = self.update_azure_storage_accounts_slot.metadata['url'] + url = self.update_connection_strings_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'), @@ -11953,7 +12826,7 @@ def update_azure_storage_accounts_slot( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(azure_storage_accounts, 'AzureStoragePropertyDictionaryResource') + body_content = self._serialize.body(connection_strings, 'ConnectionStringDictionary') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -11964,21 +12837,20 @@ def update_azure_storage_accounts_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', response) + deserialized = self._deserialize('ConnectionStringDictionary', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update_azure_storage_accounts_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts'} + update_connection_strings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings'} - def list_azure_storage_accounts_slot( + def list_connection_strings_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Gets the Azure storage account configurations of an app. + """Gets the connection strings of an app. - Description for Gets the Azure storage account configurations of an - app. + Description for Gets the connection strings of an app. :param resource_group_name: Name of the resource group to which the resource belongs. @@ -11986,24 +12858,21 @@ def list_azure_storage_accounts_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 update the Azure storage account configurations for the - production slot. + the API will get the connection settings 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: AzureStoragePropertyDictionaryResource or ClientRawResponse - if raw=true - :rtype: - ~azure.mgmt.web.v2019_08_01.models.AzureStoragePropertyDictionaryResource + :return: ConnectionStringDictionary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.ConnectionStringDictionary or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.list_azure_storage_accounts_slot.metadata['url'] + url = self.list_connection_strings_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'), @@ -12035,44 +12904,42 @@ def list_azure_storage_accounts_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', response) + deserialized = self._deserialize('ConnectionStringDictionary', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_azure_storage_accounts_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts/list'} + list_connection_strings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list'} - def update_backup_configuration_slot( - self, resource_group_name, name, request, slot, custom_headers=None, raw=False, **operation_config): - """Updates the backup configuration of an app. + def get_diagnostic_logs_configuration_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Gets the logging configuration of an app. - Description for Updates the backup configuration of an app. + Description for Gets the logging 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 request: Edited backup configuration. - :type request: ~azure.mgmt.web.v2019_08_01.models.BackupRequest :param slot: Name of the deployment slot. If a slot is not specified, - the API will update the backup configuration for the production slot. + the API will get the logging 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: BackupRequest or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.BackupRequest or + :return: SiteLogsConfig or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.SiteLogsConfig or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.update_backup_configuration_slot.metadata['url'] + url = self.get_diagnostic_logs_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'), @@ -12088,7 +12955,6 @@ def update_backup_configuration_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: @@ -12096,11 +12962,8 @@ def update_backup_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(request, 'BackupRequest') - # 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]: @@ -12108,41 +12971,46 @@ def update_backup_configuration_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('BackupRequest', response) + deserialized = self._deserialize('SiteLogsConfig', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup'} + get_diagnostic_logs_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'} - def delete_backup_configuration_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Deletes the backup configuration of an app. + def update_diagnostic_logs_config_slot( + self, resource_group_name, name, site_logs_config, slot, custom_headers=None, raw=False, **operation_config): + """Updates the logging configuration of an app. - Description for Deletes the backup configuration of an app. + Description for Updates the logging 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_logs_config: A SiteLogsConfig JSON object that contains + the logging configuration to change in the "properties" property. + :type site_logs_config: + ~azure.mgmt.web.v2019_08_01.models.SiteLogsConfig :param slot: Name of the deployment slot. If a slot is not specified, - the API will delete the backup configuration for the production slot. + the API will update the logging 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 + :return: SiteLogsConfig or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.SiteLogsConfig or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_backup_configuration_slot.metadata['url'] + url = self.update_diagnostic_logs_config_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'), @@ -12157,6 +13025,8 @@ def delete_backup_configuration_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: @@ -12164,23 +13034,32 @@ def delete_backup_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_logs_config, 'SiteLogsConfig') + # 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]: raise models.DefaultErrorResponseException(self._deserialize, response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SiteLogsConfig', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup'} - def get_backup_configuration_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Gets the backup configuration of an app. + return deserialized + update_diagnostic_logs_config_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'} - Description for Gets the backup configuration of an app. + def update_metadata_slot( + self, resource_group_name, name, slot, kind=None, properties=None, custom_headers=None, raw=False, **operation_config): + """Replaces the metadata of an app. + + Description for Replaces the metadata of an app. :param resource_group_name: Name of the resource group to which the resource belongs. @@ -12188,21 +13067,27 @@ def get_backup_configuration_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 the backup configuration for the production slot. + the API will update the metadata for the production slot. :type slot: str + :param kind: Kind of resource. + :type kind: str + :param properties: Settings. + :type properties: dict[str, 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: BackupRequest or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.BackupRequest or + :return: StringDictionary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.StringDictionary or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ + metadata = models.StringDictionary(kind=kind, properties=properties) + # Construct URL - url = self.get_backup_configuration_slot.metadata['url'] + url = self.update_metadata_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'), @@ -12218,6 +13103,7 @@ def get_backup_configuration_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: @@ -12225,8 +13111,11 @@ def get_backup_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(metadata, 'StringDictionary') + # 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]: @@ -12234,20 +13123,20 @@ def get_backup_configuration_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('BackupRequest', response) + deserialized = self._deserialize('StringDictionary', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list'} + update_metadata_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata'} - def update_connection_strings_slot( - self, resource_group_name, name, slot, kind=None, properties=None, custom_headers=None, raw=False, **operation_config): - """Replaces the connection strings of an app. + def list_metadata_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Gets the metadata of an app. - Description for Replaces the connection strings of an app. + Description for Gets the metadata of an app. :param resource_group_name: Name of the resource group to which the resource belongs. @@ -12255,28 +13144,21 @@ def update_connection_strings_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 update the connection settings for the production slot. + the API will get the metadata for the production slot. :type slot: str - :param kind: Kind of resource. - :type kind: str - :param properties: Connection strings. - :type properties: dict[str, - ~azure.mgmt.web.v2019_08_01.models.ConnStringValueTypePair] :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: ConnectionStringDictionary or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.ConnectionStringDictionary - or ~msrest.pipeline.ClientRawResponse + :return: StringDictionary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.StringDictionary or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ - connection_strings = models.ConnectionStringDictionary(kind=kind, properties=properties) - # Construct URL - url = self.update_connection_strings_slot.metadata['url'] + url = self.list_metadata_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'), @@ -12292,7 +13174,6 @@ def update_connection_strings_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: @@ -12300,11 +13181,8 @@ def update_connection_strings_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_strings, 'ConnectionStringDictionary') - # 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]: @@ -12312,42 +13190,20 @@ def update_connection_strings_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ConnectionStringDictionary', response) + deserialized = self._deserialize('StringDictionary', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update_connection_strings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings'} - - def list_connection_strings_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Gets the connection strings of an app. + list_metadata_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list'} - Description for Gets the connection strings 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 slot: Name of the deployment slot. If a slot is not specified, - the API will get the connection settings 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: ConnectionStringDictionary or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.ConnectionStringDictionary - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` - """ + def _list_publishing_credentials_slot_initial( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.list_connection_strings_slot.metadata['url'] + url = self.list_publishing_credentials_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'), @@ -12378,43 +13234,100 @@ def list_connection_strings_slot( raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None + if response.status_code == 200: - deserialized = self._deserialize('ConnectionStringDictionary', response) + deserialized = self._deserialize('User', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_connection_strings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list'} - def get_diagnostic_logs_configuration_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Gets the logging configuration of an app. + def list_publishing_credentials_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, polling=True, **operation_config): + """Gets the Git/FTP publishing credentials of an app. + + Description for Gets the Git/FTP publishing credentials 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 slot: Name of the deployment slot. If a slot is not specified, + the API will get the publishing credentials for the production slot. + :type slot: 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 User or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.v2019_08_01.models.User] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.v2019_08_01.models.User]] + :raises: + :class:`DefaultErrorResponseException` + """ + raw_result = self._list_publishing_credentials_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('User', 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) + list_publishing_credentials_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list'} + + def update_site_push_settings_slot( + self, resource_group_name, name, push_settings, slot, custom_headers=None, raw=False, **operation_config): + """Updates the Push settings associated with web app. - Description for Gets the logging configuration of an app. + Description for Updates the Push settings 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. + :param name: Name of web app. :type name: str - :param slot: Name of the deployment slot. If a slot is not specified, - the API will get the logging configuration for the production slot. + :param push_settings: Push settings associated with web app. + :type push_settings: ~azure.mgmt.web.v2019_08_01.models.PushSettings + :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: SiteLogsConfig or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.SiteLogsConfig or + :return: PushSettings or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.PushSettings or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_diagnostic_logs_configuration_slot.metadata['url'] + url = self.update_site_push_settings_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'), @@ -12430,6 +13343,7 @@ def get_diagnostic_logs_configuration_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: @@ -12437,8 +13351,11 @@ def get_diagnostic_logs_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(push_settings, 'PushSettings') + # 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]: @@ -12446,46 +13363,42 @@ def get_diagnostic_logs_configuration_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SiteLogsConfig', response) + deserialized = self._deserialize('PushSettings', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_diagnostic_logs_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'} + update_site_push_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings'} - def update_diagnostic_logs_config_slot( - self, resource_group_name, name, site_logs_config, slot, custom_headers=None, raw=False, **operation_config): - """Updates the logging configuration of an app. + def list_site_push_settings_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Gets the Push settings associated with web app. - Description for Updates the logging configuration of an app. + Description for Gets the Push settings 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. + :param name: Name of web app. :type name: str - :param site_logs_config: A SiteLogsConfig JSON object that contains - the logging configuration to change in the "properties" property. - :type site_logs_config: - ~azure.mgmt.web.v2019_08_01.models.SiteLogsConfig - :param slot: Name of the deployment slot. If a slot is not specified, - the API will update the logging 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 operation_config: :ref:`Operation configuration overrides`. - :return: SiteLogsConfig or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.SiteLogsConfig or + :return: PushSettings or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.PushSettings or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.update_diagnostic_logs_config_slot.metadata['url'] + url = self.list_site_push_settings_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'), @@ -12501,7 +13414,6 @@ def update_diagnostic_logs_config_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: @@ -12509,11 +13421,8 @@ def update_diagnostic_logs_config_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_logs_config, 'SiteLogsConfig') - # 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]: @@ -12521,20 +13430,23 @@ def update_diagnostic_logs_config_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SiteLogsConfig', response) + deserialized = self._deserialize('PushSettings', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update_diagnostic_logs_config_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'} + list_site_push_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings/list'} - def update_metadata_slot( - self, resource_group_name, name, slot, kind=None, properties=None, custom_headers=None, raw=False, **operation_config): - """Replaces the metadata of an app. + 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. - Description for Replaces the metadata of an app. + Description for 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. @@ -12542,27 +13454,21 @@ def update_metadata_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 update the metadata for the production slot. + the API will return configuration for the production slot. :type slot: str - :param kind: Kind of resource. - :type kind: str - :param properties: Settings. - :type properties: dict[str, 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: StringDictionary or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.StringDictionary or + :return: SiteConfigResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.SiteConfigResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ - metadata = models.StringDictionary(kind=kind, properties=properties) - # Construct URL - url = self.update_metadata_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'), @@ -12578,7 +13484,6 @@ def update_metadata_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: @@ -12586,11 +13491,8 @@ def update_metadata_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(metadata, 'StringDictionary') - # 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]: @@ -12598,42 +13500,46 @@ def update_metadata_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('StringDictionary', response) + deserialized = self._deserialize('SiteConfigResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update_metadata_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata'} + get_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} - def list_metadata_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Gets the metadata of an app. + 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. - Description for Gets the metadata of an app. + Description for 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.v2019_08_01.models.SiteConfigResource :param slot: Name of the deployment slot. If a slot is not specified, - the API will get the metadata 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: StringDictionary or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.StringDictionary or + :return: SiteConfigResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.SiteConfigResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.list_metadata_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'), @@ -12649,6 +13555,7 @@ def list_metadata_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: @@ -12656,153 +13563,58 @@ def list_metadata_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 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('StringDictionary', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_metadata_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list'} - - - def _list_publishing_credentials_slot_initial( - self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.list_publishing_credentials_slot.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), - 'name': self._serialize.url("name", name, 'str'), - 'slot': self._serialize.url("slot", slot, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + # Construct body + body_content = self._serialize.body(site_config, 'SiteConfigResource') # 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]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('User', response) + deserialized = self._deserialize('SiteConfigResource', response) 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'} - def list_publishing_credentials_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, polling=True, **operation_config): - """Gets the Git/FTP publishing credentials of an app. + 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. - Description for Gets the Git/FTP publishing credentials of an app. + Description for 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.v2019_08_01.models.SiteConfigResource :param slot: Name of the deployment slot. If a slot is not specified, - the API will get the publishing credentials for the production slot. - :type slot: 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 User or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.v2019_08_01.models.User] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.v2019_08_01.models.User]] - :raises: - :class:`DefaultErrorResponseException` - """ - raw_result = self._list_publishing_credentials_slot_initial( - resource_group_name=resource_group_name, - name=name, - slot=slot, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('User', 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) - list_publishing_credentials_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list'} - - def update_site_push_settings_slot( - self, resource_group_name, name, push_settings, slot, custom_headers=None, raw=False, **operation_config): - """Updates the Push settings associated with web app. - - Description for Updates the Push settings 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 web app. - :type name: str - :param push_settings: Push settings associated with web app. - :type push_settings: ~azure.mgmt.web.v2019_08_01.models.PushSettings - :param slot: Name of web app slot. If not specified then will default - to 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: PushSettings or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.PushSettings or + overrides`. + :return: SiteConfigResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.SiteConfigResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.update_site_push_settings_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'), @@ -12827,10 +13639,10 @@ def update_site_push_settings_slot( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(push_settings, 'PushSettings') + 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.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -12838,45 +13650,131 @@ def update_site_push_settings_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('PushSettings', response) + deserialized = self._deserialize('SiteConfigResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update_site_push_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings'} + update_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} - def list_site_push_settings_slot( + def list_configuration_snapshot_info_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Gets the Push settings associated with web app. + """Gets a list of web app configuration snapshots identifiers. Each + element of the list contains a timestamp and the ID of the snapshot. - Description for Gets the Push settings associated with web app. + Description for 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 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 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: PushSettings or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.PushSettings or + :return: An iterator like instance of SiteConfigurationSnapshotInfo + :rtype: + ~azure.mgmt.web.v2019_08_01.models.SiteConfigurationSnapshotInfoPaged[~azure.mgmt.web.v2019_08_01.models.SiteConfigurationSnapshotInfo] + :raises: + :class:`DefaultErrorResponseException` + """ + def prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.SiteConfigurationSnapshotInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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. + + Description for 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.v2019_08_01.models.SiteConfigResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.list_site_push_settings_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') } @@ -12897,7 +13795,7 @@ def list_site_push_settings_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]: @@ -12905,29 +13803,29 @@ def list_site_push_settings_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('PushSettings', response) + deserialized = self._deserialize('SiteConfigResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_site_push_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings/list'} + 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. - Description for Gets the configuration of an app, such as platform - version and bitness, default documents, virtual applications, Always - On, etc. + Description for 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 @@ -12936,17 +13834,17 @@ def get_configuration_slot( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: SiteConfigResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.SiteConfigResource or - ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # 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') } @@ -12958,7 +13856,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: @@ -12967,54 +13864,47 @@ 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]: + if response.status_code not in [204]: raise models.DefaultErrorResponseException(self._deserialize, response) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('SiteConfigResource', response) - 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. - Description for Updates the configuration of an app. + Description for 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.v2019_08_01.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.v2019_08_01.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'), @@ -13029,8 +13919,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: @@ -13038,58 +13927,55 @@ 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. - Description for Updates the configuration of an app. + Description for 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.v2019_08_01.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.v2019_08_01.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'), @@ -13104,68 +13990,62 @@ 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: 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(site_config, 'SiteConfigResource') + 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_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. - Description for Gets a list of web app configuration snapshots - identifiers. Each element of the list contains a timestamp and the ID - of the snapshot. + Description for 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.v2019_08_01.models.SiteConfigurationSnapshotInfoPaged[~azure.mgmt.web.v2019_08_01.models.SiteConfigurationSnapshotInfo] + ~azure.mgmt.web.v2019_08_01.models.ContinuousWebJobPaged[~azure.mgmt.web.v2019_08_01.models.ContinuousWebJob] :raises: :class:`DefaultErrorResponseException` """ def prepare_request(next_link=None): 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'), @@ -13210,46 +14090,45 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.SiteConfigurationSnapshotInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.ContinuousWebJobPaged(internal_paging, self._deserialize.dependencies, header_dict) 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. - Description for Gets a snapshot of the configuration of an app at a - previous point in time. + Description for 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.v2019_08_01.models.SiteConfigResource or + :return: ContinuousWebJob or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.ContinuousWebJob or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # 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') } @@ -13273,36 +14152,36 @@ 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]: + if response.status_code not in [200, 404]: raise models.DefaultErrorResponseException(self._deserialize, response) 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. - Description for Reverts the configuration of an app to a previous - snapshot. + Description for 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 @@ -13315,11 +14194,11 @@ def recover_site_configuration_snapshot_slot( :class:`DefaultErrorResponseException` """ # 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') } @@ -13339,50 +14218,50 @@ 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]: raise models.DefaultErrorResponseException(self._deserialize, response) 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. - Description for Gets the last lines of docker logs for the given site. + Description for 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 - :raises: :class:`CloudError` + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` """ # 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') } @@ -13394,7 +14273,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: @@ -13404,56 +14282,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) - - if response.status_code not in [200, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + response = self._client.send(request, stream=False, **operation_config) - deserialized = self._client.stream_download(response, callback) + if response.status_code not in [200, 404]: + raise models.DefaultErrorResponseException(self._deserialize, response) 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. - Description for Gets the ZIP archived docker log files for the given - site. + Description for 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 - :raises: :class:`CloudError` + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` """ # 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') } @@ -13465,7 +14336,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: @@ -13475,52 +14345,45 @@ 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) - - if response.status_code not in [200, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + response = self._client.send(request, stream=False, **operation_config) - deserialized = self._client.stream_download(response, callback) + if response.status_code not in [200, 404]: + raise models.DefaultErrorResponseException(self._deserialize, response) 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. - Description for List continuous web jobs for an app, or a deployment - slot. + Description for 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.v2019_08_01.models.ContinuousWebJobPaged[~azure.mgmt.web.v2019_08_01.models.ContinuousWebJob] + ~azure.mgmt.web.v2019_08_01.models.DeploymentPaged[~azure.mgmt.web.v2019_08_01.models.Deployment] :raises: :class:`DefaultErrorResponseException` """ def prepare_request(next_link=None): 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'), @@ -13547,63 +14410,135 @@ def prepare_request(next_link=None): 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) - return request + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_deployments_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments'} + + 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. + + Description for 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: 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 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: Deployment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.Deployment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct 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'), + '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') - def internal_paging(next_link=None): - request = prepare_request(next_link) + # 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') - 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 + if response.status_code == 200: + deserialized = self._deserialize('Deployment', response) - # Deserialize response - header_dict = None if raw: - header_dict = {} - deserialized = models.ContinuousWebJobPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) + 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'} + get_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} - 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 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. - Description for Gets a continuous web job by its ID for an app, or a - deployment slot. + Description for 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 deletes a deployment for the production slot. + the API creates a deployment for the production slot. :type slot: str + :param deployment: Deployment details. + :type deployment: ~azure.mgmt.web.v2019_08_01.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: ContinuousWebJob or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.ContinuousWebJob or + :return: Deployment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.Deployment or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_continuous_web_job_slot.metadata['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'), - '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') } @@ -13616,6 +14551,7 @@ def get_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: @@ -13623,38 +14559,41 @@ def get_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(deployment, 'Deployment') + # 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]: + 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}'} + create_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 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. - Description for Delete a continuous web job by its ID for an app, or a + Description for 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 slot: Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. :type slot: str @@ -13669,11 +14608,11 @@ def delete_continuous_web_job_slot( :class:`DefaultErrorResponseException` """ # 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') } @@ -13702,41 +14641,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}'} - - 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. + delete_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} - Description for Start a continuous web job for an app, or a deployment + 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. + Description for 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 + :return: Deployment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.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') } @@ -13748,6 +14691,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: @@ -13756,50 +14700,60 @@ 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]: + 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'} - Description for 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. + + Description for 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.v2019_08_01.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 + :return: RestoreRequest or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.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') } @@ -13811,6 +14765,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: @@ -13818,23 +14774,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]: + 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. - Description for List deployments for an app, or a deployment slot. + Description for Lists ownership identifiers for domain associated with + web app. :param resource_group_name: Name of the resource group to which the resource belongs. @@ -13842,23 +14808,23 @@ 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.v2019_08_01.models.DeploymentPaged[~azure.mgmt.web.v2019_08_01.models.Deployment] + ~azure.mgmt.web.v2019_08_01.models.IdentifierPaged[~azure.mgmt.web.v2019_08_01.models.Identifier] :raises: :class:`DefaultErrorResponseException` """ def prepare_request(next_link=None): 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'), @@ -13903,45 +14869,45 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.DeploymentPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.IdentifierPaged(internal_paging, self._deserialize.dependencies, header_dict) 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. - Description for Get a deployment by its ID for an app, or a deployment - slot. + Description for 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 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.v2019_08_01.models.Deployment or + :return: Identifier or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.Identifier or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_deployment_slot.metadata['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'), - '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') } @@ -13970,50 +14936,57 @@ def get_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 - get_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} + get_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} - 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 create_or_update_domain_ownership_identifier_slot( + self, resource_group_name, name, domain_ownership_identifier_name, slot, kind=None, value=None, custom_headers=None, raw=False, **operation_config): + """Creates a domain ownership identifier for web app, or updates an + existing ownership identifier. - Description for Create a deployment for an app, or a deployment slot. + Description for 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.v2019_08_01.models.Deployment + :param kind: Kind of resource. + :type kind: str + :param value: String representation of the identity. + :type value: 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.v2019_08_01.models.Deployment or + :return: Identifier or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.Identifier or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ + domain_ownership_identifier = models.Identifier(kind=kind, value=value) + # Construct URL - url = self.create_deployment_slot.metadata['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'), - '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') } @@ -14035,7 +15008,7 @@ 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) @@ -14046,31 +15019,31 @@ 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}'} + create_or_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 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. - Description for Delete a deployment by its ID for an app, or a - deployment slot. + Description for 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 slot: Name of the deployment slot. If a slot is not specified, - the API deletes 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 @@ -14083,11 +15056,11 @@ def delete_deployment_slot( :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_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') } @@ -14116,45 +15089,50 @@ def delete_deployment_slot( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} + delete_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} - 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. + def update_domain_ownership_identifier_slot( + self, resource_group_name, name, domain_ownership_identifier_name, slot, kind=None, value=None, custom_headers=None, raw=False, **operation_config): + """Creates a domain ownership identifier for web app, or updates an + existing ownership identifier. - Description for List deployment log for specific deployment for an app, - or a deployment slot. + Description for 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 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 kind: Kind of resource. + :type kind: str + :param value: String representation of the identity. + :type value: 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.v2019_08_01.models.Deployment or + :return: Identifier or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.Identifier or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ + domain_ownership_identifier = models.Identifier(kind=kind, value=value) + # Construct URL - url = self.list_deployment_log_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') } @@ -14167,6 +15145,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: @@ -14174,8 +15153,11 @@ 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(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]: @@ -14183,49 +15165,42 @@ def list_deployment_log_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 - list_deployment_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log'} + update_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} - 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 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. - Description for 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. + Description for 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.v2019_08_01.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 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.v2019_08_01.models.RestoreRequest or + :return: MSDeployStatus or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.MSDeployStatus or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.discover_backup_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'), @@ -14241,7 +15216,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: @@ -14249,11 +15223,8 @@ 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]: @@ -14261,128 +15232,23 @@ def discover_backup_slot( 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_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): - """Lists ownership identifiers for domain associated with web app. - - Description for 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 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: An iterator like instance of Identifier - :rtype: - ~azure.mgmt.web.v2019_08_01.models.IdentifierPaged[~azure.mgmt.web.v2019_08_01.models.Identifier] - :raises: - :class:`DefaultErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct 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'), - '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) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - 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 - header_dict = None - if raw: - header_dict = {} - deserialized = models.IdentifierPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_domain_ownership_identifiers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers'} - - 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_ms_deploy_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} - Description for 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 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.v2019_08_01.models.Identifier 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.get_domain_ownership_identifier_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'), - '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') } @@ -14395,6 +15261,7 @@ def get_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: @@ -14402,66 +15269,115 @@ def get_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(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]: + if response.status_code not in [201, 409]: 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('MSDeployStatus', 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, value=None, custom_headers=None, raw=False, **operation_config): - """Creates a domain ownership identifier for web app, or updates an - existing ownership identifier. + 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. - Description for Creates a domain ownership identifier for web app, or - updates an existing ownership identifier. + Description for 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 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 ms_deploy: Details of MSDeploy operation + :type ms_deploy: ~azure.mgmt.web.v2019_08_01.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.v2019_08_01.models.MSDeployStatus] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.v2019_08_01.models.MSDeployStatus]] + :raises: + :class:`DefaultErrorResponseException` + """ + 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. + + Description for 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 kind: Kind of resource. - :type kind: str - :param value: String representation of the identity. - :type value: 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.v2019_08_01.models.Identifier or + :return: MSDeployLog or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.MSDeployLog or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ - domain_ownership_identifier = models.Identifier(kind=kind, value=value) - # Construct URL - url = self.create_or_update_domain_ownership_identifier_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'), - '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') } @@ -14474,7 +15390,6 @@ def create_or_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: @@ -14482,132 +15397,132 @@ def create_or_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.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, 404]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Identifier', response) + deserialized = self._deserialize('MSDeployLog', 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}'} + get_ms_deploy_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log'} - 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 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. - Description for Deletes a domain ownership identifier for a web app. + Description for 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 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 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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: An iterator like instance of FunctionEnvelope + :rtype: + ~azure.mgmt.web.v2019_08_01.models.FunctionEnvelopePaged[~azure.mgmt.web.v2019_08_01.models.FunctionEnvelope] :raises: :class:`DefaultErrorResponseException` """ - # Construct 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'), - '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) + def prepare_request(next_link=None): + 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 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, 204]: - raise models.DefaultErrorResponseException(self._deserialize, response) + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.DefaultErrorResponseException(self._deserialize, response) + return response + + # Deserialize response + header_dict = None 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}'} + header_dict = {} + deserialized = models.FunctionEnvelopePaged(internal_paging, self._deserialize.dependencies, header_dict) - def update_domain_ownership_identifier_slot( - self, resource_group_name, name, domain_ownership_identifier_name, slot, kind=None, value=None, custom_headers=None, raw=False, **operation_config): - """Creates a domain ownership identifier for web app, or updates an - existing ownership identifier. + return deserialized + list_instance_functions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions'} - Description for Creates a domain ownership identifier for web app, or - updates an existing ownership identifier. + 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. + + Description for 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 kind: Kind of resource. - :type kind: str - :param value: String representation of the identity. - :type value: 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.v2019_08_01.models.Identifier or - ~msrest.pipeline.ClientRawResponse + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ - domain_ownership_identifier = models.Identifier(kind=kind, value=value) - # Construct URL - url = self.update_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') } @@ -14620,19 +15535,15 @@ 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: 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') + 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) + 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]: @@ -14640,45 +15551,48 @@ def update_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 - update_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 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. + 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. - Description for Get the status of the last MSDeploy operation. + Description for 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 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 function_name: Function name. + :type function_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: MSDeployStatus or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.MSDeployStatus or + :return: FunctionEnvelope or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.FunctionEnvelope or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_ms_deploy_status_slot.metadata['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') } @@ -14702,28 +15616,29 @@ def get_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]: + if response.status_code not in [200, 404]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('MSDeployStatus', response) + deserialized = self._deserialize('FunctionEnvelope', 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_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} - def _create_ms_deploy_operation_slot_initial( - self, resource_group_name, name, slot, ms_deploy, custom_headers=None, raw=False, **operation_config): + 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_ms_deploy_operation_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'), + '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') } @@ -14745,19 +15660,19 @@ def _create_ms_deploy_operation_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(ms_deploy, 'MSDeploy') + 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 [201, 409]: + if response.status_code not in [201]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 201: - deserialized = self._deserialize('MSDeployStatus', response) + deserialized = self._deserialize('FunctionEnvelope', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -14765,48 +15680,51 @@ def _create_ms_deploy_operation_slot_initial( 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. + 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. - Description for Invoke the MSDeploy web app extension. + Description for 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 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 function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. :type slot: str - :param ms_deploy: Details of MSDeploy operation - :type ms_deploy: ~azure.mgmt.web.v2019_08_01.models.MSDeploy + :param function_envelope: Function details. + :type function_envelope: + ~azure.mgmt.web.v2019_08_01.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 MSDeployStatus or - ClientRawResponse if raw==True + :return: An instance of LROPoller that returns FunctionEnvelope or + ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.v2019_08_01.models.MSDeployStatus] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.v2019_08_01.models.FunctionEnvelope] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.v2019_08_01.models.MSDeployStatus]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.v2019_08_01.models.FunctionEnvelope]] :raises: :class:`DefaultErrorResponseException` """ - raw_result = self._create_ms_deploy_operation_slot_initial( + raw_result = self._create_instance_function_slot_initial( resource_group_name=resource_group_name, name=name, + function_name=function_name, slot=slot, - ms_deploy=ms_deploy, + function_envelope=function_envelope, custom_headers=custom_headers, raw=True, **operation_config ) def get_long_running_output(response): - deserialized = self._deserialize('MSDeployStatus', response) + deserialized = self._deserialize('FunctionEnvelope', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -14821,38 +15739,110 @@ 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) - create_ms_deploy_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} + create_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} - 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. + 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. - Description for Get the MSDeploy Log for the last MSDeploy operation. + Description for 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: 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 function_name: Function name. + :type function_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: MSDeployLog or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.MSDeployLog or + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct 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'), + '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 = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, 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 create_or_update_function_secret_slot( + self, resource_group_name, name, function_name, key_name, slot, name1=None, value=None, custom_headers=None, raw=False, **operation_config): + """Add or update a function secret. + + Description for Add or update a function secret. + + :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: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :param name1: Key name + :type name1: str + :param value: Key value + :type value: 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: KeyInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.KeyInfo or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ + key = models.KeyInfo(name=name1, value=value) + # Construct URL - url = self.get_ms_deploy_log_slot.metadata['url'] + url = self.create_or_update_function_secret_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'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -14865,6 +15855,7 @@ def get_ms_deploy_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: @@ -14872,36 +15863,44 @@ def get_ms_deploy_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(key, 'KeyInfo') + # 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]: + if response.status_code not in [200, 201]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('MSDeployLog', response) + deserialized = self._deserialize('KeyInfo', response) + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_ms_deploy_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log'} + create_or_update_function_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}'} - 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 delete_function_secret_slot( + self, resource_group_name, name, function_name, key_name, slot, custom_headers=None, raw=False, **operation_config): + """Delete a function secret. - Description for List the functions for a web site, or a deployment - slot. + Description for Delete a function secret. :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: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str :param slot: Name of the deployment slot. :type slot: str :param dict custom_headers: headers that will be added to the request @@ -14909,95 +15908,81 @@ def list_instance_functions_slot( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of FunctionEnvelope - :rtype: - ~azure.mgmt.web.v2019_08_01.models.FunctionEnvelopePaged[~azure.mgmt.web.v2019_08_01.models.FunctionEnvelope] + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ - def prepare_request(next_link=None): - 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') - - 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) - return request + # Construct URL + url = self.delete_function_secret_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'), + 'keyName': self._serialize.url("key_name", key_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): - request = prepare_request(next_link) + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - response = self._client.send(request, stream=False, **operation_config) + # 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') - if response.status_code not in [200, 404]: - raise models.DefaultErrorResponseException(self._deserialize, response) + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) - return response + if response.status_code not in [204, 404]: + raise models.DefaultErrorResponseException(self._deserialize, response) - # Deserialize response - header_dict = None if raw: - header_dict = {} - deserialized = models.FunctionEnvelopePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_instance_functions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions'} + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_function_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}'} - 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 list_function_keys_slot( + self, resource_group_name, name, function_name, slot, custom_headers=None, raw=False, **operation_config): + """Get function keys for a function in a web site, or a deployment slot. - Description for Fetch a short lived token that can be exchanged for a - master key. + Description for Get function keys 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 slot: Name of web app slot. If not specified then will default - to production slot. + :param function_name: Function name. + :type function_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: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse + :return: StringDictionary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.StringDictionary or + ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_functions_admin_token_slot.metadata['url'] + url = self.list_function_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'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -15018,7 +16003,7 @@ def get_functions_admin_token_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]: @@ -15026,20 +16011,21 @@ def get_functions_admin_token_slot( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('str', response) + deserialized = self._deserialize('StringDictionary', 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'} + list_function_keys_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listkeys'} - def get_instance_function_slot( + def list_function_secrets_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. + """Get function secrets for a function in a web site, or a deployment + slot. - Description for Get function information by its ID for web site, or a + Description for 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 @@ -15056,14 +16042,14 @@ def get_instance_function_slot( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: FunctionEnvelope or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.web.v2019_08_01.models.FunctionEnvelope or + :return: FunctionSecrets or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.FunctionSecrets or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ # Construct URL - url = self.get_instance_function_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'), @@ -15088,32 +16074,52 @@ 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.post(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]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('FunctionEnvelope', response) + deserialized = self._deserialize('FunctionSecrets', 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}'} + list_function_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets'} + def list_host_keys_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Get host secrets for a function app. - def _create_instance_function_slot_initial( - self, resource_group_name, name, function_name, slot, function_envelope, custom_headers=None, raw=False, **operation_config): + Description for Get host secrets for a function app. + + :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 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: HostKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.HostKeys or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ # Construct URL - url = self.create_instance_function_slot.metadata['url'] + url = self.list_host_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'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -15126,7 +16132,6 @@ def _create_instance_function_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: @@ -15134,101 +16139,95 @@ def _create_instance_function_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(function_envelope, 'FunctionEnvelope') - # 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]: + 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('HostKeys', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized + list_host_keys_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listkeys'} - 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. + def list_sync_status_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """This is to allow calling via powershell and ARM template. - Description for Create function for web site, or a deployment slot. + Description for 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 function_name: Function name. - :type function_name: str :param slot: Name of the deployment slot. :type slot: str - :param function_envelope: Function details. - :type function_envelope: - ~azure.mgmt.web.v2019_08_01.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.v2019_08_01.models.FunctionEnvelope] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.v2019_08_01.models.FunctionEnvelope]] + :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:`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 - ) + # Construct URL + url = self.list_sync_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'), + '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 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 = {} + 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) - create_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} + if response.status_code not in [204]: + raise models.DefaultErrorResponseException(self._deserialize, response) - 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. + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + list_sync_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listsyncstatus'} - Description for Delete a function for web site, or a deployment slot. + def sync_functions_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management + 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 the app. :type name: str - :param function_name: Function name. - :type function_name: str :param slot: Name of the deployment slot. :type slot: str :param dict custom_headers: headers that will be added to the request @@ -15242,11 +16241,10 @@ def delete_instance_function_slot( :class:`DefaultErrorResponseException` """ # Construct URL - url = self.delete_instance_function_slot.metadata['url'] + url = self.sync_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'), - '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') } @@ -15266,51 +16264,58 @@ 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]: + if response.status_code not in [204]: raise models.DefaultErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} + sync_functions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/sync'} - 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. + def create_or_update_host_secret_slot( + self, resource_group_name, name, key_type, key_name, slot, name1=None, value=None, custom_headers=None, raw=False, **operation_config): + """Add or update a host level secret. - Description for Get function secrets for a function in a web site, or a - deployment slot. + Description for Add or update a host level secret. :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 key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str :param slot: Name of the deployment slot. :type slot: str + :param name1: Key name + :type name1: str + :param value: Key value + :type value: 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.v2019_08_01.models.FunctionSecrets or + :return: KeyInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.v2019_08_01.models.KeyInfo or ~msrest.pipeline.ClientRawResponse :raises: :class:`DefaultErrorResponseException` """ + key = models.KeyInfo(name=name1, value=value) + # Construct URL - url = self.list_function_secrets_slot.metadata['url'] + url = self.create_or_update_host_secret_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'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), 'slot': self._serialize.url("slot", slot, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -15323,6 +16328,7 @@ def list_function_secrets_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: @@ -15330,23 +16336,92 @@ def list_function_secrets_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(key, 'KeyInfo') + # 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]: + if response.status_code not in [200, 201]: raise models.DefaultErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('FunctionSecrets', response) + deserialized = self._deserialize('KeyInfo', response) + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', 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'} + create_or_update_host_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}'} + + def delete_host_secret_slot( + self, resource_group_name, name, key_type, key_name, slot, custom_headers=None, raw=False, **operation_config): + """Delete a host level secret. + + Description for Delete a host level secret. + + :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 key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.delete_host_secret_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'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_host_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}'} def list_host_name_bindings_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): @@ -22006,10 +23081,10 @@ def sync_repository_slot( def sync_function_triggers_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): - """Syncs function trigger metadata to the scale controller. + """Syncs function trigger metadata to the management database. - Description for Syncs function trigger metadata to the scale - controller. + Description for Syncs function trigger metadata to the management + database. :param resource_group_name: Name of the resource group to which the resource belongs. @@ -24307,10 +25382,10 @@ def sync_repository( def sync_function_triggers( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """Syncs function trigger metadata to the scale controller. + """Syncs function trigger metadata to the management database. - Description for Syncs function trigger metadata to the scale - controller. + Description for Syncs function trigger metadata to the management + database. :param resource_group_name: Name of the resource group to which the resource belongs.