From ae153c82bf6cc27c9c2769638508e14f31a760b9 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 22 Dec 2020 02:06:13 +0000 Subject: [PATCH] CodeGen from PR 11823 in Azure/azure-rest-api-specs [Hub Generated] Review request for Microsoft.AppPlatform to add version preview/2020-11-01-preview (#11823) * Adds base for updating Microsoft.AppPlatform from version stable/2020-07-01 to version 2020-11-01-preview * Updates readme * Updates API version in new specs and examples * Introduce additional change to 2020-11-01-preview. * Additional properties to monitoringSettings. * Readonly properties to requiredTraffics. Signed-off-by: Pan Li * Make credscan happy. Signed-off-by: Pan Li --- .../_app_platform_management_client.py | 5 + .../v2019_05_01_preview/models/__init__.py | 13 + .../_app_platform_management_client_enums.py | 17 + .../v2019_05_01_preview/models/_models.py | 115 +- .../v2019_05_01_preview/models/_models_py3.py | 121 +- .../operations/__init__.py | 2 + .../operations/_deployments_operations.py | 22 +- .../_runtime_versions_operations.py | 93 + .../_app_platform_management_client.py | 5 + .../v2020_07_01/models/__init__.py | 19 + .../_app_platform_management_client_enums.py | 15 + .../appplatform/v2020_07_01/models/_models.py | 147 +- .../v2020_07_01/models/_models_py3.py | 149 +- .../v2020_07_01/operations/__init__.py | 2 + .../operations/_config_servers_operations.py | 108 + .../_runtime_versions_operations.py | 93 + .../v2020_11_01_preview/__init__.py | 19 + .../_app_platform_management_client.py | 101 + .../v2020_11_01_preview/_configuration.py | 50 + .../v2020_11_01_preview/models/__init__.py | 246 ++ .../_app_platform_management_client_enums.py | 135 ++ .../v2020_11_01_preview/models/_models.py | 2120 +++++++++++++++++ .../v2020_11_01_preview/models/_models_py3.py | 2120 +++++++++++++++++ .../models/_paged_models.py | 118 + .../operations/__init__.py | 36 + .../operations/_apps_operations.py | 634 +++++ .../operations/_bindings_operations.py | 510 ++++ .../operations/_certificates_operations.py | 381 +++ .../operations/_config_servers_operations.py | 428 ++++ .../operations/_custom_domains_operations.py | 510 ++++ .../operations/_deployments_operations.py | 935 ++++++++ .../_monitoring_settings_operations.py | 322 +++ .../operations/_operations.py | 103 + .../_runtime_versions_operations.py | 93 + .../operations/_services_operations.py | 859 +++++++ .../operations/_skus_operations.py | 106 + .../v2020_11_01_preview/version.py | 13 + 37 files changed, 10742 insertions(+), 23 deletions(-) create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/operations/_runtime_versions_operations.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/operations/_runtime_versions_operations.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/__init__.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/_app_platform_management_client.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/_configuration.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/models/__init__.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/models/_app_platform_management_client_enums.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/models/_models.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/models/_models_py3.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/models/_paged_models.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/__init__.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_apps_operations.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_bindings_operations.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_certificates_operations.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_config_servers_operations.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_custom_domains_operations.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_deployments_operations.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_monitoring_settings_operations.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_operations.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_runtime_versions_operations.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_services_operations.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_skus_operations.py create mode 100644 sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/version.py diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/_app_platform_management_client.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/_app_platform_management_client.py index 2836eaee3431..a0ff01ceabf3 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/_app_platform_management_client.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/_app_platform_management_client.py @@ -20,6 +20,7 @@ from .operations import CustomDomainsOperations from .operations import DeploymentsOperations from .operations import Operations +from .operations import RuntimeVersionsOperations from .operations import SkuOperations from . import models @@ -44,6 +45,8 @@ class AppPlatformManagementClient(SDKClient): :vartype deployments: azure.mgmt.appplatform.v2019_05_01_preview.operations.DeploymentsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.appplatform.v2019_05_01_preview.operations.Operations + :ivar runtime_versions: RuntimeVersions operations + :vartype runtime_versions: azure.mgmt.appplatform.v2019_05_01_preview.operations.RuntimeVersionsOperations :ivar sku: Sku operations :vartype sku: azure.mgmt.appplatform.v2019_05_01_preview.operations.SkuOperations @@ -82,5 +85,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) + self.runtime_versions = RuntimeVersionsOperations( + self._client, self.config, self._serialize, self._deserialize) self.sku = SkuOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/models/__init__.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/models/__init__.py index fd6e2ee703f5..05307b382a42 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/models/__init__.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/models/__init__.py @@ -12,6 +12,7 @@ try: from ._models_py3 import AppResource from ._models_py3 import AppResourceProperties + from ._models_py3 import AvailableRuntimeVersions from ._models_py3 import BindingResource from ._models_py3 import BindingResourceProperties from ._models_py3 import CertificateProperties @@ -38,6 +39,7 @@ from ._models_py3 import NameAvailability from ._models_py3 import NameAvailabilityParameters from ._models_py3 import NetworkProfile + from ._models_py3 import NetworkProfileOutboundIPs from ._models_py3 import OperationDetail from ._models_py3 import OperationDisplay from ._models_py3 import OperationProperties @@ -56,6 +58,7 @@ from ._models_py3 import ServiceSpecification from ._models_py3 import Sku from ._models_py3 import SkuCapacity + from ._models_py3 import SupportedRuntimeVersion from ._models_py3 import TemporaryDisk from ._models_py3 import TestKeys from ._models_py3 import TraceProperties @@ -64,6 +67,7 @@ except (SyntaxError, ImportError): from ._models import AppResource from ._models import AppResourceProperties + from ._models import AvailableRuntimeVersions from ._models import BindingResource from ._models import BindingResourceProperties from ._models import CertificateProperties @@ -90,6 +94,7 @@ from ._models import NameAvailability from ._models import NameAvailabilityParameters from ._models import NetworkProfile + from ._models import NetworkProfileOutboundIPs from ._models import OperationDetail from ._models import OperationDisplay from ._models import OperationProperties @@ -108,6 +113,7 @@ from ._models import ServiceSpecification from ._models import Sku from ._models import SkuCapacity + from ._models import SupportedRuntimeVersion from ._models import TemporaryDisk from ._models import TestKeys from ._models import TraceProperties @@ -135,11 +141,14 @@ SkuScaleType, ResourceSkuRestrictionsType, ResourceSkuRestrictionsReasonCode, + SupportedRuntimeValue, + SupportedRuntimePlatform, ) __all__ = [ 'AppResource', 'AppResourceProperties', + 'AvailableRuntimeVersions', 'BindingResource', 'BindingResourceProperties', 'CertificateProperties', @@ -166,6 +175,7 @@ 'NameAvailability', 'NameAvailabilityParameters', 'NetworkProfile', + 'NetworkProfileOutboundIPs', 'OperationDetail', 'OperationDisplay', 'OperationProperties', @@ -184,6 +194,7 @@ 'ServiceSpecification', 'Sku', 'SkuCapacity', + 'SupportedRuntimeVersion', 'TemporaryDisk', 'TestKeys', 'TraceProperties', @@ -210,4 +221,6 @@ 'SkuScaleType', 'ResourceSkuRestrictionsType', 'ResourceSkuRestrictionsReasonCode', + 'SupportedRuntimeValue', + 'SupportedRuntimePlatform', ] diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/models/_app_platform_management_client_enums.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/models/_app_platform_management_client_enums.py index 43b052634d0f..bcd6f5bb797f 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/models/_app_platform_management_client_enums.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/models/_app_platform_management_client_enums.py @@ -62,11 +62,13 @@ class AppResourceProvisioningState(str, Enum): failed = "Failed" creating = "Creating" updating = "Updating" + deleting = "Deleting" class UserSourceType(str, Enum): jar = "Jar" + net_core_zip = "NetCoreZip" source = "Source" @@ -74,6 +76,7 @@ class RuntimeVersion(str, Enum): java_8 = "Java_8" java_11 = "Java_11" + net_core_31 = "NetCore_31" class DeploymentResourceProvisioningState(str, Enum): @@ -82,6 +85,7 @@ class DeploymentResourceProvisioningState(str, Enum): updating = "Updating" succeeded = "Succeeded" failed = "Failed" + deleting = "Deleting" class DeploymentResourceStatus(str, Enum): @@ -112,3 +116,16 @@ class ResourceSkuRestrictionsReasonCode(str, Enum): quota_id = "QuotaId" not_available_for_subscription = "NotAvailableForSubscription" + + +class SupportedRuntimeValue(str, Enum): + + java_8 = "Java_8" + java_11 = "Java_11" + net_core_31 = "NetCore_31" + + +class SupportedRuntimePlatform(str, Enum): + + java = "Java" + net_core = ".NET Core" diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/models/_models.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/models/_models.py index 2a7fe772dfd3..6db50d936807 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/models/_models.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/models/_models.py @@ -133,7 +133,7 @@ class AppResourceProperties(Model): :ivar url: URL of the App :vartype url: str :ivar provisioning_state: Provisioning state of the App. Possible values - include: 'Succeeded', 'Failed', 'Creating', 'Updating' + include: 'Succeeded', 'Failed', 'Creating', 'Updating', 'Deleting' :vartype provisioning_state: str or ~azure.mgmt.appplatform.v2019_05_01_preview.models.AppResourceProvisioningState :param active_deployment_name: Name of the active deployment of the App @@ -183,6 +183,30 @@ def __init__(self, **kwargs): self.persistent_disk = kwargs.get('persistent_disk', None) +class AvailableRuntimeVersions(Model): + """AvailableRuntimeVersions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: A list of all supported runtime versions. + :vartype value: + list[~azure.mgmt.appplatform.v2019_05_01_preview.models.SupportedRuntimeVersion] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SupportedRuntimeVersion]'}, + } + + def __init__(self, **kwargs): + super(AvailableRuntimeVersions, self).__init__(**kwargs) + self.value = None + + class BindingResource(ProxyResource): """Binding resource payload. @@ -725,6 +749,8 @@ class DeploymentInstance(Model): :vartype reason: str :ivar discovery_status: Discovery status of the deployment instance :vartype discovery_status: str + :ivar start_time: Start time of the deployment instance + :vartype start_time: str """ _validation = { @@ -732,6 +758,7 @@ class DeploymentInstance(Model): 'status': {'readonly': True}, 'reason': {'readonly': True}, 'discovery_status': {'readonly': True}, + 'start_time': {'readonly': True}, } _attribute_map = { @@ -739,6 +766,7 @@ class DeploymentInstance(Model): 'status': {'key': 'status', 'type': 'str'}, 'reason': {'key': 'reason', 'type': 'str'}, 'discovery_status': {'key': 'discoveryStatus', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, } def __init__(self, **kwargs): @@ -747,6 +775,7 @@ def __init__(self, **kwargs): self.status = None self.reason = None self.discovery_status = None + self.start_time = None class DeploymentResource(ProxyResource): @@ -764,6 +793,8 @@ class DeploymentResource(ProxyResource): :param properties: Properties of the Deployment resource :type properties: ~azure.mgmt.appplatform.v2019_05_01_preview.models.DeploymentResourceProperties + :param sku: Sku of the Deployment resource + :type sku: ~azure.mgmt.appplatform.v2019_05_01_preview.models.Sku """ _validation = { @@ -777,11 +808,13 @@ class DeploymentResource(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'DeploymentResourceProperties'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, } def __init__(self, **kwargs): super(DeploymentResource, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) + self.sku = kwargs.get('sku', None) class DeploymentResourceProperties(Model): @@ -799,7 +832,7 @@ class DeploymentResourceProperties(Model): :type deployment_settings: ~azure.mgmt.appplatform.v2019_05_01_preview.models.DeploymentSettings :ivar provisioning_state: Provisioning state of the Deployment. Possible - values include: 'Creating', 'Updating', 'Succeeded', 'Failed' + values include: 'Creating', 'Updating', 'Succeeded', 'Failed', 'Deleting' :vartype provisioning_state: str or ~azure.mgmt.appplatform.v2019_05_01_preview.models.DeploymentResourceProvisioningState :ivar status: Status of the Deployment. Possible values include: @@ -859,13 +892,16 @@ class DeploymentSettings(Model): :type memory_in_gb: int :param jvm_options: JVM parameter :type jvm_options: str + :param net_core_main_entry_path: The path to the .NET executable relative + to zip root + :type net_core_main_entry_path: str :param instance_count: Instance count, basic tier should be in range (1, 25), standard tier should be in range (1, 500). Default value: 1 . :type instance_count: int :param environment_variables: Collection of environment variables :type environment_variables: dict[str, str] :param runtime_version: Runtime version. Possible values include: - 'Java_8', 'Java_11' + 'Java_8', 'Java_11', 'NetCore_31' :type runtime_version: str or ~azure.mgmt.appplatform.v2019_05_01_preview.models.RuntimeVersion """ @@ -874,6 +910,7 @@ class DeploymentSettings(Model): 'cpu': {'key': 'cpu', 'type': 'int'}, 'memory_in_gb': {'key': 'memoryInGB', 'type': 'int'}, 'jvm_options': {'key': 'jvmOptions', 'type': 'str'}, + 'net_core_main_entry_path': {'key': 'netCoreMainEntryPath', 'type': 'str'}, 'instance_count': {'key': 'instanceCount', 'type': 'int'}, 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, @@ -884,6 +921,7 @@ def __init__(self, **kwargs): self.cpu = kwargs.get('cpu', 1) self.memory_in_gb = kwargs.get('memory_in_gb', 1) self.jvm_options = kwargs.get('jvm_options', None) + self.net_core_main_entry_path = kwargs.get('net_core_main_entry_path', None) self.instance_count = kwargs.get('instance_count', 1) self.environment_variables = kwargs.get('environment_variables', None) self.runtime_version = kwargs.get('runtime_version', None) @@ -1051,17 +1089,22 @@ class MetricDimension(Model): :type name: str :param display_name: Localized friendly display name of the dimension :type display_name: str + :param to_be_exported_for_shoebox: Whether this dimension should be + included for the Shoebox export scenario + :type to_be_exported_for_shoebox: bool """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, } def __init__(self, **kwargs): super(MetricDimension, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.display_name = kwargs.get('display_name', None) + self.to_be_exported_for_shoebox = kwargs.get('to_be_exported_for_shoebox', None) class MetricSpecification(Model): @@ -1174,6 +1217,9 @@ def __init__(self, **kwargs): class NetworkProfile(Model): """Service network profile payload. + Variables are only populated by the server, and will be ignored when + sending a request. + :param service_runtime_subnet_id: Fully qualified resource Id of the subnet to host Azure Spring Cloud Service Runtime :type service_runtime_subnet_id: str @@ -1188,14 +1234,23 @@ class NetworkProfile(Model): :param app_network_resource_group: Name of the resource group containing network resources of Azure Spring Cloud Apps :type app_network_resource_group: str + :ivar outbound_ips: Desired outbound IP resources for Azure Spring Cloud + instance. + :vartype outbound_ips: + ~azure.mgmt.appplatform.v2019_05_01_preview.models.NetworkProfileOutboundIPs """ + _validation = { + 'outbound_ips': {'readonly': True}, + } + _attribute_map = { 'service_runtime_subnet_id': {'key': 'serviceRuntimeSubnetId', 'type': 'str'}, 'app_subnet_id': {'key': 'appSubnetId', 'type': 'str'}, 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, 'service_runtime_network_resource_group': {'key': 'serviceRuntimeNetworkResourceGroup', 'type': 'str'}, 'app_network_resource_group': {'key': 'appNetworkResourceGroup', 'type': 'str'}, + 'outbound_ips': {'key': 'outboundIPs', 'type': 'NetworkProfileOutboundIPs'}, } def __init__(self, **kwargs): @@ -1205,6 +1260,30 @@ def __init__(self, **kwargs): self.service_cidr = kwargs.get('service_cidr', None) self.service_runtime_network_resource_group = kwargs.get('service_runtime_network_resource_group', None) self.app_network_resource_group = kwargs.get('app_network_resource_group', None) + self.outbound_ips = None + + +class NetworkProfileOutboundIPs(Model): + """Desired outbound IP resources for Azure Spring Cloud instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar public_ips: A list of public IP addresses. + :vartype public_ips: list[str] + """ + + _validation = { + 'public_ips': {'readonly': True}, + } + + _attribute_map = { + 'public_ips': {'key': 'publicIPs', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(NetworkProfileOutboundIPs, self).__init__(**kwargs) + self.public_ips = None class OperationDetail(Model): @@ -1702,6 +1781,34 @@ def __init__(self, **kwargs): self.scale_type = kwargs.get('scale_type', None) +class SupportedRuntimeVersion(Model): + """Supported deployment runtime version descriptor. + + :param value: The raw value which could be passed to deployment CRUD + operations. Possible values include: 'Java_8', 'Java_11', 'NetCore_31' + :type value: str or + ~azure.mgmt.appplatform.v2019_05_01_preview.models.SupportedRuntimeValue + :param platform: The platform of this runtime version (possible values: + "Java" or ".NET"). Possible values include: 'Java', '.NET Core' + :type platform: str or + ~azure.mgmt.appplatform.v2019_05_01_preview.models.SupportedRuntimePlatform + :param version: The detailed version (major.minor) of the platform. + :type version: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'platform': {'key': 'platform', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SupportedRuntimeVersion, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.platform = kwargs.get('platform', None) + self.version = kwargs.get('version', None) + + class TemporaryDisk(Model): """Temporary disk payload. @@ -1800,7 +1907,7 @@ class UserSourceInfo(Model): """Source information for a deployment. :param type: Type of the source uploaded. Possible values include: 'Jar', - 'Source' + 'NetCoreZip', 'Source' :type type: str or ~azure.mgmt.appplatform.v2019_05_01_preview.models.UserSourceType :param relative_path: Relative path of the storage which stores the source diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/models/_models_py3.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/models/_models_py3.py index 665c35cb7822..d781484b060b 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/models/_models_py3.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/models/_models_py3.py @@ -133,7 +133,7 @@ class AppResourceProperties(Model): :ivar url: URL of the App :vartype url: str :ivar provisioning_state: Provisioning state of the App. Possible values - include: 'Succeeded', 'Failed', 'Creating', 'Updating' + include: 'Succeeded', 'Failed', 'Creating', 'Updating', 'Deleting' :vartype provisioning_state: str or ~azure.mgmt.appplatform.v2019_05_01_preview.models.AppResourceProvisioningState :param active_deployment_name: Name of the active deployment of the App @@ -183,6 +183,30 @@ def __init__(self, *, public: bool=None, active_deployment_name: str=None, fqdn: self.persistent_disk = persistent_disk +class AvailableRuntimeVersions(Model): + """AvailableRuntimeVersions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: A list of all supported runtime versions. + :vartype value: + list[~azure.mgmt.appplatform.v2019_05_01_preview.models.SupportedRuntimeVersion] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SupportedRuntimeVersion]'}, + } + + def __init__(self, **kwargs) -> None: + super(AvailableRuntimeVersions, self).__init__(**kwargs) + self.value = None + + class BindingResource(ProxyResource): """Binding resource payload. @@ -725,6 +749,8 @@ class DeploymentInstance(Model): :vartype reason: str :ivar discovery_status: Discovery status of the deployment instance :vartype discovery_status: str + :ivar start_time: Start time of the deployment instance + :vartype start_time: str """ _validation = { @@ -732,6 +758,7 @@ class DeploymentInstance(Model): 'status': {'readonly': True}, 'reason': {'readonly': True}, 'discovery_status': {'readonly': True}, + 'start_time': {'readonly': True}, } _attribute_map = { @@ -739,6 +766,7 @@ class DeploymentInstance(Model): 'status': {'key': 'status', 'type': 'str'}, 'reason': {'key': 'reason', 'type': 'str'}, 'discovery_status': {'key': 'discoveryStatus', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, } def __init__(self, **kwargs) -> None: @@ -747,6 +775,7 @@ def __init__(self, **kwargs) -> None: self.status = None self.reason = None self.discovery_status = None + self.start_time = None class DeploymentResource(ProxyResource): @@ -764,6 +793,8 @@ class DeploymentResource(ProxyResource): :param properties: Properties of the Deployment resource :type properties: ~azure.mgmt.appplatform.v2019_05_01_preview.models.DeploymentResourceProperties + :param sku: Sku of the Deployment resource + :type sku: ~azure.mgmt.appplatform.v2019_05_01_preview.models.Sku """ _validation = { @@ -777,11 +808,13 @@ class DeploymentResource(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'DeploymentResourceProperties'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, } - def __init__(self, *, properties=None, **kwargs) -> None: + def __init__(self, *, properties=None, sku=None, **kwargs) -> None: super(DeploymentResource, self).__init__(**kwargs) self.properties = properties + self.sku = sku class DeploymentResourceProperties(Model): @@ -799,7 +832,7 @@ class DeploymentResourceProperties(Model): :type deployment_settings: ~azure.mgmt.appplatform.v2019_05_01_preview.models.DeploymentSettings :ivar provisioning_state: Provisioning state of the Deployment. Possible - values include: 'Creating', 'Updating', 'Succeeded', 'Failed' + values include: 'Creating', 'Updating', 'Succeeded', 'Failed', 'Deleting' :vartype provisioning_state: str or ~azure.mgmt.appplatform.v2019_05_01_preview.models.DeploymentResourceProvisioningState :ivar status: Status of the Deployment. Possible values include: @@ -859,13 +892,16 @@ class DeploymentSettings(Model): :type memory_in_gb: int :param jvm_options: JVM parameter :type jvm_options: str + :param net_core_main_entry_path: The path to the .NET executable relative + to zip root + :type net_core_main_entry_path: str :param instance_count: Instance count, basic tier should be in range (1, 25), standard tier should be in range (1, 500). Default value: 1 . :type instance_count: int :param environment_variables: Collection of environment variables :type environment_variables: dict[str, str] :param runtime_version: Runtime version. Possible values include: - 'Java_8', 'Java_11' + 'Java_8', 'Java_11', 'NetCore_31' :type runtime_version: str or ~azure.mgmt.appplatform.v2019_05_01_preview.models.RuntimeVersion """ @@ -874,16 +910,18 @@ class DeploymentSettings(Model): 'cpu': {'key': 'cpu', 'type': 'int'}, 'memory_in_gb': {'key': 'memoryInGB', 'type': 'int'}, 'jvm_options': {'key': 'jvmOptions', 'type': 'str'}, + 'net_core_main_entry_path': {'key': 'netCoreMainEntryPath', 'type': 'str'}, 'instance_count': {'key': 'instanceCount', 'type': 'int'}, 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, } - def __init__(self, *, cpu: int=1, memory_in_gb: int=1, jvm_options: str=None, instance_count: int=1, environment_variables=None, runtime_version=None, **kwargs) -> None: + def __init__(self, *, cpu: int=1, memory_in_gb: int=1, jvm_options: str=None, net_core_main_entry_path: str=None, instance_count: int=1, environment_variables=None, runtime_version=None, **kwargs) -> None: super(DeploymentSettings, self).__init__(**kwargs) self.cpu = cpu self.memory_in_gb = memory_in_gb self.jvm_options = jvm_options + self.net_core_main_entry_path = net_core_main_entry_path self.instance_count = instance_count self.environment_variables = environment_variables self.runtime_version = runtime_version @@ -1051,17 +1089,22 @@ class MetricDimension(Model): :type name: str :param display_name: Localized friendly display name of the dimension :type display_name: str + :param to_be_exported_for_shoebox: Whether this dimension should be + included for the Shoebox export scenario + :type to_be_exported_for_shoebox: bool """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, } - def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + def __init__(self, *, name: str=None, display_name: str=None, to_be_exported_for_shoebox: bool=None, **kwargs) -> None: super(MetricDimension, self).__init__(**kwargs) self.name = name self.display_name = display_name + self.to_be_exported_for_shoebox = to_be_exported_for_shoebox class MetricSpecification(Model): @@ -1174,6 +1217,9 @@ def __init__(self, *, type: str, name: str, **kwargs) -> None: class NetworkProfile(Model): """Service network profile payload. + Variables are only populated by the server, and will be ignored when + sending a request. + :param service_runtime_subnet_id: Fully qualified resource Id of the subnet to host Azure Spring Cloud Service Runtime :type service_runtime_subnet_id: str @@ -1188,14 +1234,23 @@ class NetworkProfile(Model): :param app_network_resource_group: Name of the resource group containing network resources of Azure Spring Cloud Apps :type app_network_resource_group: str + :ivar outbound_ips: Desired outbound IP resources for Azure Spring Cloud + instance. + :vartype outbound_ips: + ~azure.mgmt.appplatform.v2019_05_01_preview.models.NetworkProfileOutboundIPs """ + _validation = { + 'outbound_ips': {'readonly': True}, + } + _attribute_map = { 'service_runtime_subnet_id': {'key': 'serviceRuntimeSubnetId', 'type': 'str'}, 'app_subnet_id': {'key': 'appSubnetId', 'type': 'str'}, 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, 'service_runtime_network_resource_group': {'key': 'serviceRuntimeNetworkResourceGroup', 'type': 'str'}, 'app_network_resource_group': {'key': 'appNetworkResourceGroup', 'type': 'str'}, + 'outbound_ips': {'key': 'outboundIPs', 'type': 'NetworkProfileOutboundIPs'}, } def __init__(self, *, service_runtime_subnet_id: str=None, app_subnet_id: str=None, service_cidr: str=None, service_runtime_network_resource_group: str=None, app_network_resource_group: str=None, **kwargs) -> None: @@ -1205,6 +1260,30 @@ def __init__(self, *, service_runtime_subnet_id: str=None, app_subnet_id: str=No self.service_cidr = service_cidr self.service_runtime_network_resource_group = service_runtime_network_resource_group self.app_network_resource_group = app_network_resource_group + self.outbound_ips = None + + +class NetworkProfileOutboundIPs(Model): + """Desired outbound IP resources for Azure Spring Cloud instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar public_ips: A list of public IP addresses. + :vartype public_ips: list[str] + """ + + _validation = { + 'public_ips': {'readonly': True}, + } + + _attribute_map = { + 'public_ips': {'key': 'publicIPs', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(NetworkProfileOutboundIPs, self).__init__(**kwargs) + self.public_ips = None class OperationDetail(Model): @@ -1702,6 +1781,34 @@ def __init__(self, *, minimum: int, maximum: int=None, default: int=None, scale_ self.scale_type = scale_type +class SupportedRuntimeVersion(Model): + """Supported deployment runtime version descriptor. + + :param value: The raw value which could be passed to deployment CRUD + operations. Possible values include: 'Java_8', 'Java_11', 'NetCore_31' + :type value: str or + ~azure.mgmt.appplatform.v2019_05_01_preview.models.SupportedRuntimeValue + :param platform: The platform of this runtime version (possible values: + "Java" or ".NET"). Possible values include: 'Java', '.NET Core' + :type platform: str or + ~azure.mgmt.appplatform.v2019_05_01_preview.models.SupportedRuntimePlatform + :param version: The detailed version (major.minor) of the platform. + :type version: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'platform': {'key': 'platform', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, value=None, platform=None, version: str=None, **kwargs) -> None: + super(SupportedRuntimeVersion, self).__init__(**kwargs) + self.value = value + self.platform = platform + self.version = version + + class TemporaryDisk(Model): """Temporary disk payload. @@ -1800,7 +1907,7 @@ class UserSourceInfo(Model): """Source information for a deployment. :param type: Type of the source uploaded. Possible values include: 'Jar', - 'Source' + 'NetCoreZip', 'Source' :type type: str or ~azure.mgmt.appplatform.v2019_05_01_preview.models.UserSourceType :param relative_path: Relative path of the storage which stores the source diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/operations/__init__.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/operations/__init__.py index 45301a531c0e..de8f71f38f04 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/operations/__init__.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/operations/__init__.py @@ -16,6 +16,7 @@ from ._custom_domains_operations import CustomDomainsOperations from ._deployments_operations import DeploymentsOperations from ._operations import Operations +from ._runtime_versions_operations import RuntimeVersionsOperations from ._sku_operations import SkuOperations __all__ = [ @@ -26,5 +27,6 @@ 'CustomDomainsOperations', 'DeploymentsOperations', 'Operations', + 'RuntimeVersionsOperations', 'SkuOperations', ] diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/operations/_deployments_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/operations/_deployments_operations.py index 05f24f854b58..b599cbbc1ce4 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/operations/_deployments_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/operations/_deployments_operations.py @@ -113,8 +113,8 @@ def get( def _create_or_update_initial( - self, resource_group_name, service_name, app_name, deployment_name, properties=None, custom_headers=None, raw=False, **operation_config): - deployment_resource = models.DeploymentResource(properties=properties) + self, resource_group_name, service_name, app_name, deployment_name, properties=None, sku=None, custom_headers=None, raw=False, **operation_config): + deployment_resource = models.DeploymentResource(properties=properties, sku=sku) # Construct URL url = self.create_or_update.metadata['url'] @@ -149,7 +149,7 @@ def _create_or_update_initial( 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]: + if response.status_code not in [200, 201, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -160,6 +160,8 @@ def _create_or_update_initial( deserialized = self._deserialize('DeploymentResource', response) if response.status_code == 201: deserialized = self._deserialize('DeploymentResource', response) + if response.status_code == 202: + deserialized = self._deserialize('DeploymentResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -168,7 +170,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, service_name, app_name, deployment_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, service_name, app_name, deployment_name, properties=None, sku=None, custom_headers=None, raw=False, polling=True, **operation_config): """Create a new Deployment or update an exiting Deployment. :param resource_group_name: The name of the resource group that @@ -184,6 +186,8 @@ def create_or_update( :param properties: Properties of the Deployment resource :type properties: ~azure.mgmt.appplatform.v2019_05_01_preview.models.DeploymentResourceProperties + :param sku: Sku of the Deployment resource + :type sku: ~azure.mgmt.appplatform.v2019_05_01_preview.models.Sku :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 @@ -203,6 +207,7 @@ def create_or_update( app_name=app_name, deployment_name=deployment_name, properties=properties, + sku=sku, custom_headers=custom_headers, raw=True, **operation_config @@ -289,8 +294,8 @@ def delete( def _update_initial( - self, resource_group_name, service_name, app_name, deployment_name, properties=None, custom_headers=None, raw=False, **operation_config): - deployment_resource = models.DeploymentResource(properties=properties) + self, resource_group_name, service_name, app_name, deployment_name, properties=None, sku=None, custom_headers=None, raw=False, **operation_config): + deployment_resource = models.DeploymentResource(properties=properties, sku=sku) # Construct URL url = self.update.metadata['url'] @@ -344,7 +349,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, service_name, app_name, deployment_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, service_name, app_name, deployment_name, properties=None, sku=None, custom_headers=None, raw=False, polling=True, **operation_config): """Operation to update an exiting Deployment. :param resource_group_name: The name of the resource group that @@ -360,6 +365,8 @@ def update( :param properties: Properties of the Deployment resource :type properties: ~azure.mgmt.appplatform.v2019_05_01_preview.models.DeploymentResourceProperties + :param sku: Sku of the Deployment resource + :type sku: ~azure.mgmt.appplatform.v2019_05_01_preview.models.Sku :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 @@ -379,6 +386,7 @@ def update( app_name=app_name, deployment_name=deployment_name, properties=properties, + sku=sku, custom_headers=custom_headers, raw=True, **operation_config diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/operations/_runtime_versions_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/operations/_runtime_versions_operations.py new file mode 100644 index 000000000000..d3eaac0f5b06 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2019_05_01_preview/operations/_runtime_versions_operations.py @@ -0,0 +1,93 @@ +# 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 msrestazure.azure_exceptions import CloudError + +from .. import models + + +class RuntimeVersionsOperations(object): + """RuntimeVersionsOperations 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: Client Api Version. Constant value: "2019-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-05-01-preview" + + self.config = config + + def list_runtime_versions( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available runtime versions supported by + Microsoft.AppPlatform provider. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AvailableRuntimeVersions or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2019_05_01_preview.models.AvailableRuntimeVersions + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_runtime_versions.metadata['url'] + + # 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]: + 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('AvailableRuntimeVersions', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_runtime_versions.metadata = {'url': '/providers/Microsoft.AppPlatform/runtimeVersions'} diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/_app_platform_management_client.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/_app_platform_management_client.py index 4bd86311153c..ca5a03e81bd9 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/_app_platform_management_client.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/_app_platform_management_client.py @@ -22,6 +22,7 @@ from .operations import CustomDomainsOperations from .operations import DeploymentsOperations from .operations import Operations +from .operations import RuntimeVersionsOperations from .operations import SkusOperations from . import models @@ -50,6 +51,8 @@ class AppPlatformManagementClient(SDKClient): :vartype deployments: azure.mgmt.appplatform.v2020_07_01.operations.DeploymentsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.appplatform.v2020_07_01.operations.Operations + :ivar runtime_versions: RuntimeVersions operations + :vartype runtime_versions: azure.mgmt.appplatform.v2020_07_01.operations.RuntimeVersionsOperations :ivar skus: Skus operations :vartype skus: azure.mgmt.appplatform.v2020_07_01.operations.SkusOperations @@ -92,5 +95,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) + self.runtime_versions = RuntimeVersionsOperations( + self._client, self.config, self._serialize, self._deserialize) self.skus = SkusOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/models/__init__.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/models/__init__.py index f344f11ac6f3..4ce60886aabf 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/models/__init__.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/models/__init__.py @@ -12,6 +12,7 @@ try: from ._models_py3 import AppResource from ._models_py3 import AppResourceProperties + from ._models_py3 import AvailableRuntimeVersions from ._models_py3 import BindingResource from ._models_py3 import BindingResourceProperties from ._models_py3 import CertificateProperties @@ -21,6 +22,8 @@ from ._models_py3 import ConfigServerProperties from ._models_py3 import ConfigServerResource from ._models_py3 import ConfigServerSettings + from ._models_py3 import ConfigServerSettingsErrorRecord + from ._models_py3 import ConfigServerSettingsValidateResult from ._models_py3 import CustomDomainProperties from ._models_py3 import CustomDomainResource from ._models_py3 import CustomDomainValidatePayload @@ -41,6 +44,7 @@ from ._models_py3 import NameAvailability from ._models_py3 import NameAvailabilityParameters from ._models_py3 import NetworkProfile + from ._models_py3 import NetworkProfileOutboundIPs from ._models_py3 import OperationDetail from ._models_py3 import OperationDisplay from ._models_py3 import OperationProperties @@ -59,6 +63,7 @@ from ._models_py3 import ServiceSpecification from ._models_py3 import Sku from ._models_py3 import SkuCapacity + from ._models_py3 import SupportedRuntimeVersion from ._models_py3 import TemporaryDisk from ._models_py3 import TestKeys from ._models_py3 import TrackedResource @@ -66,6 +71,7 @@ except (SyntaxError, ImportError): from ._models import AppResource from ._models import AppResourceProperties + from ._models import AvailableRuntimeVersions from ._models import BindingResource from ._models import BindingResourceProperties from ._models import CertificateProperties @@ -75,6 +81,8 @@ from ._models import ConfigServerProperties from ._models import ConfigServerResource from ._models import ConfigServerSettings + from ._models import ConfigServerSettingsErrorRecord + from ._models import ConfigServerSettingsValidateResult from ._models import CustomDomainProperties from ._models import CustomDomainResource from ._models import CustomDomainValidatePayload @@ -95,6 +103,7 @@ from ._models import NameAvailability from ._models import NameAvailabilityParameters from ._models import NetworkProfile + from ._models import NetworkProfileOutboundIPs from ._models import OperationDetail from ._models import OperationDisplay from ._models import OperationProperties @@ -113,6 +122,7 @@ from ._models import ServiceSpecification from ._models import Sku from ._models import SkuCapacity + from ._models import SupportedRuntimeVersion from ._models import TemporaryDisk from ._models import TestKeys from ._models import TrackedResource @@ -139,11 +149,14 @@ SkuScaleType, ResourceSkuRestrictionsType, ResourceSkuRestrictionsReasonCode, + SupportedRuntimeValue, + SupportedRuntimePlatform, ) __all__ = [ 'AppResource', 'AppResourceProperties', + 'AvailableRuntimeVersions', 'BindingResource', 'BindingResourceProperties', 'CertificateProperties', @@ -153,6 +166,8 @@ 'ConfigServerProperties', 'ConfigServerResource', 'ConfigServerSettings', + 'ConfigServerSettingsErrorRecord', + 'ConfigServerSettingsValidateResult', 'CustomDomainProperties', 'CustomDomainResource', 'CustomDomainValidatePayload', @@ -173,6 +188,7 @@ 'NameAvailability', 'NameAvailabilityParameters', 'NetworkProfile', + 'NetworkProfileOutboundIPs', 'OperationDetail', 'OperationDisplay', 'OperationProperties', @@ -191,6 +207,7 @@ 'ServiceSpecification', 'Sku', 'SkuCapacity', + 'SupportedRuntimeVersion', 'TemporaryDisk', 'TestKeys', 'TrackedResource', @@ -216,4 +233,6 @@ 'SkuScaleType', 'ResourceSkuRestrictionsType', 'ResourceSkuRestrictionsReasonCode', + 'SupportedRuntimeValue', + 'SupportedRuntimePlatform', ] diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/models/_app_platform_management_client_enums.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/models/_app_platform_management_client_enums.py index bff22e842112..b24c61016427 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/models/_app_platform_management_client_enums.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/models/_app_platform_management_client_enums.py @@ -67,6 +67,7 @@ class AppResourceProvisioningState(str, Enum): class UserSourceType(str, Enum): jar = "Jar" + net_core_zip = "NetCoreZip" source = "Source" @@ -74,6 +75,7 @@ class RuntimeVersion(str, Enum): java_8 = "Java_8" java_11 = "Java_11" + net_core_31 = "NetCore_31" class DeploymentResourceProvisioningState(str, Enum): @@ -112,3 +114,16 @@ class ResourceSkuRestrictionsReasonCode(str, Enum): quota_id = "QuotaId" not_available_for_subscription = "NotAvailableForSubscription" + + +class SupportedRuntimeValue(str, Enum): + + java_8 = "Java_8" + java_11 = "Java_11" + net_core_31 = "NetCore_31" + + +class SupportedRuntimePlatform(str, Enum): + + java = "Java" + net_core = ".NET Core" diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/models/_models.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/models/_models.py index b8da605188fa..899625f1fad8 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/models/_models.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/models/_models.py @@ -183,6 +183,30 @@ def __init__(self, **kwargs): self.persistent_disk = kwargs.get('persistent_disk', None) +class AvailableRuntimeVersions(Model): + """AvailableRuntimeVersions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: A list of all supported runtime versions. + :vartype value: + list[~azure.mgmt.appplatform.v2020_07_01.models.SupportedRuntimeVersion] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SupportedRuntimeVersion]'}, + } + + def __init__(self, **kwargs): + super(AvailableRuntimeVersions, self).__init__(**kwargs) + self.value = None + + class BindingResource(ProxyResource): """Binding resource payload. @@ -626,6 +650,51 @@ def __init__(self, **kwargs): self.git_property = kwargs.get('git_property', None) +class ConfigServerSettingsErrorRecord(Model): + """Error record of the config server settings. + + :param name: The name of the config server settings error record + :type name: str + :param uri: The uri of the config server settings error record + :type uri: str + :param messages: The detail error messages of the record + :type messages: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'messages': {'key': 'messages', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ConfigServerSettingsErrorRecord, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.uri = kwargs.get('uri', None) + self.messages = kwargs.get('messages', None) + + +class ConfigServerSettingsValidateResult(Model): + """Validation result for config server settings. + + :param is_valid: Indicate if the config server settings are valid + :type is_valid: bool + :param details: The detail validation results + :type details: + list[~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerSettingsErrorRecord] + """ + + _attribute_map = { + 'is_valid': {'key': 'isValid', 'type': 'bool'}, + 'details': {'key': 'details', 'type': '[ConfigServerSettingsErrorRecord]'}, + } + + def __init__(self, **kwargs): + super(ConfigServerSettingsValidateResult, self).__init__(**kwargs) + self.is_valid = kwargs.get('is_valid', None) + self.details = kwargs.get('details', None) + + class CustomDomainProperties(Model): """Custom domain of app resource payload. @@ -748,6 +817,8 @@ class DeploymentInstance(Model): :vartype reason: str :ivar discovery_status: Discovery status of the deployment instance :vartype discovery_status: str + :ivar start_time: Start time of the deployment instance + :vartype start_time: str """ _validation = { @@ -755,6 +826,7 @@ class DeploymentInstance(Model): 'status': {'readonly': True}, 'reason': {'readonly': True}, 'discovery_status': {'readonly': True}, + 'start_time': {'readonly': True}, } _attribute_map = { @@ -762,6 +834,7 @@ class DeploymentInstance(Model): 'status': {'key': 'status', 'type': 'str'}, 'reason': {'key': 'reason', 'type': 'str'}, 'discovery_status': {'key': 'discoveryStatus', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, } def __init__(self, **kwargs): @@ -770,6 +843,7 @@ def __init__(self, **kwargs): self.status = None self.reason = None self.discovery_status = None + self.start_time = None class DeploymentResource(ProxyResource): @@ -885,10 +959,13 @@ class DeploymentSettings(Model): :type memory_in_gb: int :param jvm_options: JVM parameter :type jvm_options: str + :param net_core_main_entry_path: The path to the .NET executable relative + to zip root + :type net_core_main_entry_path: str :param environment_variables: Collection of environment variables :type environment_variables: dict[str, str] :param runtime_version: Runtime version. Possible values include: - 'Java_8', 'Java_11' + 'Java_8', 'Java_11', 'NetCore_31' :type runtime_version: str or ~azure.mgmt.appplatform.v2020_07_01.models.RuntimeVersion """ @@ -897,6 +974,7 @@ class DeploymentSettings(Model): 'cpu': {'key': 'cpu', 'type': 'int'}, 'memory_in_gb': {'key': 'memoryInGB', 'type': 'int'}, 'jvm_options': {'key': 'jvmOptions', 'type': 'str'}, + 'net_core_main_entry_path': {'key': 'netCoreMainEntryPath', 'type': 'str'}, 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, } @@ -906,6 +984,7 @@ def __init__(self, **kwargs): self.cpu = kwargs.get('cpu', 1) self.memory_in_gb = kwargs.get('memory_in_gb', 1) self.jvm_options = kwargs.get('jvm_options', None) + self.net_core_main_entry_path = kwargs.get('net_core_main_entry_path', None) self.environment_variables = kwargs.get('environment_variables', None) self.runtime_version = kwargs.get('runtime_version', None) @@ -1268,6 +1347,9 @@ def __init__(self, **kwargs): class NetworkProfile(Model): """Service network profile payload. + Variables are only populated by the server, and will be ignored when + sending a request. + :param service_runtime_subnet_id: Fully qualified resource Id of the subnet to host Azure Spring Cloud Service Runtime :type service_runtime_subnet_id: str @@ -1282,14 +1364,23 @@ class NetworkProfile(Model): :param app_network_resource_group: Name of the resource group containing network resources of Azure Spring Cloud Apps :type app_network_resource_group: str + :ivar outbound_ips: Desired outbound IP resources for Azure Spring Cloud + instance. + :vartype outbound_ips: + ~azure.mgmt.appplatform.v2020_07_01.models.NetworkProfileOutboundIPs """ + _validation = { + 'outbound_ips': {'readonly': True}, + } + _attribute_map = { 'service_runtime_subnet_id': {'key': 'serviceRuntimeSubnetId', 'type': 'str'}, 'app_subnet_id': {'key': 'appSubnetId', 'type': 'str'}, 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, 'service_runtime_network_resource_group': {'key': 'serviceRuntimeNetworkResourceGroup', 'type': 'str'}, 'app_network_resource_group': {'key': 'appNetworkResourceGroup', 'type': 'str'}, + 'outbound_ips': {'key': 'outboundIPs', 'type': 'NetworkProfileOutboundIPs'}, } def __init__(self, **kwargs): @@ -1299,6 +1390,30 @@ def __init__(self, **kwargs): self.service_cidr = kwargs.get('service_cidr', None) self.service_runtime_network_resource_group = kwargs.get('service_runtime_network_resource_group', None) self.app_network_resource_group = kwargs.get('app_network_resource_group', None) + self.outbound_ips = None + + +class NetworkProfileOutboundIPs(Model): + """Desired outbound IP resources for Azure Spring Cloud instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar public_ips: A list of public IP addresses. + :vartype public_ips: list[str] + """ + + _validation = { + 'public_ips': {'readonly': True}, + } + + _attribute_map = { + 'public_ips': {'key': 'publicIPs', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(NetworkProfileOutboundIPs, self).__init__(**kwargs) + self.public_ips = None class OperationDetail(Model): @@ -1794,6 +1909,34 @@ def __init__(self, **kwargs): self.scale_type = kwargs.get('scale_type', None) +class SupportedRuntimeVersion(Model): + """Supported deployment runtime version descriptor. + + :param value: The raw value which could be passed to deployment CRUD + operations. Possible values include: 'Java_8', 'Java_11', 'NetCore_31' + :type value: str or + ~azure.mgmt.appplatform.v2020_07_01.models.SupportedRuntimeValue + :param platform: The platform of this runtime version (possible values: + "Java" or ".NET"). Possible values include: 'Java', '.NET Core' + :type platform: str or + ~azure.mgmt.appplatform.v2020_07_01.models.SupportedRuntimePlatform + :param version: The detailed version (major.minor) of the platform. + :type version: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'platform': {'key': 'platform', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SupportedRuntimeVersion, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.platform = kwargs.get('platform', None) + self.version = kwargs.get('version', None) + + class TemporaryDisk(Model): """Temporary disk payload. @@ -1854,7 +1997,7 @@ class UserSourceInfo(Model): """Source information for a deployment. :param type: Type of the source uploaded. Possible values include: 'Jar', - 'Source' + 'NetCoreZip', 'Source' :type type: str or ~azure.mgmt.appplatform.v2020_07_01.models.UserSourceType :param relative_path: Relative path of the storage which stores the source diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/models/_models_py3.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/models/_models_py3.py index f3a67049843c..261e7655946e 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/models/_models_py3.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/models/_models_py3.py @@ -183,6 +183,30 @@ def __init__(self, *, public: bool=None, active_deployment_name: str=None, fqdn: self.persistent_disk = persistent_disk +class AvailableRuntimeVersions(Model): + """AvailableRuntimeVersions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: A list of all supported runtime versions. + :vartype value: + list[~azure.mgmt.appplatform.v2020_07_01.models.SupportedRuntimeVersion] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SupportedRuntimeVersion]'}, + } + + def __init__(self, **kwargs) -> None: + super(AvailableRuntimeVersions, self).__init__(**kwargs) + self.value = None + + class BindingResource(ProxyResource): """Binding resource payload. @@ -626,6 +650,51 @@ def __init__(self, *, git_property=None, **kwargs) -> None: self.git_property = git_property +class ConfigServerSettingsErrorRecord(Model): + """Error record of the config server settings. + + :param name: The name of the config server settings error record + :type name: str + :param uri: The uri of the config server settings error record + :type uri: str + :param messages: The detail error messages of the record + :type messages: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'messages': {'key': 'messages', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, uri: str=None, messages=None, **kwargs) -> None: + super(ConfigServerSettingsErrorRecord, self).__init__(**kwargs) + self.name = name + self.uri = uri + self.messages = messages + + +class ConfigServerSettingsValidateResult(Model): + """Validation result for config server settings. + + :param is_valid: Indicate if the config server settings are valid + :type is_valid: bool + :param details: The detail validation results + :type details: + list[~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerSettingsErrorRecord] + """ + + _attribute_map = { + 'is_valid': {'key': 'isValid', 'type': 'bool'}, + 'details': {'key': 'details', 'type': '[ConfigServerSettingsErrorRecord]'}, + } + + def __init__(self, *, is_valid: bool=None, details=None, **kwargs) -> None: + super(ConfigServerSettingsValidateResult, self).__init__(**kwargs) + self.is_valid = is_valid + self.details = details + + class CustomDomainProperties(Model): """Custom domain of app resource payload. @@ -748,6 +817,8 @@ class DeploymentInstance(Model): :vartype reason: str :ivar discovery_status: Discovery status of the deployment instance :vartype discovery_status: str + :ivar start_time: Start time of the deployment instance + :vartype start_time: str """ _validation = { @@ -755,6 +826,7 @@ class DeploymentInstance(Model): 'status': {'readonly': True}, 'reason': {'readonly': True}, 'discovery_status': {'readonly': True}, + 'start_time': {'readonly': True}, } _attribute_map = { @@ -762,6 +834,7 @@ class DeploymentInstance(Model): 'status': {'key': 'status', 'type': 'str'}, 'reason': {'key': 'reason', 'type': 'str'}, 'discovery_status': {'key': 'discoveryStatus', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, } def __init__(self, **kwargs) -> None: @@ -770,6 +843,7 @@ def __init__(self, **kwargs) -> None: self.status = None self.reason = None self.discovery_status = None + self.start_time = None class DeploymentResource(ProxyResource): @@ -885,10 +959,13 @@ class DeploymentSettings(Model): :type memory_in_gb: int :param jvm_options: JVM parameter :type jvm_options: str + :param net_core_main_entry_path: The path to the .NET executable relative + to zip root + :type net_core_main_entry_path: str :param environment_variables: Collection of environment variables :type environment_variables: dict[str, str] :param runtime_version: Runtime version. Possible values include: - 'Java_8', 'Java_11' + 'Java_8', 'Java_11', 'NetCore_31' :type runtime_version: str or ~azure.mgmt.appplatform.v2020_07_01.models.RuntimeVersion """ @@ -897,15 +974,17 @@ class DeploymentSettings(Model): 'cpu': {'key': 'cpu', 'type': 'int'}, 'memory_in_gb': {'key': 'memoryInGB', 'type': 'int'}, 'jvm_options': {'key': 'jvmOptions', 'type': 'str'}, + 'net_core_main_entry_path': {'key': 'netCoreMainEntryPath', 'type': 'str'}, 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, } - def __init__(self, *, cpu: int=1, memory_in_gb: int=1, jvm_options: str=None, environment_variables=None, runtime_version=None, **kwargs) -> None: + def __init__(self, *, cpu: int=1, memory_in_gb: int=1, jvm_options: str=None, net_core_main_entry_path: str=None, environment_variables=None, runtime_version=None, **kwargs) -> None: super(DeploymentSettings, self).__init__(**kwargs) self.cpu = cpu self.memory_in_gb = memory_in_gb self.jvm_options = jvm_options + self.net_core_main_entry_path = net_core_main_entry_path self.environment_variables = environment_variables self.runtime_version = runtime_version @@ -1268,6 +1347,9 @@ def __init__(self, *, type: str, name: str, **kwargs) -> None: class NetworkProfile(Model): """Service network profile payload. + Variables are only populated by the server, and will be ignored when + sending a request. + :param service_runtime_subnet_id: Fully qualified resource Id of the subnet to host Azure Spring Cloud Service Runtime :type service_runtime_subnet_id: str @@ -1282,14 +1364,23 @@ class NetworkProfile(Model): :param app_network_resource_group: Name of the resource group containing network resources of Azure Spring Cloud Apps :type app_network_resource_group: str + :ivar outbound_ips: Desired outbound IP resources for Azure Spring Cloud + instance. + :vartype outbound_ips: + ~azure.mgmt.appplatform.v2020_07_01.models.NetworkProfileOutboundIPs """ + _validation = { + 'outbound_ips': {'readonly': True}, + } + _attribute_map = { 'service_runtime_subnet_id': {'key': 'serviceRuntimeSubnetId', 'type': 'str'}, 'app_subnet_id': {'key': 'appSubnetId', 'type': 'str'}, 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, 'service_runtime_network_resource_group': {'key': 'serviceRuntimeNetworkResourceGroup', 'type': 'str'}, 'app_network_resource_group': {'key': 'appNetworkResourceGroup', 'type': 'str'}, + 'outbound_ips': {'key': 'outboundIPs', 'type': 'NetworkProfileOutboundIPs'}, } def __init__(self, *, service_runtime_subnet_id: str=None, app_subnet_id: str=None, service_cidr: str=None, service_runtime_network_resource_group: str=None, app_network_resource_group: str=None, **kwargs) -> None: @@ -1299,6 +1390,30 @@ def __init__(self, *, service_runtime_subnet_id: str=None, app_subnet_id: str=No self.service_cidr = service_cidr self.service_runtime_network_resource_group = service_runtime_network_resource_group self.app_network_resource_group = app_network_resource_group + self.outbound_ips = None + + +class NetworkProfileOutboundIPs(Model): + """Desired outbound IP resources for Azure Spring Cloud instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar public_ips: A list of public IP addresses. + :vartype public_ips: list[str] + """ + + _validation = { + 'public_ips': {'readonly': True}, + } + + _attribute_map = { + 'public_ips': {'key': 'publicIPs', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(NetworkProfileOutboundIPs, self).__init__(**kwargs) + self.public_ips = None class OperationDetail(Model): @@ -1794,6 +1909,34 @@ def __init__(self, *, minimum: int, maximum: int=None, default: int=None, scale_ self.scale_type = scale_type +class SupportedRuntimeVersion(Model): + """Supported deployment runtime version descriptor. + + :param value: The raw value which could be passed to deployment CRUD + operations. Possible values include: 'Java_8', 'Java_11', 'NetCore_31' + :type value: str or + ~azure.mgmt.appplatform.v2020_07_01.models.SupportedRuntimeValue + :param platform: The platform of this runtime version (possible values: + "Java" or ".NET"). Possible values include: 'Java', '.NET Core' + :type platform: str or + ~azure.mgmt.appplatform.v2020_07_01.models.SupportedRuntimePlatform + :param version: The detailed version (major.minor) of the platform. + :type version: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'platform': {'key': 'platform', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, value=None, platform=None, version: str=None, **kwargs) -> None: + super(SupportedRuntimeVersion, self).__init__(**kwargs) + self.value = value + self.platform = platform + self.version = version + + class TemporaryDisk(Model): """Temporary disk payload. @@ -1854,7 +1997,7 @@ class UserSourceInfo(Model): """Source information for a deployment. :param type: Type of the source uploaded. Possible values include: 'Jar', - 'Source' + 'NetCoreZip', 'Source' :type type: str or ~azure.mgmt.appplatform.v2020_07_01.models.UserSourceType :param relative_path: Relative path of the storage which stores the source diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/operations/__init__.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/operations/__init__.py index b886c1ca927f..0a24a9df9f9c 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/operations/__init__.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/operations/__init__.py @@ -18,6 +18,7 @@ from ._custom_domains_operations import CustomDomainsOperations from ._deployments_operations import DeploymentsOperations from ._operations import Operations +from ._runtime_versions_operations import RuntimeVersionsOperations from ._skus_operations import SkusOperations __all__ = [ @@ -30,5 +31,6 @@ 'CustomDomainsOperations', 'DeploymentsOperations', 'Operations', + 'RuntimeVersionsOperations', 'SkusOperations', ] diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/operations/_config_servers_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/operations/_config_servers_operations.py index d08df16e4e26..c5c72fd3eaf9 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/operations/_config_servers_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/operations/_config_servers_operations.py @@ -318,3 +318,111 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update_patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default'} + + + def _validate_initial( + self, resource_group_name, service_name, git_property=None, custom_headers=None, raw=False, **operation_config): + config_server_settings = models.ConfigServerSettings(git_property=git_property) + + # Construct URL + url = self.validate.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, '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(config_server_settings, 'ConfigServerSettings') + + # 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]: + 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('ConfigServerSettingsValidateResult', response) + if response.status_code == 202: + deserialized = self._deserialize('ConfigServerSettingsValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def validate( + self, resource_group_name, service_name, git_property=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Check if the config server settings are valid. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param git_property: Property of git environment. + :type git_property: + ~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerGitProperty + :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 + ConfigServerSettingsValidateResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerSettingsValidateResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerSettingsValidateResult]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_initial( + resource_group_name=resource_group_name, + service_name=service_name, + git_property=git_property, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ConfigServerSettingsValidateResult', 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, lro_options={'final-state-via': 'location'}, **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) + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate'} diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/operations/_runtime_versions_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/operations/_runtime_versions_operations.py new file mode 100644 index 000000000000..d7dfdef53fc7 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/operations/_runtime_versions_operations.py @@ -0,0 +1,93 @@ +# 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 msrestazure.azure_exceptions import CloudError + +from .. import models + + +class RuntimeVersionsOperations(object): + """RuntimeVersionsOperations 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: Client Api Version. Constant value: "2020-07-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-07-01" + + self.config = config + + def list_runtime_versions( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available runtime versions supported by + Microsoft.AppPlatform provider. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AvailableRuntimeVersions or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2020_07_01.models.AvailableRuntimeVersions or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_runtime_versions.metadata['url'] + + # 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]: + 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('AvailableRuntimeVersions', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_runtime_versions.metadata = {'url': '/providers/Microsoft.AppPlatform/runtimeVersions'} diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/__init__.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/__init__.py new file mode 100644 index 000000000000..ee44eafce0fc --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._configuration import AppPlatformManagementClientConfiguration +from ._app_platform_management_client import AppPlatformManagementClient +__all__ = ['AppPlatformManagementClient', 'AppPlatformManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/_app_platform_management_client.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/_app_platform_management_client.py new file mode 100644 index 000000000000..e401566fb47e --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/_app_platform_management_client.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import AppPlatformManagementClientConfiguration +from .operations import ServicesOperations +from .operations import ConfigServersOperations +from .operations import MonitoringSettingsOperations +from .operations import AppsOperations +from .operations import BindingsOperations +from .operations import CertificatesOperations +from .operations import CustomDomainsOperations +from .operations import DeploymentsOperations +from .operations import Operations +from .operations import RuntimeVersionsOperations +from .operations import SkusOperations +from . import models + + +class AppPlatformManagementClient(SDKClient): + """REST API for Azure Spring Cloud + + :ivar config: Configuration for client. + :vartype config: AppPlatformManagementClientConfiguration + + :ivar services: Services operations + :vartype services: azure.mgmt.appplatform.v2020_11_01_preview.operations.ServicesOperations + :ivar config_servers: ConfigServers operations + :vartype config_servers: azure.mgmt.appplatform.v2020_11_01_preview.operations.ConfigServersOperations + :ivar monitoring_settings: MonitoringSettings operations + :vartype monitoring_settings: azure.mgmt.appplatform.v2020_11_01_preview.operations.MonitoringSettingsOperations + :ivar apps: Apps operations + :vartype apps: azure.mgmt.appplatform.v2020_11_01_preview.operations.AppsOperations + :ivar bindings: Bindings operations + :vartype bindings: azure.mgmt.appplatform.v2020_11_01_preview.operations.BindingsOperations + :ivar certificates: Certificates operations + :vartype certificates: azure.mgmt.appplatform.v2020_11_01_preview.operations.CertificatesOperations + :ivar custom_domains: CustomDomains operations + :vartype custom_domains: azure.mgmt.appplatform.v2020_11_01_preview.operations.CustomDomainsOperations + :ivar deployments: Deployments operations + :vartype deployments: azure.mgmt.appplatform.v2020_11_01_preview.operations.DeploymentsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.appplatform.v2020_11_01_preview.operations.Operations + :ivar runtime_versions: RuntimeVersions operations + :vartype runtime_versions: azure.mgmt.appplatform.v2020_11_01_preview.operations.RuntimeVersionsOperations + :ivar skus: Skus operations + :vartype skus: azure.mgmt.appplatform.v2020_11_01_preview.operations.SkusOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Gets subscription ID which uniquely identify the + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = AppPlatformManagementClientConfiguration(credentials, subscription_id, base_url) + super(AppPlatformManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2020-11-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.services = ServicesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.config_servers = ConfigServersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.monitoring_settings = MonitoringSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.apps = AppsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.bindings = BindingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.certificates = CertificatesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.custom_domains = CustomDomainsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.deployments = DeploymentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.runtime_versions = RuntimeVersionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.skus = SkusOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/_configuration.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/_configuration.py new file mode 100644 index 000000000000..5a7f3752f059 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/_configuration.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +from msrestazure import AzureConfiguration + +from .version import VERSION + + +class AppPlatformManagementClientConfiguration(AzureConfiguration): + """Configuration for AppPlatformManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Gets subscription ID which uniquely identify the + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(AppPlatformManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-appplatform/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/models/__init__.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/models/__init__.py new file mode 100644 index 000000000000..43fd5c13f36d --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/models/__init__.py @@ -0,0 +1,246 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import ApplicationInsightsAgentVersions + from ._models_py3 import AppResource + from ._models_py3 import AppResourceProperties + from ._models_py3 import AvailableRuntimeVersions + from ._models_py3 import BindingResource + from ._models_py3 import BindingResourceProperties + from ._models_py3 import CertificateProperties + from ._models_py3 import CertificateResource + from ._models_py3 import ClusterResourceProperties + from ._models_py3 import ConfigServerGitProperty + from ._models_py3 import ConfigServerProperties + from ._models_py3 import ConfigServerResource + from ._models_py3 import ConfigServerSettings + from ._models_py3 import ConfigServerSettingsErrorRecord + from ._models_py3 import ConfigServerSettingsValidateResult + from ._models_py3 import CustomDomainProperties + from ._models_py3 import CustomDomainResource + from ._models_py3 import CustomDomainValidatePayload + from ._models_py3 import CustomDomainValidateResult + from ._models_py3 import DeploymentInstance + from ._models_py3 import DeploymentResource + from ._models_py3 import DeploymentResourceProperties + from ._models_py3 import DeploymentSettings + from ._models_py3 import Error + from ._models_py3 import GitPatternRepository + from ._models_py3 import LogFileUrlResponse + from ._models_py3 import LogSpecification + from ._models_py3 import ManagedIdentityProperties + from ._models_py3 import MetricDimension + from ._models_py3 import MetricSpecification + from ._models_py3 import MonitoringSettingProperties + from ._models_py3 import MonitoringSettingResource + from ._models_py3 import NameAvailability + from ._models_py3 import NameAvailabilityParameters + from ._models_py3 import NetworkProfile + from ._models_py3 import NetworkProfileOutboundIPs + from ._models_py3 import OperationDetail + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationProperties + from ._models_py3 import PersistentDisk + from ._models_py3 import ProxyResource + from ._models_py3 import RegenerateTestKeyRequestPayload + from ._models_py3 import RequiredTraffic + from ._models_py3 import Resource + from ._models_py3 import ResourceSku + from ._models_py3 import ResourceSkuCapabilities + from ._models_py3 import ResourceSkuLocationInfo + from ._models_py3 import ResourceSkuRestrictionInfo + from ._models_py3 import ResourceSkuRestrictions + from ._models_py3 import ResourceSkuZoneDetails + from ._models_py3 import ResourceUploadDefinition + from ._models_py3 import ServiceResource + from ._models_py3 import ServiceSpecification + from ._models_py3 import Sku + from ._models_py3 import SkuCapacity + from ._models_py3 import SupportedRuntimeVersion + from ._models_py3 import TemporaryDisk + from ._models_py3 import TestKeys + from ._models_py3 import TrackedResource + from ._models_py3 import UserSourceInfo +except (SyntaxError, ImportError): + from ._models import ApplicationInsightsAgentVersions + from ._models import AppResource + from ._models import AppResourceProperties + from ._models import AvailableRuntimeVersions + from ._models import BindingResource + from ._models import BindingResourceProperties + from ._models import CertificateProperties + from ._models import CertificateResource + from ._models import ClusterResourceProperties + from ._models import ConfigServerGitProperty + from ._models import ConfigServerProperties + from ._models import ConfigServerResource + from ._models import ConfigServerSettings + from ._models import ConfigServerSettingsErrorRecord + from ._models import ConfigServerSettingsValidateResult + from ._models import CustomDomainProperties + from ._models import CustomDomainResource + from ._models import CustomDomainValidatePayload + from ._models import CustomDomainValidateResult + from ._models import DeploymentInstance + from ._models import DeploymentResource + from ._models import DeploymentResourceProperties + from ._models import DeploymentSettings + from ._models import Error + from ._models import GitPatternRepository + from ._models import LogFileUrlResponse + from ._models import LogSpecification + from ._models import ManagedIdentityProperties + from ._models import MetricDimension + from ._models import MetricSpecification + from ._models import MonitoringSettingProperties + from ._models import MonitoringSettingResource + from ._models import NameAvailability + from ._models import NameAvailabilityParameters + from ._models import NetworkProfile + from ._models import NetworkProfileOutboundIPs + from ._models import OperationDetail + from ._models import OperationDisplay + from ._models import OperationProperties + from ._models import PersistentDisk + from ._models import ProxyResource + from ._models import RegenerateTestKeyRequestPayload + from ._models import RequiredTraffic + from ._models import Resource + from ._models import ResourceSku + from ._models import ResourceSkuCapabilities + from ._models import ResourceSkuLocationInfo + from ._models import ResourceSkuRestrictionInfo + from ._models import ResourceSkuRestrictions + from ._models import ResourceSkuZoneDetails + from ._models import ResourceUploadDefinition + from ._models import ServiceResource + from ._models import ServiceSpecification + from ._models import Sku + from ._models import SkuCapacity + from ._models import SupportedRuntimeVersion + from ._models import TemporaryDisk + from ._models import TestKeys + from ._models import TrackedResource + from ._models import UserSourceInfo +from ._paged_models import AppResourcePaged +from ._paged_models import BindingResourcePaged +from ._paged_models import CertificateResourcePaged +from ._paged_models import CustomDomainResourcePaged +from ._paged_models import DeploymentResourcePaged +from ._paged_models import OperationDetailPaged +from ._paged_models import ResourceSkuPaged +from ._paged_models import ServiceResourcePaged +from ._app_platform_management_client_enums import ( + ProvisioningState, + TrafficDirection, + ManagedIdentityType, + ConfigServerState, + MonitoringSettingState, + TestKeyType, + AppResourceProvisioningState, + UserSourceType, + RuntimeVersion, + DeploymentResourceProvisioningState, + DeploymentResourceStatus, + SkuScaleType, + ResourceSkuRestrictionsType, + ResourceSkuRestrictionsReasonCode, + SupportedRuntimeValue, + SupportedRuntimePlatform, +) + +__all__ = [ + 'ApplicationInsightsAgentVersions', + 'AppResource', + 'AppResourceProperties', + 'AvailableRuntimeVersions', + 'BindingResource', + 'BindingResourceProperties', + 'CertificateProperties', + 'CertificateResource', + 'ClusterResourceProperties', + 'ConfigServerGitProperty', + 'ConfigServerProperties', + 'ConfigServerResource', + 'ConfigServerSettings', + 'ConfigServerSettingsErrorRecord', + 'ConfigServerSettingsValidateResult', + 'CustomDomainProperties', + 'CustomDomainResource', + 'CustomDomainValidatePayload', + 'CustomDomainValidateResult', + 'DeploymentInstance', + 'DeploymentResource', + 'DeploymentResourceProperties', + 'DeploymentSettings', + 'Error', + 'GitPatternRepository', + 'LogFileUrlResponse', + 'LogSpecification', + 'ManagedIdentityProperties', + 'MetricDimension', + 'MetricSpecification', + 'MonitoringSettingProperties', + 'MonitoringSettingResource', + 'NameAvailability', + 'NameAvailabilityParameters', + 'NetworkProfile', + 'NetworkProfileOutboundIPs', + 'OperationDetail', + 'OperationDisplay', + 'OperationProperties', + 'PersistentDisk', + 'ProxyResource', + 'RegenerateTestKeyRequestPayload', + 'RequiredTraffic', + 'Resource', + 'ResourceSku', + 'ResourceSkuCapabilities', + 'ResourceSkuLocationInfo', + 'ResourceSkuRestrictionInfo', + 'ResourceSkuRestrictions', + 'ResourceSkuZoneDetails', + 'ResourceUploadDefinition', + 'ServiceResource', + 'ServiceSpecification', + 'Sku', + 'SkuCapacity', + 'SupportedRuntimeVersion', + 'TemporaryDisk', + 'TestKeys', + 'TrackedResource', + 'UserSourceInfo', + 'ServiceResourcePaged', + 'AppResourcePaged', + 'BindingResourcePaged', + 'CertificateResourcePaged', + 'CustomDomainResourcePaged', + 'DeploymentResourcePaged', + 'OperationDetailPaged', + 'ResourceSkuPaged', + 'ProvisioningState', + 'TrafficDirection', + 'ManagedIdentityType', + 'ConfigServerState', + 'MonitoringSettingState', + 'TestKeyType', + 'AppResourceProvisioningState', + 'UserSourceType', + 'RuntimeVersion', + 'DeploymentResourceProvisioningState', + 'DeploymentResourceStatus', + 'SkuScaleType', + 'ResourceSkuRestrictionsType', + 'ResourceSkuRestrictionsReasonCode', + 'SupportedRuntimeValue', + 'SupportedRuntimePlatform', +] diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/models/_app_platform_management_client_enums.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/models/_app_platform_management_client_enums.py new file mode 100644 index 000000000000..5ae8632fbad8 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/models/_app_platform_management_client_enums.py @@ -0,0 +1,135 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class ProvisioningState(str, Enum): + + creating = "Creating" + updating = "Updating" + deleting = "Deleting" + deleted = "Deleted" + succeeded = "Succeeded" + failed = "Failed" + moving = "Moving" + moved = "Moved" + move_failed = "MoveFailed" + + +class TrafficDirection(str, Enum): + + inbound = "Inbound" + outbound = "Outbound" + + +class ManagedIdentityType(str, Enum): + + none = "None" + system_assigned = "SystemAssigned" + user_assigned = "UserAssigned" + system_assigned_user_assigned = "SystemAssigned,UserAssigned" + + +class ConfigServerState(str, Enum): + + not_available = "NotAvailable" + deleted = "Deleted" + failed = "Failed" + succeeded = "Succeeded" + updating = "Updating" + + +class MonitoringSettingState(str, Enum): + + not_available = "NotAvailable" + failed = "Failed" + succeeded = "Succeeded" + updating = "Updating" + + +class TestKeyType(str, Enum): + + primary = "Primary" + secondary = "Secondary" + + +class AppResourceProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + creating = "Creating" + updating = "Updating" + + +class UserSourceType(str, Enum): + + jar = "Jar" + net_core_zip = "NetCoreZip" + source = "Source" + + +class RuntimeVersion(str, Enum): + + java_8 = "Java_8" + java_11 = "Java_11" + net_core_31 = "NetCore_31" + + +class DeploymentResourceProvisioningState(str, Enum): + + creating = "Creating" + updating = "Updating" + succeeded = "Succeeded" + failed = "Failed" + + +class DeploymentResourceStatus(str, Enum): + + unknown = "Unknown" + stopped = "Stopped" + running = "Running" + failed = "Failed" + allocating = "Allocating" + upgrading = "Upgrading" + compiling = "Compiling" + + +class SkuScaleType(str, Enum): + + none = "None" + manual = "Manual" + automatic = "Automatic" + + +class ResourceSkuRestrictionsType(str, Enum): + + location = "Location" + zone = "Zone" + + +class ResourceSkuRestrictionsReasonCode(str, Enum): + + quota_id = "QuotaId" + not_available_for_subscription = "NotAvailableForSubscription" + + +class SupportedRuntimeValue(str, Enum): + + java_8 = "Java_8" + java_11 = "Java_11" + net_core_31 = "NetCore_31" + + +class SupportedRuntimePlatform(str, Enum): + + java = "Java" + net_core = ".NET Core" diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/models/_models.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/models/_models.py new file mode 100644 index 000000000000..d0e8bbc4d86d --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/models/_models.py @@ -0,0 +1,2120 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ApplicationInsightsAgentVersions(Model): + """Application Insights agent versions properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar java: Indicates the version of application insight java agent + :vartype java: str + """ + + _validation = { + 'java': {'readonly': True}, + } + + _attribute_map = { + 'java': {'key': 'java', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsAgentVersions, self).__init__(**kwargs) + self.java = None + + +class Resource(Model): + """The core properties of ARM resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) + + +class AppResource(ProxyResource): + """App resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the App resource + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResourceProperties + :param identity: The Managed Identity type of the app resource + :type identity: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ManagedIdentityProperties + :param location: The GEO location of the application, always the same with + its parent resource + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'AppResourceProperties'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentityProperties'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AppResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.identity = kwargs.get('identity', None) + self.location = kwargs.get('location', None) + + +class AppResourceProperties(Model): + """App resource properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param public: Indicates whether the App exposes public endpoint + :type public: bool + :ivar url: URL of the App + :vartype url: str + :ivar provisioning_state: Provisioning state of the App. Possible values + include: 'Succeeded', 'Failed', 'Creating', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResourceProvisioningState + :param active_deployment_name: Name of the active deployment of the App + :type active_deployment_name: str + :param fqdn: Fully qualified dns Name. + :type fqdn: str + :param https_only: Indicate if only https is allowed. + :type https_only: bool + :ivar created_time: Date time when the resource is created + :vartype created_time: datetime + :param temporary_disk: Temporary disk settings + :type temporary_disk: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.TemporaryDisk + :param persistent_disk: Persistent disk settings + :type persistent_disk: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.PersistentDisk + """ + + _validation = { + 'url': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'created_time': {'readonly': True}, + } + + _attribute_map = { + 'public': {'key': 'public', 'type': 'bool'}, + 'url': {'key': 'url', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'active_deployment_name': {'key': 'activeDeploymentName', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'https_only': {'key': 'httpsOnly', 'type': 'bool'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'temporary_disk': {'key': 'temporaryDisk', 'type': 'TemporaryDisk'}, + 'persistent_disk': {'key': 'persistentDisk', 'type': 'PersistentDisk'}, + } + + def __init__(self, **kwargs): + super(AppResourceProperties, self).__init__(**kwargs) + self.public = kwargs.get('public', None) + self.url = None + self.provisioning_state = None + self.active_deployment_name = kwargs.get('active_deployment_name', None) + self.fqdn = kwargs.get('fqdn', None) + self.https_only = kwargs.get('https_only', None) + self.created_time = None + self.temporary_disk = kwargs.get('temporary_disk', None) + self.persistent_disk = kwargs.get('persistent_disk', None) + + +class AvailableRuntimeVersions(Model): + """AvailableRuntimeVersions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: A list of all supported runtime versions. + :vartype value: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.SupportedRuntimeVersion] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SupportedRuntimeVersion]'}, + } + + def __init__(self, **kwargs): + super(AvailableRuntimeVersions, self).__init__(**kwargs) + self.value = None + + +class BindingResource(ProxyResource): + """Binding resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the Binding resource + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.BindingResourceProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'BindingResourceProperties'}, + } + + def __init__(self, **kwargs): + super(BindingResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class BindingResourceProperties(Model): + """Binding resource properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_name: The name of the bound resource + :vartype resource_name: str + :ivar resource_type: The standard Azure resource type of the bound + resource + :vartype resource_type: str + :param resource_id: The Azure resource id of the bound resource + :type resource_id: str + :param key: The key of the bound resource + :type key: str + :param binding_parameters: Binding parameters of the Binding resource + :type binding_parameters: dict[str, object] + :ivar generated_properties: The generated Spring Boot property file for + this binding. The secret will be deducted. + :vartype generated_properties: str + :ivar created_at: Creation time of the Binding resource + :vartype created_at: str + :ivar updated_at: Update time of the Binding resource + :vartype updated_at: str + """ + + _validation = { + 'resource_name': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'generated_properties': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + } + + _attribute_map = { + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'str'}, + 'binding_parameters': {'key': 'bindingParameters', 'type': '{object}'}, + 'generated_properties': {'key': 'generatedProperties', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'str'}, + 'updated_at': {'key': 'updatedAt', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BindingResourceProperties, self).__init__(**kwargs) + self.resource_name = None + self.resource_type = None + self.resource_id = kwargs.get('resource_id', None) + self.key = kwargs.get('key', None) + self.binding_parameters = kwargs.get('binding_parameters', None) + self.generated_properties = None + self.created_at = None + self.updated_at = None + + +class CertificateProperties(Model): + """Certificate resource payload. + + 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 thumbprint: The thumbprint of certificate. + :vartype thumbprint: str + :param vault_uri: Required. The vault uri of user key vault. + :type vault_uri: str + :param key_vault_cert_name: Required. The certificate name of key vault. + :type key_vault_cert_name: str + :param cert_version: The certificate version of key vault. + :type cert_version: str + :ivar issuer: The issuer of certificate. + :vartype issuer: str + :ivar issued_date: The issue date of certificate. + :vartype issued_date: str + :ivar expiration_date: The expiration date of certificate. + :vartype expiration_date: str + :ivar activate_date: The activate date of certificate. + :vartype activate_date: str + :ivar subject_name: The subject name of certificate. + :vartype subject_name: str + :ivar dns_names: The domain list of certificate. + :vartype dns_names: list[str] + """ + + _validation = { + 'thumbprint': {'readonly': True}, + 'vault_uri': {'required': True}, + 'key_vault_cert_name': {'required': True}, + 'issuer': {'readonly': True}, + 'issued_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'activate_date': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'dns_names': {'readonly': True}, + } + + _attribute_map = { + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'vault_uri': {'key': 'vaultUri', 'type': 'str'}, + 'key_vault_cert_name': {'key': 'keyVaultCertName', 'type': 'str'}, + 'cert_version': {'key': 'certVersion', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'issued_date': {'key': 'issuedDate', 'type': 'str'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'str'}, + 'activate_date': {'key': 'activateDate', 'type': 'str'}, + 'subject_name': {'key': 'subjectName', 'type': 'str'}, + 'dns_names': {'key': 'dnsNames', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(CertificateProperties, self).__init__(**kwargs) + self.thumbprint = None + self.vault_uri = kwargs.get('vault_uri', None) + self.key_vault_cert_name = kwargs.get('key_vault_cert_name', None) + self.cert_version = kwargs.get('cert_version', None) + self.issuer = None + self.issued_date = None + self.expiration_date = None + self.activate_date = None + self.subject_name = None + self.dns_names = None + + +class CertificateResource(ProxyResource): + """Certificate resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the certificate resource payload. + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.CertificateProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CertificateProperties'}, + } + + def __init__(self, **kwargs): + super(CertificateResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class CloudError(Model): + """An error response from the service. + + :param error: An error response from the service. + :type error: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, **kwargs): + super(CloudError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + :param target: The target of the particular error. For example, the name + of the property in error. + :type target: str + :param details: A list of additional details about the error. + :type details: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, **kwargs): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class ClusterResourceProperties(Model): + """Service properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: Provisioning state of the Service. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Deleted', + 'Succeeded', 'Failed', 'Moving', 'Moved', 'MoveFailed' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ProvisioningState + :param network_profile: Network profile of the Service + :type network_profile: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.NetworkProfile + :ivar version: Version of the Service + :vartype version: int + :ivar service_id: ServiceInstanceEntity GUID which uniquely identifies a + created resource + :vartype service_id: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'version': {'readonly': True}, + 'service_id': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'network_profile': {'key': 'networkProfile', 'type': 'NetworkProfile'}, + 'version': {'key': 'version', 'type': 'int'}, + 'service_id': {'key': 'serviceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ClusterResourceProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.network_profile = kwargs.get('network_profile', None) + self.version = None + self.service_id = None + + +class ConfigServerGitProperty(Model): + """Property of git. + + All required parameters must be populated in order to send to Azure. + + :param repositories: Repositories of git. + :type repositories: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.GitPatternRepository] + :param uri: Required. URI of the repository + :type uri: str + :param label: Label of the repository + :type label: str + :param search_paths: Searching path of the repository + :type search_paths: list[str] + :param username: Username of git repository basic auth. + :type username: str + :param password: Password of git repository basic auth. + :type password: str + :param host_key: Public sshKey of git repository. + :type host_key: str + :param host_key_algorithm: SshKey algorithm of git repository. + :type host_key_algorithm: str + :param private_key: Private sshKey algorithm of git repository. + :type private_key: str + :param strict_host_key_checking: Strict host key checking or not. + :type strict_host_key_checking: bool + """ + + _validation = { + 'uri': {'required': True}, + } + + _attribute_map = { + 'repositories': {'key': 'repositories', 'type': '[GitPatternRepository]'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'search_paths': {'key': 'searchPaths', 'type': '[str]'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'host_key': {'key': 'hostKey', 'type': 'str'}, + 'host_key_algorithm': {'key': 'hostKeyAlgorithm', 'type': 'str'}, + 'private_key': {'key': 'privateKey', 'type': 'str'}, + 'strict_host_key_checking': {'key': 'strictHostKeyChecking', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ConfigServerGitProperty, self).__init__(**kwargs) + self.repositories = kwargs.get('repositories', None) + self.uri = kwargs.get('uri', None) + self.label = kwargs.get('label', None) + self.search_paths = kwargs.get('search_paths', None) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) + self.host_key = kwargs.get('host_key', None) + self.host_key_algorithm = kwargs.get('host_key_algorithm', None) + self.private_key = kwargs.get('private_key', None) + self.strict_host_key_checking = kwargs.get('strict_host_key_checking', None) + + +class ConfigServerProperties(Model): + """Config server git properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: State of the config server. Possible values + include: 'NotAvailable', 'Deleted', 'Failed', 'Succeeded', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerState + :param error: Error when apply config server settings. + :type error: ~azure.mgmt.appplatform.v2020_11_01_preview.models.Error + :param config_server: Settings of config server. + :type config_server: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerSettings + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + 'config_server': {'key': 'configServer', 'type': 'ConfigServerSettings'}, + } + + def __init__(self, **kwargs): + super(ConfigServerProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.error = kwargs.get('error', None) + self.config_server = kwargs.get('config_server', None) + + +class ConfigServerResource(ProxyResource): + """Config Server resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the Config Server resource + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ConfigServerProperties'}, + } + + def __init__(self, **kwargs): + super(ConfigServerResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ConfigServerSettings(Model): + """The settings of config server. + + :param git_property: Property of git environment. + :type git_property: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerGitProperty + """ + + _attribute_map = { + 'git_property': {'key': 'gitProperty', 'type': 'ConfigServerGitProperty'}, + } + + def __init__(self, **kwargs): + super(ConfigServerSettings, self).__init__(**kwargs) + self.git_property = kwargs.get('git_property', None) + + +class ConfigServerSettingsErrorRecord(Model): + """Error record of the config server settings. + + :param name: The name of the config server settings error record + :type name: str + :param uri: The uri of the config server settings error record + :type uri: str + :param messages: The detail error messages of the record + :type messages: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'messages': {'key': 'messages', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ConfigServerSettingsErrorRecord, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.uri = kwargs.get('uri', None) + self.messages = kwargs.get('messages', None) + + +class ConfigServerSettingsValidateResult(Model): + """Validation result for config server settings. + + :param is_valid: Indicate if the config server settings are valid + :type is_valid: bool + :param details: The detail validation results + :type details: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerSettingsErrorRecord] + """ + + _attribute_map = { + 'is_valid': {'key': 'isValid', 'type': 'bool'}, + 'details': {'key': 'details', 'type': '[ConfigServerSettingsErrorRecord]'}, + } + + def __init__(self, **kwargs): + super(ConfigServerSettingsValidateResult, self).__init__(**kwargs) + self.is_valid = kwargs.get('is_valid', None) + self.details = kwargs.get('details', None) + + +class CustomDomainProperties(Model): + """Custom domain of app resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param thumbprint: The thumbprint of bound certificate. + :type thumbprint: str + :ivar app_name: The app name of domain. + :vartype app_name: str + :param cert_name: The bound certificate name of domain. + :type cert_name: str + """ + + _validation = { + 'app_name': {'readonly': True}, + } + + _attribute_map = { + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'app_name': {'key': 'appName', 'type': 'str'}, + 'cert_name': {'key': 'certName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomDomainProperties, self).__init__(**kwargs) + self.thumbprint = kwargs.get('thumbprint', None) + self.app_name = None + self.cert_name = kwargs.get('cert_name', None) + + +class CustomDomainResource(ProxyResource): + """Custom domain resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the custom domain resource. + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CustomDomainProperties'}, + } + + def __init__(self, **kwargs): + super(CustomDomainResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class CustomDomainValidatePayload(Model): + """Custom domain validate payload. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name to be validated + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomDomainValidatePayload, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class CustomDomainValidateResult(Model): + """Validation result for custom domain. + + :param is_valid: Indicates if domain name is valid. + :type is_valid: bool + :param message: Message of why domain name is invalid. + :type message: str + """ + + _attribute_map = { + 'is_valid': {'key': 'isValid', 'type': 'bool'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomDomainValidateResult, self).__init__(**kwargs) + self.is_valid = kwargs.get('is_valid', None) + self.message = kwargs.get('message', None) + + +class DeploymentInstance(Model): + """Deployment instance payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the deployment instance + :vartype name: str + :ivar status: Status of the deployment instance + :vartype status: str + :ivar reason: Failed reason of the deployment instance + :vartype reason: str + :ivar discovery_status: Discovery status of the deployment instance + :vartype discovery_status: str + :ivar start_time: Start time of the deployment instance + :vartype start_time: str + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'reason': {'readonly': True}, + 'discovery_status': {'readonly': True}, + 'start_time': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'discovery_status': {'key': 'discoveryStatus', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DeploymentInstance, self).__init__(**kwargs) + self.name = None + self.status = None + self.reason = None + self.discovery_status = None + self.start_time = None + + +class DeploymentResource(ProxyResource): + """Deployment resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the Deployment resource + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResourceProperties + :param sku: Sku of the Deployment resource + :type sku: ~azure.mgmt.appplatform.v2020_11_01_preview.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentResourceProperties'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, **kwargs): + super(DeploymentResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.sku = kwargs.get('sku', None) + + +class DeploymentResourceProperties(Model): + """Deployment resource properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param source: Uploaded source information of the deployment. + :type source: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.UserSourceInfo + :ivar app_name: App name of the deployment + :vartype app_name: str + :param deployment_settings: Deployment settings of the Deployment + :type deployment_settings: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentSettings + :ivar provisioning_state: Provisioning state of the Deployment. Possible + values include: 'Creating', 'Updating', 'Succeeded', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResourceProvisioningState + :ivar status: Status of the Deployment. Possible values include: + 'Unknown', 'Stopped', 'Running', 'Failed', 'Allocating', 'Upgrading', + 'Compiling' + :vartype status: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResourceStatus + :ivar active: Indicates whether the Deployment is active + :vartype active: bool + :ivar created_time: Date time when the resource is created + :vartype created_time: datetime + :ivar instances: Collection of instances belong to the Deployment + :vartype instances: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentInstance] + """ + + _validation = { + 'app_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'active': {'readonly': True}, + 'created_time': {'readonly': True}, + 'instances': {'readonly': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'UserSourceInfo'}, + 'app_name': {'key': 'appName', 'type': 'str'}, + 'deployment_settings': {'key': 'deploymentSettings', 'type': 'DeploymentSettings'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'active': {'key': 'active', 'type': 'bool'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'instances': {'key': 'instances', 'type': '[DeploymentInstance]'}, + } + + def __init__(self, **kwargs): + super(DeploymentResourceProperties, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.app_name = None + self.deployment_settings = kwargs.get('deployment_settings', None) + self.provisioning_state = None + self.status = None + self.active = None + self.created_time = None + self.instances = None + + +class DeploymentSettings(Model): + """Deployment settings payload. + + :param cpu: Required CPU, basic tier should be 1, standard tier should be + in range (1, 4). Default value: 1 . + :type cpu: int + :param memory_in_gb: Required Memory size in GB, basic tier should be in + range (1, 2), standard tier should be in range (1, 8). Default value: 1 . + :type memory_in_gb: int + :param jvm_options: JVM parameter + :type jvm_options: str + :param net_core_main_entry_path: The path to the .NET executable relative + to zip root + :type net_core_main_entry_path: str + :param environment_variables: Collection of environment variables + :type environment_variables: dict[str, str] + :param runtime_version: Runtime version. Possible values include: + 'Java_8', 'Java_11', 'NetCore_31' + :type runtime_version: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.RuntimeVersion + """ + + _attribute_map = { + 'cpu': {'key': 'cpu', 'type': 'int'}, + 'memory_in_gb': {'key': 'memoryInGB', 'type': 'int'}, + 'jvm_options': {'key': 'jvmOptions', 'type': 'str'}, + 'net_core_main_entry_path': {'key': 'netCoreMainEntryPath', 'type': 'str'}, + 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DeploymentSettings, self).__init__(**kwargs) + self.cpu = kwargs.get('cpu', 1) + self.memory_in_gb = kwargs.get('memory_in_gb', 1) + self.jvm_options = kwargs.get('jvm_options', None) + self.net_core_main_entry_path = kwargs.get('net_core_main_entry_path', None) + self.environment_variables = kwargs.get('environment_variables', None) + self.runtime_version = kwargs.get('runtime_version', None) + + +class Error(Model): + """The error code compose of code and message. + + :param code: The code of error. + :type code: str + :param message: The message of error. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class GitPatternRepository(Model): + """Git repository property payload. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the repository + :type name: str + :param pattern: Collection of pattern of the repository + :type pattern: list[str] + :param uri: Required. URI of the repository + :type uri: str + :param label: Label of the repository + :type label: str + :param search_paths: Searching path of the repository + :type search_paths: list[str] + :param username: Username of git repository basic auth. + :type username: str + :param password: Password of git repository basic auth. + :type password: str + :param host_key: Public sshKey of git repository. + :type host_key: str + :param host_key_algorithm: SshKey algorithm of git repository. + :type host_key_algorithm: str + :param private_key: Private sshKey algorithm of git repository. + :type private_key: str + :param strict_host_key_checking: Strict host key checking or not. + :type strict_host_key_checking: bool + """ + + _validation = { + 'name': {'required': True}, + 'uri': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'pattern': {'key': 'pattern', 'type': '[str]'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'search_paths': {'key': 'searchPaths', 'type': '[str]'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'host_key': {'key': 'hostKey', 'type': 'str'}, + 'host_key_algorithm': {'key': 'hostKeyAlgorithm', 'type': 'str'}, + 'private_key': {'key': 'privateKey', 'type': 'str'}, + 'strict_host_key_checking': {'key': 'strictHostKeyChecking', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(GitPatternRepository, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.pattern = kwargs.get('pattern', None) + self.uri = kwargs.get('uri', None) + self.label = kwargs.get('label', None) + self.search_paths = kwargs.get('search_paths', None) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) + self.host_key = kwargs.get('host_key', None) + self.host_key_algorithm = kwargs.get('host_key_algorithm', None) + self.private_key = kwargs.get('private_key', None) + self.strict_host_key_checking = kwargs.get('strict_host_key_checking', None) + + +class LogFileUrlResponse(Model): + """Log file URL payload. + + All required parameters must be populated in order to send to Azure. + + :param url: Required. URL of the log file + :type url: str + """ + + _validation = { + 'url': {'required': True}, + } + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LogFileUrlResponse, self).__init__(**kwargs) + self.url = kwargs.get('url', None) + + +class LogSpecification(Model): + """Specifications of the Log for Azure Monitoring. + + :param name: Name of the log + :type name: str + :param display_name: Localized friendly display name of the log + :type display_name: str + :param blob_duration: Blob duration of the log + :type blob_duration: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LogSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.blob_duration = kwargs.get('blob_duration', None) + + +class ManagedIdentityProperties(Model): + """Managed identity properties retrieved from ARM request headers. + + :param type: Type of the managed identity. Possible values include: + 'None', 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned' + :type type: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ManagedIdentityType + :param principal_id: Principal Id + :type principal_id: str + :param tenant_id: Tenant Id + :type tenant_id: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ManagedIdentityProperties, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.principal_id = kwargs.get('principal_id', None) + self.tenant_id = kwargs.get('tenant_id', None) + + +class MetricDimension(Model): + """Specifications of the Dimension of metrics. + + :param name: Name of the dimension + :type name: str + :param display_name: Localized friendly display name of the dimension + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricDimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + + +class MetricSpecification(Model): + """Specifications of the Metrics for Azure Monitoring. + + :param name: Name of the metric + :type name: str + :param display_name: Localized friendly display name of the metric + :type display_name: str + :param display_description: Localized friendly description of the metric + :type display_description: str + :param unit: Unit that makes sense for the metric + :type unit: str + :param category: Name of the metric category that the metric belongs to. A + metric can only belong to a single category. + :type category: str + :param aggregation_type: Only provide one value for this field. Valid + values: Average, Minimum, Maximum, Total, Count. + :type aggregation_type: str + :param supported_aggregation_types: Supported aggregation types + :type supported_aggregation_types: list[str] + :param supported_time_grain_types: Supported time grain types + :type supported_time_grain_types: list[str] + :param fill_gap_with_zero: Optional. If set to true, then zero will be + returned for time duration where no metric is emitted/published. + :type fill_gap_with_zero: bool + :param dimensions: Dimensions of the metric + :type dimensions: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.MetricDimension] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + } + + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.category = kwargs.get('category', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) + self.supported_time_grain_types = kwargs.get('supported_time_grain_types', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.dimensions = kwargs.get('dimensions', None) + + +class MonitoringSettingProperties(Model): + """Monitoring Setting properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: State of the Monitoring Setting. Possible values + include: 'NotAvailable', 'Failed', 'Succeeded', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingState + :param error: Error when apply Monitoring Setting changes. + :type error: ~azure.mgmt.appplatform.v2020_11_01_preview.models.Error + :param trace_enabled: Indicates whether enable the trace functionality, + which will be deprecated since api version 2020-11-01-preview. Please + leverage appInsightsInstrumentationKey to indicate if monitoringSettings + enabled or not + :type trace_enabled: bool + :param app_insights_instrumentation_key: Target application insight + instrumentation key, null or whitespace include empty will disable + monitoringSettings + :type app_insights_instrumentation_key: str + :param app_insights_sampling_rate: Indicates the sampling rate of + application insight agent, should be in range [0.0, 100.0] + :type app_insights_sampling_rate: float + :param app_insights_agent_versions: Indicates the versions of application + insight agent + :type app_insights_agent_versions: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ApplicationInsightsAgentVersions + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'app_insights_sampling_rate': {'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + 'trace_enabled': {'key': 'traceEnabled', 'type': 'bool'}, + 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, + 'app_insights_sampling_rate': {'key': 'appInsightsSamplingRate', 'type': 'float'}, + 'app_insights_agent_versions': {'key': 'appInsightsAgentVersions', 'type': 'ApplicationInsightsAgentVersions'}, + } + + def __init__(self, **kwargs): + super(MonitoringSettingProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.error = kwargs.get('error', None) + self.trace_enabled = kwargs.get('trace_enabled', None) + self.app_insights_instrumentation_key = kwargs.get('app_insights_instrumentation_key', None) + self.app_insights_sampling_rate = kwargs.get('app_insights_sampling_rate', None) + self.app_insights_agent_versions = kwargs.get('app_insights_agent_versions', None) + + +class MonitoringSettingResource(ProxyResource): + """Monitoring Setting resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the Monitoring Setting resource + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'MonitoringSettingProperties'}, + } + + def __init__(self, **kwargs): + super(MonitoringSettingResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class NameAvailability(Model): + """Name availability result payload. + + :param name_available: Indicates whether the name is available + :type name_available: bool + :param reason: Reason why the name is not available + :type reason: str + :param message: Message why the name is not available + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NameAvailability, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) + + +class NameAvailabilityParameters(Model): + """Name availability parameters payload. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Type of the resource to check name availability + :type type: str + :param name: Required. Name to be checked + :type name: str + """ + + _validation = { + 'type': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NameAvailabilityParameters, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) + + +class NetworkProfile(Model): + """Service network profile payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param service_runtime_subnet_id: Fully qualified resource Id of the + subnet to host Azure Spring Cloud Service Runtime + :type service_runtime_subnet_id: str + :param app_subnet_id: Fully qualified resource Id of the subnet to host + Azure Spring Cloud Apps + :type app_subnet_id: str + :param service_cidr: Azure Spring Cloud service reserved CIDR + :type service_cidr: str + :param service_runtime_network_resource_group: Name of the resource group + containing network resources of Azure Spring Cloud Service Runtime + :type service_runtime_network_resource_group: str + :param app_network_resource_group: Name of the resource group containing + network resources of Azure Spring Cloud Apps + :type app_network_resource_group: str + :ivar outbound_ips: Desired outbound IP resources for Azure Spring Cloud + instance. + :vartype outbound_ips: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.NetworkProfileOutboundIPs + :ivar required_traffics: Required inbound or outbound traffics for Azure + Spring Cloud instance. + :vartype required_traffics: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.RequiredTraffic] + """ + + _validation = { + 'outbound_ips': {'readonly': True}, + 'required_traffics': {'readonly': True}, + } + + _attribute_map = { + 'service_runtime_subnet_id': {'key': 'serviceRuntimeSubnetId', 'type': 'str'}, + 'app_subnet_id': {'key': 'appSubnetId', 'type': 'str'}, + 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, + 'service_runtime_network_resource_group': {'key': 'serviceRuntimeNetworkResourceGroup', 'type': 'str'}, + 'app_network_resource_group': {'key': 'appNetworkResourceGroup', 'type': 'str'}, + 'outbound_ips': {'key': 'outboundIPs', 'type': 'NetworkProfileOutboundIPs'}, + 'required_traffics': {'key': 'requiredTraffics', 'type': '[RequiredTraffic]'}, + } + + def __init__(self, **kwargs): + super(NetworkProfile, self).__init__(**kwargs) + self.service_runtime_subnet_id = kwargs.get('service_runtime_subnet_id', None) + self.app_subnet_id = kwargs.get('app_subnet_id', None) + self.service_cidr = kwargs.get('service_cidr', None) + self.service_runtime_network_resource_group = kwargs.get('service_runtime_network_resource_group', None) + self.app_network_resource_group = kwargs.get('app_network_resource_group', None) + self.outbound_ips = None + self.required_traffics = None + + +class NetworkProfileOutboundIPs(Model): + """Desired outbound IP resources for Azure Spring Cloud instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar public_ips: A list of public IP addresses. + :vartype public_ips: list[str] + """ + + _validation = { + 'public_ips': {'readonly': True}, + } + + _attribute_map = { + 'public_ips': {'key': 'publicIPs', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(NetworkProfileOutboundIPs, self).__init__(**kwargs) + self.public_ips = None + + +class OperationDetail(Model): + """Operation detail payload. + + :param name: Name of the operation + :type name: str + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: bool + :param display: Display of the operation + :type display: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.OperationDisplay + :param origin: Origin of the operation + :type origin: str + :param properties: Properties of the operation + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.OperationProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'OperationProperties'}, + } + + def __init__(self, **kwargs): + super(OperationDetail, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) + + +class OperationDisplay(Model): + """Operation display payload. + + :param provider: Resource provider of the operation + :type provider: str + :param resource: Resource of the operation + :type resource: str + :param operation: Localized friendly name for the operation + :type operation: str + :param description: Localized friendly description for the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class OperationProperties(Model): + """Extra Operation properties. + + :param service_specification: Service specifications of the operation + :type service_specification: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceSpecification + """ + + _attribute_map = { + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, **kwargs): + super(OperationProperties, self).__init__(**kwargs) + self.service_specification = kwargs.get('service_specification', None) + + +class PersistentDisk(Model): + """Persistent disk payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param size_in_gb: Size of the persistent disk in GB + :type size_in_gb: int + :ivar used_in_gb: Size of the used persistent disk in GB + :vartype used_in_gb: int + :param mount_path: Mount path of the persistent disk + :type mount_path: str + """ + + _validation = { + 'size_in_gb': {'maximum': 50, 'minimum': 0}, + 'used_in_gb': {'readonly': True, 'maximum': 50, 'minimum': 0}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'used_in_gb': {'key': 'usedInGB', 'type': 'int'}, + 'mount_path': {'key': 'mountPath', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PersistentDisk, self).__init__(**kwargs) + self.size_in_gb = kwargs.get('size_in_gb', None) + self.used_in_gb = None + self.mount_path = kwargs.get('mount_path', None) + + +class RegenerateTestKeyRequestPayload(Model): + """Regenerate test key request payload. + + All required parameters must be populated in order to send to Azure. + + :param key_type: Required. Type of the test key. Possible values include: + 'Primary', 'Secondary' + :type key_type: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.TestKeyType + """ + + _validation = { + 'key_type': {'required': True}, + } + + _attribute_map = { + 'key_type': {'key': 'keyType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RegenerateTestKeyRequestPayload, self).__init__(**kwargs) + self.key_type = kwargs.get('key_type', None) + + +class RequiredTraffic(Model): + """Required inbound or outbound traffic for Azure Spring Cloud instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar protocol: The protocol of required traffic + :vartype protocol: str + :ivar port: The port of required traffic + :vartype port: int + :ivar ips: The ip list of required traffic + :vartype ips: list[str] + :ivar fqdns: The FQDN list of required traffic + :vartype fqdns: list[str] + :ivar direction: The direction of required traffic. Possible values + include: 'Inbound', 'Outbound' + :vartype direction: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.TrafficDirection + """ + + _validation = { + 'protocol': {'readonly': True}, + 'port': {'readonly': True}, + 'ips': {'readonly': True}, + 'fqdns': {'readonly': True}, + 'direction': {'readonly': True}, + } + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'ips': {'key': 'ips', 'type': '[str]'}, + 'fqdns': {'key': 'fqdns', 'type': '[str]'}, + 'direction': {'key': 'direction', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RequiredTraffic, self).__init__(**kwargs) + self.protocol = None + self.port = None + self.ips = None + self.fqdns = None + self.direction = None + + +class ResourceSku(Model): + """Describes an available Azure Spring Cloud SKU. + + :param resource_type: Gets the type of resource the SKU applies to. + :type resource_type: str + :param name: Gets the name of SKU. + :type name: str + :param tier: Gets the tier of SKU. + :type tier: str + :param capacity: Gets the capacity of SKU. + :type capacity: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.SkuCapacity + :param locations: Gets the set of locations that the SKU is available. + :type locations: list[str] + :param location_info: Gets a list of locations and availability zones in + those locations where the SKU is available. + :type location_info: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceSkuLocationInfo] + :param restrictions: Gets the restrictions because of which SKU cannot be + used. This is + empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceSkuRestrictions] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[ResourceSkuLocationInfo]'}, + 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, + } + + def __init__(self, **kwargs): + super(ResourceSku, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) + self.locations = kwargs.get('locations', None) + self.location_info = kwargs.get('location_info', None) + self.restrictions = kwargs.get('restrictions', None) + + +class ResourceSkuCapabilities(Model): + """ResourceSkuCapabilities. + + :param name: Gets an invariant to describe the feature. + :type name: str + :param value: Gets an invariant if the feature is measured by quantity. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuCapabilities, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class ResourceSkuLocationInfo(Model): + """Locations and availability zones where the SKU is available. + + :param location: Gets location of the SKU + :type location: str + :param zones: Gets list of availability zones where the SKU is supported. + :type zones: list[str] + :param zone_details: Gets details of capabilities available to a SKU in + specific zones. + :type zone_details: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceSkuZoneDetails] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'zone_details': {'key': 'zoneDetails', 'type': '[ResourceSkuZoneDetails]'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuLocationInfo, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.zones = kwargs.get('zones', None) + self.zone_details = kwargs.get('zone_details', None) + + +class ResourceSkuRestrictionInfo(Model): + """Information about the restriction where the SKU cannot be used. + + :param locations: Gets locations where the SKU is restricted + :type locations: list[str] + :param zones: Gets list of availability zones where the SKU is restricted. + :type zones: list[str] + """ + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuRestrictionInfo, self).__init__(**kwargs) + self.locations = kwargs.get('locations', None) + self.zones = kwargs.get('zones', None) + + +class ResourceSkuRestrictions(Model): + """Restrictions where the SKU cannot be used. + + :param type: Gets the type of restrictions. Possible values include: + 'Location', 'Zone' + :type type: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceSkuRestrictionsType + :param values: Gets the value of restrictions. If the restriction type is + set to + location. This would be different locations where the SKU is restricted. + :type values: list[str] + :param restriction_info: Gets the information about the restriction where + the SKU cannot be used. + :type restriction_info: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceSkuRestrictionInfo + :param reason_code: Gets the reason for restriction. Possible values + include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceSkuRestrictionsReasonCode + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'ResourceSkuRestrictionInfo'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuRestrictions, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.values = kwargs.get('values', None) + self.restriction_info = kwargs.get('restriction_info', None) + self.reason_code = kwargs.get('reason_code', None) + + +class ResourceSkuZoneDetails(Model): + """Details of capabilities available to a SKU in specific zones. + + :param name: Gets the set of zones that the SKU is available in with the + specified capabilities. + :type name: list[str] + :param capabilities: Gets a list of capabilities that are available for + the SKU in the + specified list of zones. + :type capabilities: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceSkuCapabilities] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[ResourceSkuCapabilities]'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuZoneDetails, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.capabilities = kwargs.get('capabilities', None) + + +class ResourceUploadDefinition(Model): + """Resource upload definition payload. + + :param relative_path: Source relative path + :type relative_path: str + :param upload_url: Upload URL + :type upload_url: str + """ + + _attribute_map = { + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + 'upload_url': {'key': 'uploadUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceUploadDefinition, self).__init__(**kwargs) + self.relative_path = kwargs.get('relative_path', None) + self.upload_url = kwargs.get('upload_url', None) + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The GEO location of the resource. + :type location: str + :param tags: Tags of the service which is a list of key value pairs that + describe the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class ServiceResource(TrackedResource): + """Service resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The GEO location of the resource. + :type location: str + :param tags: Tags of the service which is a list of key value pairs that + describe the resource. + :type tags: dict[str, str] + :param properties: Properties of the Service resource + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ClusterResourceProperties + :param sku: Sku of the Service resource + :type sku: ~azure.mgmt.appplatform.v2020_11_01_preview.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'ClusterResourceProperties'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, **kwargs): + super(ServiceResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.sku = kwargs.get('sku', None) + + +class ServiceSpecification(Model): + """Service specification payload. + + :param log_specifications: Specifications of the Log for Azure Monitoring + :type log_specifications: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.LogSpecification] + :param metric_specifications: Specifications of the Metrics for Azure + Monitoring + :type metric_specifications: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.MetricSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.log_specifications = kwargs.get('log_specifications', None) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class Sku(Model): + """Sku of Azure Spring Cloud. + + :param name: Name of the Sku + :type name: str + :param tier: Tier of the Sku + :type tier: str + :param capacity: Current capacity of the target resource + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) + + +class SkuCapacity(Model): + """The SKU capacity. + + All required parameters must be populated in order to send to Azure. + + :param minimum: Required. Gets or sets the minimum. + :type minimum: int + :param maximum: Gets or sets the maximum. + :type maximum: int + :param default: Gets or sets the default. + :type default: int + :param scale_type: Gets or sets the type of the scale. Possible values + include: 'None', 'Manual', 'Automatic' + :type scale_type: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.SkuScaleType + """ + + _validation = { + 'minimum': {'required': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SkuCapacity, self).__init__(**kwargs) + self.minimum = kwargs.get('minimum', None) + self.maximum = kwargs.get('maximum', None) + self.default = kwargs.get('default', None) + self.scale_type = kwargs.get('scale_type', None) + + +class SupportedRuntimeVersion(Model): + """Supported deployment runtime version descriptor. + + :param value: The raw value which could be passed to deployment CRUD + operations. Possible values include: 'Java_8', 'Java_11', 'NetCore_31' + :type value: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.SupportedRuntimeValue + :param platform: The platform of this runtime version (possible values: + "Java" or ".NET"). Possible values include: 'Java', '.NET Core' + :type platform: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.SupportedRuntimePlatform + :param version: The detailed version (major.minor) of the platform. + :type version: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'platform': {'key': 'platform', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SupportedRuntimeVersion, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.platform = kwargs.get('platform', None) + self.version = kwargs.get('version', None) + + +class TemporaryDisk(Model): + """Temporary disk payload. + + :param size_in_gb: Size of the temporary disk in GB + :type size_in_gb: int + :param mount_path: Mount path of the temporary disk + :type mount_path: str + """ + + _validation = { + 'size_in_gb': {'maximum': 5, 'minimum': 0}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'mount_path': {'key': 'mountPath', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TemporaryDisk, self).__init__(**kwargs) + self.size_in_gb = kwargs.get('size_in_gb', None) + self.mount_path = kwargs.get('mount_path', None) + + +class TestKeys(Model): + """Test keys payload. + + :param primary_key: Primary key + :type primary_key: str + :param secondary_key: Secondary key + :type secondary_key: str + :param primary_test_endpoint: Primary test endpoint + :type primary_test_endpoint: str + :param secondary_test_endpoint: Secondary test endpoint + :type secondary_test_endpoint: str + :param enabled: Indicates whether the test endpoint feature enabled or not + :type enabled: bool + """ + + _attribute_map = { + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'primary_test_endpoint': {'key': 'primaryTestEndpoint', 'type': 'str'}, + 'secondary_test_endpoint': {'key': 'secondaryTestEndpoint', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(TestKeys, self).__init__(**kwargs) + self.primary_key = kwargs.get('primary_key', None) + self.secondary_key = kwargs.get('secondary_key', None) + self.primary_test_endpoint = kwargs.get('primary_test_endpoint', None) + self.secondary_test_endpoint = kwargs.get('secondary_test_endpoint', None) + self.enabled = kwargs.get('enabled', None) + + +class UserSourceInfo(Model): + """Source information for a deployment. + + :param type: Type of the source uploaded. Possible values include: 'Jar', + 'NetCoreZip', 'Source' + :type type: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.UserSourceType + :param relative_path: Relative path of the storage which stores the source + :type relative_path: str + :param version: Version of the source + :type version: str + :param artifact_selector: Selector for the artifact to be used for the + deployment for multi-module projects. This should be + the relative path to the target module/project. + :type artifact_selector: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'artifact_selector': {'key': 'artifactSelector', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserSourceInfo, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.relative_path = kwargs.get('relative_path', None) + self.version = kwargs.get('version', None) + self.artifact_selector = kwargs.get('artifact_selector', None) diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/models/_models_py3.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..ca36c19bc5e4 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/models/_models_py3.py @@ -0,0 +1,2120 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ApplicationInsightsAgentVersions(Model): + """Application Insights agent versions properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar java: Indicates the version of application insight java agent + :vartype java: str + """ + + _validation = { + 'java': {'readonly': True}, + } + + _attribute_map = { + 'java': {'key': 'java', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ApplicationInsightsAgentVersions, self).__init__(**kwargs) + self.java = None + + +class Resource(Model): + """The core properties of ARM resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) + + +class AppResource(ProxyResource): + """App resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the App resource + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResourceProperties + :param identity: The Managed Identity type of the app resource + :type identity: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ManagedIdentityProperties + :param location: The GEO location of the application, always the same with + its parent resource + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'AppResourceProperties'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentityProperties'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, properties=None, identity=None, location: str=None, **kwargs) -> None: + super(AppResource, self).__init__(**kwargs) + self.properties = properties + self.identity = identity + self.location = location + + +class AppResourceProperties(Model): + """App resource properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param public: Indicates whether the App exposes public endpoint + :type public: bool + :ivar url: URL of the App + :vartype url: str + :ivar provisioning_state: Provisioning state of the App. Possible values + include: 'Succeeded', 'Failed', 'Creating', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResourceProvisioningState + :param active_deployment_name: Name of the active deployment of the App + :type active_deployment_name: str + :param fqdn: Fully qualified dns Name. + :type fqdn: str + :param https_only: Indicate if only https is allowed. + :type https_only: bool + :ivar created_time: Date time when the resource is created + :vartype created_time: datetime + :param temporary_disk: Temporary disk settings + :type temporary_disk: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.TemporaryDisk + :param persistent_disk: Persistent disk settings + :type persistent_disk: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.PersistentDisk + """ + + _validation = { + 'url': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'created_time': {'readonly': True}, + } + + _attribute_map = { + 'public': {'key': 'public', 'type': 'bool'}, + 'url': {'key': 'url', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'active_deployment_name': {'key': 'activeDeploymentName', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'https_only': {'key': 'httpsOnly', 'type': 'bool'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'temporary_disk': {'key': 'temporaryDisk', 'type': 'TemporaryDisk'}, + 'persistent_disk': {'key': 'persistentDisk', 'type': 'PersistentDisk'}, + } + + def __init__(self, *, public: bool=None, active_deployment_name: str=None, fqdn: str=None, https_only: bool=None, temporary_disk=None, persistent_disk=None, **kwargs) -> None: + super(AppResourceProperties, self).__init__(**kwargs) + self.public = public + self.url = None + self.provisioning_state = None + self.active_deployment_name = active_deployment_name + self.fqdn = fqdn + self.https_only = https_only + self.created_time = None + self.temporary_disk = temporary_disk + self.persistent_disk = persistent_disk + + +class AvailableRuntimeVersions(Model): + """AvailableRuntimeVersions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: A list of all supported runtime versions. + :vartype value: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.SupportedRuntimeVersion] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SupportedRuntimeVersion]'}, + } + + def __init__(self, **kwargs) -> None: + super(AvailableRuntimeVersions, self).__init__(**kwargs) + self.value = None + + +class BindingResource(ProxyResource): + """Binding resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the Binding resource + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.BindingResourceProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'BindingResourceProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(BindingResource, self).__init__(**kwargs) + self.properties = properties + + +class BindingResourceProperties(Model): + """Binding resource properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_name: The name of the bound resource + :vartype resource_name: str + :ivar resource_type: The standard Azure resource type of the bound + resource + :vartype resource_type: str + :param resource_id: The Azure resource id of the bound resource + :type resource_id: str + :param key: The key of the bound resource + :type key: str + :param binding_parameters: Binding parameters of the Binding resource + :type binding_parameters: dict[str, object] + :ivar generated_properties: The generated Spring Boot property file for + this binding. The secret will be deducted. + :vartype generated_properties: str + :ivar created_at: Creation time of the Binding resource + :vartype created_at: str + :ivar updated_at: Update time of the Binding resource + :vartype updated_at: str + """ + + _validation = { + 'resource_name': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'generated_properties': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + } + + _attribute_map = { + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'str'}, + 'binding_parameters': {'key': 'bindingParameters', 'type': '{object}'}, + 'generated_properties': {'key': 'generatedProperties', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'str'}, + 'updated_at': {'key': 'updatedAt', 'type': 'str'}, + } + + def __init__(self, *, resource_id: str=None, key: str=None, binding_parameters=None, **kwargs) -> None: + super(BindingResourceProperties, self).__init__(**kwargs) + self.resource_name = None + self.resource_type = None + self.resource_id = resource_id + self.key = key + self.binding_parameters = binding_parameters + self.generated_properties = None + self.created_at = None + self.updated_at = None + + +class CertificateProperties(Model): + """Certificate resource payload. + + 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 thumbprint: The thumbprint of certificate. + :vartype thumbprint: str + :param vault_uri: Required. The vault uri of user key vault. + :type vault_uri: str + :param key_vault_cert_name: Required. The certificate name of key vault. + :type key_vault_cert_name: str + :param cert_version: The certificate version of key vault. + :type cert_version: str + :ivar issuer: The issuer of certificate. + :vartype issuer: str + :ivar issued_date: The issue date of certificate. + :vartype issued_date: str + :ivar expiration_date: The expiration date of certificate. + :vartype expiration_date: str + :ivar activate_date: The activate date of certificate. + :vartype activate_date: str + :ivar subject_name: The subject name of certificate. + :vartype subject_name: str + :ivar dns_names: The domain list of certificate. + :vartype dns_names: list[str] + """ + + _validation = { + 'thumbprint': {'readonly': True}, + 'vault_uri': {'required': True}, + 'key_vault_cert_name': {'required': True}, + 'issuer': {'readonly': True}, + 'issued_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'activate_date': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'dns_names': {'readonly': True}, + } + + _attribute_map = { + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'vault_uri': {'key': 'vaultUri', 'type': 'str'}, + 'key_vault_cert_name': {'key': 'keyVaultCertName', 'type': 'str'}, + 'cert_version': {'key': 'certVersion', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'issued_date': {'key': 'issuedDate', 'type': 'str'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'str'}, + 'activate_date': {'key': 'activateDate', 'type': 'str'}, + 'subject_name': {'key': 'subjectName', 'type': 'str'}, + 'dns_names': {'key': 'dnsNames', 'type': '[str]'}, + } + + def __init__(self, *, vault_uri: str, key_vault_cert_name: str, cert_version: str=None, **kwargs) -> None: + super(CertificateProperties, self).__init__(**kwargs) + self.thumbprint = None + self.vault_uri = vault_uri + self.key_vault_cert_name = key_vault_cert_name + self.cert_version = cert_version + self.issuer = None + self.issued_date = None + self.expiration_date = None + self.activate_date = None + self.subject_name = None + self.dns_names = None + + +class CertificateResource(ProxyResource): + """Certificate resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the certificate resource payload. + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.CertificateProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CertificateProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(CertificateResource, self).__init__(**kwargs) + self.properties = properties + + +class CloudError(Model): + """An error response from the service. + + :param error: An error response from the service. + :type error: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(CloudError, self).__init__(**kwargs) + self.error = error + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + :param target: The target of the particular error. For example, the name + of the property in error. + :type target: str + :param details: A list of additional details about the error. + :type details: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ClusterResourceProperties(Model): + """Service properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: Provisioning state of the Service. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Deleted', + 'Succeeded', 'Failed', 'Moving', 'Moved', 'MoveFailed' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ProvisioningState + :param network_profile: Network profile of the Service + :type network_profile: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.NetworkProfile + :ivar version: Version of the Service + :vartype version: int + :ivar service_id: ServiceInstanceEntity GUID which uniquely identifies a + created resource + :vartype service_id: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'version': {'readonly': True}, + 'service_id': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'network_profile': {'key': 'networkProfile', 'type': 'NetworkProfile'}, + 'version': {'key': 'version', 'type': 'int'}, + 'service_id': {'key': 'serviceId', 'type': 'str'}, + } + + def __init__(self, *, network_profile=None, **kwargs) -> None: + super(ClusterResourceProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.network_profile = network_profile + self.version = None + self.service_id = None + + +class ConfigServerGitProperty(Model): + """Property of git. + + All required parameters must be populated in order to send to Azure. + + :param repositories: Repositories of git. + :type repositories: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.GitPatternRepository] + :param uri: Required. URI of the repository + :type uri: str + :param label: Label of the repository + :type label: str + :param search_paths: Searching path of the repository + :type search_paths: list[str] + :param username: Username of git repository basic auth. + :type username: str + :param password: Password of git repository basic auth. + :type password: str + :param host_key: Public sshKey of git repository. + :type host_key: str + :param host_key_algorithm: SshKey algorithm of git repository. + :type host_key_algorithm: str + :param private_key: Private sshKey algorithm of git repository. + :type private_key: str + :param strict_host_key_checking: Strict host key checking or not. + :type strict_host_key_checking: bool + """ + + _validation = { + 'uri': {'required': True}, + } + + _attribute_map = { + 'repositories': {'key': 'repositories', 'type': '[GitPatternRepository]'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'search_paths': {'key': 'searchPaths', 'type': '[str]'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'host_key': {'key': 'hostKey', 'type': 'str'}, + 'host_key_algorithm': {'key': 'hostKeyAlgorithm', 'type': 'str'}, + 'private_key': {'key': 'privateKey', 'type': 'str'}, + 'strict_host_key_checking': {'key': 'strictHostKeyChecking', 'type': 'bool'}, + } + + def __init__(self, *, uri: str, repositories=None, label: str=None, search_paths=None, username: str=None, password: str=None, host_key: str=None, host_key_algorithm: str=None, private_key: str=None, strict_host_key_checking: bool=None, **kwargs) -> None: + super(ConfigServerGitProperty, self).__init__(**kwargs) + self.repositories = repositories + self.uri = uri + self.label = label + self.search_paths = search_paths + self.username = username + self.password = password + self.host_key = host_key + self.host_key_algorithm = host_key_algorithm + self.private_key = private_key + self.strict_host_key_checking = strict_host_key_checking + + +class ConfigServerProperties(Model): + """Config server git properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: State of the config server. Possible values + include: 'NotAvailable', 'Deleted', 'Failed', 'Succeeded', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerState + :param error: Error when apply config server settings. + :type error: ~azure.mgmt.appplatform.v2020_11_01_preview.models.Error + :param config_server: Settings of config server. + :type config_server: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerSettings + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + 'config_server': {'key': 'configServer', 'type': 'ConfigServerSettings'}, + } + + def __init__(self, *, error=None, config_server=None, **kwargs) -> None: + super(ConfigServerProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.error = error + self.config_server = config_server + + +class ConfigServerResource(ProxyResource): + """Config Server resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the Config Server resource + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ConfigServerProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(ConfigServerResource, self).__init__(**kwargs) + self.properties = properties + + +class ConfigServerSettings(Model): + """The settings of config server. + + :param git_property: Property of git environment. + :type git_property: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerGitProperty + """ + + _attribute_map = { + 'git_property': {'key': 'gitProperty', 'type': 'ConfigServerGitProperty'}, + } + + def __init__(self, *, git_property=None, **kwargs) -> None: + super(ConfigServerSettings, self).__init__(**kwargs) + self.git_property = git_property + + +class ConfigServerSettingsErrorRecord(Model): + """Error record of the config server settings. + + :param name: The name of the config server settings error record + :type name: str + :param uri: The uri of the config server settings error record + :type uri: str + :param messages: The detail error messages of the record + :type messages: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'messages': {'key': 'messages', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, uri: str=None, messages=None, **kwargs) -> None: + super(ConfigServerSettingsErrorRecord, self).__init__(**kwargs) + self.name = name + self.uri = uri + self.messages = messages + + +class ConfigServerSettingsValidateResult(Model): + """Validation result for config server settings. + + :param is_valid: Indicate if the config server settings are valid + :type is_valid: bool + :param details: The detail validation results + :type details: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerSettingsErrorRecord] + """ + + _attribute_map = { + 'is_valid': {'key': 'isValid', 'type': 'bool'}, + 'details': {'key': 'details', 'type': '[ConfigServerSettingsErrorRecord]'}, + } + + def __init__(self, *, is_valid: bool=None, details=None, **kwargs) -> None: + super(ConfigServerSettingsValidateResult, self).__init__(**kwargs) + self.is_valid = is_valid + self.details = details + + +class CustomDomainProperties(Model): + """Custom domain of app resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param thumbprint: The thumbprint of bound certificate. + :type thumbprint: str + :ivar app_name: The app name of domain. + :vartype app_name: str + :param cert_name: The bound certificate name of domain. + :type cert_name: str + """ + + _validation = { + 'app_name': {'readonly': True}, + } + + _attribute_map = { + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'app_name': {'key': 'appName', 'type': 'str'}, + 'cert_name': {'key': 'certName', 'type': 'str'}, + } + + def __init__(self, *, thumbprint: str=None, cert_name: str=None, **kwargs) -> None: + super(CustomDomainProperties, self).__init__(**kwargs) + self.thumbprint = thumbprint + self.app_name = None + self.cert_name = cert_name + + +class CustomDomainResource(ProxyResource): + """Custom domain resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the custom domain resource. + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CustomDomainProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(CustomDomainResource, self).__init__(**kwargs) + self.properties = properties + + +class CustomDomainValidatePayload(Model): + """Custom domain validate payload. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name to be validated + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str, **kwargs) -> None: + super(CustomDomainValidatePayload, self).__init__(**kwargs) + self.name = name + + +class CustomDomainValidateResult(Model): + """Validation result for custom domain. + + :param is_valid: Indicates if domain name is valid. + :type is_valid: bool + :param message: Message of why domain name is invalid. + :type message: str + """ + + _attribute_map = { + 'is_valid': {'key': 'isValid', 'type': 'bool'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, is_valid: bool=None, message: str=None, **kwargs) -> None: + super(CustomDomainValidateResult, self).__init__(**kwargs) + self.is_valid = is_valid + self.message = message + + +class DeploymentInstance(Model): + """Deployment instance payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the deployment instance + :vartype name: str + :ivar status: Status of the deployment instance + :vartype status: str + :ivar reason: Failed reason of the deployment instance + :vartype reason: str + :ivar discovery_status: Discovery status of the deployment instance + :vartype discovery_status: str + :ivar start_time: Start time of the deployment instance + :vartype start_time: str + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'reason': {'readonly': True}, + 'discovery_status': {'readonly': True}, + 'start_time': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'discovery_status': {'key': 'discoveryStatus', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DeploymentInstance, self).__init__(**kwargs) + self.name = None + self.status = None + self.reason = None + self.discovery_status = None + self.start_time = None + + +class DeploymentResource(ProxyResource): + """Deployment resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the Deployment resource + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResourceProperties + :param sku: Sku of the Deployment resource + :type sku: ~azure.mgmt.appplatform.v2020_11_01_preview.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentResourceProperties'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, properties=None, sku=None, **kwargs) -> None: + super(DeploymentResource, self).__init__(**kwargs) + self.properties = properties + self.sku = sku + + +class DeploymentResourceProperties(Model): + """Deployment resource properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param source: Uploaded source information of the deployment. + :type source: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.UserSourceInfo + :ivar app_name: App name of the deployment + :vartype app_name: str + :param deployment_settings: Deployment settings of the Deployment + :type deployment_settings: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentSettings + :ivar provisioning_state: Provisioning state of the Deployment. Possible + values include: 'Creating', 'Updating', 'Succeeded', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResourceProvisioningState + :ivar status: Status of the Deployment. Possible values include: + 'Unknown', 'Stopped', 'Running', 'Failed', 'Allocating', 'Upgrading', + 'Compiling' + :vartype status: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResourceStatus + :ivar active: Indicates whether the Deployment is active + :vartype active: bool + :ivar created_time: Date time when the resource is created + :vartype created_time: datetime + :ivar instances: Collection of instances belong to the Deployment + :vartype instances: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentInstance] + """ + + _validation = { + 'app_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'active': {'readonly': True}, + 'created_time': {'readonly': True}, + 'instances': {'readonly': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'UserSourceInfo'}, + 'app_name': {'key': 'appName', 'type': 'str'}, + 'deployment_settings': {'key': 'deploymentSettings', 'type': 'DeploymentSettings'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'active': {'key': 'active', 'type': 'bool'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'instances': {'key': 'instances', 'type': '[DeploymentInstance]'}, + } + + def __init__(self, *, source=None, deployment_settings=None, **kwargs) -> None: + super(DeploymentResourceProperties, self).__init__(**kwargs) + self.source = source + self.app_name = None + self.deployment_settings = deployment_settings + self.provisioning_state = None + self.status = None + self.active = None + self.created_time = None + self.instances = None + + +class DeploymentSettings(Model): + """Deployment settings payload. + + :param cpu: Required CPU, basic tier should be 1, standard tier should be + in range (1, 4). Default value: 1 . + :type cpu: int + :param memory_in_gb: Required Memory size in GB, basic tier should be in + range (1, 2), standard tier should be in range (1, 8). Default value: 1 . + :type memory_in_gb: int + :param jvm_options: JVM parameter + :type jvm_options: str + :param net_core_main_entry_path: The path to the .NET executable relative + to zip root + :type net_core_main_entry_path: str + :param environment_variables: Collection of environment variables + :type environment_variables: dict[str, str] + :param runtime_version: Runtime version. Possible values include: + 'Java_8', 'Java_11', 'NetCore_31' + :type runtime_version: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.RuntimeVersion + """ + + _attribute_map = { + 'cpu': {'key': 'cpu', 'type': 'int'}, + 'memory_in_gb': {'key': 'memoryInGB', 'type': 'int'}, + 'jvm_options': {'key': 'jvmOptions', 'type': 'str'}, + 'net_core_main_entry_path': {'key': 'netCoreMainEntryPath', 'type': 'str'}, + 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + } + + def __init__(self, *, cpu: int=1, memory_in_gb: int=1, jvm_options: str=None, net_core_main_entry_path: str=None, environment_variables=None, runtime_version=None, **kwargs) -> None: + super(DeploymentSettings, self).__init__(**kwargs) + self.cpu = cpu + self.memory_in_gb = memory_in_gb + self.jvm_options = jvm_options + self.net_core_main_entry_path = net_core_main_entry_path + self.environment_variables = environment_variables + self.runtime_version = runtime_version + + +class Error(Model): + """The error code compose of code and message. + + :param code: The code of error. + :type code: str + :param message: The message of error. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + + +class GitPatternRepository(Model): + """Git repository property payload. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the repository + :type name: str + :param pattern: Collection of pattern of the repository + :type pattern: list[str] + :param uri: Required. URI of the repository + :type uri: str + :param label: Label of the repository + :type label: str + :param search_paths: Searching path of the repository + :type search_paths: list[str] + :param username: Username of git repository basic auth. + :type username: str + :param password: Password of git repository basic auth. + :type password: str + :param host_key: Public sshKey of git repository. + :type host_key: str + :param host_key_algorithm: SshKey algorithm of git repository. + :type host_key_algorithm: str + :param private_key: Private sshKey algorithm of git repository. + :type private_key: str + :param strict_host_key_checking: Strict host key checking or not. + :type strict_host_key_checking: bool + """ + + _validation = { + 'name': {'required': True}, + 'uri': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'pattern': {'key': 'pattern', 'type': '[str]'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'search_paths': {'key': 'searchPaths', 'type': '[str]'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'host_key': {'key': 'hostKey', 'type': 'str'}, + 'host_key_algorithm': {'key': 'hostKeyAlgorithm', 'type': 'str'}, + 'private_key': {'key': 'privateKey', 'type': 'str'}, + 'strict_host_key_checking': {'key': 'strictHostKeyChecking', 'type': 'bool'}, + } + + def __init__(self, *, name: str, uri: str, pattern=None, label: str=None, search_paths=None, username: str=None, password: str=None, host_key: str=None, host_key_algorithm: str=None, private_key: str=None, strict_host_key_checking: bool=None, **kwargs) -> None: + super(GitPatternRepository, self).__init__(**kwargs) + self.name = name + self.pattern = pattern + self.uri = uri + self.label = label + self.search_paths = search_paths + self.username = username + self.password = password + self.host_key = host_key + self.host_key_algorithm = host_key_algorithm + self.private_key = private_key + self.strict_host_key_checking = strict_host_key_checking + + +class LogFileUrlResponse(Model): + """Log file URL payload. + + All required parameters must be populated in order to send to Azure. + + :param url: Required. URL of the log file + :type url: str + """ + + _validation = { + 'url': {'required': True}, + } + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__(self, *, url: str, **kwargs) -> None: + super(LogFileUrlResponse, self).__init__(**kwargs) + self.url = url + + +class LogSpecification(Model): + """Specifications of the Log for Azure Monitoring. + + :param name: Name of the log + :type name: str + :param display_name: Localized friendly display name of the log + :type display_name: str + :param blob_duration: Blob duration of the log + :type blob_duration: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, blob_duration: str=None, **kwargs) -> None: + super(LogSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.blob_duration = blob_duration + + +class ManagedIdentityProperties(Model): + """Managed identity properties retrieved from ARM request headers. + + :param type: Type of the managed identity. Possible values include: + 'None', 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned' + :type type: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ManagedIdentityType + :param principal_id: Principal Id + :type principal_id: str + :param tenant_id: Tenant Id + :type tenant_id: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, *, type=None, principal_id: str=None, tenant_id: str=None, **kwargs) -> None: + super(ManagedIdentityProperties, self).__init__(**kwargs) + self.type = type + self.principal_id = principal_id + self.tenant_id = tenant_id + + +class MetricDimension(Model): + """Specifications of the Dimension of metrics. + + :param name: Name of the dimension + :type name: str + :param display_name: Localized friendly display name of the dimension + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(MetricDimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + + +class MetricSpecification(Model): + """Specifications of the Metrics for Azure Monitoring. + + :param name: Name of the metric + :type name: str + :param display_name: Localized friendly display name of the metric + :type display_name: str + :param display_description: Localized friendly description of the metric + :type display_description: str + :param unit: Unit that makes sense for the metric + :type unit: str + :param category: Name of the metric category that the metric belongs to. A + metric can only belong to a single category. + :type category: str + :param aggregation_type: Only provide one value for this field. Valid + values: Average, Minimum, Maximum, Total, Count. + :type aggregation_type: str + :param supported_aggregation_types: Supported aggregation types + :type supported_aggregation_types: list[str] + :param supported_time_grain_types: Supported time grain types + :type supported_time_grain_types: list[str] + :param fill_gap_with_zero: Optional. If set to true, then zero will be + returned for time duration where no metric is emitted/published. + :type fill_gap_with_zero: bool + :param dimensions: Dimensions of the metric + :type dimensions: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.MetricDimension] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, category: str=None, aggregation_type: str=None, supported_aggregation_types=None, supported_time_grain_types=None, fill_gap_with_zero: bool=None, dimensions=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.category = category + self.aggregation_type = aggregation_type + self.supported_aggregation_types = supported_aggregation_types + self.supported_time_grain_types = supported_time_grain_types + self.fill_gap_with_zero = fill_gap_with_zero + self.dimensions = dimensions + + +class MonitoringSettingProperties(Model): + """Monitoring Setting properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: State of the Monitoring Setting. Possible values + include: 'NotAvailable', 'Failed', 'Succeeded', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingState + :param error: Error when apply Monitoring Setting changes. + :type error: ~azure.mgmt.appplatform.v2020_11_01_preview.models.Error + :param trace_enabled: Indicates whether enable the trace functionality, + which will be deprecated since api version 2020-11-01-preview. Please + leverage appInsightsInstrumentationKey to indicate if monitoringSettings + enabled or not + :type trace_enabled: bool + :param app_insights_instrumentation_key: Target application insight + instrumentation key, null or whitespace include empty will disable + monitoringSettings + :type app_insights_instrumentation_key: str + :param app_insights_sampling_rate: Indicates the sampling rate of + application insight agent, should be in range [0.0, 100.0] + :type app_insights_sampling_rate: float + :param app_insights_agent_versions: Indicates the versions of application + insight agent + :type app_insights_agent_versions: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ApplicationInsightsAgentVersions + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'app_insights_sampling_rate': {'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + 'trace_enabled': {'key': 'traceEnabled', 'type': 'bool'}, + 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, + 'app_insights_sampling_rate': {'key': 'appInsightsSamplingRate', 'type': 'float'}, + 'app_insights_agent_versions': {'key': 'appInsightsAgentVersions', 'type': 'ApplicationInsightsAgentVersions'}, + } + + def __init__(self, *, error=None, trace_enabled: bool=None, app_insights_instrumentation_key: str=None, app_insights_sampling_rate: float=None, app_insights_agent_versions=None, **kwargs) -> None: + super(MonitoringSettingProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.error = error + self.trace_enabled = trace_enabled + self.app_insights_instrumentation_key = app_insights_instrumentation_key + self.app_insights_sampling_rate = app_insights_sampling_rate + self.app_insights_agent_versions = app_insights_agent_versions + + +class MonitoringSettingResource(ProxyResource): + """Monitoring Setting resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the Monitoring Setting resource + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'MonitoringSettingProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(MonitoringSettingResource, self).__init__(**kwargs) + self.properties = properties + + +class NameAvailability(Model): + """Name availability result payload. + + :param name_available: Indicates whether the name is available + :type name_available: bool + :param reason: Reason why the name is not available + :type reason: str + :param message: Message why the name is not available + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, name_available: bool=None, reason: str=None, message: str=None, **kwargs) -> None: + super(NameAvailability, self).__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message + + +class NameAvailabilityParameters(Model): + """Name availability parameters payload. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Type of the resource to check name availability + :type type: str + :param name: Required. Name to be checked + :type name: str + """ + + _validation = { + 'type': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, type: str, name: str, **kwargs) -> None: + super(NameAvailabilityParameters, self).__init__(**kwargs) + self.type = type + self.name = name + + +class NetworkProfile(Model): + """Service network profile payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param service_runtime_subnet_id: Fully qualified resource Id of the + subnet to host Azure Spring Cloud Service Runtime + :type service_runtime_subnet_id: str + :param app_subnet_id: Fully qualified resource Id of the subnet to host + Azure Spring Cloud Apps + :type app_subnet_id: str + :param service_cidr: Azure Spring Cloud service reserved CIDR + :type service_cidr: str + :param service_runtime_network_resource_group: Name of the resource group + containing network resources of Azure Spring Cloud Service Runtime + :type service_runtime_network_resource_group: str + :param app_network_resource_group: Name of the resource group containing + network resources of Azure Spring Cloud Apps + :type app_network_resource_group: str + :ivar outbound_ips: Desired outbound IP resources for Azure Spring Cloud + instance. + :vartype outbound_ips: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.NetworkProfileOutboundIPs + :ivar required_traffics: Required inbound or outbound traffics for Azure + Spring Cloud instance. + :vartype required_traffics: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.RequiredTraffic] + """ + + _validation = { + 'outbound_ips': {'readonly': True}, + 'required_traffics': {'readonly': True}, + } + + _attribute_map = { + 'service_runtime_subnet_id': {'key': 'serviceRuntimeSubnetId', 'type': 'str'}, + 'app_subnet_id': {'key': 'appSubnetId', 'type': 'str'}, + 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, + 'service_runtime_network_resource_group': {'key': 'serviceRuntimeNetworkResourceGroup', 'type': 'str'}, + 'app_network_resource_group': {'key': 'appNetworkResourceGroup', 'type': 'str'}, + 'outbound_ips': {'key': 'outboundIPs', 'type': 'NetworkProfileOutboundIPs'}, + 'required_traffics': {'key': 'requiredTraffics', 'type': '[RequiredTraffic]'}, + } + + def __init__(self, *, service_runtime_subnet_id: str=None, app_subnet_id: str=None, service_cidr: str=None, service_runtime_network_resource_group: str=None, app_network_resource_group: str=None, **kwargs) -> None: + super(NetworkProfile, self).__init__(**kwargs) + self.service_runtime_subnet_id = service_runtime_subnet_id + self.app_subnet_id = app_subnet_id + self.service_cidr = service_cidr + self.service_runtime_network_resource_group = service_runtime_network_resource_group + self.app_network_resource_group = app_network_resource_group + self.outbound_ips = None + self.required_traffics = None + + +class NetworkProfileOutboundIPs(Model): + """Desired outbound IP resources for Azure Spring Cloud instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar public_ips: A list of public IP addresses. + :vartype public_ips: list[str] + """ + + _validation = { + 'public_ips': {'readonly': True}, + } + + _attribute_map = { + 'public_ips': {'key': 'publicIPs', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(NetworkProfileOutboundIPs, self).__init__(**kwargs) + self.public_ips = None + + +class OperationDetail(Model): + """Operation detail payload. + + :param name: Name of the operation + :type name: str + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: bool + :param display: Display of the operation + :type display: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.OperationDisplay + :param origin: Origin of the operation + :type origin: str + :param properties: Properties of the operation + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.OperationProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'OperationProperties'}, + } + + def __init__(self, *, name: str=None, is_data_action: bool=None, display=None, origin: str=None, properties=None, **kwargs) -> None: + super(OperationDetail, self).__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.display = display + self.origin = origin + self.properties = properties + + +class OperationDisplay(Model): + """Operation display payload. + + :param provider: Resource provider of the operation + :type provider: str + :param resource: Resource of the operation + :type resource: str + :param operation: Localized friendly name for the operation + :type operation: str + :param description: Localized friendly description for the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationProperties(Model): + """Extra Operation properties. + + :param service_specification: Service specifications of the operation + :type service_specification: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceSpecification + """ + + _attribute_map = { + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, service_specification=None, **kwargs) -> None: + super(OperationProperties, self).__init__(**kwargs) + self.service_specification = service_specification + + +class PersistentDisk(Model): + """Persistent disk payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param size_in_gb: Size of the persistent disk in GB + :type size_in_gb: int + :ivar used_in_gb: Size of the used persistent disk in GB + :vartype used_in_gb: int + :param mount_path: Mount path of the persistent disk + :type mount_path: str + """ + + _validation = { + 'size_in_gb': {'maximum': 50, 'minimum': 0}, + 'used_in_gb': {'readonly': True, 'maximum': 50, 'minimum': 0}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'used_in_gb': {'key': 'usedInGB', 'type': 'int'}, + 'mount_path': {'key': 'mountPath', 'type': 'str'}, + } + + def __init__(self, *, size_in_gb: int=None, mount_path: str=None, **kwargs) -> None: + super(PersistentDisk, self).__init__(**kwargs) + self.size_in_gb = size_in_gb + self.used_in_gb = None + self.mount_path = mount_path + + +class RegenerateTestKeyRequestPayload(Model): + """Regenerate test key request payload. + + All required parameters must be populated in order to send to Azure. + + :param key_type: Required. Type of the test key. Possible values include: + 'Primary', 'Secondary' + :type key_type: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.TestKeyType + """ + + _validation = { + 'key_type': {'required': True}, + } + + _attribute_map = { + 'key_type': {'key': 'keyType', 'type': 'str'}, + } + + def __init__(self, *, key_type, **kwargs) -> None: + super(RegenerateTestKeyRequestPayload, self).__init__(**kwargs) + self.key_type = key_type + + +class RequiredTraffic(Model): + """Required inbound or outbound traffic for Azure Spring Cloud instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar protocol: The protocol of required traffic + :vartype protocol: str + :ivar port: The port of required traffic + :vartype port: int + :ivar ips: The ip list of required traffic + :vartype ips: list[str] + :ivar fqdns: The FQDN list of required traffic + :vartype fqdns: list[str] + :ivar direction: The direction of required traffic. Possible values + include: 'Inbound', 'Outbound' + :vartype direction: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.TrafficDirection + """ + + _validation = { + 'protocol': {'readonly': True}, + 'port': {'readonly': True}, + 'ips': {'readonly': True}, + 'fqdns': {'readonly': True}, + 'direction': {'readonly': True}, + } + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'ips': {'key': 'ips', 'type': '[str]'}, + 'fqdns': {'key': 'fqdns', 'type': '[str]'}, + 'direction': {'key': 'direction', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(RequiredTraffic, self).__init__(**kwargs) + self.protocol = None + self.port = None + self.ips = None + self.fqdns = None + self.direction = None + + +class ResourceSku(Model): + """Describes an available Azure Spring Cloud SKU. + + :param resource_type: Gets the type of resource the SKU applies to. + :type resource_type: str + :param name: Gets the name of SKU. + :type name: str + :param tier: Gets the tier of SKU. + :type tier: str + :param capacity: Gets the capacity of SKU. + :type capacity: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.SkuCapacity + :param locations: Gets the set of locations that the SKU is available. + :type locations: list[str] + :param location_info: Gets a list of locations and availability zones in + those locations where the SKU is available. + :type location_info: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceSkuLocationInfo] + :param restrictions: Gets the restrictions because of which SKU cannot be + used. This is + empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceSkuRestrictions] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[ResourceSkuLocationInfo]'}, + 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, + } + + def __init__(self, *, resource_type: str=None, name: str=None, tier: str=None, capacity=None, locations=None, location_info=None, restrictions=None, **kwargs) -> None: + super(ResourceSku, self).__init__(**kwargs) + self.resource_type = resource_type + self.name = name + self.tier = tier + self.capacity = capacity + self.locations = locations + self.location_info = location_info + self.restrictions = restrictions + + +class ResourceSkuCapabilities(Model): + """ResourceSkuCapabilities. + + :param name: Gets an invariant to describe the feature. + :type name: str + :param value: Gets an invariant if the feature is measured by quantity. + :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(ResourceSkuCapabilities, self).__init__(**kwargs) + self.name = name + self.value = value + + +class ResourceSkuLocationInfo(Model): + """Locations and availability zones where the SKU is available. + + :param location: Gets location of the SKU + :type location: str + :param zones: Gets list of availability zones where the SKU is supported. + :type zones: list[str] + :param zone_details: Gets details of capabilities available to a SKU in + specific zones. + :type zone_details: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceSkuZoneDetails] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'zone_details': {'key': 'zoneDetails', 'type': '[ResourceSkuZoneDetails]'}, + } + + def __init__(self, *, location: str=None, zones=None, zone_details=None, **kwargs) -> None: + super(ResourceSkuLocationInfo, self).__init__(**kwargs) + self.location = location + self.zones = zones + self.zone_details = zone_details + + +class ResourceSkuRestrictionInfo(Model): + """Information about the restriction where the SKU cannot be used. + + :param locations: Gets locations where the SKU is restricted + :type locations: list[str] + :param zones: Gets list of availability zones where the SKU is restricted. + :type zones: list[str] + """ + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, locations=None, zones=None, **kwargs) -> None: + super(ResourceSkuRestrictionInfo, self).__init__(**kwargs) + self.locations = locations + self.zones = zones + + +class ResourceSkuRestrictions(Model): + """Restrictions where the SKU cannot be used. + + :param type: Gets the type of restrictions. Possible values include: + 'Location', 'Zone' + :type type: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceSkuRestrictionsType + :param values: Gets the value of restrictions. If the restriction type is + set to + location. This would be different locations where the SKU is restricted. + :type values: list[str] + :param restriction_info: Gets the information about the restriction where + the SKU cannot be used. + :type restriction_info: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceSkuRestrictionInfo + :param reason_code: Gets the reason for restriction. Possible values + include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceSkuRestrictionsReasonCode + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'ResourceSkuRestrictionInfo'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, *, type=None, values=None, restriction_info=None, reason_code=None, **kwargs) -> None: + super(ResourceSkuRestrictions, self).__init__(**kwargs) + self.type = type + self.values = values + self.restriction_info = restriction_info + self.reason_code = reason_code + + +class ResourceSkuZoneDetails(Model): + """Details of capabilities available to a SKU in specific zones. + + :param name: Gets the set of zones that the SKU is available in with the + specified capabilities. + :type name: list[str] + :param capabilities: Gets a list of capabilities that are available for + the SKU in the + specified list of zones. + :type capabilities: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceSkuCapabilities] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[ResourceSkuCapabilities]'}, + } + + def __init__(self, *, name=None, capabilities=None, **kwargs) -> None: + super(ResourceSkuZoneDetails, self).__init__(**kwargs) + self.name = name + self.capabilities = capabilities + + +class ResourceUploadDefinition(Model): + """Resource upload definition payload. + + :param relative_path: Source relative path + :type relative_path: str + :param upload_url: Upload URL + :type upload_url: str + """ + + _attribute_map = { + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + 'upload_url': {'key': 'uploadUrl', 'type': 'str'}, + } + + def __init__(self, *, relative_path: str=None, upload_url: str=None, **kwargs) -> None: + super(ResourceUploadDefinition, self).__init__(**kwargs) + self.relative_path = relative_path + self.upload_url = upload_url + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The GEO location of the resource. + :type location: str + :param tags: Tags of the service which is a list of key value pairs that + describe the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.location = location + self.tags = tags + + +class ServiceResource(TrackedResource): + """Service resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The GEO location of the resource. + :type location: str + :param tags: Tags of the service which is a list of key value pairs that + describe the resource. + :type tags: dict[str, str] + :param properties: Properties of the Service resource + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ClusterResourceProperties + :param sku: Sku of the Service resource + :type sku: ~azure.mgmt.appplatform.v2020_11_01_preview.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'ClusterResourceProperties'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, location: str=None, tags=None, properties=None, sku=None, **kwargs) -> None: + super(ServiceResource, self).__init__(location=location, tags=tags, **kwargs) + self.properties = properties + self.sku = sku + + +class ServiceSpecification(Model): + """Service specification payload. + + :param log_specifications: Specifications of the Log for Azure Monitoring + :type log_specifications: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.LogSpecification] + :param metric_specifications: Specifications of the Metrics for Azure + Monitoring + :type metric_specifications: + list[~azure.mgmt.appplatform.v2020_11_01_preview.models.MetricSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, log_specifications=None, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.log_specifications = log_specifications + self.metric_specifications = metric_specifications + + +class Sku(Model): + """Sku of Azure Spring Cloud. + + :param name: Name of the Sku + :type name: str + :param tier: Tier of the Sku + :type tier: str + :param capacity: Current capacity of the target resource + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name: str=None, tier: str=None, capacity: int=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity + + +class SkuCapacity(Model): + """The SKU capacity. + + All required parameters must be populated in order to send to Azure. + + :param minimum: Required. Gets or sets the minimum. + :type minimum: int + :param maximum: Gets or sets the maximum. + :type maximum: int + :param default: Gets or sets the default. + :type default: int + :param scale_type: Gets or sets the type of the scale. Possible values + include: 'None', 'Manual', 'Automatic' + :type scale_type: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.SkuScaleType + """ + + _validation = { + 'minimum': {'required': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__(self, *, minimum: int, maximum: int=None, default: int=None, scale_type=None, **kwargs) -> None: + super(SkuCapacity, self).__init__(**kwargs) + self.minimum = minimum + self.maximum = maximum + self.default = default + self.scale_type = scale_type + + +class SupportedRuntimeVersion(Model): + """Supported deployment runtime version descriptor. + + :param value: The raw value which could be passed to deployment CRUD + operations. Possible values include: 'Java_8', 'Java_11', 'NetCore_31' + :type value: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.SupportedRuntimeValue + :param platform: The platform of this runtime version (possible values: + "Java" or ".NET"). Possible values include: 'Java', '.NET Core' + :type platform: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.SupportedRuntimePlatform + :param version: The detailed version (major.minor) of the platform. + :type version: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'platform': {'key': 'platform', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, value=None, platform=None, version: str=None, **kwargs) -> None: + super(SupportedRuntimeVersion, self).__init__(**kwargs) + self.value = value + self.platform = platform + self.version = version + + +class TemporaryDisk(Model): + """Temporary disk payload. + + :param size_in_gb: Size of the temporary disk in GB + :type size_in_gb: int + :param mount_path: Mount path of the temporary disk + :type mount_path: str + """ + + _validation = { + 'size_in_gb': {'maximum': 5, 'minimum': 0}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'mount_path': {'key': 'mountPath', 'type': 'str'}, + } + + def __init__(self, *, size_in_gb: int=None, mount_path: str=None, **kwargs) -> None: + super(TemporaryDisk, self).__init__(**kwargs) + self.size_in_gb = size_in_gb + self.mount_path = mount_path + + +class TestKeys(Model): + """Test keys payload. + + :param primary_key: Primary key + :type primary_key: str + :param secondary_key: Secondary key + :type secondary_key: str + :param primary_test_endpoint: Primary test endpoint + :type primary_test_endpoint: str + :param secondary_test_endpoint: Secondary test endpoint + :type secondary_test_endpoint: str + :param enabled: Indicates whether the test endpoint feature enabled or not + :type enabled: bool + """ + + _attribute_map = { + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'primary_test_endpoint': {'key': 'primaryTestEndpoint', 'type': 'str'}, + 'secondary_test_endpoint': {'key': 'secondaryTestEndpoint', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, primary_key: str=None, secondary_key: str=None, primary_test_endpoint: str=None, secondary_test_endpoint: str=None, enabled: bool=None, **kwargs) -> None: + super(TestKeys, self).__init__(**kwargs) + self.primary_key = primary_key + self.secondary_key = secondary_key + self.primary_test_endpoint = primary_test_endpoint + self.secondary_test_endpoint = secondary_test_endpoint + self.enabled = enabled + + +class UserSourceInfo(Model): + """Source information for a deployment. + + :param type: Type of the source uploaded. Possible values include: 'Jar', + 'NetCoreZip', 'Source' + :type type: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.UserSourceType + :param relative_path: Relative path of the storage which stores the source + :type relative_path: str + :param version: Version of the source + :type version: str + :param artifact_selector: Selector for the artifact to be used for the + deployment for multi-module projects. This should be + the relative path to the target module/project. + :type artifact_selector: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'artifact_selector': {'key': 'artifactSelector', 'type': 'str'}, + } + + def __init__(self, *, type=None, relative_path: str=None, version: str=None, artifact_selector: str=None, **kwargs) -> None: + super(UserSourceInfo, self).__init__(**kwargs) + self.type = type + self.relative_path = relative_path + self.version = version + self.artifact_selector = artifact_selector diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/models/_paged_models.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/models/_paged_models.py new file mode 100644 index 000000000000..d8a3f0b9370f --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/models/_paged_models.py @@ -0,0 +1,118 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ServiceResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`ServiceResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ServiceResource]'} + } + + def __init__(self, *args, **kwargs): + + super(ServiceResourcePaged, self).__init__(*args, **kwargs) +class AppResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`AppResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AppResource]'} + } + + def __init__(self, *args, **kwargs): + + super(AppResourcePaged, self).__init__(*args, **kwargs) +class BindingResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`BindingResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[BindingResource]'} + } + + def __init__(self, *args, **kwargs): + + super(BindingResourcePaged, self).__init__(*args, **kwargs) +class CertificateResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`CertificateResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[CertificateResource]'} + } + + def __init__(self, *args, **kwargs): + + super(CertificateResourcePaged, self).__init__(*args, **kwargs) +class CustomDomainResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`CustomDomainResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[CustomDomainResource]'} + } + + def __init__(self, *args, **kwargs): + + super(CustomDomainResourcePaged, self).__init__(*args, **kwargs) +class DeploymentResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`DeploymentResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeploymentResource]'} + } + + def __init__(self, *args, **kwargs): + + super(DeploymentResourcePaged, self).__init__(*args, **kwargs) +class OperationDetailPaged(Paged): + """ + A paging container for iterating over a list of :class:`OperationDetail ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[OperationDetail]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationDetailPaged, self).__init__(*args, **kwargs) +class ResourceSkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceSku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceSku]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceSkuPaged, self).__init__(*args, **kwargs) diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/__init__.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/__init__.py new file mode 100644 index 000000000000..0a24a9df9f9c --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/__init__.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._services_operations import ServicesOperations +from ._config_servers_operations import ConfigServersOperations +from ._monitoring_settings_operations import MonitoringSettingsOperations +from ._apps_operations import AppsOperations +from ._bindings_operations import BindingsOperations +from ._certificates_operations import CertificatesOperations +from ._custom_domains_operations import CustomDomainsOperations +from ._deployments_operations import DeploymentsOperations +from ._operations import Operations +from ._runtime_versions_operations import RuntimeVersionsOperations +from ._skus_operations import SkusOperations + +__all__ = [ + 'ServicesOperations', + 'ConfigServersOperations', + 'MonitoringSettingsOperations', + 'AppsOperations', + 'BindingsOperations', + 'CertificatesOperations', + 'CustomDomainsOperations', + 'DeploymentsOperations', + 'Operations', + 'RuntimeVersionsOperations', + 'SkusOperations', +] diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_apps_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_apps_operations.py new file mode 100644 index 000000000000..4aeca2d36bee --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_apps_operations.py @@ -0,0 +1,634 @@ +# 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 msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class AppsOperations(object): + """AppsOperations 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: The API version to use for this operation. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-01-preview" + + self.config = config + + def get( + self, resource_group_name, service_name, app_name, sync_status=None, custom_headers=None, raw=False, **operation_config): + """Get an App and its properties. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param sync_status: Indicates whether sync status + :type sync_status: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AppResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, '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', min_length=1) + if sync_status is not None: + query_parameters['syncStatus'] = self._serialize.query("sync_status", sync_status, '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]: + 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('AppResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}'} + + + def _create_or_update_initial( + self, resource_group_name, service_name, app_name, app_resource, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, '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', min_length=1) + + # 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_resource, 'AppResource') + + # 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, 201, 202]: + 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('AppResource', response) + if response.status_code == 201: + deserialized = self._deserialize('AppResource', response) + if response.status_code == 202: + deserialized = self._deserialize('AppResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, service_name, app_name, app_resource, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a new App or update an exiting App. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param app_resource: Parameters for the create or update operation + :type app_resource: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResource + :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 AppResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + app_resource=app_resource, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('AppResource', 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_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}'} + + + def _delete_initial( + self, resource_group_name, service_name, app_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, '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', min_length=1) + + # 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, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, service_name, app_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Operation to delete an App. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: 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:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}'} + + + def _update_initial( + self, resource_group_name, service_name, app_name, app_resource, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, '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', min_length=1) + + # 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_resource, 'AppResource') + + # 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]: + 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('AppResource', response) + if response.status_code == 202: + deserialized = self._deserialize('AppResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, service_name, app_name, app_resource, custom_headers=None, raw=False, polling=True, **operation_config): + """Operation to update an exiting App. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param app_resource: Parameters for the update operation + :type app_resource: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResource + :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 AppResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + app_resource=app_resource, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('AppResource', 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) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}'} + + def list( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Handles requests to list all resources in a Service. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_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 AppResource + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResourcePaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResource] + :raises: :class:`CloudError` + """ + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, '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', min_length=1) + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AppResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps'} + + def get_resource_upload_url( + self, resource_group_name, service_name, app_name, custom_headers=None, raw=False, **operation_config): + """Get an resource upload URL for an App, which may be artifacts or source + archive. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_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: ResourceUploadDefinition or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceUploadDefinition + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_resource_upload_url.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, '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', min_length=1) + + # 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]: + 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('ResourceUploadDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_resource_upload_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl'} + + def validate_domain( + self, resource_group_name, service_name, app_name, name, custom_headers=None, raw=False, **operation_config): + """Check the resource name is valid as well as not in use. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param name: Name to be validated + :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: CustomDomainValidateResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainValidateResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + validate_payload = models.CustomDomainValidatePayload(name=name) + + # Construct URL + url = self.validate_domain.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(validate_payload, 'CustomDomainValidatePayload') + + # 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]: + 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('CustomDomainValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + validate_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain'} diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_bindings_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_bindings_operations.py new file mode 100644 index 000000000000..5eaa5f8c6aa4 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_bindings_operations.py @@ -0,0 +1,510 @@ +# 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 msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class BindingsOperations(object): + """BindingsOperations 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: The API version to use for this operation. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-01-preview" + + self.config = config + + def get( + self, resource_group_name, service_name, app_name, binding_name, custom_headers=None, raw=False, **operation_config): + """Get a Binding and its properties. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param binding_name: The name of the Binding resource. + :type binding_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: BindingResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.BindingResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'bindingName': self._serialize.url("binding_name", binding_name, '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', min_length=1) + + # 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]: + 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('BindingResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}'} + + + def _create_or_update_initial( + self, resource_group_name, service_name, app_name, binding_name, properties=None, custom_headers=None, raw=False, **operation_config): + binding_resource = models.BindingResource(properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'bindingName': self._serialize.url("binding_name", binding_name, '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', min_length=1) + + # 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(binding_resource, 'BindingResource') + + # 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, 201, 202]: + 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('BindingResource', response) + if response.status_code == 201: + deserialized = self._deserialize('BindingResource', response) + if response.status_code == 202: + deserialized = self._deserialize('BindingResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, service_name, app_name, binding_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a new Binding or update an exiting Binding. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param binding_name: The name of the Binding resource. + :type binding_name: str + :param properties: Properties of the Binding resource + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.BindingResourceProperties + :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 BindingResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_11_01_preview.models.BindingResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_11_01_preview.models.BindingResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + binding_name=binding_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('BindingResource', 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_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}'} + + + def _delete_initial( + self, resource_group_name, service_name, app_name, binding_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'bindingName': self._serialize.url("binding_name", binding_name, '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', min_length=1) + + # 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, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, service_name, app_name, binding_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Operation to delete a Binding. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param binding_name: The name of the Binding resource. + :type binding_name: 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:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + binding_name=binding_name, + 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}'} + + + def _update_initial( + self, resource_group_name, service_name, app_name, binding_name, properties=None, custom_headers=None, raw=False, **operation_config): + binding_resource = models.BindingResource(properties=properties) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'bindingName': self._serialize.url("binding_name", binding_name, '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', min_length=1) + + # 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(binding_resource, 'BindingResource') + + # 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]: + 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('BindingResource', response) + if response.status_code == 202: + deserialized = self._deserialize('BindingResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, service_name, app_name, binding_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Operation to update an exiting Binding. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param binding_name: The name of the Binding resource. + :type binding_name: str + :param properties: Properties of the Binding resource + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.BindingResourceProperties + :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 BindingResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_11_01_preview.models.BindingResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_11_01_preview.models.BindingResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + binding_name=binding_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('BindingResource', 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) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}'} + + def list( + self, resource_group_name, service_name, app_name, custom_headers=None, raw=False, **operation_config): + """Handles requests to list all resources in an App. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_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 BindingResource + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.BindingResourcePaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.BindingResource] + :raises: :class:`CloudError` + """ + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, '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', min_length=1) + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.BindingResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings'} diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_certificates_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_certificates_operations.py new file mode 100644 index 000000000000..586011d287d4 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_certificates_operations.py @@ -0,0 +1,381 @@ +# 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 msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class CertificatesOperations(object): + """CertificatesOperations 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: The API version to use for this operation. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-01-preview" + + self.config = config + + def get( + self, resource_group_name, service_name, certificate_name, custom_headers=None, raw=False, **operation_config): + """Get the certificate resource. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param certificate_name: The name of the certificate resource. + :type 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: CertificateResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.CertificateResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, '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', min_length=1) + + # 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]: + 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('CertificateResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}'} + + + def _create_or_update_initial( + self, resource_group_name, service_name, certificate_name, properties=None, custom_headers=None, raw=False, **operation_config): + certificate_resource = models.CertificateResource(properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, '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', min_length=1) + + # 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(certificate_resource, 'CertificateResource') + + # 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, 201, 202]: + 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('CertificateResource', response) + if response.status_code == 201: + deserialized = self._deserialize('CertificateResource', response) + if response.status_code == 202: + deserialized = self._deserialize('CertificateResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, service_name, certificate_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update certificate resource. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param certificate_name: The name of the certificate resource. + :type certificate_name: str + :param properties: Properties of the certificate resource payload. + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.CertificateProperties + :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 CertificateResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_11_01_preview.models.CertificateResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_11_01_preview.models.CertificateResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + certificate_name=certificate_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('CertificateResource', 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_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}'} + + + def _delete_initial( + self, resource_group_name, service_name, certificate_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, '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', min_length=1) + + # 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, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, service_name, certificate_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete the certificate resource. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param certificate_name: The name of the certificate resource. + :type certificate_name: 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:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + service_name=service_name, + certificate_name=certificate_name, + 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}'} + + def list( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """List all the certificates of one user. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_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 CertificateResource + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.CertificateResourcePaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.CertificateResource] + :raises: :class:`CloudError` + """ + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, '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', min_length=1) + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.CertificateResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates'} diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_config_servers_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_config_servers_operations.py new file mode 100644 index 000000000000..2f7cb0fc9e4d --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_config_servers_operations.py @@ -0,0 +1,428 @@ +# 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 msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ConfigServersOperations(object): + """ConfigServersOperations 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: The API version to use for this operation. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-01-preview" + + self.config = config + + def get( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Get the config server and its properties. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_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: ConfigServerResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, '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', min_length=1) + + # 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]: + 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('ConfigServerResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default'} + + + def _update_put_initial( + self, resource_group_name, service_name, properties=None, custom_headers=None, raw=False, **operation_config): + config_server_resource = models.ConfigServerResource(properties=properties) + + # Construct URL + url = self.update_put.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, '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', min_length=1) + + # 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(config_server_resource, 'ConfigServerResource') + + # 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]: + 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('ConfigServerResource', response) + if response.status_code == 202: + deserialized = self._deserialize('ConfigServerResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_put( + self, resource_group_name, service_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the config server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param properties: Properties of the Config Server resource + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerProperties + :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 ConfigServerResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_put_initial( + resource_group_name=resource_group_name, + service_name=service_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ConfigServerResource', 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) + update_put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default'} + + + def _update_patch_initial( + self, resource_group_name, service_name, properties=None, custom_headers=None, raw=False, **operation_config): + config_server_resource = models.ConfigServerResource(properties=properties) + + # Construct URL + url = self.update_patch.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, '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', min_length=1) + + # 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(config_server_resource, 'ConfigServerResource') + + # 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]: + 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('ConfigServerResource', response) + if response.status_code == 202: + deserialized = self._deserialize('ConfigServerResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_patch( + self, resource_group_name, service_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the config server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param properties: Properties of the Config Server resource + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerProperties + :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 ConfigServerResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_patch_initial( + resource_group_name=resource_group_name, + service_name=service_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ConfigServerResource', 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) + update_patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default'} + + + def _validate_initial( + self, resource_group_name, service_name, git_property=None, custom_headers=None, raw=False, **operation_config): + config_server_settings = models.ConfigServerSettings(git_property=git_property) + + # Construct URL + url = self.validate.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, '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', min_length=1) + + # 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(config_server_settings, 'ConfigServerSettings') + + # 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]: + 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('ConfigServerSettingsValidateResult', response) + if response.status_code == 202: + deserialized = self._deserialize('ConfigServerSettingsValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def validate( + self, resource_group_name, service_name, git_property=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Check if the config server settings are valid. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param git_property: Property of git environment. + :type git_property: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerGitProperty + :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 + ConfigServerSettingsValidateResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerSettingsValidateResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerSettingsValidateResult]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_initial( + resource_group_name=resource_group_name, + service_name=service_name, + git_property=git_property, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ConfigServerSettingsValidateResult', 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, lro_options={'final-state-via': 'location'}, **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) + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate'} diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_custom_domains_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_custom_domains_operations.py new file mode 100644 index 000000000000..550a865b24af --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_custom_domains_operations.py @@ -0,0 +1,510 @@ +# 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 msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class CustomDomainsOperations(object): + """CustomDomainsOperations 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: The API version to use for this operation. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-01-preview" + + self.config = config + + def get( + self, resource_group_name, service_name, app_name, domain_name, custom_headers=None, raw=False, **operation_config): + """Get the custom domain of one lifecycle application. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param domain_name: The name of the custom domain resource. + :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: CustomDomainResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, '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', min_length=1) + + # 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]: + 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('CustomDomainResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}'} + + + def _create_or_update_initial( + self, resource_group_name, service_name, app_name, domain_name, properties=None, custom_headers=None, raw=False, **operation_config): + domain_resource = models.CustomDomainResource(properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, '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', min_length=1) + + # 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_resource, 'CustomDomainResource') + + # 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, 201, 202]: + 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('CustomDomainResource', response) + if response.status_code == 201: + deserialized = self._deserialize('CustomDomainResource', response) + if response.status_code == 202: + deserialized = self._deserialize('CustomDomainResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, service_name, app_name, domain_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update custom domain of one lifecycle application. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param domain_name: The name of the custom domain resource. + :type domain_name: str + :param properties: Properties of the custom domain resource. + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainProperties + :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 CustomDomainResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + domain_name=domain_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('CustomDomainResource', 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_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}'} + + + def _delete_initial( + self, resource_group_name, service_name, app_name, domain_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, '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', min_length=1) + + # 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, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, service_name, app_name, domain_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete the custom domain of one lifecycle application. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param domain_name: The name of the custom domain resource. + :type domain_name: 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:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + domain_name=domain_name, + 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}'} + + + def _update_initial( + self, resource_group_name, service_name, app_name, domain_name, properties=None, custom_headers=None, raw=False, **operation_config): + domain_resource = models.CustomDomainResource(properties=properties) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, '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', min_length=1) + + # 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_resource, 'CustomDomainResource') + + # 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]: + 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('CustomDomainResource', response) + if response.status_code == 202: + deserialized = self._deserialize('CustomDomainResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, service_name, app_name, domain_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update custom domain of one lifecycle application. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param domain_name: The name of the custom domain resource. + :type domain_name: str + :param properties: Properties of the custom domain resource. + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainProperties + :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 CustomDomainResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + domain_name=domain_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('CustomDomainResource', 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) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}'} + + def list( + self, resource_group_name, service_name, app_name, custom_headers=None, raw=False, **operation_config): + """List the custom domains of one lifecycle application. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_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 CustomDomainResource + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainResourcePaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainResource] + :raises: :class:`CloudError` + """ + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, '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', min_length=1) + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.CustomDomainResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains'} diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_deployments_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_deployments_operations.py new file mode 100644 index 000000000000..f14383c09901 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_deployments_operations.py @@ -0,0 +1,935 @@ +# 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 msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DeploymentsOperations(object): + """DeploymentsOperations 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: The API version to use for this operation. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-01-preview" + + self.config = config + + def get( + self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, **operation_config): + """Get a Deployment and its properties. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param deployment_name: The name of the Deployment resource. + :type deployment_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: DeploymentResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, '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', min_length=1) + + # 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]: + 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('DeploymentResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}'} + + + def _create_or_update_initial( + self, resource_group_name, service_name, app_name, deployment_name, properties=None, sku=None, custom_headers=None, raw=False, **operation_config): + deployment_resource = models.DeploymentResource(properties=properties, sku=sku) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(deployment_resource, 'DeploymentResource') + + # 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, 201, 202]: + 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('DeploymentResource', response) + if response.status_code == 201: + deserialized = self._deserialize('DeploymentResource', response) + if response.status_code == 202: + deserialized = self._deserialize('DeploymentResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, service_name, app_name, deployment_name, properties=None, sku=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a new Deployment or update an exiting Deployment. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param deployment_name: The name of the Deployment resource. + :type deployment_name: str + :param properties: Properties of the Deployment resource + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResourceProperties + :param sku: Sku of the Deployment resource + :type sku: ~azure.mgmt.appplatform.v2020_11_01_preview.models.Sku + :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 DeploymentResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + properties=properties, + sku=sku, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentResource', 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_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}'} + + + def _delete_initial( + self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, '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', min_length=1) + + # 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, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Operation to delete a Deployment. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param deployment_name: The name of the Deployment resource. + :type deployment_name: 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:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}'} + + + def _update_initial( + self, resource_group_name, service_name, app_name, deployment_name, properties=None, sku=None, custom_headers=None, raw=False, **operation_config): + deployment_resource = models.DeploymentResource(properties=properties, sku=sku) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(deployment_resource, 'DeploymentResource') + + # 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]: + 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('DeploymentResource', response) + if response.status_code == 202: + deserialized = self._deserialize('DeploymentResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, service_name, app_name, deployment_name, properties=None, sku=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Operation to update an exiting Deployment. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param deployment_name: The name of the Deployment resource. + :type deployment_name: str + :param properties: Properties of the Deployment resource + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResourceProperties + :param sku: Sku of the Deployment resource + :type sku: ~azure.mgmt.appplatform.v2020_11_01_preview.models.Sku + :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 DeploymentResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + properties=properties, + sku=sku, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentResource', 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) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}'} + + def list( + self, resource_group_name, service_name, app_name, version=None, custom_headers=None, raw=False, **operation_config): + """Handles requests to list all resources in an App. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param version: Version of the deployments to be listed + :type version: list[str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DeploymentResource + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResourcePaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource] + :raises: :class:`CloudError` + """ + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, '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', min_length=1) + if version is not None: + query_parameters['version'] = self._serialize.query("version", version, '[str]', div=',') + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments'} + + def list_for_cluster( + self, resource_group_name, service_name, version=None, custom_headers=None, raw=False, **operation_config): + """List deployments for a certain service. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param version: Version of the deployments to be listed + :type version: list[str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DeploymentResource + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResourcePaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_for_cluster.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, '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', min_length=1) + if version is not None: + query_parameters['version'] = self._serialize.query("version", version, '[str]', div=',') + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_for_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments'} + + + def _start_initial( + self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.start.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, '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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def start( + self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Start the deployment. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param deployment_name: The name of the Deployment resource. + :type deployment_name: 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:`CloudError` + """ + raw_result = self._start_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + 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, lro_options={'final-state-via': 'azure-async-operation'}, **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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start'} + + + def _stop_initial( + self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, '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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def stop( + self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Stop the deployment. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param deployment_name: The name of the Deployment resource. + :type deployment_name: 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:`CloudError` + """ + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + 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, lro_options={'final-state-via': 'azure-async-operation'}, **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) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop'} + + + def _restart_initial( + self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.restart.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, '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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def restart( + self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Restart the deployment. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param deployment_name: The name of the Deployment resource. + :type deployment_name: 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:`CloudError` + """ + raw_result = self._restart_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + 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, lro_options={'final-state-via': 'azure-async-operation'}, **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) + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart'} + + def get_log_file_url( + self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, **operation_config): + """Get deployment log file URL. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param deployment_name: The name of the Deployment resource. + :type deployment_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: LogFileUrlResponse or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.LogFileUrlResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_log_file_url.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, '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', min_length=1) + + # 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, 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('LogFileUrlResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_log_file_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl'} diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_monitoring_settings_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_monitoring_settings_operations.py new file mode 100644 index 000000000000..481998142edd --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_monitoring_settings_operations.py @@ -0,0 +1,322 @@ +# 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 msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class MonitoringSettingsOperations(object): + """MonitoringSettingsOperations 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: The API version to use for this operation. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-01-preview" + + self.config = config + + def get( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Get the Monitoring Setting and its properties. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_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: MonitoringSettingResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, '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', min_length=1) + + # 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]: + 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('MonitoringSettingResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default'} + + + def _update_put_initial( + self, resource_group_name, service_name, properties=None, custom_headers=None, raw=False, **operation_config): + monitoring_setting_resource = models.MonitoringSettingResource(properties=properties) + + # Construct URL + url = self.update_put.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, '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', min_length=1) + + # 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(monitoring_setting_resource, 'MonitoringSettingResource') + + # 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]: + 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('MonitoringSettingResource', response) + if response.status_code == 202: + deserialized = self._deserialize('MonitoringSettingResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_put( + self, resource_group_name, service_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the Monitoring Setting. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param properties: Properties of the Monitoring Setting resource + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingProperties + :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 + MonitoringSettingResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_put_initial( + resource_group_name=resource_group_name, + service_name=service_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('MonitoringSettingResource', 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) + update_put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default'} + + + def _update_patch_initial( + self, resource_group_name, service_name, properties=None, custom_headers=None, raw=False, **operation_config): + monitoring_setting_resource = models.MonitoringSettingResource(properties=properties) + + # Construct URL + url = self.update_patch.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, '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', min_length=1) + + # 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(monitoring_setting_resource, 'MonitoringSettingResource') + + # 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]: + 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('MonitoringSettingResource', response) + if response.status_code == 202: + deserialized = self._deserialize('MonitoringSettingResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_patch( + self, resource_group_name, service_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the Monitoring Setting. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param properties: Properties of the Monitoring Setting resource + :type properties: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingProperties + :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 + MonitoringSettingResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_patch_initial( + resource_group_name=resource_group_name, + service_name=service_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('MonitoringSettingResource', 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) + update_patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default'} diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_operations.py new file mode 100644 index 000000000000..9b0217b968ce --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_operations.py @@ -0,0 +1,103 @@ +# 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 msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations 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: The API version to use for this operation. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available REST API operations of the + Microsoft.AppPlatform provider. + + :param dict custom_headers: headers that will 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 OperationDetail + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.OperationDetailPaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.OperationDetail] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationDetailPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.AppPlatform/operations'} diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_runtime_versions_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_runtime_versions_operations.py new file mode 100644 index 000000000000..143ea4c291ba --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_runtime_versions_operations.py @@ -0,0 +1,93 @@ +# 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 msrestazure.azure_exceptions import CloudError + +from .. import models + + +class RuntimeVersionsOperations(object): + """RuntimeVersionsOperations 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: The API version to use for this operation. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-01-preview" + + self.config = config + + def list_runtime_versions( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available runtime versions supported by + Microsoft.AppPlatform provider. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AvailableRuntimeVersions or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.AvailableRuntimeVersions + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_runtime_versions.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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]: + 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('AvailableRuntimeVersions', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_runtime_versions.metadata = {'url': '/providers/Microsoft.AppPlatform/runtimeVersions'} diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_services_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_services_operations.py new file mode 100644 index 000000000000..cd5766c5cbfd --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_services_operations.py @@ -0,0 +1,859 @@ +# 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 msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ServicesOperations(object): + """ServicesOperations 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: The API version to use for this operation. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-01-preview" + + self.config = config + + def get( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Get a Service and its properties. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_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: ServiceResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, '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', min_length=1) + + # 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]: + 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('ServiceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}'} + + + def _create_or_update_initial( + self, resource_group_name, service_name, resource, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, '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', min_length=1) + + # 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(resource, 'ServiceResource') + + # 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, 201, 202]: + 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('ServiceResource', response) + if response.status_code == 201: + deserialized = self._deserialize('ServiceResource', response) + if response.status_code == 202: + deserialized = self._deserialize('ServiceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, service_name, resource, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a new Service or update an exiting Service. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param resource: Parameters for the create or update operation + :type resource: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource + :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 ServiceResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + resource=resource, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ServiceResource', 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_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}'} + + + def _delete_initial( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, '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', min_length=1) + + # 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 [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, service_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Operation to delete a Service. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: 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:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + service_name=service_name, + 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}'} + + + def _update_initial( + self, resource_group_name, service_name, resource, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, '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', min_length=1) + + # 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(resource, 'ServiceResource') + + # 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]: + 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('ServiceResource', response) + if response.status_code == 202: + deserialized = self._deserialize('ServiceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, service_name, resource, custom_headers=None, raw=False, polling=True, **operation_config): + """Operation to update an exiting Service. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param resource: Parameters for the update operation + :type resource: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource + :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 ServiceResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + resource=resource, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ServiceResource', 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) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}'} + + def list_test_keys( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """List test keys for a Service. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_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: TestKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.TestKeys or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_test_keys.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, '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', min_length=1) + + # 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]: + 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('TestKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_test_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys'} + + def regenerate_test_key( + self, resource_group_name, service_name, key_type, custom_headers=None, raw=False, **operation_config): + """Regenerate a test key for a Service. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param key_type: Type of the test key. Possible values include: + 'Primary', 'Secondary' + :type key_type: str or + ~azure.mgmt.appplatform.v2020_11_01_preview.models.TestKeyType + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TestKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.TestKeys or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_test_key_request = models.RegenerateTestKeyRequestPayload(key_type=key_type) + + # Construct URL + url = self.regenerate_test_key.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, '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', min_length=1) + + # 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(regenerate_test_key_request, 'RegenerateTestKeyRequestPayload') + + # 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]: + 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('TestKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_test_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey'} + + def disable_test_endpoint( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Disable test endpoint functionality for a Service. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.disable_test_endpoint.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + disable_test_endpoint.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint'} + + def enable_test_endpoint( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Enable test endpoint functionality for a Service. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_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: TestKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.TestKeys or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.enable_test_endpoint.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, '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', min_length=1) + + # 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]: + 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('TestKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + enable_test_endpoint.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint'} + + def check_name_availability( + self, location, type, name, custom_headers=None, raw=False, **operation_config): + """Checks that the resource name is valid and is not already in use. + + :param location: the region + :type location: str + :param type: Type of the resource to check name availability + :type type: str + :param name: Name to be checked + :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: NameAvailability or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.NameAvailability or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + availability_parameters = models.NameAvailabilityParameters(type=type, name=name) + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, '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', min_length=1) + + # 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(availability_parameters, 'NameAvailabilityParameters') + + # 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]: + 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('NameAvailability', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Handles requests to list all resources in 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 ServiceResource + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResourcePaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.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', min_length=1) + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ServiceResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring'} + + def list( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Handles requests to list all resources in a resource group. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :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 ServiceResource + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResourcePaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource] + :raises: :class:`CloudError` + """ + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, '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', min_length=1) + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ServiceResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring'} diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_skus_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_skus_operations.py new file mode 100644 index 000000000000..b50492dd2009 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/operations/_skus_operations.py @@ -0,0 +1,106 @@ +# 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 msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SkusOperations(object): + """SkusOperations 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: The API version to use for this operation. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available skus of the Microsoft.AppPlatform provider. + + :param dict custom_headers: headers that will 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 ResourceSku + :rtype: + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceSkuPaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceSku] + :raises: :class:`CloudError` + """ + 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', min_length=1) + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ResourceSkuPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus'} diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/version.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/version.py new file mode 100644 index 000000000000..0ec2fae7a625 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_11_01_preview/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "2020-11-01-preview" +