diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/_meta.json b/sdk/servicefabric/azure-mgmt-servicefabric/_meta.json index 3f28cb47766a..cafc58d3eeea 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/_meta.json +++ b/sdk/servicefabric/azure-mgmt-servicefabric/_meta.json @@ -1,11 +1,11 @@ { - "autorest": "3.4.2", + "autorest": "3.4.5", "use": [ - "@autorest/python@5.8.0", + "@autorest/python@5.8.4", "@autorest/modelerfour@4.19.2" ], - "commit": "6bab06211537f8f0b462661871b806de8be26521", + "commit": "4272591f9214235c325d8e49ff3eedc7cd022f6a", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/servicefabric/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.0 --use=@autorest/modelerfour@4.19.2 --version=3.4.2", + "autorest_command": "autorest specification/servicefabric/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "readme": "specification/servicefabric/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_configuration.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_configuration.py index f33b4886ddfa..208b027514b2 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_configuration.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_configuration.py @@ -48,6 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id + self.api_version = "2021-06-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-servicefabric/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_metadata.json b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_metadata.json index def6c71f97ee..e2d072b58bc8 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_metadata.json +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_metadata.json @@ -1,6 +1,6 @@ { - "chosen_version": "", - "total_api_version_list": ["2020-01-01-preview", "2020-03-01"], + "chosen_version": "2021-06-01", + "total_api_version_list": ["2021-06-01"], "client": { "name": "ServiceFabricManagementClient", "filename": "_service_fabric_management_client", @@ -101,15 +101,9 @@ "clusters": "ClustersOperations", "cluster_versions": "ClusterVersionsOperations", "operations": "Operations", - "application": "ApplicationOperations", "application_types": "ApplicationTypesOperations", "application_type_versions": "ApplicationTypeVersionsOperations", "applications": "ApplicationsOperations", - "services": "ServicesOperations", - "managed_clusters": "ManagedClustersOperations", - "managedcluster": "ManagedclusterOperations", - "managed_cluster_versions": "ManagedClusterVersionsOperations", - "nodetype": "NodetypeOperations", - "node_types": "NodeTypesOperations" + "services": "ServicesOperations" } } \ No newline at end of file diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_service_fabric_management_client.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_service_fabric_management_client.py index 38faae318475..1a50f2e95575 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_service_fabric_management_client.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_service_fabric_management_client.py @@ -22,16 +22,10 @@ from .operations import ClustersOperations from .operations import ClusterVersionsOperations from .operations import Operations -from .operations import ApplicationOperations from .operations import ApplicationTypesOperations from .operations import ApplicationTypeVersionsOperations from .operations import ApplicationsOperations from .operations import ServicesOperations -from .operations import ManagedClustersOperations -from .operations import ManagedclusterOperations -from .operations import ManagedClusterVersionsOperations -from .operations import NodetypeOperations -from .operations import NodeTypesOperations from . import models @@ -44,8 +38,6 @@ class ServiceFabricManagementClient(object): :vartype cluster_versions: azure.mgmt.servicefabric.operations.ClusterVersionsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.servicefabric.operations.Operations - :ivar application: ApplicationOperations operations - :vartype application: azure.mgmt.servicefabric.operations.ApplicationOperations :ivar application_types: ApplicationTypesOperations operations :vartype application_types: azure.mgmt.servicefabric.operations.ApplicationTypesOperations :ivar application_type_versions: ApplicationTypeVersionsOperations operations @@ -54,16 +46,6 @@ class ServiceFabricManagementClient(object): :vartype applications: azure.mgmt.servicefabric.operations.ApplicationsOperations :ivar services: ServicesOperations operations :vartype services: azure.mgmt.servicefabric.operations.ServicesOperations - :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.servicefabric.operations.ManagedClustersOperations - :ivar managedcluster: ManagedclusterOperations operations - :vartype managedcluster: azure.mgmt.servicefabric.operations.ManagedclusterOperations - :ivar managed_cluster_versions: ManagedClusterVersionsOperations operations - :vartype managed_cluster_versions: azure.mgmt.servicefabric.operations.ManagedClusterVersionsOperations - :ivar nodetype: NodetypeOperations operations - :vartype nodetype: azure.mgmt.servicefabric.operations.NodetypeOperations - :ivar node_types: NodeTypesOperations operations - :vartype node_types: azure.mgmt.servicefabric.operations.NodeTypesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The customer subscription identifier. @@ -96,8 +78,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) - self.application = ApplicationOperations( - self._client, self._config, self._serialize, self._deserialize) self.application_types = ApplicationTypesOperations( self._client, self._config, self._serialize, self._deserialize) self.application_type_versions = ApplicationTypeVersionsOperations( @@ -106,16 +86,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.services = ServicesOperations( self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.managedcluster = ManagedclusterOperations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_cluster_versions = ManagedClusterVersionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.nodetype = NodetypeOperations( - self._client, self._config, self._serialize, self._deserialize) - self.node_types = NodeTypesOperations( - self._client, self._config, self._serialize, self._deserialize) def _send_request(self, http_request, **kwargs): # type: (HttpRequest, Any) -> HttpResponse diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_version.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_version.py index c47f66669f1b..e5754a47ce68 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_version.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/_configuration.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/_configuration.py index 0d14dfb4db9a..cba0c3a330ce 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/_configuration.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/_configuration.py @@ -45,6 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id + self.api_version = "2021-06-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-servicefabric/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/_service_fabric_management_client.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/_service_fabric_management_client.py index 56122d6c18a5..f9db8bc059c1 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/_service_fabric_management_client.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/_service_fabric_management_client.py @@ -20,16 +20,10 @@ from .operations import ClustersOperations from .operations import ClusterVersionsOperations from .operations import Operations -from .operations import ApplicationOperations from .operations import ApplicationTypesOperations from .operations import ApplicationTypeVersionsOperations from .operations import ApplicationsOperations from .operations import ServicesOperations -from .operations import ManagedClustersOperations -from .operations import ManagedclusterOperations -from .operations import ManagedClusterVersionsOperations -from .operations import NodetypeOperations -from .operations import NodeTypesOperations from .. import models @@ -42,8 +36,6 @@ class ServiceFabricManagementClient(object): :vartype cluster_versions: azure.mgmt.servicefabric.aio.operations.ClusterVersionsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.servicefabric.aio.operations.Operations - :ivar application: ApplicationOperations operations - :vartype application: azure.mgmt.servicefabric.aio.operations.ApplicationOperations :ivar application_types: ApplicationTypesOperations operations :vartype application_types: azure.mgmt.servicefabric.aio.operations.ApplicationTypesOperations :ivar application_type_versions: ApplicationTypeVersionsOperations operations @@ -52,16 +44,6 @@ class ServiceFabricManagementClient(object): :vartype applications: azure.mgmt.servicefabric.aio.operations.ApplicationsOperations :ivar services: ServicesOperations operations :vartype services: azure.mgmt.servicefabric.aio.operations.ServicesOperations - :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.servicefabric.aio.operations.ManagedClustersOperations - :ivar managedcluster: ManagedclusterOperations operations - :vartype managedcluster: azure.mgmt.servicefabric.aio.operations.ManagedclusterOperations - :ivar managed_cluster_versions: ManagedClusterVersionsOperations operations - :vartype managed_cluster_versions: azure.mgmt.servicefabric.aio.operations.ManagedClusterVersionsOperations - :ivar nodetype: NodetypeOperations operations - :vartype nodetype: azure.mgmt.servicefabric.aio.operations.NodetypeOperations - :ivar node_types: NodeTypesOperations operations - :vartype node_types: azure.mgmt.servicefabric.aio.operations.NodeTypesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The customer subscription identifier. @@ -93,8 +75,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) - self.application = ApplicationOperations( - self._client, self._config, self._serialize, self._deserialize) self.application_types = ApplicationTypesOperations( self._client, self._config, self._serialize, self._deserialize) self.application_type_versions = ApplicationTypeVersionsOperations( @@ -103,16 +83,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.services = ServicesOperations( self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.managedcluster = ManagedclusterOperations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_cluster_versions = ManagedClusterVersionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.nodetype = NodetypeOperations( - self._client, self._config, self._serialize, self._deserialize) - self.node_types = NodeTypesOperations( - self._client, self._config, self._serialize, self._deserialize) async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/__init__.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/__init__.py index ed7940a82986..dd0e1c0084f7 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/__init__.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/__init__.py @@ -9,29 +9,17 @@ from ._clusters_operations import ClustersOperations from ._cluster_versions_operations import ClusterVersionsOperations from ._operations import Operations -from ._application_operations import ApplicationOperations from ._application_types_operations import ApplicationTypesOperations from ._application_type_versions_operations import ApplicationTypeVersionsOperations from ._applications_operations import ApplicationsOperations from ._services_operations import ServicesOperations -from ._managed_clusters_operations import ManagedClustersOperations -from ._managedcluster_operations import ManagedclusterOperations -from ._managed_cluster_versions_operations import ManagedClusterVersionsOperations -from ._nodetype_operations import NodetypeOperations -from ._node_types_operations import NodeTypesOperations __all__ = [ 'ClustersOperations', 'ClusterVersionsOperations', 'Operations', - 'ApplicationOperations', 'ApplicationTypesOperations', 'ApplicationTypeVersionsOperations', 'ApplicationsOperations', 'ServicesOperations', - 'ManagedClustersOperations', - 'ManagedclusterOperations', - 'ManagedClusterVersionsOperations', - 'NodetypeOperations', - 'NodeTypesOperations', ] diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_application_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_application_operations.py deleted file mode 100644 index c72a9a2cb564..000000000000 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_application_operations.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ApplicationOperations: - """ApplicationOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.servicefabric.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.OperationListResult"]: - """Lists all of the available Service Fabric resource provider API operations. - - Get the list of available Service Fabric resource provider API operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicefabric.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.ServiceFabric/operations'} # type: ignore diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_application_type_versions_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_application_type_versions_operations.py index 66d1cc3fed51..24ad457214c3 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_application_type_versions_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_application_type_versions_operations.py @@ -73,7 +73,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -126,7 +126,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -266,7 +266,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -406,7 +406,7 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_application_types_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_application_types_operations.py index 91a8ef5dab48..16ea77c9b92b 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_application_types_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_application_types_operations.py @@ -70,7 +70,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -138,7 +138,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -193,7 +193,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -324,7 +324,7 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_applications_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_applications_operations.py index 0f5d478ef8e2..5dbd2c7b4986 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_applications_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_applications_operations.py @@ -70,7 +70,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -121,7 +121,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -255,7 +255,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -388,7 +388,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -519,7 +519,7 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_cluster_versions_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_cluster_versions_operations.py index 279d2e4efd5f..242e960af2ae 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_cluster_versions_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_cluster_versions_operations.py @@ -65,7 +65,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -91,7 +91,8 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ClusterCodeVersionsListResult', pipeline_response) @@ -104,7 +105,7 @@ async def get( async def get_by_environment( self, location: str, - environment: Union[str, "_models.Enum8"], + environment: Union[str, "_models.Enum14"], cluster_version: str, **kwargs: Any ) -> "_models.ClusterCodeVersionsListResult": @@ -116,7 +117,7 @@ async def get_by_environment( location. :type location: str :param environment: The operating system of the cluster. The default means all. - :type environment: str or ~azure.mgmt.servicefabric.models.Enum8 + :type environment: str or ~azure.mgmt.servicefabric.models.Enum14 :param cluster_version: The cluster code version. :type cluster_version: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -129,7 +130,7 @@ async def get_by_environment( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -156,7 +157,8 @@ async def get_by_environment( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ClusterCodeVersionsListResult', pipeline_response) @@ -188,7 +190,7 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -213,7 +215,8 @@ async def list( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ClusterCodeVersionsListResult', pipeline_response) @@ -226,7 +229,7 @@ async def list( async def list_by_environment( self, location: str, - environment: Union[str, "_models.Enum8"], + environment: Union[str, "_models.Enum14"], **kwargs: Any ) -> "_models.ClusterCodeVersionsListResult": """Gets the list of Service Fabric cluster code versions available for the specified environment. @@ -237,7 +240,7 @@ async def list_by_environment( location. :type location: str :param environment: The operating system of the cluster. The default means all. - :type environment: str or ~azure.mgmt.servicefabric.models.Enum8 + :type environment: str or ~azure.mgmt.servicefabric.models.Enum14 :keyword callable cls: A custom type or function that will be passed the direct response :return: ClusterCodeVersionsListResult, or the result of cls(response) :rtype: ~azure.mgmt.servicefabric.models.ClusterCodeVersionsListResult @@ -248,7 +251,7 @@ async def list_by_environment( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -274,7 +277,8 @@ async def list_by_environment( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ClusterCodeVersionsListResult', pipeline_response) diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_clusters_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_clusters_operations.py index ad70aa2c48bb..3b05f0764ef3 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_clusters_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_clusters_operations.py @@ -67,7 +67,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -116,7 +116,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -247,7 +247,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -391,7 +391,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -447,7 +447,7 @@ async def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -502,7 +502,7 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -536,3 +536,77 @@ async def list( return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters'} # type: ignore + + async def list_upgradable_versions( + self, + resource_group_name: str, + cluster_name: str, + versions_description: Optional["_models.UpgradableVersionsDescription"] = None, + **kwargs: Any + ) -> "_models.UpgradableVersionPathResult": + """Operation to get the minimum and maximum upgradable version from the current cluster version, or the required path to get to the an specific target version. + + If a target is not provided, it will get the minimum and maximum versions available from the + current cluster version. If a target is given, it will provide the required path to get from + the current cluster version to the target version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. + :type cluster_name: str + :param versions_description: The upgrade path description with target version. + :type versions_description: ~azure.mgmt.servicefabric.models.UpgradableVersionsDescription + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpgradableVersionPathResult, or the result of cls(response) + :rtype: ~azure.mgmt.servicefabric.models.UpgradableVersionPathResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UpgradableVersionPathResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_upgradable_versions.metadata['url'] # type: ignore + 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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if versions_description is not None: + body_content = self._serialize.body(versions_description, 'UpgradableVersionsDescription') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('UpgradableVersionPathResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_upgradable_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/listUpgradableVersions'} # type: ignore diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_managed_cluster_versions_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_managed_cluster_versions_operations.py deleted file mode 100644 index 2ee782ac1ad6..000000000000 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_managed_cluster_versions_operations.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ManagedClusterVersionsOperations: - """ManagedClusterVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.servicefabric.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def list_by_os( - self, - location: str, - os_type: Union[str, "_models.Enum23"], - **kwargs: Any - ) -> List["_models.ManagedClusterVersionDetails"]: - """Gets the list of Service Fabric cluster code versions available for the specified OS type. - - Gets all available code versions for Service Fabric cluster resources by OS type. - - :param location: The location for the cluster code versions. This is different from cluster - location. - :type location: str - :param os_type: The operating system of the cluster. - :type os_type: str or ~azure.mgmt.servicefabric.models.Enum23 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of ManagedClusterVersionDetails, or the result of cls(response) - :rtype: list[~azure.mgmt.servicefabric.models.ManagedClusterVersionDetails] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ManagedClusterVersionDetails"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - accept = "application/json" - - # Construct URL - url = self.list_by_os.metadata['url'] # type: ignore - path_format_arguments = { - 'location': self._serialize.url("location", location, 'str'), - 'osType': self._serialize.url("os_type", os_type, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[ManagedClusterVersionDetails]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list_by_os.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedclusters/locations/{location}/osType/{osType}/clusterVersions'} # type: ignore diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_managed_clusters_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_managed_clusters_operations.py deleted file mode 100644 index 58cb89a19f22..000000000000 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_managed_clusters_operations.py +++ /dev/null @@ -1,626 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ManagedClustersOperations: - """ManagedClustersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.servicefabric.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ManagedClusterListResult"]: - """Gets the list of Service Fabric cluster resources created in the specified resource group. - - Gets all Service Fabric cluster resources created or in the process of being created in the - resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicefabric.models.ManagedClusterListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters'} # type: ignore - - def list_by_subscription( - self, - **kwargs: Any - ) -> AsyncIterable["_models.ManagedClusterListResult"]: - """Gets the list of Service Fabric cluster resources created in the specified subscription. - - Gets all Service Fabric cluster resources created or in the process of being created in the - subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicefabric.models.ManagedClusterListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedClusters'} # type: ignore - - async def get( - self, - resource_group_name: str, - cluster_name: str, - **kwargs: Any - ) -> "_models.ManagedCluster": - """Gets a Service Fabric managed cluster resource. - - Get a Service Fabric managed cluster resource created or in the process of being created in the - specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ManagedCluster, or the result of cls(response) - :rtype: ~azure.mgmt.servicefabric.models.ManagedCluster - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ManagedCluster', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - cluster_name: str, - parameters: "_models.ManagedCluster", - **kwargs: Any - ) -> "_models.ManagedCluster": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ManagedCluster', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ManagedCluster', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('ManagedCluster', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - parameters: "_models.ManagedCluster", - **kwargs: Any - ) -> AsyncLROPoller["_models.ManagedCluster"]: - """Creates or updates a Service Fabric managed cluster resource. - - Create or update a Service Fabric managed cluster resource with the specified name. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :param parameters: The cluster resource. - :type parameters: ~azure.mgmt.servicefabric.models.ManagedCluster - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabric.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ManagedCluster', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}'} # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - cluster_name: str, - parameters: "_models.ManagedClusterUpdateParameters", - **kwargs: Any - ) -> "_models.ManagedCluster": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ManagedCluster', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('ManagedCluster', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}'} # type: ignore - - async def begin_update( - self, - resource_group_name: str, - cluster_name: str, - parameters: "_models.ManagedClusterUpdateParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.ManagedCluster"]: - """Updates the configuration of a Service Fabric managed cluster resource. - - Update the configuration of a Service Fabric managed cluster resource with the specified name. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :param parameters: The parameters to update the managed cluster configuration. - :type parameters: ~azure.mgmt.servicefabric.models.ManagedClusterUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabric.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ManagedCluster', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - cluster_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - cluster_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Service Fabric managed cluster resource. - - Delete a Service Fabric managed cluster resource with the specified name. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}'} # type: ignore diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_managedcluster_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_managedcluster_operations.py deleted file mode 100644 index 122309bd3ce5..000000000000 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_managedcluster_operations.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ManagedclusterOperations: - """ManagedclusterOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.servicefabric.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.OperationListResult"]: - """Lists all of the available Service Fabric resource provider API operations. - - Get the list of available Service Fabric resource provider API operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicefabric.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.ServiceFabric/operations'} # type: ignore diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_node_types_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_node_types_operations.py deleted file mode 100644 index 055aa3e3814c..000000000000 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_node_types_operations.py +++ /dev/null @@ -1,970 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class NodeTypesOperations: - """NodeTypesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.servicefabric.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list_by_managed_clusters( - self, - resource_group_name: str, - cluster_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.NodeTypeListResult"]: - """Gets the list of Node types of the specified managed cluster. - - Gets all Node types of the specified managed cluster. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NodeTypeListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicefabric.models.NodeTypeListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NodeTypeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_managed_clusters.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('NodeTypeListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_managed_clusters.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes'} # type: ignore - - async def _restart_initial( - self, - resource_group_name: str, - cluster_name: str, - node_type_name: str, - parameters: "_models.NodeTypeActionParameters", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._restart_initial.metadata['url'] # type: ignore - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NodeTypeActionParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/restart'} # type: ignore - - async def begin_restart( - self, - resource_group_name: str, - cluster_name: str, - node_type_name: str, - parameters: "_models.NodeTypeActionParameters", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Restarts one or more nodes on the node type. - - Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a - restart on the VMs and activate the nodes back again. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :param node_type_name: The name of the node type. - :type node_type_name: str - :param parameters: parameters for restart action. - :type parameters: ~azure.mgmt.servicefabric.models.NodeTypeActionParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._restart_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - node_type_name=node_type_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/restart'} # type: ignore - - async def _reimage_initial( - self, - resource_group_name: str, - cluster_name: str, - node_type_name: str, - parameters: "_models.NodeTypeActionParameters", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reimage_initial.metadata['url'] # type: ignore - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NodeTypeActionParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _reimage_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/reimage'} # type: ignore - - async def begin_reimage( - self, - resource_group_name: str, - cluster_name: str, - node_type_name: str, - parameters: "_models.NodeTypeActionParameters", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Reimages one or more nodes on the node type. - - Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a - reimage on the VMs and activate the nodes back again. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :param node_type_name: The name of the node type. - :type node_type_name: str - :param parameters: parameters for reimage action. - :type parameters: ~azure.mgmt.servicefabric.models.NodeTypeActionParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._reimage_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - node_type_name=node_type_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_reimage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/reimage'} # type: ignore - - async def _delete_node_initial( - self, - resource_group_name: str, - cluster_name: str, - node_type_name: str, - parameters: "_models.NodeTypeActionParameters", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._delete_node_initial.metadata['url'] # type: ignore - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NodeTypeActionParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_node_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/deleteNode'} # type: ignore - - async def begin_delete_node( - self, - resource_group_name: str, - cluster_name: str, - node_type_name: str, - parameters: "_models.NodeTypeActionParameters", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes one or more nodes on the node type. - - Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete - on the VMs and removes the state from the cluster. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :param node_type_name: The name of the node type. - :type node_type_name: str - :param parameters: parameters for delete action. - :type parameters: ~azure.mgmt.servicefabric.models.NodeTypeActionParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_node_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - node_type_name=node_type_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete_node.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/deleteNode'} # type: ignore - - async def get( - self, - resource_group_name: str, - cluster_name: str, - node_type_name: str, - **kwargs: Any - ) -> "_models.NodeType": - """Gets a Service Fabric node type. - - Get a Service Fabric node type of a given managed cluster. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :param node_type_name: The name of the node type. - :type node_type_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NodeType, or the result of cls(response) - :rtype: ~azure.mgmt.servicefabric.models.NodeType - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NodeType"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NodeType', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - cluster_name: str, - node_type_name: str, - parameters: "_models.NodeType", - **kwargs: Any - ) -> "_models.NodeType": - cls = kwargs.pop('cls', None) # type: ClsType["_models.NodeType"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NodeType') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NodeType', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('NodeType', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('NodeType', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - node_type_name: str, - parameters: "_models.NodeType", - **kwargs: Any - ) -> AsyncLROPoller["_models.NodeType"]: - """Creates or updates a Service Fabric node type. - - Create or update a Service Fabric node type of a given managed cluster. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :param node_type_name: The name of the node type. - :type node_type_name: str - :param parameters: The node type resource. - :type parameters: ~azure.mgmt.servicefabric.models.NodeType - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NodeType or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabric.models.NodeType] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NodeType"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - node_type_name=node_type_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('NodeType', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}'} # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - cluster_name: str, - node_type_name: str, - parameters: "_models.NodeTypeUpdateParameters", - **kwargs: Any - ) -> "_models.NodeType": - cls = kwargs.pop('cls', None) # type: ClsType["_models.NodeType"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NodeTypeUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NodeType', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('NodeType', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}'} # type: ignore - - async def begin_update( - self, - resource_group_name: str, - cluster_name: str, - node_type_name: str, - parameters: "_models.NodeTypeUpdateParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.NodeType"]: - """Updates the configuration of a node type of a given managed cluster. - - Update the configuration of a node type of a given managed cluster. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :param node_type_name: The name of the node type. - :type node_type_name: str - :param parameters: The parameters to update the node type configuration. - :type parameters: ~azure.mgmt.servicefabric.models.NodeTypeUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NodeType or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabric.models.NodeType] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NodeType"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - node_type_name=node_type_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('NodeType', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - cluster_name: str, - node_type_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - cluster_name: str, - node_type_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Service Fabric node type. - - Delete a Service Fabric node type of a given managed cluster. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :param node_type_name: The name of the node type. - :type node_type_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - node_type_name=node_type_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}'} # type: ignore diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_nodetype_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_nodetype_operations.py deleted file mode 100644 index 5b333b4e7134..000000000000 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_nodetype_operations.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class NodetypeOperations: - """NodetypeOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.servicefabric.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.OperationListResult"]: - """Lists all of the available Service Fabric resource provider API operations. - - Get the list of available Service Fabric resource provider API operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicefabric.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.ServiceFabric/operations'} # type: ignore diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_operations.py index 2f67f21a590c..9a03647156cf 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_operations.py @@ -59,7 +59,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_services_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_services_operations.py index 4d5dc86d9719..34709800f371 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_services_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_services_operations.py @@ -74,7 +74,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -127,7 +127,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -269,7 +269,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -410,7 +410,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -551,7 +551,7 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/__init__.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/__init__.py index a2fd334743b1..8491cd577bf6 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/__init__.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/__init__.py @@ -28,7 +28,6 @@ from ._models_py3 import AvailableOperationDisplay from ._models_py3 import AzureActiveDirectory from ._models_py3 import CertificateDescription - from ._models_py3 import ClientCertificate from ._models_py3 import ClientCertificateCommonName from ._models_py3 import ClientCertificateThumbprint from ._models_py3 import Cluster @@ -44,19 +43,11 @@ from ._models_py3 import EndpointRangeDescription from ._models_py3 import ErrorModel from ._models_py3 import ErrorModelError - from ._models_py3 import LoadBalancingRule - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterUpdateParameters - from ._models_py3 import ManagedClusterVersionDetails from ._models_py3 import ManagedIdentity - from ._models_py3 import ManagedProxyResource from ._models_py3 import NamedPartitionSchemeDescription - from ._models_py3 import NodeType - from ._models_py3 import NodeTypeActionParameters from ._models_py3 import NodeTypeDescription - from ._models_py3 import NodeTypeListResult - from ._models_py3 import NodeTypeUpdateParameters + from ._models_py3 import Notification + from ._models_py3 import NotificationTarget from ._models_py3 import OperationListResult from ._models_py3 import OperationResult from ._models_py3 import PartitionSchemeDescription @@ -78,17 +69,15 @@ from ._models_py3 import SettingsParameterDescription from ._models_py3 import SettingsSectionDescription from ._models_py3 import SingletonPartitionSchemeDescription - from ._models_py3 import Sku from ._models_py3 import StatefulServiceProperties from ._models_py3 import StatefulServiceUpdateProperties from ._models_py3 import StatelessServiceProperties from ._models_py3 import StatelessServiceUpdateProperties - from ._models_py3 import SubResource + from ._models_py3 import SystemData from ._models_py3 import UniformInt64RangePartitionSchemeDescription + from ._models_py3 import UpgradableVersionPathResult + from ._models_py3 import UpgradableVersionsDescription from ._models_py3 import UserAssignedIdentity - from ._models_py3 import VMSSExtension - from ._models_py3 import VaultCertificate - from ._models_py3 import VaultSecretGroup except (SyntaxError, ImportError): from ._models import ApplicationDeltaHealthPolicy # type: ignore from ._models import ApplicationHealthPolicy # type: ignore @@ -111,7 +100,6 @@ from ._models import AvailableOperationDisplay # type: ignore from ._models import AzureActiveDirectory # type: ignore from ._models import CertificateDescription # type: ignore - from ._models import ClientCertificate # type: ignore from ._models import ClientCertificateCommonName # type: ignore from ._models import ClientCertificateThumbprint # type: ignore from ._models import Cluster # type: ignore @@ -127,19 +115,11 @@ from ._models import EndpointRangeDescription # type: ignore from ._models import ErrorModel # type: ignore from ._models import ErrorModelError # type: ignore - from ._models import LoadBalancingRule # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterUpdateParameters # type: ignore - from ._models import ManagedClusterVersionDetails # type: ignore from ._models import ManagedIdentity # type: ignore - from ._models import ManagedProxyResource # type: ignore from ._models import NamedPartitionSchemeDescription # type: ignore - from ._models import NodeType # type: ignore - from ._models import NodeTypeActionParameters # type: ignore from ._models import NodeTypeDescription # type: ignore - from ._models import NodeTypeListResult # type: ignore - from ._models import NodeTypeUpdateParameters # type: ignore + from ._models import Notification # type: ignore + from ._models import NotificationTarget # type: ignore from ._models import OperationListResult # type: ignore from ._models import OperationResult # type: ignore from ._models import PartitionSchemeDescription # type: ignore @@ -161,35 +141,31 @@ from ._models import SettingsParameterDescription # type: ignore from ._models import SettingsSectionDescription # type: ignore from ._models import SingletonPartitionSchemeDescription # type: ignore - from ._models import Sku # type: ignore from ._models import StatefulServiceProperties # type: ignore from ._models import StatefulServiceUpdateProperties # type: ignore from ._models import StatelessServiceProperties # type: ignore from ._models import StatelessServiceUpdateProperties # type: ignore - from ._models import SubResource # type: ignore + from ._models import SystemData # type: ignore from ._models import UniformInt64RangePartitionSchemeDescription # type: ignore + from ._models import UpgradableVersionPathResult # type: ignore + from ._models import UpgradableVersionsDescription # type: ignore from ._models import UserAssignedIdentity # type: ignore - from ._models import VMSSExtension # type: ignore - from ._models import VaultCertificate # type: ignore - from ._models import VaultSecretGroup # type: ignore from ._service_fabric_management_client_enums import ( AddOnFeatures, ArmServicePackageActivationMode, ArmUpgradeFailureAction, ClusterEnvironment, - ClusterOsType, ClusterState, + ClusterUpgradeCadence, DurabilityLevel, - Enum23, - Enum8, - ManagedClusterAddOnFeature, + Enum14, ManagedIdentityType, - ManagedResourceProvisioningState, MoveCost, + NotificationCategory, + NotificationChannel, + NotificationLevel, PartitionScheme, - ProbeProtocol, - Protocol, ProvisioningState, ReliabilityLevel, RollingUpgradeMode, @@ -197,9 +173,10 @@ ServiceKind, ServiceLoadMetricWeight, ServicePlacementPolicyType, - SkuName, + SfZonalUpgradeMode, StoreName, UpgradeMode, + VmssZonalUpgradeMode, ) __all__ = [ @@ -224,7 +201,6 @@ 'AvailableOperationDisplay', 'AzureActiveDirectory', 'CertificateDescription', - 'ClientCertificate', 'ClientCertificateCommonName', 'ClientCertificateThumbprint', 'Cluster', @@ -240,19 +216,11 @@ 'EndpointRangeDescription', 'ErrorModel', 'ErrorModelError', - 'LoadBalancingRule', - 'ManagedCluster', - 'ManagedClusterListResult', - 'ManagedClusterUpdateParameters', - 'ManagedClusterVersionDetails', 'ManagedIdentity', - 'ManagedProxyResource', 'NamedPartitionSchemeDescription', - 'NodeType', - 'NodeTypeActionParameters', 'NodeTypeDescription', - 'NodeTypeListResult', - 'NodeTypeUpdateParameters', + 'Notification', + 'NotificationTarget', 'OperationListResult', 'OperationResult', 'PartitionSchemeDescription', @@ -274,33 +242,29 @@ 'SettingsParameterDescription', 'SettingsSectionDescription', 'SingletonPartitionSchemeDescription', - 'Sku', 'StatefulServiceProperties', 'StatefulServiceUpdateProperties', 'StatelessServiceProperties', 'StatelessServiceUpdateProperties', - 'SubResource', + 'SystemData', 'UniformInt64RangePartitionSchemeDescription', + 'UpgradableVersionPathResult', + 'UpgradableVersionsDescription', 'UserAssignedIdentity', - 'VMSSExtension', - 'VaultCertificate', - 'VaultSecretGroup', 'AddOnFeatures', 'ArmServicePackageActivationMode', 'ArmUpgradeFailureAction', 'ClusterEnvironment', - 'ClusterOsType', 'ClusterState', + 'ClusterUpgradeCadence', 'DurabilityLevel', - 'Enum23', - 'Enum8', - 'ManagedClusterAddOnFeature', + 'Enum14', 'ManagedIdentityType', - 'ManagedResourceProvisioningState', 'MoveCost', + 'NotificationCategory', + 'NotificationChannel', + 'NotificationLevel', 'PartitionScheme', - 'ProbeProtocol', - 'Protocol', 'ProvisioningState', 'ReliabilityLevel', 'RollingUpgradeMode', @@ -308,7 +272,8 @@ 'ServiceKind', 'ServiceLoadMetricWeight', 'ServicePlacementPolicyType', - 'SkuName', + 'SfZonalUpgradeMode', 'StoreName', 'UpgradeMode', + 'VmssZonalUpgradeMode', ] diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_models.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_models.py index 4b09f3319e6c..7c24715734c0 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_models.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_models.py @@ -132,6 +132,8 @@ class ProxyResource(msrest.serialization.Model): :type tags: dict[str, str] :ivar etag: Azure resource etag. :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.servicefabric.models.SystemData """ _validation = { @@ -139,6 +141,7 @@ class ProxyResource(msrest.serialization.Model): 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -148,6 +151,7 @@ class ProxyResource(msrest.serialization.Model): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__( @@ -161,6 +165,7 @@ def __init__( self.location = kwargs.get('location', None) self.tags = kwargs.get('tags', None) self.etag = None + self.system_data = None class ApplicationResource(ProxyResource): @@ -181,6 +186,8 @@ class ApplicationResource(ProxyResource): :type tags: dict[str, str] :ivar etag: Azure resource etag. :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.servicefabric.models.SystemData :param identity: Describes the managed identities for an Azure resource. :type identity: ~azure.mgmt.servicefabric.models.ManagedIdentity :param type_version: The version of the application type as defined in the application @@ -221,6 +228,7 @@ class ApplicationResource(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, 'minimum_nodes': {'minimum': 0}, 'maximum_nodes': {'minimum': 0}, 'provisioning_state': {'readonly': True}, @@ -233,6 +241,7 @@ class ApplicationResource(ProxyResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, 'type_version': {'key': 'properties.typeVersion', 'type': 'str'}, 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, @@ -439,6 +448,8 @@ class ApplicationResourceUpdate(ProxyResource): :type tags: dict[str, str] :ivar etag: Azure resource etag. :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.servicefabric.models.SystemData :param type_version: The version of the application type as defined in the application manifest. :type type_version: str @@ -472,6 +483,7 @@ class ApplicationResourceUpdate(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, 'minimum_nodes': {'minimum': 0}, 'maximum_nodes': {'minimum': 0}, } @@ -483,6 +495,7 @@ class ApplicationResourceUpdate(ProxyResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'type_version': {'key': 'properties.typeVersion', 'type': 'str'}, 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, 'upgrade_policy': {'key': 'properties.upgradePolicy', 'type': 'ApplicationUpgradePolicy'}, @@ -526,6 +539,8 @@ class ApplicationTypeResource(ProxyResource): :type tags: dict[str, str] :ivar etag: Azure resource etag. :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.servicefabric.models.SystemData :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -536,6 +551,7 @@ class ApplicationTypeResource(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -546,6 +562,7 @@ class ApplicationTypeResource(ProxyResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } @@ -604,6 +621,8 @@ class ApplicationTypeVersionResource(ProxyResource): :type tags: dict[str, str] :ivar etag: Azure resource etag. :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.servicefabric.models.SystemData :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -619,6 +638,7 @@ class ApplicationTypeVersionResource(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'default_parameter_list': {'readonly': True}, } @@ -630,6 +650,7 @@ class ApplicationTypeVersionResource(ProxyResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'app_package_url': {'key': 'properties.appPackageUrl', 'type': 'str'}, 'default_parameter_list': {'key': 'properties.defaultParameterList', 'type': '{str}'}, @@ -682,7 +703,7 @@ class ApplicationTypeVersionsCleanupPolicy(msrest.serialization.Model): :param max_unused_versions_to_keep: Required. Number of unused versions per application type to keep. - :type max_unused_versions_to_keep: int + :type max_unused_versions_to_keep: long """ _validation = { @@ -690,7 +711,7 @@ class ApplicationTypeVersionsCleanupPolicy(msrest.serialization.Model): } _attribute_map = { - 'max_unused_versions_to_keep': {'key': 'maxUnusedVersionsToKeep', 'type': 'int'}, + 'max_unused_versions_to_keep': {'key': 'maxUnusedVersionsToKeep', 'type': 'long'}, } def __init__( @@ -724,6 +745,10 @@ class ApplicationUpgradePolicy(msrest.serialization.Model): UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: "Invalid", "UnmonitoredAuto", "UnmonitoredManual", "Monitored". Default value: "Monitored". :type upgrade_mode: str or ~azure.mgmt.servicefabric.models.RollingUpgradeMode + :param recreate_application: Determines whether the application should be recreated on update. + If value=true, the rest of the upgrade policy parameters are not allowed and it will result in + availability loss. + :type recreate_application: bool """ _attribute_map = { @@ -732,6 +757,7 @@ class ApplicationUpgradePolicy(msrest.serialization.Model): 'rolling_upgrade_monitoring_policy': {'key': 'rollingUpgradeMonitoringPolicy', 'type': 'ArmRollingUpgradeMonitoringPolicy'}, 'application_health_policy': {'key': 'applicationHealthPolicy', 'type': 'ArmApplicationHealthPolicy'}, 'upgrade_mode': {'key': 'upgradeMode', 'type': 'str'}, + 'recreate_application': {'key': 'recreateApplication', 'type': 'bool'}, } def __init__( @@ -744,6 +770,7 @@ def __init__( self.rolling_upgrade_monitoring_policy = kwargs.get('rolling_upgrade_monitoring_policy', None) self.application_health_policy = kwargs.get('application_health_policy', None) self.upgrade_mode = kwargs.get('upgrade_mode', "Monitored") + self.recreate_application = kwargs.get('recreate_application', None) class ApplicationUserAssignedIdentity(msrest.serialization.Model): @@ -1003,44 +1030,6 @@ def __init__( self.x509_store_name = kwargs.get('x509_store_name', None) -class ClientCertificate(msrest.serialization.Model): - """Client Certificate definition. - - All required parameters must be populated in order to send to Azure. - - :param is_admin: Required. Whether the certificate is admin or not. - :type is_admin: bool - :param thumbprint: Certificate Thumbprint. - :type thumbprint: str - :param common_name: Certificate Common name. - :type common_name: str - :param issuer_thumbprint: Issuer thumbprint for the certificate. Only used together with - CommonName. - :type issuer_thumbprint: str - """ - - _validation = { - 'is_admin': {'required': True}, - } - - _attribute_map = { - 'is_admin': {'key': 'isAdmin', 'type': 'bool'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - 'common_name': {'key': 'commonName', 'type': 'str'}, - 'issuer_thumbprint': {'key': 'issuerThumbprint', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ClientCertificate, self).__init__(**kwargs) - self.is_admin = kwargs['is_admin'] - self.thumbprint = kwargs.get('thumbprint', None) - self.common_name = kwargs.get('common_name', None) - self.issuer_thumbprint = kwargs.get('issuer_thumbprint', None) - - class ClientCertificateCommonName(msrest.serialization.Model): """Describes the client certificate details using common name. @@ -1128,6 +1117,8 @@ class Resource(msrest.serialization.Model): :type tags: dict[str, str] :ivar etag: Azure resource etag. :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.servicefabric.models.SystemData """ _validation = { @@ -1136,6 +1127,7 @@ class Resource(msrest.serialization.Model): 'type': {'readonly': True}, 'location': {'required': True}, 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -1145,6 +1137,7 @@ class Resource(msrest.serialization.Model): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__( @@ -1158,10 +1151,11 @@ def __init__( self.location = kwargs['location'] self.tags = kwargs.get('tags', None) self.etag = None + self.system_data = None class Cluster(Resource): - """The cluster resource properties. + """The cluster resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -1179,6 +1173,8 @@ class Cluster(Resource): :type tags: dict[str, str] :ivar etag: Azure resource etag. :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.servicefabric.models.SystemData :param add_on_features: The list of add-on features to enable in the cluster. :type add_on_features: list[str or ~azure.mgmt.servicefabric.models.AddOnFeatures] :ivar available_cluster_versions: The Service Fabric runtime versions available for this @@ -1277,14 +1273,7 @@ class Cluster(Resource): :param upgrade_description: The policy to use when upgrading the cluster. :type upgrade_description: ~azure.mgmt.servicefabric.models.ClusterUpgradePolicy :param upgrade_mode: The upgrade mode of the cluster when new Service Fabric runtime version is - available. - - - * Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime - version as soon as it is available. - * Manual - The cluster will not be automatically upgraded to the latest Service Fabric runtime - version. The cluster is upgraded by setting the **clusterCodeVersion** property in the cluster - resource. Possible values include: "Automatic", "Manual". + available. Possible values include: "Automatic", "Manual". Default value: "Automatic". :type upgrade_mode: str or ~azure.mgmt.servicefabric.models.UpgradeMode :param application_type_versions_cleanup_policy: The policy used to clean up unused versions. :type application_type_versions_cleanup_policy: @@ -1292,6 +1281,30 @@ class Cluster(Resource): :param vm_image: The VM image VMSS has been configured with. Generic names such as Windows or Linux can be used. :type vm_image: str + :param sf_zonal_upgrade_mode: This property controls the logical grouping of VMs in upgrade + domains (UDs). This property can't be modified if a node type with multiple Availability Zones + is already present in the cluster. Possible values include: "Parallel", "Hierarchical". + :type sf_zonal_upgrade_mode: str or ~azure.mgmt.servicefabric.models.SfZonalUpgradeMode + :param vmss_zonal_upgrade_mode: This property defines the upgrade mode for the virtual machine + scale set, it is mandatory if a node type with multiple Availability Zones is added. Possible + values include: "Parallel", "Hierarchical". + :type vmss_zonal_upgrade_mode: str or ~azure.mgmt.servicefabric.models.VmssZonalUpgradeMode + :param infrastructure_service_manager: Indicates if infrastructure service manager is enabled. + :type infrastructure_service_manager: bool + :param upgrade_wave: Indicates when new cluster runtime version upgrades will be applied after + they are released. By default is Wave0. Only applies when **upgradeMode** is set to + 'Automatic'. Possible values include: "Wave0", "Wave1", "Wave2". + :type upgrade_wave: str or ~azure.mgmt.servicefabric.models.ClusterUpgradeCadence + :param upgrade_pause_start_timestamp_utc: Indicates the start date and time to pause automatic + runtime version upgrades on the cluster for an specific period of time on the cluster (UTC). + :type upgrade_pause_start_timestamp_utc: ~datetime.datetime + :param upgrade_pause_end_timestamp_utc: Indicates the end date and time to pause automatic + runtime version upgrades on the cluster for an specific period of time on the cluster (UTC). + :type upgrade_pause_end_timestamp_utc: ~datetime.datetime + :param wave_upgrade_paused: Boolean to pause automatic runtime version upgrades to the cluster. + :type wave_upgrade_paused: bool + :param notifications: Indicates a list of notification channels for cluster events. + :type notifications: list[~azure.mgmt.servicefabric.models.Notification] """ _validation = { @@ -1300,6 +1313,7 @@ class Cluster(Resource): 'type': {'readonly': True}, 'location': {'required': True}, 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, 'available_cluster_versions': {'readonly': True}, 'cluster_endpoint': {'readonly': True}, 'cluster_id': {'readonly': True}, @@ -1314,6 +1328,7 @@ class Cluster(Resource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'add_on_features': {'key': 'properties.addOnFeatures', 'type': '[str]'}, 'available_cluster_versions': {'key': 'properties.availableClusterVersions', 'type': '[ClusterVersionDetails]'}, 'azure_active_directory': {'key': 'properties.azureActiveDirectory', 'type': 'AzureActiveDirectory'}, @@ -1338,6 +1353,14 @@ class Cluster(Resource): 'upgrade_mode': {'key': 'properties.upgradeMode', 'type': 'str'}, 'application_type_versions_cleanup_policy': {'key': 'properties.applicationTypeVersionsCleanupPolicy', 'type': 'ApplicationTypeVersionsCleanupPolicy'}, 'vm_image': {'key': 'properties.vmImage', 'type': 'str'}, + 'sf_zonal_upgrade_mode': {'key': 'properties.sfZonalUpgradeMode', 'type': 'str'}, + 'vmss_zonal_upgrade_mode': {'key': 'properties.vmssZonalUpgradeMode', 'type': 'str'}, + 'infrastructure_service_manager': {'key': 'properties.infrastructureServiceManager', 'type': 'bool'}, + 'upgrade_wave': {'key': 'properties.upgradeWave', 'type': 'str'}, + 'upgrade_pause_start_timestamp_utc': {'key': 'properties.upgradePauseStartTimestampUtc', 'type': 'iso-8601'}, + 'upgrade_pause_end_timestamp_utc': {'key': 'properties.upgradePauseEndTimestampUtc', 'type': 'iso-8601'}, + 'wave_upgrade_paused': {'key': 'properties.waveUpgradePaused', 'type': 'bool'}, + 'notifications': {'key': 'properties.notifications', 'type': '[Notification]'}, } def __init__( @@ -1366,9 +1389,17 @@ def __init__( self.reverse_proxy_certificate = kwargs.get('reverse_proxy_certificate', None) self.reverse_proxy_certificate_common_names = kwargs.get('reverse_proxy_certificate_common_names', None) self.upgrade_description = kwargs.get('upgrade_description', None) - self.upgrade_mode = kwargs.get('upgrade_mode', None) + self.upgrade_mode = kwargs.get('upgrade_mode', "Automatic") self.application_type_versions_cleanup_policy = kwargs.get('application_type_versions_cleanup_policy', None) self.vm_image = kwargs.get('vm_image', None) + self.sf_zonal_upgrade_mode = kwargs.get('sf_zonal_upgrade_mode', None) + self.vmss_zonal_upgrade_mode = kwargs.get('vmss_zonal_upgrade_mode', None) + self.infrastructure_service_manager = kwargs.get('infrastructure_service_manager', None) + self.upgrade_wave = kwargs.get('upgrade_wave', None) + self.upgrade_pause_start_timestamp_utc = kwargs.get('upgrade_pause_start_timestamp_utc', None) + self.upgrade_pause_end_timestamp_utc = kwargs.get('upgrade_pause_end_timestamp_utc', None) + self.wave_upgrade_paused = kwargs.get('wave_upgrade_paused', None) + self.notifications = kwargs.get('notifications', None) class ClusterCodeVersionsListResult(msrest.serialization.Model): @@ -1569,19 +1600,36 @@ class ClusterUpdateParameters(msrest.serialization.Model): :type reverse_proxy_certificate: ~azure.mgmt.servicefabric.models.CertificateDescription :param upgrade_description: The policy to use when upgrading the cluster. :type upgrade_description: ~azure.mgmt.servicefabric.models.ClusterUpgradePolicy - :param upgrade_mode: The upgrade mode of the cluster when new Service Fabric runtime version is - available. - - - * Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime - version as soon as it is available. - * Manual - The cluster will not be automatically upgraded to the latest Service Fabric runtime - version. The cluster is upgraded by setting the **clusterCodeVersion** property in the cluster - resource. Possible values include: "Automatic", "Manual". - :type upgrade_mode: str or ~azure.mgmt.servicefabric.models.UpgradeMode :param application_type_versions_cleanup_policy: The policy used to clean up unused versions. :type application_type_versions_cleanup_policy: ~azure.mgmt.servicefabric.models.ApplicationTypeVersionsCleanupPolicy + :param upgrade_mode: The upgrade mode of the cluster when new Service Fabric runtime version is + available. Possible values include: "Automatic", "Manual". Default value: "Automatic". + :type upgrade_mode: str or ~azure.mgmt.servicefabric.models.UpgradeMode + :param sf_zonal_upgrade_mode: This property controls the logical grouping of VMs in upgrade + domains (UDs). This property can't be modified if a node type with multiple Availability Zones + is already present in the cluster. Possible values include: "Parallel", "Hierarchical". + :type sf_zonal_upgrade_mode: str or ~azure.mgmt.servicefabric.models.SfZonalUpgradeMode + :param vmss_zonal_upgrade_mode: This property defines the upgrade mode for the virtual machine + scale set, it is mandatory if a node type with multiple Availability Zones is added. Possible + values include: "Parallel", "Hierarchical". + :type vmss_zonal_upgrade_mode: str or ~azure.mgmt.servicefabric.models.VmssZonalUpgradeMode + :param infrastructure_service_manager: Indicates if infrastructure service manager is enabled. + :type infrastructure_service_manager: bool + :param upgrade_wave: Indicates when new cluster runtime version upgrades will be applied after + they are released. By default is Wave0. Only applies when **upgradeMode** is set to + 'Automatic'. Possible values include: "Wave0", "Wave1", "Wave2". + :type upgrade_wave: str or ~azure.mgmt.servicefabric.models.ClusterUpgradeCadence + :param upgrade_pause_start_timestamp_utc: The start timestamp to pause runtime version upgrades + on the cluster (UTC). + :type upgrade_pause_start_timestamp_utc: ~datetime.datetime + :param upgrade_pause_end_timestamp_utc: The end timestamp of pause runtime version upgrades on + the cluster (UTC). + :type upgrade_pause_end_timestamp_utc: ~datetime.datetime + :param wave_upgrade_paused: Boolean to pause automatic runtime version upgrades to the cluster. + :type wave_upgrade_paused: bool + :param notifications: Indicates a list of notification channels for cluster events. + :type notifications: list[~azure.mgmt.servicefabric.models.Notification] """ _attribute_map = { @@ -1598,8 +1646,16 @@ class ClusterUpdateParameters(msrest.serialization.Model): 'reliability_level': {'key': 'properties.reliabilityLevel', 'type': 'str'}, 'reverse_proxy_certificate': {'key': 'properties.reverseProxyCertificate', 'type': 'CertificateDescription'}, 'upgrade_description': {'key': 'properties.upgradeDescription', 'type': 'ClusterUpgradePolicy'}, - 'upgrade_mode': {'key': 'properties.upgradeMode', 'type': 'str'}, 'application_type_versions_cleanup_policy': {'key': 'properties.applicationTypeVersionsCleanupPolicy', 'type': 'ApplicationTypeVersionsCleanupPolicy'}, + 'upgrade_mode': {'key': 'properties.upgradeMode', 'type': 'str'}, + 'sf_zonal_upgrade_mode': {'key': 'properties.sfZonalUpgradeMode', 'type': 'str'}, + 'vmss_zonal_upgrade_mode': {'key': 'properties.vmssZonalUpgradeMode', 'type': 'str'}, + 'infrastructure_service_manager': {'key': 'properties.infrastructureServiceManager', 'type': 'bool'}, + 'upgrade_wave': {'key': 'properties.upgradeWave', 'type': 'str'}, + 'upgrade_pause_start_timestamp_utc': {'key': 'properties.upgradePauseStartTimestampUtc', 'type': 'iso-8601'}, + 'upgrade_pause_end_timestamp_utc': {'key': 'properties.upgradePauseEndTimestampUtc', 'type': 'iso-8601'}, + 'wave_upgrade_paused': {'key': 'properties.waveUpgradePaused', 'type': 'bool'}, + 'notifications': {'key': 'properties.notifications', 'type': '[Notification]'}, } def __init__( @@ -1620,8 +1676,16 @@ def __init__( self.reliability_level = kwargs.get('reliability_level', None) self.reverse_proxy_certificate = kwargs.get('reverse_proxy_certificate', None) self.upgrade_description = kwargs.get('upgrade_description', None) - self.upgrade_mode = kwargs.get('upgrade_mode', None) self.application_type_versions_cleanup_policy = kwargs.get('application_type_versions_cleanup_policy', None) + self.upgrade_mode = kwargs.get('upgrade_mode', "Automatic") + self.sf_zonal_upgrade_mode = kwargs.get('sf_zonal_upgrade_mode', None) + self.vmss_zonal_upgrade_mode = kwargs.get('vmss_zonal_upgrade_mode', None) + self.infrastructure_service_manager = kwargs.get('infrastructure_service_manager', None) + self.upgrade_wave = kwargs.get('upgrade_wave', None) + self.upgrade_pause_start_timestamp_utc = kwargs.get('upgrade_pause_start_timestamp_utc', None) + self.upgrade_pause_end_timestamp_utc = kwargs.get('upgrade_pause_end_timestamp_utc', None) + self.wave_upgrade_paused = kwargs.get('wave_upgrade_paused', None) + self.notifications = kwargs.get('notifications', None) class ClusterUpgradeDeltaHealthPolicy(msrest.serialization.Model): @@ -1908,287 +1972,6 @@ def __init__( self.message = kwargs.get('message', None) -class LoadBalancingRule(msrest.serialization.Model): - """Describes a load balancing rule. - - All required parameters must be populated in order to send to Azure. - - :param frontend_port: Required. The port for the external endpoint. Port numbers for each rule - must be unique within the Load Balancer. Acceptable values are between 1 and 65534. - :type frontend_port: int - :param backend_port: Required. The port used for internal connections on the endpoint. - Acceptable values are between 1 and 65535. - :type backend_port: int - :param protocol: Required. The reference to the transport protocol used by the load balancing - rule. Possible values include: "tcp", "udp". - :type protocol: str or ~azure.mgmt.servicefabric.models.Protocol - :param probe_protocol: Required. the reference to the load balancer probe used by the load - balancing rule. Possible values include: "tcp", "http", "https". - :type probe_protocol: str or ~azure.mgmt.servicefabric.models.ProbeProtocol - :param probe_request_path: The probe request path. Only supported for HTTP/HTTPS probes. - :type probe_request_path: str - """ - - _validation = { - 'frontend_port': {'required': True, 'maximum': 65534, 'minimum': 1}, - 'backend_port': {'required': True, 'maximum': 65534, 'minimum': 1}, - 'protocol': {'required': True}, - 'probe_protocol': {'required': True}, - } - - _attribute_map = { - 'frontend_port': {'key': 'frontendPort', 'type': 'int'}, - 'backend_port': {'key': 'backendPort', 'type': 'int'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'probe_protocol': {'key': 'probeProtocol', 'type': 'str'}, - 'probe_request_path': {'key': 'probeRequestPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LoadBalancingRule, self).__init__(**kwargs) - self.frontend_port = kwargs['frontend_port'] - self.backend_port = kwargs['backend_port'] - self.protocol = kwargs['protocol'] - self.probe_protocol = kwargs['probe_protocol'] - self.probe_request_path = kwargs.get('probe_request_path', None) - - -class ManagedCluster(Resource): - """The manged cluster resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Azure resource identifier. - :vartype id: str - :ivar name: Azure resource name. - :vartype name: str - :ivar type: Azure resource type. - :vartype type: str - :param location: Required. Azure resource location. - :type location: str - :param tags: A set of tags. Azure resource tags. - :type tags: dict[str, str] - :ivar etag: Azure resource etag. - :vartype etag: str - :param sku: The sku of the managed cluster. - :type sku: ~azure.mgmt.servicefabric.models.Sku - :param dns_name: The cluster dns name. - :type dns_name: str - :ivar fqdn: the cluster Fully qualified domain name. - :vartype fqdn: str - :ivar cluster_id: A service generated unique identifier for the cluster resource. - :vartype cluster_id: str - :ivar cluster_state: The current state of the cluster. Possible values include: - "WaitingForNodes", "Deploying", "BaselineUpgrade", "UpdatingUserConfiguration", - "UpdatingUserCertificate", "UpdatingInfrastructure", "EnforcingClusterVersion", - "UpgradeServiceUnreachable", "AutoScale", "Ready". - :vartype cluster_state: str or ~azure.mgmt.servicefabric.models.ClusterState - :ivar cluster_certificate_thumbprint: The cluster certificate thumbprint used node to node - communication. - :vartype cluster_certificate_thumbprint: str - :param client_connection_port: The port used for client connections to the cluster. - :type client_connection_port: int - :param http_gateway_connection_port: The port used for http connections to the cluster. - :type http_gateway_connection_port: int - :param admin_user_name: vm admin user name. - :type admin_user_name: str - :param admin_password: vm admin user password. - :type admin_password: str - :param load_balancing_rules: Describes load balancing rules. - :type load_balancing_rules: list[~azure.mgmt.servicefabric.models.LoadBalancingRule] - :param clients: client certificates for the cluster. - :type clients: list[~azure.mgmt.servicefabric.models.ClientCertificate] - :param azure_active_directory: Azure active directory. - :type azure_active_directory: ~azure.mgmt.servicefabric.models.AzureActiveDirectory - :param fabric_settings: The list of custom fabric settings to configure the cluster. - :type fabric_settings: list[~azure.mgmt.servicefabric.models.SettingsSectionDescription] - :ivar provisioning_state: The provisioning state of the managed cluster resource. Possible - values include: "None", "Creating", "Created", "Updating", "Succeeded", "Failed", "Canceled", - "Deleting", "Deleted", "Other". - :vartype provisioning_state: str or - ~azure.mgmt.servicefabric.models.ManagedResourceProvisioningState - :param cluster_code_version: The Service Fabric runtime version of the cluster. This property - can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available - Service Fabric versions for new clusters use `ClusterVersion API <./ClusterVersion.md>`_. To - get the list of available version for existing clusters use **availableClusterVersions**. - :type cluster_code_version: str - :param addon_features: client certificates for the cluster. - :type addon_features: list[str or ~azure.mgmt.servicefabric.models.ManagedClusterAddOnFeature] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'etag': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'cluster_id': {'readonly': True}, - 'cluster_state': {'readonly': True}, - 'cluster_certificate_thumbprint': {'readonly': True}, - 'provisioning_state': {'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}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'dns_name': {'key': 'properties.dnsName', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'cluster_id': {'key': 'properties.clusterId', 'type': 'str'}, - 'cluster_state': {'key': 'properties.clusterState', 'type': 'str'}, - 'cluster_certificate_thumbprint': {'key': 'properties.clusterCertificateThumbprint', 'type': 'str'}, - 'client_connection_port': {'key': 'properties.clientConnectionPort', 'type': 'int'}, - 'http_gateway_connection_port': {'key': 'properties.httpGatewayConnectionPort', 'type': 'int'}, - 'admin_user_name': {'key': 'properties.adminUserName', 'type': 'str'}, - 'admin_password': {'key': 'properties.adminPassword', 'type': 'str'}, - 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[LoadBalancingRule]'}, - 'clients': {'key': 'properties.clients', 'type': '[ClientCertificate]'}, - 'azure_active_directory': {'key': 'properties.azureActiveDirectory', 'type': 'AzureActiveDirectory'}, - 'fabric_settings': {'key': 'properties.fabricSettings', 'type': '[SettingsSectionDescription]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'cluster_code_version': {'key': 'properties.clusterCodeVersion', 'type': 'str'}, - 'addon_features': {'key': 'properties.addonFeatures', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.dns_name = kwargs.get('dns_name', None) - self.fqdn = None - self.cluster_id = None - self.cluster_state = None - self.cluster_certificate_thumbprint = None - self.client_connection_port = kwargs.get('client_connection_port', 19000) - self.http_gateway_connection_port = kwargs.get('http_gateway_connection_port', 19080) - self.admin_user_name = kwargs.get('admin_user_name', None) - self.admin_password = kwargs.get('admin_password', None) - self.load_balancing_rules = kwargs.get('load_balancing_rules', None) - self.clients = kwargs.get('clients', None) - self.azure_active_directory = kwargs.get('azure_active_directory', None) - self.fabric_settings = kwargs.get('fabric_settings', None) - self.provisioning_state = None - self.cluster_code_version = kwargs.get('cluster_code_version', None) - self.addon_features = kwargs.get('addon_features', None) - - -class ManagedClusterListResult(msrest.serialization.Model): - """Managed Cluster list results. - - :param value: - :type value: list[~azure.mgmt.servicefabric.models.ManagedCluster] - :param next_link: The URL to use for getting the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ManagedClusterUpdateParameters(msrest.serialization.Model): - """Managed cluster update request. - - :param tags: A set of tags. Managed cluster update parameters. - :type tags: dict[str, str] - :param client_connection_port: The port used for client connections to the cluster. - :type client_connection_port: int - :param http_gateway_connection_port: The port used for http connections to the cluster. - :type http_gateway_connection_port: int - :param load_balancing_rules: Describes load balancing rules. - :type load_balancing_rules: list[~azure.mgmt.servicefabric.models.LoadBalancingRule] - :param clients: client certificates for the cluster. - :type clients: list[~azure.mgmt.servicefabric.models.ClientCertificate] - :param azure_active_directory: Azure active directory. - :type azure_active_directory: ~azure.mgmt.servicefabric.models.AzureActiveDirectory - :param fabric_settings: The list of custom fabric settings to configure the cluster. - :type fabric_settings: list[~azure.mgmt.servicefabric.models.SettingsSectionDescription] - :param cluster_code_version: The Service Fabric runtime version of the cluster. This property - can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available - Service Fabric versions for new clusters use `ClusterVersion API <./ClusterVersion.md>`_. To - get the list of available version for existing clusters use **availableClusterVersions**. - :type cluster_code_version: str - :param addon_features: client certificates for the cluster. - :type addon_features: list[str or ~azure.mgmt.servicefabric.models.ManagedClusterAddOnFeature] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'client_connection_port': {'key': 'properties.clientConnectionPort', 'type': 'int'}, - 'http_gateway_connection_port': {'key': 'properties.httpGatewayConnectionPort', 'type': 'int'}, - 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[LoadBalancingRule]'}, - 'clients': {'key': 'properties.clients', 'type': '[ClientCertificate]'}, - 'azure_active_directory': {'key': 'properties.azureActiveDirectory', 'type': 'AzureActiveDirectory'}, - 'fabric_settings': {'key': 'properties.fabricSettings', 'type': '[SettingsSectionDescription]'}, - 'cluster_code_version': {'key': 'properties.clusterCodeVersion', 'type': 'str'}, - 'addon_features': {'key': 'properties.addonFeatures', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.client_connection_port = kwargs.get('client_connection_port', None) - self.http_gateway_connection_port = kwargs.get('http_gateway_connection_port', None) - self.load_balancing_rules = kwargs.get('load_balancing_rules', None) - self.clients = kwargs.get('clients', None) - self.azure_active_directory = kwargs.get('azure_active_directory', None) - self.fabric_settings = kwargs.get('fabric_settings', None) - self.cluster_code_version = kwargs.get('cluster_code_version', None) - self.addon_features = kwargs.get('addon_features', None) - - -class ManagedClusterVersionDetails(msrest.serialization.Model): - """The detail of the Service Fabric runtime version. - - :param msi_version: The Service Fabric runtime version of the cluster. - :type msi_version: str - :param support_expiry_utc: The date of expiry of support of the version. - :type support_expiry_utc: str - :param os_type: Indicates the operating system of the cluster. Possible values include: - "Windows", "Ubuntu", "RedHat", "Ubuntu18_04". - :type os_type: str or ~azure.mgmt.servicefabric.models.ClusterOsType - """ - - _attribute_map = { - 'msi_version': {'key': 'msiVersion', 'type': 'str'}, - 'support_expiry_utc': {'key': 'supportExpiryUtc', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterVersionDetails, self).__init__(**kwargs) - self.msi_version = kwargs.get('msi_version', None) - self.support_expiry_utc = kwargs.get('support_expiry_utc', None) - self.os_type = kwargs.get('os_type', None) - - class ManagedIdentity(msrest.serialization.Model): """Describes the managed identities for an Azure resource. @@ -2233,45 +2016,6 @@ def __init__( self.user_assigned_identities = kwargs.get('user_assigned_identities', None) -class ManagedProxyResource(msrest.serialization.Model): - """The resource model definition for proxy-only resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Azure resource identifier. - :vartype id: str - :ivar name: Azure resource name. - :vartype name: str - :ivar type: Azure resource type. - :vartype type: str - :param tags: A set of tags. Azure resource tags. - :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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedProxyResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.tags = kwargs.get('tags', None) - - class PartitionSchemeDescription(msrest.serialization.Model): """Describes how the service is partitioned. @@ -2342,146 +2086,6 @@ def __init__( self.names = kwargs['names'] -class NodeType(ManagedProxyResource): - """Describes a node type in the cluster, each node type represents sub set of nodes in the cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Azure resource identifier. - :vartype id: str - :ivar name: Azure resource name. - :vartype name: str - :ivar type: Azure resource type. - :vartype type: str - :param tags: A set of tags. Azure resource tags. - :type tags: dict[str, str] - :param is_primary: The node type on which system services will run. Only one node type should - be marked as primary. Primary node type cannot be deleted or changed for existing clusters. - :type is_primary: bool - :param vm_instance_count: The number of nodes in the node type. - :type vm_instance_count: int - :param data_disk_size_gb: Disk size for each vm in the node type in GBs. - :type data_disk_size_gb: int - :param placement_properties: The placement tags applied to nodes in the node type, which can be - used to indicate where certain services (workload) should run. - :type placement_properties: dict[str, str] - :param capacities: The capacity tags applied to the nodes in the node type, the cluster - resource manager uses these tags to understand how much resource a node has. - :type capacities: dict[str, str] - :param application_ports: The range of ports from which cluster assigned port to Service Fabric - applications. - :type application_ports: ~azure.mgmt.servicefabric.models.EndpointRangeDescription - :param ephemeral_ports: The range of ephemeral ports that nodes in this node type should be - configured with. - :type ephemeral_ports: ~azure.mgmt.servicefabric.models.EndpointRangeDescription - :param vm_size: The size of virtual machines in the pool. All virtual machines in a pool are - the same size. For example, Standard_D3. - :type vm_size: str - :param vm_image_publisher: The publisher of the Azure Virtual Machines Marketplace image. For - example, Canonical or MicrosoftWindowsServer. - :type vm_image_publisher: str - :param vm_image_offer: The offer type of the Azure Virtual Machines Marketplace image. For - example, UbuntuServer or WindowsServer. - :type vm_image_offer: str - :param vm_image_sku: The SKU of the Azure Virtual Machines Marketplace image. For example, - 14.04.0-LTS or 2012-R2-Datacenter. - :type vm_image_sku: str - :param vm_image_version: The version of the Azure Virtual Machines Marketplace image. A value - of 'latest' can be specified to select the latest version of an image. If omitted, the default - is 'latest'. - :type vm_image_version: str - :param vm_secrets: The secrets to install in the virtual machines. - :type vm_secrets: list[~azure.mgmt.servicefabric.models.VaultSecretGroup] - :param vm_extensions: Set of extensions that should be installed onto the virtual machines. - :type vm_extensions: list[~azure.mgmt.servicefabric.models.VMSSExtension] - :ivar provisioning_state: The provisioning state of the managed cluster resource. Possible - values include: "None", "Creating", "Created", "Updating", "Succeeded", "Failed", "Canceled", - "Deleting", "Deleted", "Other". - :vartype provisioning_state: str or - ~azure.mgmt.servicefabric.models.ManagedResourceProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'vm_instance_count': {'maximum': 2147483647, 'minimum': 1}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_primary': {'key': 'properties.isPrimary', 'type': 'bool'}, - 'vm_instance_count': {'key': 'properties.vmInstanceCount', 'type': 'int'}, - 'data_disk_size_gb': {'key': 'properties.dataDiskSizeGB', 'type': 'int'}, - 'placement_properties': {'key': 'properties.placementProperties', 'type': '{str}'}, - 'capacities': {'key': 'properties.capacities', 'type': '{str}'}, - 'application_ports': {'key': 'properties.applicationPorts', 'type': 'EndpointRangeDescription'}, - 'ephemeral_ports': {'key': 'properties.ephemeralPorts', 'type': 'EndpointRangeDescription'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'vm_image_publisher': {'key': 'properties.vmImagePublisher', 'type': 'str'}, - 'vm_image_offer': {'key': 'properties.vmImageOffer', 'type': 'str'}, - 'vm_image_sku': {'key': 'properties.vmImageSku', 'type': 'str'}, - 'vm_image_version': {'key': 'properties.vmImageVersion', 'type': 'str'}, - 'vm_secrets': {'key': 'properties.vmSecrets', 'type': '[VaultSecretGroup]'}, - 'vm_extensions': {'key': 'properties.vmExtensions', 'type': '[VMSSExtension]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NodeType, self).__init__(**kwargs) - self.is_primary = kwargs.get('is_primary', None) - self.vm_instance_count = kwargs.get('vm_instance_count', None) - self.data_disk_size_gb = kwargs.get('data_disk_size_gb', None) - self.placement_properties = kwargs.get('placement_properties', None) - self.capacities = kwargs.get('capacities', None) - self.application_ports = kwargs.get('application_ports', None) - self.ephemeral_ports = kwargs.get('ephemeral_ports', None) - self.vm_size = kwargs.get('vm_size', None) - self.vm_image_publisher = kwargs.get('vm_image_publisher', None) - self.vm_image_offer = kwargs.get('vm_image_offer', None) - self.vm_image_sku = kwargs.get('vm_image_sku', None) - self.vm_image_version = kwargs.get('vm_image_version', None) - self.vm_secrets = kwargs.get('vm_secrets', None) - self.vm_extensions = kwargs.get('vm_extensions', None) - self.provisioning_state = None - - -class NodeTypeActionParameters(msrest.serialization.Model): - """Parameters for Node type action. - - All required parameters must be populated in order to send to Azure. - - :param nodes: Required. List of node names from the node type. - :type nodes: list[str] - :param force: Force the action to go through. - :type force: bool - """ - - _validation = { - 'nodes': {'required': True}, - } - - _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[str]'}, - 'force': {'key': 'force', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(NodeTypeActionParameters, self).__init__(**kwargs) - self.nodes = kwargs['nodes'] - self.force = kwargs.get('force', None) - - class NodeTypeDescription(msrest.serialization.Model): """Describes a node type in the cluster, each node type represents sub set of nodes in the cluster. @@ -2519,11 +2123,19 @@ class NodeTypeDescription(msrest.serialization.Model): type should be marked as primary. Primary node type cannot be deleted or changed for existing clusters. :type is_primary: bool - :param vm_instance_count: Required. The number of nodes in the node type. This count should - match the capacity property in the corresponding VirtualMachineScaleSet resource. + :param vm_instance_count: Required. VMInstanceCount should be 1 to n, where n indicates the + number of VM instances corresponding to this nodeType. VMInstanceCount = 0 can be done only in + these scenarios: NodeType is a secondary nodeType. Durability = Bronze or Durability >= Bronze + and InfrastructureServiceManager = true. If VMInstanceCount = 0, implies the VMs for this + nodeType will not be used for the initial cluster size computation. :type vm_instance_count: int :param reverse_proxy_endpoint_port: The endpoint used by reverse proxy. :type reverse_proxy_endpoint_port: int + :param is_stateless: Indicates if the node type can only host Stateless workloads. + :type is_stateless: bool + :param multiple_availability_zones: Indicates if the node type is enabled to support multiple + zones. + :type multiple_availability_zones: bool """ _validation = { @@ -2531,7 +2143,7 @@ class NodeTypeDescription(msrest.serialization.Model): 'client_connection_endpoint_port': {'required': True}, 'http_gateway_endpoint_port': {'required': True}, 'is_primary': {'required': True}, - 'vm_instance_count': {'required': True, 'maximum': 2147483647, 'minimum': 1}, + 'vm_instance_count': {'required': True, 'maximum': 2147483647, 'minimum': 0}, } _attribute_map = { @@ -2546,6 +2158,8 @@ class NodeTypeDescription(msrest.serialization.Model): 'is_primary': {'key': 'isPrimary', 'type': 'bool'}, 'vm_instance_count': {'key': 'vmInstanceCount', 'type': 'int'}, 'reverse_proxy_endpoint_port': {'key': 'reverseProxyEndpointPort', 'type': 'int'}, + 'is_stateless': {'key': 'isStateless', 'type': 'bool'}, + 'multiple_availability_zones': {'key': 'multipleAvailabilityZones', 'type': 'bool'}, } def __init__( @@ -2564,84 +2178,82 @@ def __init__( self.is_primary = kwargs['is_primary'] self.vm_instance_count = kwargs['vm_instance_count'] self.reverse_proxy_endpoint_port = kwargs.get('reverse_proxy_endpoint_port', None) + self.is_stateless = kwargs.get('is_stateless', None) + self.multiple_availability_zones = kwargs.get('multiple_availability_zones', None) -class NodeTypeListResult(msrest.serialization.Model): - """Node type list results. +class Notification(msrest.serialization.Model): + """Describes the notification channel for cluster events. - :param value: The list of node types. - :type value: list[~azure.mgmt.servicefabric.models.NodeType] - :param next_link: The URL to use for getting the next set of results. - :type next_link: str + All required parameters must be populated in order to send to Azure. + + :param is_enabled: Required. Indicates if the notification is enabled. + :type is_enabled: bool + :param notification_category: Required. The category of notification. Possible values include: + "WaveProgress". + :type notification_category: str or ~azure.mgmt.servicefabric.models.NotificationCategory + :param notification_level: Required. The level of notification. Possible values include: + "Critical", "All". + :type notification_level: str or ~azure.mgmt.servicefabric.models.NotificationLevel + :param notification_targets: Required. List of targets that subscribe to the notification. + :type notification_targets: list[~azure.mgmt.servicefabric.models.NotificationTarget] """ + _validation = { + 'is_enabled': {'required': True}, + 'notification_category': {'required': True}, + 'notification_level': {'required': True}, + 'notification_targets': {'required': True}, + } + _attribute_map = { - 'value': {'key': 'value', 'type': '[NodeType]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'notification_category': {'key': 'notificationCategory', 'type': 'str'}, + 'notification_level': {'key': 'notificationLevel', 'type': 'str'}, + 'notification_targets': {'key': 'notificationTargets', 'type': '[NotificationTarget]'}, } def __init__( self, **kwargs ): - super(NodeTypeListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + super(Notification, self).__init__(**kwargs) + self.is_enabled = kwargs['is_enabled'] + self.notification_category = kwargs['notification_category'] + self.notification_level = kwargs['notification_level'] + self.notification_targets = kwargs['notification_targets'] -class NodeTypeUpdateParameters(msrest.serialization.Model): - """Node type update request. +class NotificationTarget(msrest.serialization.Model): + """Describes the notification target properties. - :param tags: A set of tags. Node type update parameters. - :type tags: dict[str, str] - :param vm_instance_count: The number of nodes in the node type. - :type vm_instance_count: int - :param placement_properties: The placement tags applied to nodes in the node type, which can be - used to indicate where certain services (workload) should run. - :type placement_properties: dict[str, str] - :param capacities: The capacity tags applied to the nodes in the node type, the cluster - resource manager uses these tags to understand how much resource a node has. - :type capacities: dict[str, str] - :param application_ports: The range of ports from which cluster assigned port to Service Fabric - applications. - :type application_ports: ~azure.mgmt.servicefabric.models.EndpointRangeDescription - :param ephemeral_ports: The range of ephemeral ports that nodes in this node type should be - configured with. - :type ephemeral_ports: ~azure.mgmt.servicefabric.models.EndpointRangeDescription - :param vm_secrets: The secrets to install in the virtual machines. - :type vm_secrets: list[~azure.mgmt.servicefabric.models.VaultSecretGroup] - :param vm_extensions: Set of extensions that should be installed onto the virtual machines. - :type vm_extensions: list[~azure.mgmt.servicefabric.models.VMSSExtension] + All required parameters must be populated in order to send to Azure. + + :param notification_channel: Required. The notification channel indicates the type of receivers + subscribed to the notification, either user or subscription. Possible values include: + "EmailUser", "EmailSubscription". + :type notification_channel: str or ~azure.mgmt.servicefabric.models.NotificationChannel + :param receivers: Required. List of targets that subscribe to the notification. + :type receivers: list[str] """ _validation = { - 'vm_instance_count': {'maximum': 2147483647, 'minimum': 1}, + 'notification_channel': {'required': True}, + 'receivers': {'required': True}, } _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'vm_instance_count': {'key': 'properties.vmInstanceCount', 'type': 'int'}, - 'placement_properties': {'key': 'properties.placementProperties', 'type': '{str}'}, - 'capacities': {'key': 'properties.capacities', 'type': '{str}'}, - 'application_ports': {'key': 'properties.applicationPorts', 'type': 'EndpointRangeDescription'}, - 'ephemeral_ports': {'key': 'properties.ephemeralPorts', 'type': 'EndpointRangeDescription'}, - 'vm_secrets': {'key': 'properties.vmSecrets', 'type': '[VaultSecretGroup]'}, - 'vm_extensions': {'key': 'properties.vmExtensions', 'type': '[VMSSExtension]'}, + 'notification_channel': {'key': 'notificationChannel', 'type': 'str'}, + 'receivers': {'key': 'receivers', 'type': '[str]'}, } def __init__( self, **kwargs ): - super(NodeTypeUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.vm_instance_count = kwargs.get('vm_instance_count', None) - self.placement_properties = kwargs.get('placement_properties', None) - self.capacities = kwargs.get('capacities', None) - self.application_ports = kwargs.get('application_ports', None) - self.ephemeral_ports = kwargs.get('ephemeral_ports', None) - self.vm_secrets = kwargs.get('vm_secrets', None) - self.vm_extensions = kwargs.get('vm_extensions', None) + super(NotificationTarget, self).__init__(**kwargs) + self.notification_channel = kwargs['notification_channel'] + self.receivers = kwargs['receivers'] class OperationListResult(msrest.serialization.Model): @@ -2678,6 +2290,8 @@ class OperationResult(msrest.serialization.Model): :param name: The 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: The object that represents the operation. :type display: ~azure.mgmt.servicefabric.models.AvailableOperationDisplay :param origin: Origin result. @@ -2688,6 +2302,7 @@ class OperationResult(msrest.serialization.Model): _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, 'display': {'key': 'display', 'type': 'AvailableOperationDisplay'}, 'origin': {'key': 'origin', 'type': 'str'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, @@ -2699,6 +2314,7 @@ def __init__( ): super(OperationResult, 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.next_link = kwargs.get('next_link', None) @@ -2894,6 +2510,8 @@ class ServiceResource(ProxyResource): :type tags: dict[str, str] :ivar etag: Azure resource etag. :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.servicefabric.models.SystemData :param placement_constraints: The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is @@ -2936,6 +2554,7 @@ class ServiceResource(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -2946,6 +2565,7 @@ class ServiceResource(ProxyResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'placement_constraints': {'key': 'properties.placementConstraints', 'type': 'str'}, 'correlation_scheme': {'key': 'properties.correlationScheme', 'type': '[ServiceCorrelationDescription]'}, 'service_load_metrics': {'key': 'properties.serviceLoadMetrics', 'type': '[ServiceLoadMetricDescription]'}, @@ -3150,6 +2770,8 @@ class ServiceResourceUpdate(ProxyResource): :type tags: dict[str, str] :ivar etag: Azure resource etag. :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.servicefabric.models.SystemData :param placement_constraints: The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is @@ -3178,6 +2800,7 @@ class ServiceResourceUpdate(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -3187,6 +2810,7 @@ class ServiceResourceUpdate(ProxyResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'placement_constraints': {'key': 'properties.placementConstraints', 'type': 'str'}, 'correlation_scheme': {'key': 'properties.correlationScheme', 'type': '[ServiceCorrelationDescription]'}, 'service_load_metrics': {'key': 'properties.serviceLoadMetrics', 'type': '[ServiceLoadMetricDescription]'}, @@ -3402,31 +3026,6 @@ def __init__( self.partition_scheme = 'Singleton' # type: str -class Sku(msrest.serialization.Model): - """Sku definition. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Sku Name. Possible values include: "Basic", "Standard". - :type name: str or ~azure.mgmt.servicefabric.models.SkuName - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - - class StatefulServiceProperties(ServiceResourceProperties): """The properties of a stateful service resource. @@ -3752,23 +3351,43 @@ def __init__( self.instance_close_delay_duration = kwargs.get('instance_close_delay_duration', None) -class SubResource(msrest.serialization.Model): - """Azure resource identifier. +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. - :param id: Azure resource identifier. - :type id: str + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + :type created_by_type: str + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. + :type last_modified_by_type: str + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, } def __init__( self, **kwargs ): - super(SubResource, self).__init__(**kwargs) - self.id = kwargs.get('id', None) + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) class UniformInt64RangePartitionSchemeDescription(PartitionSchemeDescription): @@ -3814,177 +3433,75 @@ def __init__( self.high_key = kwargs['high_key'] -class UserAssignedIdentity(msrest.serialization.Model): - """UserAssignedIdentity. - - Variables are only populated by the server, and will be ignored when sending a request. +class UpgradableVersionPathResult(msrest.serialization.Model): + """The list of intermediate cluster code versions for an upgrade or downgrade. Or minimum and maximum upgradable version if no target was given. - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str + :param supported_path: + :type supported_path: list[str] """ - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class VaultCertificate(msrest.serialization.Model): - """Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. - - All required parameters must be populated in order to send to Azure. - - :param certificate_url: Required. This is the URL of a certificate that has been uploaded to - Key Vault as a secret. For adding a secret to the Key Vault, see `Add a key or secret to the - key vault `_. In this - case, your certificate needs to be It is the Base64 encoding of the following JSON Object which - is encoded in UTF-8: :code:`
`:code:`
` {:code:`
` - "data":":code:``",:code:`
` "dataType":"pfx",:code:`
` - "password":":code:``":code:`
`}. - :type certificate_url: str - :param certificate_store: Required. For Windows VMs, specifies the certificate store on the - Virtual Machine to which the certificate should be added. The specified certificate store is - implicitly in the LocalMachine account. :code:`
`:code:`
`For Linux VMs, the certificate - file is placed under the /var/lib/waagent directory, with the file name - :code:``.crt for the X509 certificate file and - :code:``.prv for private key. Both of these files are .pem formatted. - :type certificate_store: str - """ - - _validation = { - 'certificate_url': {'required': True}, - 'certificate_store': {'required': True}, - } - _attribute_map = { - 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, - 'certificate_store': {'key': 'certificateStore', 'type': 'str'}, + 'supported_path': {'key': 'supportedPath', 'type': '[str]'}, } def __init__( self, **kwargs ): - super(VaultCertificate, self).__init__(**kwargs) - self.certificate_url = kwargs['certificate_url'] - self.certificate_store = kwargs['certificate_store'] + super(UpgradableVersionPathResult, self).__init__(**kwargs) + self.supported_path = kwargs.get('supported_path', None) -class VaultSecretGroup(msrest.serialization.Model): - """Specifies set of certificates that should be installed onto the virtual machines. +class UpgradableVersionsDescription(msrest.serialization.Model): + """UpgradableVersionsDescription. All required parameters must be populated in order to send to Azure. - :param source_vault: Required. The relative URL of the Key Vault containing all of the - certificates in VaultCertificates. - :type source_vault: ~azure.mgmt.servicefabric.models.SubResource - :param vault_certificates: Required. The list of key vault references in SourceVault which - contain certificates. - :type vault_certificates: list[~azure.mgmt.servicefabric.models.VaultCertificate] + :param target_version: Required. The target code version. + :type target_version: str """ _validation = { - 'source_vault': {'required': True}, - 'vault_certificates': {'required': True}, + 'target_version': {'required': True}, } _attribute_map = { - 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, - 'vault_certificates': {'key': 'vaultCertificates', 'type': '[VaultCertificate]'}, + 'target_version': {'key': 'targetVersion', 'type': 'str'}, } def __init__( self, **kwargs ): - super(VaultSecretGroup, self).__init__(**kwargs) - self.source_vault = kwargs['source_vault'] - self.vault_certificates = kwargs['vault_certificates'] + super(UpgradableVersionsDescription, self).__init__(**kwargs) + self.target_version = kwargs['target_version'] -class VMSSExtension(msrest.serialization.Model): - """Specifies set of extensions that should be installed onto the virtual machines. +class UserAssignedIdentity(msrest.serialization.Model): + """UserAssignedIdentity. 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. - - :param name: Required. The name of the extension. - :type name: str - :param publisher: Required. The name of the extension handler publisher. - :type publisher: str - :param type: Required. Specifies the type of the extension; an example is - "CustomScriptExtension". - :type type: str - :param type_handler_version: Required. Specifies the version of the script handler. - :type type_handler_version: str - :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor - version if one is available at deployment time. Once deployed, however, the extension will not - upgrade minor versions unless redeployed, even with this property set to true. - :type auto_upgrade_minor_version: bool - :param settings: Json formatted public settings for the extension. - :type settings: any - :param protected_settings: The extension can contain either protectedSettings or - protectedSettingsFromKeyVault or no protected settings at all. - :type protected_settings: any - :param force_update_tag: If a value is provided and is different from the previous value, the - extension handler will be forced to update even if the extension configuration has not changed. - :type force_update_tag: str - :param provision_after_extensions: Collection of extension names after which this extension - needs to be provisioned. - :type provision_after_extensions: list[str] - :ivar provisioning_state: The provisioning state, which only appears in the response. - :vartype provisioning_state: str + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str """ _validation = { - 'name': {'required': True}, - 'publisher': {'required': True}, - 'type': {'required': True}, - 'type_handler_version': {'required': True}, - 'provisioning_state': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'publisher': {'key': 'properties.publisher', 'type': 'str'}, - 'type': {'key': 'properties.type', 'type': 'str'}, - 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, - 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, - 'settings': {'key': 'properties.settings', 'type': 'object'}, - 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, - 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, - 'provision_after_extensions': {'key': 'properties.provisionAfterExtensions', 'type': '[str]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, } def __init__( self, **kwargs ): - super(VMSSExtension, self).__init__(**kwargs) - self.name = kwargs['name'] - self.publisher = kwargs['publisher'] - self.type = kwargs['type'] - self.type_handler_version = kwargs['type_handler_version'] - self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) - self.settings = kwargs.get('settings', None) - self.protected_settings = kwargs.get('protected_settings', None) - self.force_update_tag = kwargs.get('force_update_tag', None) - self.provision_after_extensions = kwargs.get('provision_after_extensions', None) - self.provisioning_state = None + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_models_py3.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_models_py3.py index 254fc15ab61e..66fddb483ccd 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_models_py3.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_models_py3.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Any, Dict, List, Optional, Union +from typing import Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -148,6 +148,8 @@ class ProxyResource(msrest.serialization.Model): :type tags: dict[str, str] :ivar etag: Azure resource etag. :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.servicefabric.models.SystemData """ _validation = { @@ -155,6 +157,7 @@ class ProxyResource(msrest.serialization.Model): 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -164,6 +167,7 @@ class ProxyResource(msrest.serialization.Model): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__( @@ -180,6 +184,7 @@ def __init__( self.location = location self.tags = tags self.etag = None + self.system_data = None class ApplicationResource(ProxyResource): @@ -200,6 +205,8 @@ class ApplicationResource(ProxyResource): :type tags: dict[str, str] :ivar etag: Azure resource etag. :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.servicefabric.models.SystemData :param identity: Describes the managed identities for an Azure resource. :type identity: ~azure.mgmt.servicefabric.models.ManagedIdentity :param type_version: The version of the application type as defined in the application @@ -240,6 +247,7 @@ class ApplicationResource(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, 'minimum_nodes': {'minimum': 0}, 'maximum_nodes': {'minimum': 0}, 'provisioning_state': {'readonly': True}, @@ -252,6 +260,7 @@ class ApplicationResource(ProxyResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, 'type_version': {'key': 'properties.typeVersion', 'type': 'str'}, 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, @@ -492,6 +501,8 @@ class ApplicationResourceUpdate(ProxyResource): :type tags: dict[str, str] :ivar etag: Azure resource etag. :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.servicefabric.models.SystemData :param type_version: The version of the application type as defined in the application manifest. :type type_version: str @@ -525,6 +536,7 @@ class ApplicationResourceUpdate(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, 'minimum_nodes': {'minimum': 0}, 'maximum_nodes': {'minimum': 0}, } @@ -536,6 +548,7 @@ class ApplicationResourceUpdate(ProxyResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'type_version': {'key': 'properties.typeVersion', 'type': 'str'}, 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, 'upgrade_policy': {'key': 'properties.upgradePolicy', 'type': 'ApplicationUpgradePolicy'}, @@ -590,6 +603,8 @@ class ApplicationTypeResource(ProxyResource): :type tags: dict[str, str] :ivar etag: Azure resource etag. :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.servicefabric.models.SystemData :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -600,6 +615,7 @@ class ApplicationTypeResource(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -610,6 +626,7 @@ class ApplicationTypeResource(ProxyResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } @@ -673,6 +690,8 @@ class ApplicationTypeVersionResource(ProxyResource): :type tags: dict[str, str] :ivar etag: Azure resource etag. :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.servicefabric.models.SystemData :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -688,6 +707,7 @@ class ApplicationTypeVersionResource(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'default_parameter_list': {'readonly': True}, } @@ -699,6 +719,7 @@ class ApplicationTypeVersionResource(ProxyResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'app_package_url': {'key': 'properties.appPackageUrl', 'type': 'str'}, 'default_parameter_list': {'key': 'properties.defaultParameterList', 'type': '{str}'}, @@ -757,7 +778,7 @@ class ApplicationTypeVersionsCleanupPolicy(msrest.serialization.Model): :param max_unused_versions_to_keep: Required. Number of unused versions per application type to keep. - :type max_unused_versions_to_keep: int + :type max_unused_versions_to_keep: long """ _validation = { @@ -765,7 +786,7 @@ class ApplicationTypeVersionsCleanupPolicy(msrest.serialization.Model): } _attribute_map = { - 'max_unused_versions_to_keep': {'key': 'maxUnusedVersionsToKeep', 'type': 'int'}, + 'max_unused_versions_to_keep': {'key': 'maxUnusedVersionsToKeep', 'type': 'long'}, } def __init__( @@ -801,6 +822,10 @@ class ApplicationUpgradePolicy(msrest.serialization.Model): UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: "Invalid", "UnmonitoredAuto", "UnmonitoredManual", "Monitored". Default value: "Monitored". :type upgrade_mode: str or ~azure.mgmt.servicefabric.models.RollingUpgradeMode + :param recreate_application: Determines whether the application should be recreated on update. + If value=true, the rest of the upgrade policy parameters are not allowed and it will result in + availability loss. + :type recreate_application: bool """ _attribute_map = { @@ -809,6 +834,7 @@ class ApplicationUpgradePolicy(msrest.serialization.Model): 'rolling_upgrade_monitoring_policy': {'key': 'rollingUpgradeMonitoringPolicy', 'type': 'ArmRollingUpgradeMonitoringPolicy'}, 'application_health_policy': {'key': 'applicationHealthPolicy', 'type': 'ArmApplicationHealthPolicy'}, 'upgrade_mode': {'key': 'upgradeMode', 'type': 'str'}, + 'recreate_application': {'key': 'recreateApplication', 'type': 'bool'}, } def __init__( @@ -819,6 +845,7 @@ def __init__( rolling_upgrade_monitoring_policy: Optional["ArmRollingUpgradeMonitoringPolicy"] = None, application_health_policy: Optional["ArmApplicationHealthPolicy"] = None, upgrade_mode: Optional[Union[str, "RollingUpgradeMode"]] = "Monitored", + recreate_application: Optional[bool] = None, **kwargs ): super(ApplicationUpgradePolicy, self).__init__(**kwargs) @@ -827,6 +854,7 @@ def __init__( self.rolling_upgrade_monitoring_policy = rolling_upgrade_monitoring_policy self.application_health_policy = application_health_policy self.upgrade_mode = upgrade_mode + self.recreate_application = recreate_application class ApplicationUserAssignedIdentity(msrest.serialization.Model): @@ -1118,49 +1146,6 @@ def __init__( self.x509_store_name = x509_store_name -class ClientCertificate(msrest.serialization.Model): - """Client Certificate definition. - - All required parameters must be populated in order to send to Azure. - - :param is_admin: Required. Whether the certificate is admin or not. - :type is_admin: bool - :param thumbprint: Certificate Thumbprint. - :type thumbprint: str - :param common_name: Certificate Common name. - :type common_name: str - :param issuer_thumbprint: Issuer thumbprint for the certificate. Only used together with - CommonName. - :type issuer_thumbprint: str - """ - - _validation = { - 'is_admin': {'required': True}, - } - - _attribute_map = { - 'is_admin': {'key': 'isAdmin', 'type': 'bool'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - 'common_name': {'key': 'commonName', 'type': 'str'}, - 'issuer_thumbprint': {'key': 'issuerThumbprint', 'type': 'str'}, - } - - def __init__( - self, - *, - is_admin: bool, - thumbprint: Optional[str] = None, - common_name: Optional[str] = None, - issuer_thumbprint: Optional[str] = None, - **kwargs - ): - super(ClientCertificate, self).__init__(**kwargs) - self.is_admin = is_admin - self.thumbprint = thumbprint - self.common_name = common_name - self.issuer_thumbprint = issuer_thumbprint - - class ClientCertificateCommonName(msrest.serialization.Model): """Describes the client certificate details using common name. @@ -1255,6 +1240,8 @@ class Resource(msrest.serialization.Model): :type tags: dict[str, str] :ivar etag: Azure resource etag. :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.servicefabric.models.SystemData """ _validation = { @@ -1263,6 +1250,7 @@ class Resource(msrest.serialization.Model): 'type': {'readonly': True}, 'location': {'required': True}, 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -1272,6 +1260,7 @@ class Resource(msrest.serialization.Model): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__( @@ -1288,10 +1277,11 @@ def __init__( self.location = location self.tags = tags self.etag = None + self.system_data = None class Cluster(Resource): - """The cluster resource properties. + """The cluster resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -1309,6 +1299,8 @@ class Cluster(Resource): :type tags: dict[str, str] :ivar etag: Azure resource etag. :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.servicefabric.models.SystemData :param add_on_features: The list of add-on features to enable in the cluster. :type add_on_features: list[str or ~azure.mgmt.servicefabric.models.AddOnFeatures] :ivar available_cluster_versions: The Service Fabric runtime versions available for this @@ -1407,14 +1399,7 @@ class Cluster(Resource): :param upgrade_description: The policy to use when upgrading the cluster. :type upgrade_description: ~azure.mgmt.servicefabric.models.ClusterUpgradePolicy :param upgrade_mode: The upgrade mode of the cluster when new Service Fabric runtime version is - available. - - - * Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime - version as soon as it is available. - * Manual - The cluster will not be automatically upgraded to the latest Service Fabric runtime - version. The cluster is upgraded by setting the **clusterCodeVersion** property in the cluster - resource. Possible values include: "Automatic", "Manual". + available. Possible values include: "Automatic", "Manual". Default value: "Automatic". :type upgrade_mode: str or ~azure.mgmt.servicefabric.models.UpgradeMode :param application_type_versions_cleanup_policy: The policy used to clean up unused versions. :type application_type_versions_cleanup_policy: @@ -1422,6 +1407,30 @@ class Cluster(Resource): :param vm_image: The VM image VMSS has been configured with. Generic names such as Windows or Linux can be used. :type vm_image: str + :param sf_zonal_upgrade_mode: This property controls the logical grouping of VMs in upgrade + domains (UDs). This property can't be modified if a node type with multiple Availability Zones + is already present in the cluster. Possible values include: "Parallel", "Hierarchical". + :type sf_zonal_upgrade_mode: str or ~azure.mgmt.servicefabric.models.SfZonalUpgradeMode + :param vmss_zonal_upgrade_mode: This property defines the upgrade mode for the virtual machine + scale set, it is mandatory if a node type with multiple Availability Zones is added. Possible + values include: "Parallel", "Hierarchical". + :type vmss_zonal_upgrade_mode: str or ~azure.mgmt.servicefabric.models.VmssZonalUpgradeMode + :param infrastructure_service_manager: Indicates if infrastructure service manager is enabled. + :type infrastructure_service_manager: bool + :param upgrade_wave: Indicates when new cluster runtime version upgrades will be applied after + they are released. By default is Wave0. Only applies when **upgradeMode** is set to + 'Automatic'. Possible values include: "Wave0", "Wave1", "Wave2". + :type upgrade_wave: str or ~azure.mgmt.servicefabric.models.ClusterUpgradeCadence + :param upgrade_pause_start_timestamp_utc: Indicates the start date and time to pause automatic + runtime version upgrades on the cluster for an specific period of time on the cluster (UTC). + :type upgrade_pause_start_timestamp_utc: ~datetime.datetime + :param upgrade_pause_end_timestamp_utc: Indicates the end date and time to pause automatic + runtime version upgrades on the cluster for an specific period of time on the cluster (UTC). + :type upgrade_pause_end_timestamp_utc: ~datetime.datetime + :param wave_upgrade_paused: Boolean to pause automatic runtime version upgrades to the cluster. + :type wave_upgrade_paused: bool + :param notifications: Indicates a list of notification channels for cluster events. + :type notifications: list[~azure.mgmt.servicefabric.models.Notification] """ _validation = { @@ -1430,6 +1439,7 @@ class Cluster(Resource): 'type': {'readonly': True}, 'location': {'required': True}, 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, 'available_cluster_versions': {'readonly': True}, 'cluster_endpoint': {'readonly': True}, 'cluster_id': {'readonly': True}, @@ -1444,6 +1454,7 @@ class Cluster(Resource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'add_on_features': {'key': 'properties.addOnFeatures', 'type': '[str]'}, 'available_cluster_versions': {'key': 'properties.availableClusterVersions', 'type': '[ClusterVersionDetails]'}, 'azure_active_directory': {'key': 'properties.azureActiveDirectory', 'type': 'AzureActiveDirectory'}, @@ -1468,6 +1479,14 @@ class Cluster(Resource): 'upgrade_mode': {'key': 'properties.upgradeMode', 'type': 'str'}, 'application_type_versions_cleanup_policy': {'key': 'properties.applicationTypeVersionsCleanupPolicy', 'type': 'ApplicationTypeVersionsCleanupPolicy'}, 'vm_image': {'key': 'properties.vmImage', 'type': 'str'}, + 'sf_zonal_upgrade_mode': {'key': 'properties.sfZonalUpgradeMode', 'type': 'str'}, + 'vmss_zonal_upgrade_mode': {'key': 'properties.vmssZonalUpgradeMode', 'type': 'str'}, + 'infrastructure_service_manager': {'key': 'properties.infrastructureServiceManager', 'type': 'bool'}, + 'upgrade_wave': {'key': 'properties.upgradeWave', 'type': 'str'}, + 'upgrade_pause_start_timestamp_utc': {'key': 'properties.upgradePauseStartTimestampUtc', 'type': 'iso-8601'}, + 'upgrade_pause_end_timestamp_utc': {'key': 'properties.upgradePauseEndTimestampUtc', 'type': 'iso-8601'}, + 'wave_upgrade_paused': {'key': 'properties.waveUpgradePaused', 'type': 'bool'}, + 'notifications': {'key': 'properties.notifications', 'type': '[Notification]'}, } def __init__( @@ -1491,9 +1510,17 @@ def __init__( reverse_proxy_certificate: Optional["CertificateDescription"] = None, reverse_proxy_certificate_common_names: Optional["ServerCertificateCommonNames"] = None, upgrade_description: Optional["ClusterUpgradePolicy"] = None, - upgrade_mode: Optional[Union[str, "UpgradeMode"]] = None, + upgrade_mode: Optional[Union[str, "UpgradeMode"]] = "Automatic", application_type_versions_cleanup_policy: Optional["ApplicationTypeVersionsCleanupPolicy"] = None, vm_image: Optional[str] = None, + sf_zonal_upgrade_mode: Optional[Union[str, "SfZonalUpgradeMode"]] = None, + vmss_zonal_upgrade_mode: Optional[Union[str, "VmssZonalUpgradeMode"]] = None, + infrastructure_service_manager: Optional[bool] = None, + upgrade_wave: Optional[Union[str, "ClusterUpgradeCadence"]] = None, + upgrade_pause_start_timestamp_utc: Optional[datetime.datetime] = None, + upgrade_pause_end_timestamp_utc: Optional[datetime.datetime] = None, + wave_upgrade_paused: Optional[bool] = None, + notifications: Optional[List["Notification"]] = None, **kwargs ): super(Cluster, self).__init__(location=location, tags=tags, **kwargs) @@ -1521,6 +1548,14 @@ def __init__( self.upgrade_mode = upgrade_mode self.application_type_versions_cleanup_policy = application_type_versions_cleanup_policy self.vm_image = vm_image + self.sf_zonal_upgrade_mode = sf_zonal_upgrade_mode + self.vmss_zonal_upgrade_mode = vmss_zonal_upgrade_mode + self.infrastructure_service_manager = infrastructure_service_manager + self.upgrade_wave = upgrade_wave + self.upgrade_pause_start_timestamp_utc = upgrade_pause_start_timestamp_utc + self.upgrade_pause_end_timestamp_utc = upgrade_pause_end_timestamp_utc + self.wave_upgrade_paused = wave_upgrade_paused + self.notifications = notifications class ClusterCodeVersionsListResult(msrest.serialization.Model): @@ -1738,19 +1773,36 @@ class ClusterUpdateParameters(msrest.serialization.Model): :type reverse_proxy_certificate: ~azure.mgmt.servicefabric.models.CertificateDescription :param upgrade_description: The policy to use when upgrading the cluster. :type upgrade_description: ~azure.mgmt.servicefabric.models.ClusterUpgradePolicy - :param upgrade_mode: The upgrade mode of the cluster when new Service Fabric runtime version is - available. - - - * Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime - version as soon as it is available. - * Manual - The cluster will not be automatically upgraded to the latest Service Fabric runtime - version. The cluster is upgraded by setting the **clusterCodeVersion** property in the cluster - resource. Possible values include: "Automatic", "Manual". - :type upgrade_mode: str or ~azure.mgmt.servicefabric.models.UpgradeMode :param application_type_versions_cleanup_policy: The policy used to clean up unused versions. :type application_type_versions_cleanup_policy: ~azure.mgmt.servicefabric.models.ApplicationTypeVersionsCleanupPolicy + :param upgrade_mode: The upgrade mode of the cluster when new Service Fabric runtime version is + available. Possible values include: "Automatic", "Manual". Default value: "Automatic". + :type upgrade_mode: str or ~azure.mgmt.servicefabric.models.UpgradeMode + :param sf_zonal_upgrade_mode: This property controls the logical grouping of VMs in upgrade + domains (UDs). This property can't be modified if a node type with multiple Availability Zones + is already present in the cluster. Possible values include: "Parallel", "Hierarchical". + :type sf_zonal_upgrade_mode: str or ~azure.mgmt.servicefabric.models.SfZonalUpgradeMode + :param vmss_zonal_upgrade_mode: This property defines the upgrade mode for the virtual machine + scale set, it is mandatory if a node type with multiple Availability Zones is added. Possible + values include: "Parallel", "Hierarchical". + :type vmss_zonal_upgrade_mode: str or ~azure.mgmt.servicefabric.models.VmssZonalUpgradeMode + :param infrastructure_service_manager: Indicates if infrastructure service manager is enabled. + :type infrastructure_service_manager: bool + :param upgrade_wave: Indicates when new cluster runtime version upgrades will be applied after + they are released. By default is Wave0. Only applies when **upgradeMode** is set to + 'Automatic'. Possible values include: "Wave0", "Wave1", "Wave2". + :type upgrade_wave: str or ~azure.mgmt.servicefabric.models.ClusterUpgradeCadence + :param upgrade_pause_start_timestamp_utc: The start timestamp to pause runtime version upgrades + on the cluster (UTC). + :type upgrade_pause_start_timestamp_utc: ~datetime.datetime + :param upgrade_pause_end_timestamp_utc: The end timestamp of pause runtime version upgrades on + the cluster (UTC). + :type upgrade_pause_end_timestamp_utc: ~datetime.datetime + :param wave_upgrade_paused: Boolean to pause automatic runtime version upgrades to the cluster. + :type wave_upgrade_paused: bool + :param notifications: Indicates a list of notification channels for cluster events. + :type notifications: list[~azure.mgmt.servicefabric.models.Notification] """ _attribute_map = { @@ -1767,8 +1819,16 @@ class ClusterUpdateParameters(msrest.serialization.Model): 'reliability_level': {'key': 'properties.reliabilityLevel', 'type': 'str'}, 'reverse_proxy_certificate': {'key': 'properties.reverseProxyCertificate', 'type': 'CertificateDescription'}, 'upgrade_description': {'key': 'properties.upgradeDescription', 'type': 'ClusterUpgradePolicy'}, - 'upgrade_mode': {'key': 'properties.upgradeMode', 'type': 'str'}, 'application_type_versions_cleanup_policy': {'key': 'properties.applicationTypeVersionsCleanupPolicy', 'type': 'ApplicationTypeVersionsCleanupPolicy'}, + 'upgrade_mode': {'key': 'properties.upgradeMode', 'type': 'str'}, + 'sf_zonal_upgrade_mode': {'key': 'properties.sfZonalUpgradeMode', 'type': 'str'}, + 'vmss_zonal_upgrade_mode': {'key': 'properties.vmssZonalUpgradeMode', 'type': 'str'}, + 'infrastructure_service_manager': {'key': 'properties.infrastructureServiceManager', 'type': 'bool'}, + 'upgrade_wave': {'key': 'properties.upgradeWave', 'type': 'str'}, + 'upgrade_pause_start_timestamp_utc': {'key': 'properties.upgradePauseStartTimestampUtc', 'type': 'iso-8601'}, + 'upgrade_pause_end_timestamp_utc': {'key': 'properties.upgradePauseEndTimestampUtc', 'type': 'iso-8601'}, + 'wave_upgrade_paused': {'key': 'properties.waveUpgradePaused', 'type': 'bool'}, + 'notifications': {'key': 'properties.notifications', 'type': '[Notification]'}, } def __init__( @@ -1787,8 +1847,16 @@ def __init__( reliability_level: Optional[Union[str, "ReliabilityLevel"]] = None, reverse_proxy_certificate: Optional["CertificateDescription"] = None, upgrade_description: Optional["ClusterUpgradePolicy"] = None, - upgrade_mode: Optional[Union[str, "UpgradeMode"]] = None, application_type_versions_cleanup_policy: Optional["ApplicationTypeVersionsCleanupPolicy"] = None, + upgrade_mode: Optional[Union[str, "UpgradeMode"]] = "Automatic", + sf_zonal_upgrade_mode: Optional[Union[str, "SfZonalUpgradeMode"]] = None, + vmss_zonal_upgrade_mode: Optional[Union[str, "VmssZonalUpgradeMode"]] = None, + infrastructure_service_manager: Optional[bool] = None, + upgrade_wave: Optional[Union[str, "ClusterUpgradeCadence"]] = None, + upgrade_pause_start_timestamp_utc: Optional[datetime.datetime] = None, + upgrade_pause_end_timestamp_utc: Optional[datetime.datetime] = None, + wave_upgrade_paused: Optional[bool] = None, + notifications: Optional[List["Notification"]] = None, **kwargs ): super(ClusterUpdateParameters, self).__init__(**kwargs) @@ -1805,8 +1873,16 @@ def __init__( self.reliability_level = reliability_level self.reverse_proxy_certificate = reverse_proxy_certificate self.upgrade_description = upgrade_description - self.upgrade_mode = upgrade_mode self.application_type_versions_cleanup_policy = application_type_versions_cleanup_policy + self.upgrade_mode = upgrade_mode + self.sf_zonal_upgrade_mode = sf_zonal_upgrade_mode + self.vmss_zonal_upgrade_mode = vmss_zonal_upgrade_mode + self.infrastructure_service_manager = infrastructure_service_manager + self.upgrade_wave = upgrade_wave + self.upgrade_pause_start_timestamp_utc = upgrade_pause_start_timestamp_utc + self.upgrade_pause_end_timestamp_utc = upgrade_pause_end_timestamp_utc + self.wave_upgrade_paused = wave_upgrade_paused + self.notifications = notifications class ClusterUpgradeDeltaHealthPolicy(msrest.serialization.Model): @@ -2127,325 +2203,6 @@ def __init__( self.message = message -class LoadBalancingRule(msrest.serialization.Model): - """Describes a load balancing rule. - - All required parameters must be populated in order to send to Azure. - - :param frontend_port: Required. The port for the external endpoint. Port numbers for each rule - must be unique within the Load Balancer. Acceptable values are between 1 and 65534. - :type frontend_port: int - :param backend_port: Required. The port used for internal connections on the endpoint. - Acceptable values are between 1 and 65535. - :type backend_port: int - :param protocol: Required. The reference to the transport protocol used by the load balancing - rule. Possible values include: "tcp", "udp". - :type protocol: str or ~azure.mgmt.servicefabric.models.Protocol - :param probe_protocol: Required. the reference to the load balancer probe used by the load - balancing rule. Possible values include: "tcp", "http", "https". - :type probe_protocol: str or ~azure.mgmt.servicefabric.models.ProbeProtocol - :param probe_request_path: The probe request path. Only supported for HTTP/HTTPS probes. - :type probe_request_path: str - """ - - _validation = { - 'frontend_port': {'required': True, 'maximum': 65534, 'minimum': 1}, - 'backend_port': {'required': True, 'maximum': 65534, 'minimum': 1}, - 'protocol': {'required': True}, - 'probe_protocol': {'required': True}, - } - - _attribute_map = { - 'frontend_port': {'key': 'frontendPort', 'type': 'int'}, - 'backend_port': {'key': 'backendPort', 'type': 'int'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'probe_protocol': {'key': 'probeProtocol', 'type': 'str'}, - 'probe_request_path': {'key': 'probeRequestPath', 'type': 'str'}, - } - - def __init__( - self, - *, - frontend_port: int, - backend_port: int, - protocol: Union[str, "Protocol"], - probe_protocol: Union[str, "ProbeProtocol"], - probe_request_path: Optional[str] = None, - **kwargs - ): - super(LoadBalancingRule, self).__init__(**kwargs) - self.frontend_port = frontend_port - self.backend_port = backend_port - self.protocol = protocol - self.probe_protocol = probe_protocol - self.probe_request_path = probe_request_path - - -class ManagedCluster(Resource): - """The manged cluster resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Azure resource identifier. - :vartype id: str - :ivar name: Azure resource name. - :vartype name: str - :ivar type: Azure resource type. - :vartype type: str - :param location: Required. Azure resource location. - :type location: str - :param tags: A set of tags. Azure resource tags. - :type tags: dict[str, str] - :ivar etag: Azure resource etag. - :vartype etag: str - :param sku: The sku of the managed cluster. - :type sku: ~azure.mgmt.servicefabric.models.Sku - :param dns_name: The cluster dns name. - :type dns_name: str - :ivar fqdn: the cluster Fully qualified domain name. - :vartype fqdn: str - :ivar cluster_id: A service generated unique identifier for the cluster resource. - :vartype cluster_id: str - :ivar cluster_state: The current state of the cluster. Possible values include: - "WaitingForNodes", "Deploying", "BaselineUpgrade", "UpdatingUserConfiguration", - "UpdatingUserCertificate", "UpdatingInfrastructure", "EnforcingClusterVersion", - "UpgradeServiceUnreachable", "AutoScale", "Ready". - :vartype cluster_state: str or ~azure.mgmt.servicefabric.models.ClusterState - :ivar cluster_certificate_thumbprint: The cluster certificate thumbprint used node to node - communication. - :vartype cluster_certificate_thumbprint: str - :param client_connection_port: The port used for client connections to the cluster. - :type client_connection_port: int - :param http_gateway_connection_port: The port used for http connections to the cluster. - :type http_gateway_connection_port: int - :param admin_user_name: vm admin user name. - :type admin_user_name: str - :param admin_password: vm admin user password. - :type admin_password: str - :param load_balancing_rules: Describes load balancing rules. - :type load_balancing_rules: list[~azure.mgmt.servicefabric.models.LoadBalancingRule] - :param clients: client certificates for the cluster. - :type clients: list[~azure.mgmt.servicefabric.models.ClientCertificate] - :param azure_active_directory: Azure active directory. - :type azure_active_directory: ~azure.mgmt.servicefabric.models.AzureActiveDirectory - :param fabric_settings: The list of custom fabric settings to configure the cluster. - :type fabric_settings: list[~azure.mgmt.servicefabric.models.SettingsSectionDescription] - :ivar provisioning_state: The provisioning state of the managed cluster resource. Possible - values include: "None", "Creating", "Created", "Updating", "Succeeded", "Failed", "Canceled", - "Deleting", "Deleted", "Other". - :vartype provisioning_state: str or - ~azure.mgmt.servicefabric.models.ManagedResourceProvisioningState - :param cluster_code_version: The Service Fabric runtime version of the cluster. This property - can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available - Service Fabric versions for new clusters use `ClusterVersion API <./ClusterVersion.md>`_. To - get the list of available version for existing clusters use **availableClusterVersions**. - :type cluster_code_version: str - :param addon_features: client certificates for the cluster. - :type addon_features: list[str or ~azure.mgmt.servicefabric.models.ManagedClusterAddOnFeature] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'etag': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'cluster_id': {'readonly': True}, - 'cluster_state': {'readonly': True}, - 'cluster_certificate_thumbprint': {'readonly': True}, - 'provisioning_state': {'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}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'dns_name': {'key': 'properties.dnsName', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'cluster_id': {'key': 'properties.clusterId', 'type': 'str'}, - 'cluster_state': {'key': 'properties.clusterState', 'type': 'str'}, - 'cluster_certificate_thumbprint': {'key': 'properties.clusterCertificateThumbprint', 'type': 'str'}, - 'client_connection_port': {'key': 'properties.clientConnectionPort', 'type': 'int'}, - 'http_gateway_connection_port': {'key': 'properties.httpGatewayConnectionPort', 'type': 'int'}, - 'admin_user_name': {'key': 'properties.adminUserName', 'type': 'str'}, - 'admin_password': {'key': 'properties.adminPassword', 'type': 'str'}, - 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[LoadBalancingRule]'}, - 'clients': {'key': 'properties.clients', 'type': '[ClientCertificate]'}, - 'azure_active_directory': {'key': 'properties.azureActiveDirectory', 'type': 'AzureActiveDirectory'}, - 'fabric_settings': {'key': 'properties.fabricSettings', 'type': '[SettingsSectionDescription]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'cluster_code_version': {'key': 'properties.clusterCodeVersion', 'type': 'str'}, - 'addon_features': {'key': 'properties.addonFeatures', 'type': '[str]'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - sku: Optional["Sku"] = None, - dns_name: Optional[str] = None, - client_connection_port: Optional[int] = 19000, - http_gateway_connection_port: Optional[int] = 19080, - admin_user_name: Optional[str] = None, - admin_password: Optional[str] = None, - load_balancing_rules: Optional[List["LoadBalancingRule"]] = None, - clients: Optional[List["ClientCertificate"]] = None, - azure_active_directory: Optional["AzureActiveDirectory"] = None, - fabric_settings: Optional[List["SettingsSectionDescription"]] = None, - cluster_code_version: Optional[str] = None, - addon_features: Optional[List[Union[str, "ManagedClusterAddOnFeature"]]] = None, - **kwargs - ): - super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) - self.sku = sku - self.dns_name = dns_name - self.fqdn = None - self.cluster_id = None - self.cluster_state = None - self.cluster_certificate_thumbprint = None - self.client_connection_port = client_connection_port - self.http_gateway_connection_port = http_gateway_connection_port - self.admin_user_name = admin_user_name - self.admin_password = admin_password - self.load_balancing_rules = load_balancing_rules - self.clients = clients - self.azure_active_directory = azure_active_directory - self.fabric_settings = fabric_settings - self.provisioning_state = None - self.cluster_code_version = cluster_code_version - self.addon_features = addon_features - - -class ManagedClusterListResult(msrest.serialization.Model): - """Managed Cluster list results. - - :param value: - :type value: list[~azure.mgmt.servicefabric.models.ManagedCluster] - :param next_link: The URL to use for getting the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ManagedCluster"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class ManagedClusterUpdateParameters(msrest.serialization.Model): - """Managed cluster update request. - - :param tags: A set of tags. Managed cluster update parameters. - :type tags: dict[str, str] - :param client_connection_port: The port used for client connections to the cluster. - :type client_connection_port: int - :param http_gateway_connection_port: The port used for http connections to the cluster. - :type http_gateway_connection_port: int - :param load_balancing_rules: Describes load balancing rules. - :type load_balancing_rules: list[~azure.mgmt.servicefabric.models.LoadBalancingRule] - :param clients: client certificates for the cluster. - :type clients: list[~azure.mgmt.servicefabric.models.ClientCertificate] - :param azure_active_directory: Azure active directory. - :type azure_active_directory: ~azure.mgmt.servicefabric.models.AzureActiveDirectory - :param fabric_settings: The list of custom fabric settings to configure the cluster. - :type fabric_settings: list[~azure.mgmt.servicefabric.models.SettingsSectionDescription] - :param cluster_code_version: The Service Fabric runtime version of the cluster. This property - can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available - Service Fabric versions for new clusters use `ClusterVersion API <./ClusterVersion.md>`_. To - get the list of available version for existing clusters use **availableClusterVersions**. - :type cluster_code_version: str - :param addon_features: client certificates for the cluster. - :type addon_features: list[str or ~azure.mgmt.servicefabric.models.ManagedClusterAddOnFeature] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'client_connection_port': {'key': 'properties.clientConnectionPort', 'type': 'int'}, - 'http_gateway_connection_port': {'key': 'properties.httpGatewayConnectionPort', 'type': 'int'}, - 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[LoadBalancingRule]'}, - 'clients': {'key': 'properties.clients', 'type': '[ClientCertificate]'}, - 'azure_active_directory': {'key': 'properties.azureActiveDirectory', 'type': 'AzureActiveDirectory'}, - 'fabric_settings': {'key': 'properties.fabricSettings', 'type': '[SettingsSectionDescription]'}, - 'cluster_code_version': {'key': 'properties.clusterCodeVersion', 'type': 'str'}, - 'addon_features': {'key': 'properties.addonFeatures', 'type': '[str]'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - client_connection_port: Optional[int] = None, - http_gateway_connection_port: Optional[int] = None, - load_balancing_rules: Optional[List["LoadBalancingRule"]] = None, - clients: Optional[List["ClientCertificate"]] = None, - azure_active_directory: Optional["AzureActiveDirectory"] = None, - fabric_settings: Optional[List["SettingsSectionDescription"]] = None, - cluster_code_version: Optional[str] = None, - addon_features: Optional[List[Union[str, "ManagedClusterAddOnFeature"]]] = None, - **kwargs - ): - super(ManagedClusterUpdateParameters, self).__init__(**kwargs) - self.tags = tags - self.client_connection_port = client_connection_port - self.http_gateway_connection_port = http_gateway_connection_port - self.load_balancing_rules = load_balancing_rules - self.clients = clients - self.azure_active_directory = azure_active_directory - self.fabric_settings = fabric_settings - self.cluster_code_version = cluster_code_version - self.addon_features = addon_features - - -class ManagedClusterVersionDetails(msrest.serialization.Model): - """The detail of the Service Fabric runtime version. - - :param msi_version: The Service Fabric runtime version of the cluster. - :type msi_version: str - :param support_expiry_utc: The date of expiry of support of the version. - :type support_expiry_utc: str - :param os_type: Indicates the operating system of the cluster. Possible values include: - "Windows", "Ubuntu", "RedHat", "Ubuntu18_04". - :type os_type: str or ~azure.mgmt.servicefabric.models.ClusterOsType - """ - - _attribute_map = { - 'msi_version': {'key': 'msiVersion', 'type': 'str'}, - 'support_expiry_utc': {'key': 'supportExpiryUtc', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - } - - def __init__( - self, - *, - msi_version: Optional[str] = None, - support_expiry_utc: Optional[str] = None, - os_type: Optional[Union[str, "ClusterOsType"]] = None, - **kwargs - ): - super(ManagedClusterVersionDetails, self).__init__(**kwargs) - self.msi_version = msi_version - self.support_expiry_utc = support_expiry_utc - self.os_type = os_type - - class ManagedIdentity(msrest.serialization.Model): """Describes the managed identities for an Azure resource. @@ -2493,47 +2250,6 @@ def __init__( self.user_assigned_identities = user_assigned_identities -class ManagedProxyResource(msrest.serialization.Model): - """The resource model definition for proxy-only resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Azure resource identifier. - :vartype id: str - :ivar name: Azure resource name. - :vartype name: str - :ivar type: Azure resource type. - :vartype type: str - :param tags: A set of tags. Azure resource tags. - :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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(ManagedProxyResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.tags = tags - - class PartitionSchemeDescription(msrest.serialization.Model): """Describes how the service is partitioned. @@ -2607,165 +2323,6 @@ def __init__( self.names = names -class NodeType(ManagedProxyResource): - """Describes a node type in the cluster, each node type represents sub set of nodes in the cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Azure resource identifier. - :vartype id: str - :ivar name: Azure resource name. - :vartype name: str - :ivar type: Azure resource type. - :vartype type: str - :param tags: A set of tags. Azure resource tags. - :type tags: dict[str, str] - :param is_primary: The node type on which system services will run. Only one node type should - be marked as primary. Primary node type cannot be deleted or changed for existing clusters. - :type is_primary: bool - :param vm_instance_count: The number of nodes in the node type. - :type vm_instance_count: int - :param data_disk_size_gb: Disk size for each vm in the node type in GBs. - :type data_disk_size_gb: int - :param placement_properties: The placement tags applied to nodes in the node type, which can be - used to indicate where certain services (workload) should run. - :type placement_properties: dict[str, str] - :param capacities: The capacity tags applied to the nodes in the node type, the cluster - resource manager uses these tags to understand how much resource a node has. - :type capacities: dict[str, str] - :param application_ports: The range of ports from which cluster assigned port to Service Fabric - applications. - :type application_ports: ~azure.mgmt.servicefabric.models.EndpointRangeDescription - :param ephemeral_ports: The range of ephemeral ports that nodes in this node type should be - configured with. - :type ephemeral_ports: ~azure.mgmt.servicefabric.models.EndpointRangeDescription - :param vm_size: The size of virtual machines in the pool. All virtual machines in a pool are - the same size. For example, Standard_D3. - :type vm_size: str - :param vm_image_publisher: The publisher of the Azure Virtual Machines Marketplace image. For - example, Canonical or MicrosoftWindowsServer. - :type vm_image_publisher: str - :param vm_image_offer: The offer type of the Azure Virtual Machines Marketplace image. For - example, UbuntuServer or WindowsServer. - :type vm_image_offer: str - :param vm_image_sku: The SKU of the Azure Virtual Machines Marketplace image. For example, - 14.04.0-LTS or 2012-R2-Datacenter. - :type vm_image_sku: str - :param vm_image_version: The version of the Azure Virtual Machines Marketplace image. A value - of 'latest' can be specified to select the latest version of an image. If omitted, the default - is 'latest'. - :type vm_image_version: str - :param vm_secrets: The secrets to install in the virtual machines. - :type vm_secrets: list[~azure.mgmt.servicefabric.models.VaultSecretGroup] - :param vm_extensions: Set of extensions that should be installed onto the virtual machines. - :type vm_extensions: list[~azure.mgmt.servicefabric.models.VMSSExtension] - :ivar provisioning_state: The provisioning state of the managed cluster resource. Possible - values include: "None", "Creating", "Created", "Updating", "Succeeded", "Failed", "Canceled", - "Deleting", "Deleted", "Other". - :vartype provisioning_state: str or - ~azure.mgmt.servicefabric.models.ManagedResourceProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'vm_instance_count': {'maximum': 2147483647, 'minimum': 1}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_primary': {'key': 'properties.isPrimary', 'type': 'bool'}, - 'vm_instance_count': {'key': 'properties.vmInstanceCount', 'type': 'int'}, - 'data_disk_size_gb': {'key': 'properties.dataDiskSizeGB', 'type': 'int'}, - 'placement_properties': {'key': 'properties.placementProperties', 'type': '{str}'}, - 'capacities': {'key': 'properties.capacities', 'type': '{str}'}, - 'application_ports': {'key': 'properties.applicationPorts', 'type': 'EndpointRangeDescription'}, - 'ephemeral_ports': {'key': 'properties.ephemeralPorts', 'type': 'EndpointRangeDescription'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'vm_image_publisher': {'key': 'properties.vmImagePublisher', 'type': 'str'}, - 'vm_image_offer': {'key': 'properties.vmImageOffer', 'type': 'str'}, - 'vm_image_sku': {'key': 'properties.vmImageSku', 'type': 'str'}, - 'vm_image_version': {'key': 'properties.vmImageVersion', 'type': 'str'}, - 'vm_secrets': {'key': 'properties.vmSecrets', 'type': '[VaultSecretGroup]'}, - 'vm_extensions': {'key': 'properties.vmExtensions', 'type': '[VMSSExtension]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - is_primary: Optional[bool] = None, - vm_instance_count: Optional[int] = None, - data_disk_size_gb: Optional[int] = None, - placement_properties: Optional[Dict[str, str]] = None, - capacities: Optional[Dict[str, str]] = None, - application_ports: Optional["EndpointRangeDescription"] = None, - ephemeral_ports: Optional["EndpointRangeDescription"] = None, - vm_size: Optional[str] = None, - vm_image_publisher: Optional[str] = None, - vm_image_offer: Optional[str] = None, - vm_image_sku: Optional[str] = None, - vm_image_version: Optional[str] = None, - vm_secrets: Optional[List["VaultSecretGroup"]] = None, - vm_extensions: Optional[List["VMSSExtension"]] = None, - **kwargs - ): - super(NodeType, self).__init__(tags=tags, **kwargs) - self.is_primary = is_primary - self.vm_instance_count = vm_instance_count - self.data_disk_size_gb = data_disk_size_gb - self.placement_properties = placement_properties - self.capacities = capacities - self.application_ports = application_ports - self.ephemeral_ports = ephemeral_ports - self.vm_size = vm_size - self.vm_image_publisher = vm_image_publisher - self.vm_image_offer = vm_image_offer - self.vm_image_sku = vm_image_sku - self.vm_image_version = vm_image_version - self.vm_secrets = vm_secrets - self.vm_extensions = vm_extensions - self.provisioning_state = None - - -class NodeTypeActionParameters(msrest.serialization.Model): - """Parameters for Node type action. - - All required parameters must be populated in order to send to Azure. - - :param nodes: Required. List of node names from the node type. - :type nodes: list[str] - :param force: Force the action to go through. - :type force: bool - """ - - _validation = { - 'nodes': {'required': True}, - } - - _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[str]'}, - 'force': {'key': 'force', 'type': 'bool'}, - } - - def __init__( - self, - *, - nodes: List[str], - force: Optional[bool] = None, - **kwargs - ): - super(NodeTypeActionParameters, self).__init__(**kwargs) - self.nodes = nodes - self.force = force - - class NodeTypeDescription(msrest.serialization.Model): """Describes a node type in the cluster, each node type represents sub set of nodes in the cluster. @@ -2803,11 +2360,19 @@ class NodeTypeDescription(msrest.serialization.Model): type should be marked as primary. Primary node type cannot be deleted or changed for existing clusters. :type is_primary: bool - :param vm_instance_count: Required. The number of nodes in the node type. This count should - match the capacity property in the corresponding VirtualMachineScaleSet resource. + :param vm_instance_count: Required. VMInstanceCount should be 1 to n, where n indicates the + number of VM instances corresponding to this nodeType. VMInstanceCount = 0 can be done only in + these scenarios: NodeType is a secondary nodeType. Durability = Bronze or Durability >= Bronze + and InfrastructureServiceManager = true. If VMInstanceCount = 0, implies the VMs for this + nodeType will not be used for the initial cluster size computation. :type vm_instance_count: int :param reverse_proxy_endpoint_port: The endpoint used by reverse proxy. :type reverse_proxy_endpoint_port: int + :param is_stateless: Indicates if the node type can only host Stateless workloads. + :type is_stateless: bool + :param multiple_availability_zones: Indicates if the node type is enabled to support multiple + zones. + :type multiple_availability_zones: bool """ _validation = { @@ -2815,7 +2380,7 @@ class NodeTypeDescription(msrest.serialization.Model): 'client_connection_endpoint_port': {'required': True}, 'http_gateway_endpoint_port': {'required': True}, 'is_primary': {'required': True}, - 'vm_instance_count': {'required': True, 'maximum': 2147483647, 'minimum': 1}, + 'vm_instance_count': {'required': True, 'maximum': 2147483647, 'minimum': 0}, } _attribute_map = { @@ -2830,6 +2395,8 @@ class NodeTypeDescription(msrest.serialization.Model): 'is_primary': {'key': 'isPrimary', 'type': 'bool'}, 'vm_instance_count': {'key': 'vmInstanceCount', 'type': 'int'}, 'reverse_proxy_endpoint_port': {'key': 'reverseProxyEndpointPort', 'type': 'int'}, + 'is_stateless': {'key': 'isStateless', 'type': 'bool'}, + 'multiple_availability_zones': {'key': 'multipleAvailabilityZones', 'type': 'bool'}, } def __init__( @@ -2846,6 +2413,8 @@ def __init__( application_ports: Optional["EndpointRangeDescription"] = None, ephemeral_ports: Optional["EndpointRangeDescription"] = None, reverse_proxy_endpoint_port: Optional[int] = None, + is_stateless: Optional[bool] = None, + multiple_availability_zones: Optional[bool] = None, **kwargs ): super(NodeTypeDescription, self).__init__(**kwargs) @@ -2860,96 +2429,90 @@ def __init__( self.is_primary = is_primary self.vm_instance_count = vm_instance_count self.reverse_proxy_endpoint_port = reverse_proxy_endpoint_port + self.is_stateless = is_stateless + self.multiple_availability_zones = multiple_availability_zones -class NodeTypeListResult(msrest.serialization.Model): - """Node type list results. +class Notification(msrest.serialization.Model): + """Describes the notification channel for cluster events. - :param value: The list of node types. - :type value: list[~azure.mgmt.servicefabric.models.NodeType] - :param next_link: The URL to use for getting the next set of results. - :type next_link: str + All required parameters must be populated in order to send to Azure. + + :param is_enabled: Required. Indicates if the notification is enabled. + :type is_enabled: bool + :param notification_category: Required. The category of notification. Possible values include: + "WaveProgress". + :type notification_category: str or ~azure.mgmt.servicefabric.models.NotificationCategory + :param notification_level: Required. The level of notification. Possible values include: + "Critical", "All". + :type notification_level: str or ~azure.mgmt.servicefabric.models.NotificationLevel + :param notification_targets: Required. List of targets that subscribe to the notification. + :type notification_targets: list[~azure.mgmt.servicefabric.models.NotificationTarget] """ + _validation = { + 'is_enabled': {'required': True}, + 'notification_category': {'required': True}, + 'notification_level': {'required': True}, + 'notification_targets': {'required': True}, + } + _attribute_map = { - 'value': {'key': 'value', 'type': '[NodeType]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'notification_category': {'key': 'notificationCategory', 'type': 'str'}, + 'notification_level': {'key': 'notificationLevel', 'type': 'str'}, + 'notification_targets': {'key': 'notificationTargets', 'type': '[NotificationTarget]'}, } def __init__( self, *, - value: Optional[List["NodeType"]] = None, - next_link: Optional[str] = None, + is_enabled: bool, + notification_category: Union[str, "NotificationCategory"], + notification_level: Union[str, "NotificationLevel"], + notification_targets: List["NotificationTarget"], **kwargs ): - super(NodeTypeListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link + super(Notification, self).__init__(**kwargs) + self.is_enabled = is_enabled + self.notification_category = notification_category + self.notification_level = notification_level + self.notification_targets = notification_targets -class NodeTypeUpdateParameters(msrest.serialization.Model): - """Node type update request. +class NotificationTarget(msrest.serialization.Model): + """Describes the notification target properties. - :param tags: A set of tags. Node type update parameters. - :type tags: dict[str, str] - :param vm_instance_count: The number of nodes in the node type. - :type vm_instance_count: int - :param placement_properties: The placement tags applied to nodes in the node type, which can be - used to indicate where certain services (workload) should run. - :type placement_properties: dict[str, str] - :param capacities: The capacity tags applied to the nodes in the node type, the cluster - resource manager uses these tags to understand how much resource a node has. - :type capacities: dict[str, str] - :param application_ports: The range of ports from which cluster assigned port to Service Fabric - applications. - :type application_ports: ~azure.mgmt.servicefabric.models.EndpointRangeDescription - :param ephemeral_ports: The range of ephemeral ports that nodes in this node type should be - configured with. - :type ephemeral_ports: ~azure.mgmt.servicefabric.models.EndpointRangeDescription - :param vm_secrets: The secrets to install in the virtual machines. - :type vm_secrets: list[~azure.mgmt.servicefabric.models.VaultSecretGroup] - :param vm_extensions: Set of extensions that should be installed onto the virtual machines. - :type vm_extensions: list[~azure.mgmt.servicefabric.models.VMSSExtension] + All required parameters must be populated in order to send to Azure. + + :param notification_channel: Required. The notification channel indicates the type of receivers + subscribed to the notification, either user or subscription. Possible values include: + "EmailUser", "EmailSubscription". + :type notification_channel: str or ~azure.mgmt.servicefabric.models.NotificationChannel + :param receivers: Required. List of targets that subscribe to the notification. + :type receivers: list[str] """ _validation = { - 'vm_instance_count': {'maximum': 2147483647, 'minimum': 1}, + 'notification_channel': {'required': True}, + 'receivers': {'required': True}, } _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'vm_instance_count': {'key': 'properties.vmInstanceCount', 'type': 'int'}, - 'placement_properties': {'key': 'properties.placementProperties', 'type': '{str}'}, - 'capacities': {'key': 'properties.capacities', 'type': '{str}'}, - 'application_ports': {'key': 'properties.applicationPorts', 'type': 'EndpointRangeDescription'}, - 'ephemeral_ports': {'key': 'properties.ephemeralPorts', 'type': 'EndpointRangeDescription'}, - 'vm_secrets': {'key': 'properties.vmSecrets', 'type': '[VaultSecretGroup]'}, - 'vm_extensions': {'key': 'properties.vmExtensions', 'type': '[VMSSExtension]'}, + 'notification_channel': {'key': 'notificationChannel', 'type': 'str'}, + 'receivers': {'key': 'receivers', 'type': '[str]'}, } def __init__( self, *, - tags: Optional[Dict[str, str]] = None, - vm_instance_count: Optional[int] = None, - placement_properties: Optional[Dict[str, str]] = None, - capacities: Optional[Dict[str, str]] = None, - application_ports: Optional["EndpointRangeDescription"] = None, - ephemeral_ports: Optional["EndpointRangeDescription"] = None, - vm_secrets: Optional[List["VaultSecretGroup"]] = None, - vm_extensions: Optional[List["VMSSExtension"]] = None, + notification_channel: Union[str, "NotificationChannel"], + receivers: List[str], **kwargs ): - super(NodeTypeUpdateParameters, self).__init__(**kwargs) - self.tags = tags - self.vm_instance_count = vm_instance_count - self.placement_properties = placement_properties - self.capacities = capacities - self.application_ports = application_ports - self.ephemeral_ports = ephemeral_ports - self.vm_secrets = vm_secrets - self.vm_extensions = vm_extensions + super(NotificationTarget, self).__init__(**kwargs) + self.notification_channel = notification_channel + self.receivers = receivers class OperationListResult(msrest.serialization.Model): @@ -2988,6 +2551,8 @@ class OperationResult(msrest.serialization.Model): :param name: The 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: The object that represents the operation. :type display: ~azure.mgmt.servicefabric.models.AvailableOperationDisplay :param origin: Origin result. @@ -2998,6 +2563,7 @@ class OperationResult(msrest.serialization.Model): _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, 'display': {'key': 'display', 'type': 'AvailableOperationDisplay'}, 'origin': {'key': 'origin', 'type': 'str'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, @@ -3007,6 +2573,7 @@ def __init__( self, *, name: Optional[str] = None, + is_data_action: Optional[bool] = None, display: Optional["AvailableOperationDisplay"] = None, origin: Optional[str] = None, next_link: Optional[str] = None, @@ -3014,6 +2581,7 @@ def __init__( ): super(OperationResult, self).__init__(**kwargs) self.name = name + self.is_data_action = is_data_action self.display = display self.origin = origin self.next_link = next_link @@ -3224,6 +2792,8 @@ class ServiceResource(ProxyResource): :type tags: dict[str, str] :ivar etag: Azure resource etag. :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.servicefabric.models.SystemData :param placement_constraints: The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is @@ -3266,6 +2836,7 @@ class ServiceResource(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -3276,6 +2847,7 @@ class ServiceResource(ProxyResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'placement_constraints': {'key': 'properties.placementConstraints', 'type': 'str'}, 'correlation_scheme': {'key': 'properties.correlationScheme', 'type': '[ServiceCorrelationDescription]'}, 'service_load_metrics': {'key': 'properties.serviceLoadMetrics', 'type': '[ServiceLoadMetricDescription]'}, @@ -3510,6 +3082,8 @@ class ServiceResourceUpdate(ProxyResource): :type tags: dict[str, str] :ivar etag: Azure resource etag. :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.servicefabric.models.SystemData :param placement_constraints: The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is @@ -3538,6 +3112,7 @@ class ServiceResourceUpdate(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -3547,6 +3122,7 @@ class ServiceResourceUpdate(ProxyResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'placement_constraints': {'key': 'properties.placementConstraints', 'type': 'str'}, 'correlation_scheme': {'key': 'properties.correlationScheme', 'type': '[ServiceCorrelationDescription]'}, 'service_load_metrics': {'key': 'properties.serviceLoadMetrics', 'type': '[ServiceLoadMetricDescription]'}, @@ -3786,33 +3362,6 @@ def __init__( self.partition_scheme = 'Singleton' # type: str -class Sku(msrest.serialization.Model): - """Sku definition. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Sku Name. Possible values include: "Basic", "Standard". - :type name: str or ~azure.mgmt.servicefabric.models.SkuName - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Union[str, "SkuName"], - **kwargs - ): - super(Sku, self).__init__(**kwargs) - self.name = name - - class StatefulServiceProperties(ServiceResourceProperties): """The properties of a stateful service resource. @@ -4185,25 +3734,50 @@ def __init__( self.instance_close_delay_duration = instance_close_delay_duration -class SubResource(msrest.serialization.Model): - """Azure resource identifier. +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. - :param id: Azure resource identifier. - :type id: str + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + :type created_by_type: str + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. + :type last_modified_by_type: str + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, } def __init__( self, *, - id: Optional[str] = None, + created_by: Optional[str] = None, + created_by_type: Optional[str] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[str] = None, + last_modified_at: Optional[datetime.datetime] = None, **kwargs ): - super(SubResource, self).__init__(**kwargs) - self.id = id + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at class UniformInt64RangePartitionSchemeDescription(PartitionSchemeDescription): @@ -4253,193 +3827,79 @@ def __init__( self.high_key = high_key -class UserAssignedIdentity(msrest.serialization.Model): - """UserAssignedIdentity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class VaultCertificate(msrest.serialization.Model): - """Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. - - All required parameters must be populated in order to send to Azure. +class UpgradableVersionPathResult(msrest.serialization.Model): + """The list of intermediate cluster code versions for an upgrade or downgrade. Or minimum and maximum upgradable version if no target was given. - :param certificate_url: Required. This is the URL of a certificate that has been uploaded to - Key Vault as a secret. For adding a secret to the Key Vault, see `Add a key or secret to the - key vault `_. In this - case, your certificate needs to be It is the Base64 encoding of the following JSON Object which - is encoded in UTF-8: :code:`
`:code:`
` {:code:`
` - "data":":code:``",:code:`
` "dataType":"pfx",:code:`
` - "password":":code:``":code:`
`}. - :type certificate_url: str - :param certificate_store: Required. For Windows VMs, specifies the certificate store on the - Virtual Machine to which the certificate should be added. The specified certificate store is - implicitly in the LocalMachine account. :code:`
`:code:`
`For Linux VMs, the certificate - file is placed under the /var/lib/waagent directory, with the file name - :code:``.crt for the X509 certificate file and - :code:``.prv for private key. Both of these files are .pem formatted. - :type certificate_store: str + :param supported_path: + :type supported_path: list[str] """ - _validation = { - 'certificate_url': {'required': True}, - 'certificate_store': {'required': True}, - } - _attribute_map = { - 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, - 'certificate_store': {'key': 'certificateStore', 'type': 'str'}, + 'supported_path': {'key': 'supportedPath', 'type': '[str]'}, } def __init__( self, *, - certificate_url: str, - certificate_store: str, + supported_path: Optional[List[str]] = None, **kwargs ): - super(VaultCertificate, self).__init__(**kwargs) - self.certificate_url = certificate_url - self.certificate_store = certificate_store + super(UpgradableVersionPathResult, self).__init__(**kwargs) + self.supported_path = supported_path -class VaultSecretGroup(msrest.serialization.Model): - """Specifies set of certificates that should be installed onto the virtual machines. +class UpgradableVersionsDescription(msrest.serialization.Model): + """UpgradableVersionsDescription. All required parameters must be populated in order to send to Azure. - :param source_vault: Required. The relative URL of the Key Vault containing all of the - certificates in VaultCertificates. - :type source_vault: ~azure.mgmt.servicefabric.models.SubResource - :param vault_certificates: Required. The list of key vault references in SourceVault which - contain certificates. - :type vault_certificates: list[~azure.mgmt.servicefabric.models.VaultCertificate] + :param target_version: Required. The target code version. + :type target_version: str """ _validation = { - 'source_vault': {'required': True}, - 'vault_certificates': {'required': True}, + 'target_version': {'required': True}, } _attribute_map = { - 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, - 'vault_certificates': {'key': 'vaultCertificates', 'type': '[VaultCertificate]'}, + 'target_version': {'key': 'targetVersion', 'type': 'str'}, } def __init__( self, *, - source_vault: "SubResource", - vault_certificates: List["VaultCertificate"], + target_version: str, **kwargs ): - super(VaultSecretGroup, self).__init__(**kwargs) - self.source_vault = source_vault - self.vault_certificates = vault_certificates + super(UpgradableVersionsDescription, self).__init__(**kwargs) + self.target_version = target_version -class VMSSExtension(msrest.serialization.Model): - """Specifies set of extensions that should be installed onto the virtual machines. +class UserAssignedIdentity(msrest.serialization.Model): + """UserAssignedIdentity. 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. - - :param name: Required. The name of the extension. - :type name: str - :param publisher: Required. The name of the extension handler publisher. - :type publisher: str - :param type: Required. Specifies the type of the extension; an example is - "CustomScriptExtension". - :type type: str - :param type_handler_version: Required. Specifies the version of the script handler. - :type type_handler_version: str - :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor - version if one is available at deployment time. Once deployed, however, the extension will not - upgrade minor versions unless redeployed, even with this property set to true. - :type auto_upgrade_minor_version: bool - :param settings: Json formatted public settings for the extension. - :type settings: any - :param protected_settings: The extension can contain either protectedSettings or - protectedSettingsFromKeyVault or no protected settings at all. - :type protected_settings: any - :param force_update_tag: If a value is provided and is different from the previous value, the - extension handler will be forced to update even if the extension configuration has not changed. - :type force_update_tag: str - :param provision_after_extensions: Collection of extension names after which this extension - needs to be provisioned. - :type provision_after_extensions: list[str] - :ivar provisioning_state: The provisioning state, which only appears in the response. - :vartype provisioning_state: str + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str """ _validation = { - 'name': {'required': True}, - 'publisher': {'required': True}, - 'type': {'required': True}, - 'type_handler_version': {'required': True}, - 'provisioning_state': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'publisher': {'key': 'properties.publisher', 'type': 'str'}, - 'type': {'key': 'properties.type', 'type': 'str'}, - 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, - 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, - 'settings': {'key': 'properties.settings', 'type': 'object'}, - 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, - 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, - 'provision_after_extensions': {'key': 'properties.provisionAfterExtensions', 'type': '[str]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, } def __init__( self, - *, - name: str, - publisher: str, - type: str, - type_handler_version: str, - auto_upgrade_minor_version: Optional[bool] = None, - settings: Optional[Any] = None, - protected_settings: Optional[Any] = None, - force_update_tag: Optional[str] = None, - provision_after_extensions: Optional[List[str]] = None, **kwargs ): - super(VMSSExtension, self).__init__(**kwargs) - self.name = name - self.publisher = publisher - self.type = type - self.type_handler_version = type_handler_version - self.auto_upgrade_minor_version = auto_upgrade_minor_version - self.settings = settings - self.protected_settings = protected_settings - self.force_update_tag = force_update_tag - self.provision_after_extensions = provision_after_extensions - self.provisioning_state = None + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_service_fabric_management_client_enums.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_service_fabric_management_client_enums.py index 3c1638398b2e..7633d775047e 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_service_fabric_management_client_enums.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_service_fabric_management_client_enums.py @@ -62,15 +62,6 @@ class ClusterEnvironment(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): WINDOWS = "Windows" LINUX = "Linux" -class ClusterOsType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Cluster operating system type. - """ - - WINDOWS = "Windows" - UBUNTU = "Ubuntu" - RED_HAT = "RedHat" - UBUNTU18_04 = "Ubuntu18_04" - class ClusterState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The current state of the cluster. @@ -107,6 +98,21 @@ class ClusterState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): AUTO_SCALE = "AutoScale" READY = "Ready" +class ClusterUpgradeCadence(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Indicates when new cluster runtime version upgrades will be applied after they are released. By + default is Wave0. + """ + + #: Cluster upgrade starts immediately after a new version is rolled out. Recommended for Test/Dev + #: clusters. + WAVE0 = "Wave0" + #: Cluster upgrade starts 7 days after a new version is rolled out. Recommended for Pre-prod + #: clusters. + WAVE1 = "Wave1" + #: Cluster upgrade starts 14 days after a new version is rolled out. Recommended for Production + #: clusters. + WAVE2 = "Wave2" + class DurabilityLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The durability level of the node type. Learn about `DurabilityLevel `_. @@ -122,26 +128,11 @@ class DurabilityLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SILVER = "Silver" GOLD = "Gold" -class Enum23(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - WINDOWS = "Windows" - UBUNTU = "Ubuntu" - RED_HAT = "RedHat" - UBUNTU18_04 = "Ubuntu18_04" - -class Enum8(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Enum14(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): WINDOWS = "Windows" LINUX = "Linux" -class ManagedClusterAddOnFeature(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Available cluster add-on features - """ - - DNS_SERVICE = "DnsService" - BACKUP_RESTORE_SERVICE = "BackupRestoreService" - RESOURCE_MONITOR_SERVICE = "ResourceMonitorService" - class ManagedIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of managed identity for the resource. """ @@ -156,21 +147,6 @@ class ManagedIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Indicates that no identity is associated with the resource. NONE = "None" -class ManagedResourceProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The provisioning state of the managed resource. - """ - - NONE = "None" - CREATING = "Creating" - CREATED = "Created" - UPDATING = "Updating" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - DELETING = "Deleting" - DELETED = "Deleted" - OTHER = "Other" - class MoveCost(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the move cost for the service. """ @@ -184,6 +160,35 @@ class MoveCost(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Specifies the move cost of the service as High. The value is 3. HIGH = "High" +class NotificationCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The category of notification. + """ + + #: Notification will be regarding wave progress. + WAVE_PROGRESS = "WaveProgress" + +class NotificationChannel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The notification channel indicates the type of receivers subscribed to the notification, either + user or subscription. + """ + + #: For email user receivers. In this case, the parameter receivers should be a list of email + #: addresses that will receive the notifications. + EMAIL_USER = "EmailUser" + #: For subscription receivers. In this case, the parameter receivers should be a list of roles of + #: the subscription for the cluster (eg. Owner, AccountAdmin, etc) that will receive the + #: notifications. + EMAIL_SUBSCRIPTION = "EmailSubscription" + +class NotificationLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The level of notification. + """ + + #: Receive only critical notifications. + CRITICAL = "Critical" + #: Receive all notifications. + ALL = "All" + class PartitionScheme(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Enumerates the ways that a service can be partitioned. """ @@ -201,21 +206,6 @@ class PartitionScheme(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: object. The value is 3. NAMED = "Named" -class ProbeProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """the reference to the load balancer probe used by the load balancing rule. - """ - - TCP = "tcp" - HTTP = "http" - HTTPS = "https" - -class Protocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The reference to the transport protocol used by the load balancing rule. - """ - - TCP = "tcp" - UDP = "udp" - class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state of the cluster resource. """ @@ -341,13 +331,22 @@ class ServicePlacementPolicyType(with_metaclass(_CaseInsensitiveEnumMeta, str, E #: replicas of a particular partition of the service should be placed atomically. The value is 5. NON_PARTIALLY_PLACE_SERVICE = "NonPartiallyPlaceService" -class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Sku Name. Basic will have a minimum of 3 seed nodes and Standard a minimum of 5. Basic only - allows 1 node type. +class SfZonalUpgradeMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This property controls the logical grouping of VMs in upgrade domains (UDs). This property + can't be modified if a node type with multiple Availability Zones is already present in the + cluster. """ - BASIC = "Basic" - STANDARD = "Standard" + #: VMs under the node type are grouped into UDs and ignore the zone info in five UDs. This setting + #: causes UDs across all zones to be upgraded at the same time. This deployment mode is faster for + #: upgrades, we don't recommend it because it goes against the SDP guidelines, which state that + #: the updates should be applied to one zone at a time. + PARALLEL = "Parallel" + #: If this value is omitted or set to Hierarchical, VMs are grouped to reflect the zonal + #: distribution in up to 15 UDs. Each of the three zones has five UDs. This ensures that the zones + #: are updated one at a time, moving to next zone only after completing five UDs within the first + #: zone. This update process is safer for the cluster and the user application. + HIERARCHICAL = "Hierarchical" class StoreName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The local certificate store location. @@ -364,14 +363,23 @@ class StoreName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): class UpgradeMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The upgrade mode of the cluster when new Service Fabric runtime version is available. - - - * Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime - version as soon as it is available. - * Manual - The cluster will not be automatically upgraded to the latest Service Fabric runtime - version. The cluster is upgraded by setting the **clusterCodeVersion** property in the cluster - resource. """ + #: The cluster will be automatically upgraded to the latest Service Fabric runtime version, + #: **upgradeWave** will determine when the upgrade starts after the new version becomes available. AUTOMATIC = "Automatic" + #: The cluster will not be automatically upgraded to the latest Service Fabric runtime version. + #: The cluster is upgraded by setting the **clusterCodeVersion** property in the cluster resource. MANUAL = "Manual" + +class VmssZonalUpgradeMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This property defines the upgrade mode for the virtual machine scale set, it is mandatory if a + node type with multiple Availability Zones is added. + """ + + #: Updates will happen in all Availability Zones at once for the virtual machine scale sets. + PARALLEL = "Parallel" + #: VMs are grouped to reflect the zonal distribution in up to 15 UDs. Each of the three zones has + #: five UDs. This ensures that the zones are updated one at a time, moving to next zone only after + #: completing five UDs within the first zone. + HIERARCHICAL = "Hierarchical" diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/__init__.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/__init__.py index ed7940a82986..dd0e1c0084f7 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/__init__.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/__init__.py @@ -9,29 +9,17 @@ from ._clusters_operations import ClustersOperations from ._cluster_versions_operations import ClusterVersionsOperations from ._operations import Operations -from ._application_operations import ApplicationOperations from ._application_types_operations import ApplicationTypesOperations from ._application_type_versions_operations import ApplicationTypeVersionsOperations from ._applications_operations import ApplicationsOperations from ._services_operations import ServicesOperations -from ._managed_clusters_operations import ManagedClustersOperations -from ._managedcluster_operations import ManagedclusterOperations -from ._managed_cluster_versions_operations import ManagedClusterVersionsOperations -from ._nodetype_operations import NodetypeOperations -from ._node_types_operations import NodeTypesOperations __all__ = [ 'ClustersOperations', 'ClusterVersionsOperations', 'Operations', - 'ApplicationOperations', 'ApplicationTypesOperations', 'ApplicationTypeVersionsOperations', 'ApplicationsOperations', 'ServicesOperations', - 'ManagedClustersOperations', - 'ManagedclusterOperations', - 'ManagedClusterVersionsOperations', - 'NodetypeOperations', - 'NodeTypesOperations', ] diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_application_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_application_operations.py deleted file mode 100644 index 278698747502..000000000000 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_application_operations.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class ApplicationOperations(object): - """ApplicationOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.servicefabric.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] - """Lists all of the available Service Fabric resource provider API operations. - - Get the list of available Service Fabric resource provider API operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicefabric.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.ServiceFabric/operations'} # type: ignore diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_application_type_versions_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_application_type_versions_operations.py index 3b76792656b8..8c05d77f7518 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_application_type_versions_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_application_type_versions_operations.py @@ -78,7 +78,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -132,7 +132,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -274,7 +274,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -416,7 +416,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_application_types_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_application_types_operations.py index 21cbba065ba4..2d02f041c731 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_application_types_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_application_types_operations.py @@ -75,7 +75,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -144,7 +144,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -200,7 +200,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -333,7 +333,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_applications_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_applications_operations.py index 2aea27137f7f..592887a5e162 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_applications_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_applications_operations.py @@ -75,7 +75,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -127,7 +127,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -263,7 +263,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -398,7 +398,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -531,7 +531,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_cluster_versions_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_cluster_versions_operations.py index 90337c603c77..8a7096ef2a02 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_cluster_versions_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_cluster_versions_operations.py @@ -70,7 +70,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -96,7 +96,8 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ClusterCodeVersionsListResult', pipeline_response) @@ -109,7 +110,7 @@ def get( def get_by_environment( self, location, # type: str - environment, # type: Union[str, "_models.Enum8"] + environment, # type: Union[str, "_models.Enum14"] cluster_version, # type: str **kwargs # type: Any ): @@ -122,7 +123,7 @@ def get_by_environment( location. :type location: str :param environment: The operating system of the cluster. The default means all. - :type environment: str or ~azure.mgmt.servicefabric.models.Enum8 + :type environment: str or ~azure.mgmt.servicefabric.models.Enum14 :param cluster_version: The cluster code version. :type cluster_version: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -135,7 +136,7 @@ def get_by_environment( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -162,7 +163,8 @@ def get_by_environment( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ClusterCodeVersionsListResult', pipeline_response) @@ -195,7 +197,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -220,7 +222,8 @@ def list( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ClusterCodeVersionsListResult', pipeline_response) @@ -233,7 +236,7 @@ def list( def list_by_environment( self, location, # type: str - environment, # type: Union[str, "_models.Enum8"] + environment, # type: Union[str, "_models.Enum14"] **kwargs # type: Any ): # type: (...) -> "_models.ClusterCodeVersionsListResult" @@ -245,7 +248,7 @@ def list_by_environment( location. :type location: str :param environment: The operating system of the cluster. The default means all. - :type environment: str or ~azure.mgmt.servicefabric.models.Enum8 + :type environment: str or ~azure.mgmt.servicefabric.models.Enum14 :keyword callable cls: A custom type or function that will be passed the direct response :return: ClusterCodeVersionsListResult, or the result of cls(response) :rtype: ~azure.mgmt.servicefabric.models.ClusterCodeVersionsListResult @@ -256,7 +259,7 @@ def list_by_environment( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -282,7 +285,8 @@ def list_by_environment( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ClusterCodeVersionsListResult', pipeline_response) diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_clusters_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_clusters_operations.py index 49eda9f9830c..9d855f07ba2b 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_clusters_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_clusters_operations.py @@ -72,7 +72,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -122,7 +122,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -255,7 +255,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -401,7 +401,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -458,7 +458,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -514,7 +514,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -548,3 +548,78 @@ def list( return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters'} # type: ignore + + def list_upgradable_versions( + self, + resource_group_name, # type: str + cluster_name, # type: str + versions_description=None, # type: Optional["_models.UpgradableVersionsDescription"] + **kwargs # type: Any + ): + # type: (...) -> "_models.UpgradableVersionPathResult" + """Operation to get the minimum and maximum upgradable version from the current cluster version, or the required path to get to the an specific target version. + + If a target is not provided, it will get the minimum and maximum versions available from the + current cluster version. If a target is given, it will provide the required path to get from + the current cluster version to the target version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. + :type cluster_name: str + :param versions_description: The upgrade path description with target version. + :type versions_description: ~azure.mgmt.servicefabric.models.UpgradableVersionsDescription + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpgradableVersionPathResult, or the result of cls(response) + :rtype: ~azure.mgmt.servicefabric.models.UpgradableVersionPathResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UpgradableVersionPathResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_upgradable_versions.metadata['url'] # type: ignore + 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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if versions_description is not None: + body_content = self._serialize.body(versions_description, 'UpgradableVersionsDescription') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('UpgradableVersionPathResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_upgradable_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/listUpgradableVersions'} # type: ignore diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_managed_cluster_versions_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_managed_cluster_versions_operations.py deleted file mode 100644 index cc53aa3f5751..000000000000 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_managed_cluster_versions_operations.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class ManagedClusterVersionsOperations(object): - """ManagedClusterVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.servicefabric.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list_by_os( - self, - location, # type: str - os_type, # type: Union[str, "_models.Enum23"] - **kwargs # type: Any - ): - # type: (...) -> List["_models.ManagedClusterVersionDetails"] - """Gets the list of Service Fabric cluster code versions available for the specified OS type. - - Gets all available code versions for Service Fabric cluster resources by OS type. - - :param location: The location for the cluster code versions. This is different from cluster - location. - :type location: str - :param os_type: The operating system of the cluster. - :type os_type: str or ~azure.mgmt.servicefabric.models.Enum23 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of ManagedClusterVersionDetails, or the result of cls(response) - :rtype: list[~azure.mgmt.servicefabric.models.ManagedClusterVersionDetails] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ManagedClusterVersionDetails"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - accept = "application/json" - - # Construct URL - url = self.list_by_os.metadata['url'] # type: ignore - path_format_arguments = { - 'location': self._serialize.url("location", location, 'str'), - 'osType': self._serialize.url("os_type", os_type, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[ManagedClusterVersionDetails]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list_by_os.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedclusters/locations/{location}/osType/{osType}/clusterVersions'} # type: ignore diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_managed_clusters_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_managed_clusters_operations.py deleted file mode 100644 index f68040462c8f..000000000000 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_managed_clusters_operations.py +++ /dev/null @@ -1,639 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class ManagedClustersOperations(object): - """ManagedClustersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.servicefabric.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list_by_resource_group( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] - """Gets the list of Service Fabric cluster resources created in the specified resource group. - - Gets all Service Fabric cluster resources created or in the process of being created in the - resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicefabric.models.ManagedClusterListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters'} # type: ignore - - def list_by_subscription( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] - """Gets the list of Service Fabric cluster resources created in the specified subscription. - - Gets all Service Fabric cluster resources created or in the process of being created in the - subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicefabric.models.ManagedClusterListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedClusters'} # type: ignore - - def get( - self, - resource_group_name, # type: str - cluster_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" - """Gets a Service Fabric managed cluster resource. - - Get a Service Fabric managed cluster resource created or in the process of being created in the - specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ManagedCluster, or the result of cls(response) - :rtype: ~azure.mgmt.servicefabric.models.ManagedCluster - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ManagedCluster', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - cluster_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ManagedCluster', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ManagedCluster', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('ManagedCluster', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - cluster_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] - """Creates or updates a Service Fabric managed cluster resource. - - Create or update a Service Fabric managed cluster resource with the specified name. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :param parameters: The cluster resource. - :type parameters: ~azure.mgmt.servicefabric.models.ManagedCluster - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicefabric.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ManagedCluster', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}'} # type: ignore - - def _update_initial( - self, - resource_group_name, # type: str - cluster_name, # type: str - parameters, # type: "_models.ManagedClusterUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ManagedCluster', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('ManagedCluster', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}'} # type: ignore - - def begin_update( - self, - resource_group_name, # type: str - cluster_name, # type: str - parameters, # type: "_models.ManagedClusterUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] - """Updates the configuration of a Service Fabric managed cluster resource. - - Update the configuration of a Service Fabric managed cluster resource with the specified name. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :param parameters: The parameters to update the managed cluster configuration. - :type parameters: ~azure.mgmt.servicefabric.models.ManagedClusterUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicefabric.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ManagedCluster', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - cluster_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - cluster_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a Service Fabric managed cluster resource. - - Delete a Service Fabric managed cluster resource with the specified name. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}'} # type: ignore diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_managedcluster_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_managedcluster_operations.py deleted file mode 100644 index 918931648d0e..000000000000 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_managedcluster_operations.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class ManagedclusterOperations(object): - """ManagedclusterOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.servicefabric.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] - """Lists all of the available Service Fabric resource provider API operations. - - Get the list of available Service Fabric resource provider API operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicefabric.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.ServiceFabric/operations'} # type: ignore diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_node_types_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_node_types_operations.py deleted file mode 100644 index 4bfa01e3dc23..000000000000 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_node_types_operations.py +++ /dev/null @@ -1,988 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class NodeTypesOperations(object): - """NodeTypesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.servicefabric.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list_by_managed_clusters( - self, - resource_group_name, # type: str - cluster_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NodeTypeListResult"] - """Gets the list of Node types of the specified managed cluster. - - Gets all Node types of the specified managed cluster. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NodeTypeListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicefabric.models.NodeTypeListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NodeTypeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_managed_clusters.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('NodeTypeListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_managed_clusters.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes'} # type: ignore - - def _restart_initial( - self, - resource_group_name, # type: str - cluster_name, # type: str - node_type_name, # type: str - parameters, # type: "_models.NodeTypeActionParameters" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._restart_initial.metadata['url'] # type: ignore - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NodeTypeActionParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/restart'} # type: ignore - - def begin_restart( - self, - resource_group_name, # type: str - cluster_name, # type: str - node_type_name, # type: str - parameters, # type: "_models.NodeTypeActionParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Restarts one or more nodes on the node type. - - Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a - restart on the VMs and activate the nodes back again. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :param node_type_name: The name of the node type. - :type node_type_name: str - :param parameters: parameters for restart action. - :type parameters: ~azure.mgmt.servicefabric.models.NodeTypeActionParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._restart_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - node_type_name=node_type_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/restart'} # type: ignore - - def _reimage_initial( - self, - resource_group_name, # type: str - cluster_name, # type: str - node_type_name, # type: str - parameters, # type: "_models.NodeTypeActionParameters" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reimage_initial.metadata['url'] # type: ignore - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NodeTypeActionParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _reimage_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/reimage'} # type: ignore - - def begin_reimage( - self, - resource_group_name, # type: str - cluster_name, # type: str - node_type_name, # type: str - parameters, # type: "_models.NodeTypeActionParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Reimages one or more nodes on the node type. - - Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a - reimage on the VMs and activate the nodes back again. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :param node_type_name: The name of the node type. - :type node_type_name: str - :param parameters: parameters for reimage action. - :type parameters: ~azure.mgmt.servicefabric.models.NodeTypeActionParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._reimage_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - node_type_name=node_type_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_reimage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/reimage'} # type: ignore - - def _delete_node_initial( - self, - resource_group_name, # type: str - cluster_name, # type: str - node_type_name, # type: str - parameters, # type: "_models.NodeTypeActionParameters" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._delete_node_initial.metadata['url'] # type: ignore - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NodeTypeActionParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_node_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/deleteNode'} # type: ignore - - def begin_delete_node( - self, - resource_group_name, # type: str - cluster_name, # type: str - node_type_name, # type: str - parameters, # type: "_models.NodeTypeActionParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes one or more nodes on the node type. - - Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete - on the VMs and removes the state from the cluster. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :param node_type_name: The name of the node type. - :type node_type_name: str - :param parameters: parameters for delete action. - :type parameters: ~azure.mgmt.servicefabric.models.NodeTypeActionParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_node_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - node_type_name=node_type_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete_node.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/deleteNode'} # type: ignore - - def get( - self, - resource_group_name, # type: str - cluster_name, # type: str - node_type_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.NodeType" - """Gets a Service Fabric node type. - - Get a Service Fabric node type of a given managed cluster. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :param node_type_name: The name of the node type. - :type node_type_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NodeType, or the result of cls(response) - :rtype: ~azure.mgmt.servicefabric.models.NodeType - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NodeType"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NodeType', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - cluster_name, # type: str - node_type_name, # type: str - parameters, # type: "_models.NodeType" - **kwargs # type: Any - ): - # type: (...) -> "_models.NodeType" - cls = kwargs.pop('cls', None) # type: ClsType["_models.NodeType"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NodeType') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NodeType', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('NodeType', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('NodeType', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - cluster_name, # type: str - node_type_name, # type: str - parameters, # type: "_models.NodeType" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NodeType"] - """Creates or updates a Service Fabric node type. - - Create or update a Service Fabric node type of a given managed cluster. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :param node_type_name: The name of the node type. - :type node_type_name: str - :param parameters: The node type resource. - :type parameters: ~azure.mgmt.servicefabric.models.NodeType - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either NodeType or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicefabric.models.NodeType] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NodeType"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - node_type_name=node_type_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('NodeType', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}'} # type: ignore - - def _update_initial( - self, - resource_group_name, # type: str - cluster_name, # type: str - node_type_name, # type: str - parameters, # type: "_models.NodeTypeUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.NodeType" - cls = kwargs.pop('cls', None) # type: ClsType["_models.NodeType"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NodeTypeUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NodeType', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('NodeType', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}'} # type: ignore - - def begin_update( - self, - resource_group_name, # type: str - cluster_name, # type: str - node_type_name, # type: str - parameters, # type: "_models.NodeTypeUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NodeType"] - """Updates the configuration of a node type of a given managed cluster. - - Update the configuration of a node type of a given managed cluster. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :param node_type_name: The name of the node type. - :type node_type_name: str - :param parameters: The parameters to update the node type configuration. - :type parameters: ~azure.mgmt.servicefabric.models.NodeTypeUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either NodeType or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicefabric.models.NodeType] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NodeType"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - node_type_name=node_type_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('NodeType', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - cluster_name, # type: str - node_type_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - cluster_name, # type: str - node_type_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a Service Fabric node type. - - Delete a Service Fabric node type of a given managed cluster. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. - :type cluster_name: str - :param node_type_name: The name of the node type. - :type node_type_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - node_type_name=node_type_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - 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'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'nodeTypeName': self._serialize.url("node_type_name", node_type_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}'} # type: ignore diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_nodetype_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_nodetype_operations.py deleted file mode 100644 index d8984f52f4f6..000000000000 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_nodetype_operations.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class NodetypeOperations(object): - """NodetypeOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.servicefabric.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] - """Lists all of the available Service Fabric resource provider API operations. - - Get the list of available Service Fabric resource provider API operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicefabric.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.ServiceFabric/operations'} # type: ignore diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_operations.py index f3c203574246..da3cbbe1c6fc 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_operations.py @@ -64,7 +64,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_services_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_services_operations.py index d3b000dfbe12..53cdaaa58b86 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_services_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_services_operations.py @@ -79,7 +79,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -133,7 +133,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -277,7 +277,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -420,7 +420,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -563,7 +563,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL