From bfd19d6e2fa5fbc9138cb75488c4ad7cc8ffddaf Mon Sep 17 00:00:00 2001 From: colawwj <70128817+colawwj@users.noreply.github.com> Date: Sun, 27 Sep 2020 12:32:46 +0800 Subject: [PATCH] Release synapse (#14047) * Generated from e0d3bfbfaddf622076a063b03e3589d9374b7f0d * update-0.4.0 Co-authored-by: SDK Automation --- sdk/synapse/azure-mgmt-synapse/CHANGELOG.md | 8 + sdk/synapse/azure-mgmt-synapse/README.md | 2 +- .../azure/mgmt/synapse/models/_models.py | 59 ++++--- .../azure/mgmt/synapse/models/_models_py3.py | 65 +++++--- .../_synapse_management_client_enums.py | 2 + .../_integration_runtimes_operations.py | 147 +++++++++++++----- .../azure/mgmt/synapse/version.py | 2 +- 7 files changed, 201 insertions(+), 84 deletions(-) diff --git a/sdk/synapse/azure-mgmt-synapse/CHANGELOG.md b/sdk/synapse/azure-mgmt-synapse/CHANGELOG.md index 078b08ef3bd5..c74e7a194e68 100644 --- a/sdk/synapse/azure-mgmt-synapse/CHANGELOG.md +++ b/sdk/synapse/azure-mgmt-synapse/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History +## 0.4.0 (2020-09-25) + +**Features** + + - Model BigDataPoolResourceInfo has a new parameter is_compute_isolation_enabled + - Model Workspace has a new parameter extra_properties + - Model Sku has a new parameter capacity + ## 0.3.0 (2020-06-17) **Features** diff --git a/sdk/synapse/azure-mgmt-synapse/README.md b/sdk/synapse/azure-mgmt-synapse/README.md index b842c7ac1bce..c5866eb8201d 100644 --- a/sdk/synapse/azure-mgmt-synapse/README.md +++ b/sdk/synapse/azure-mgmt-synapse/README.md @@ -2,7 +2,7 @@ This is the Microsoft Azure Synapse Management Client Library. This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. -For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all) +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). # Usage diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models.py index 0ab09f18b765..e82a36f58589 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models.py @@ -290,6 +290,9 @@ class BigDataPoolResourceInfo(TrackedResource): :type creation_date: datetime :param auto_pause: Auto-pausing properties :type auto_pause: ~azure.mgmt.synapse.models.AutoPauseProperties + :param is_compute_isolation_enabled: Whether compute isolation is required + or not. + :type is_compute_isolation_enabled: bool :param spark_events_folder: The Spark events folder :type spark_events_folder: str :param node_count: The number of nodes in the Big Data pool. @@ -302,7 +305,8 @@ class BigDataPoolResourceInfo(TrackedResource): be written. :type default_spark_log_folder: str :param node_size: The level of compute power that each node in the Big - Data pool has. Possible values include: 'None', 'Small', 'Medium', 'Large' + Data pool has. Possible values include: 'None', 'Small', 'Medium', + 'Large', 'XLarge', 'XXLarge' :type node_size: str or ~azure.mgmt.synapse.models.NodeSize :param node_size_family: The kind of nodes that the Big Data pool provides. Possible values include: 'None', 'MemoryOptimized' @@ -326,6 +330,7 @@ class BigDataPoolResourceInfo(TrackedResource): 'auto_scale': {'key': 'properties.autoScale', 'type': 'AutoScaleProperties'}, 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, 'auto_pause': {'key': 'properties.autoPause', 'type': 'AutoPauseProperties'}, + 'is_compute_isolation_enabled': {'key': 'properties.isComputeIsolationEnabled', 'type': 'bool'}, 'spark_events_folder': {'key': 'properties.sparkEventsFolder', 'type': 'str'}, 'node_count': {'key': 'properties.nodeCount', 'type': 'int'}, 'library_requirements': {'key': 'properties.libraryRequirements', 'type': 'LibraryRequirements'}, @@ -341,6 +346,7 @@ def __init__(self, **kwargs): self.auto_scale = kwargs.get('auto_scale', None) self.creation_date = kwargs.get('creation_date', None) self.auto_pause = kwargs.get('auto_pause', None) + self.is_compute_isolation_enabled = kwargs.get('is_compute_isolation_enabled', None) self.spark_events_folder = kwargs.get('spark_events_folder', None) self.node_count = kwargs.get('node_count', None) self.library_requirements = kwargs.get('library_requirements', None) @@ -1293,19 +1299,21 @@ def __init__(self, **kwargs): self.key_name = kwargs.get('key_name', None) -class SubResource(Model): - """Azure Synapse nested resource, which belongs to a factory. +class SubResource(AzureEntityResource): + """Azure Synapse nested resource, which belongs to a workspace. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The resource identifier. + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str - :ivar name: The resource name. + :ivar name: The name of the resource :vartype name: str - :ivar type: The resource type. + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str - :ivar etag: Etag identifies change in the resource. + :ivar etag: Resource Etag. :vartype etag: str """ @@ -1325,10 +1333,6 @@ class SubResource(Model): def __init__(self, **kwargs): super(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.etag = None class IntegrationRuntimeResource(SubResource): @@ -1339,13 +1343,15 @@ class IntegrationRuntimeResource(SubResource): All required parameters must be populated in order to send to Azure. - :ivar id: The resource identifier. + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str - :ivar name: The resource name. + :ivar name: The name of the resource :vartype name: str - :ivar type: The resource type. + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str - :ivar etag: Etag identifies change in the resource. + :ivar etag: Resource Etag. :vartype etag: str :param properties: Required. Integration runtime properties. :type properties: ~azure.mgmt.synapse.models.IntegrationRuntime @@ -3365,17 +3371,23 @@ class Sku(Model): :type tier: str :param name: The SKU name :type name: str + :param capacity: If the SKU supports scale out/in then the capacity + integer should be included. If scale out/in is not possible for the + resource this may be omitted. + :type capacity: int """ _attribute_map = { 'tier': {'key': 'tier', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, } def __init__(self, **kwargs): super(Sku, self).__init__(**kwargs) self.tier = kwargs.get('tier', None) self.name = kwargs.get('name', None) + self.capacity = kwargs.get('capacity', None) class SqlPool(TrackedResource): @@ -4989,8 +5001,13 @@ class Workspace(TrackedResource): ~azure.mgmt.synapse.models.DataLakeStorageAccountDetails :param sql_administrator_login_password: SQL administrator login password :type sql_administrator_login_password: str - :ivar managed_resource_group_name: Workspace managed resource group - :vartype managed_resource_group_name: str + :param managed_resource_group_name: Workspace managed resource group. The + resource group name uniquely identifies the resource group within the user + subscriptionId. The resource group name must be no longer than 90 + characters long, and must be alphanumeric characters + (Char.IsLetterOrDigit()) and '-', '_', '(', ')' and'.'. Note that the name + cannot end with '.' + :type managed_resource_group_name: str :ivar provisioning_state: Resource provisioning state :vartype provisioning_state: str :param sql_administrator_login: Login for workspace SQL active directory @@ -5009,6 +5026,8 @@ class Workspace(TrackedResource): workspace :type private_endpoint_connections: list[~azure.mgmt.synapse.models.PrivateEndpointConnection] + :ivar extra_properties: Workspace level configs and feature flags + :vartype extra_properties: dict[str, object] :param identity: Identity of the workspace :type identity: ~azure.mgmt.synapse.models.ManagedIdentity """ @@ -5018,8 +5037,8 @@ class Workspace(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'managed_resource_group_name': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'extra_properties': {'readonly': True}, } _attribute_map = { @@ -5037,6 +5056,7 @@ class Workspace(TrackedResource): 'connectivity_endpoints': {'key': 'properties.connectivityEndpoints', 'type': '{str}'}, 'managed_virtual_network': {'key': 'properties.managedVirtualNetwork', 'type': 'str'}, 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'extra_properties': {'key': 'properties.extraProperties', 'type': '{object}'}, 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, } @@ -5044,13 +5064,14 @@ def __init__(self, **kwargs): super(Workspace, self).__init__(**kwargs) self.default_data_lake_storage = kwargs.get('default_data_lake_storage', None) self.sql_administrator_login_password = kwargs.get('sql_administrator_login_password', None) - self.managed_resource_group_name = None + self.managed_resource_group_name = kwargs.get('managed_resource_group_name', None) self.provisioning_state = None self.sql_administrator_login = kwargs.get('sql_administrator_login', None) self.virtual_network_profile = kwargs.get('virtual_network_profile', None) self.connectivity_endpoints = kwargs.get('connectivity_endpoints', None) self.managed_virtual_network = kwargs.get('managed_virtual_network', None) self.private_endpoint_connections = kwargs.get('private_endpoint_connections', None) + self.extra_properties = None self.identity = kwargs.get('identity', None) diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models_py3.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models_py3.py index 4e740769a5e8..c4f72918ef88 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models_py3.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models_py3.py @@ -290,6 +290,9 @@ class BigDataPoolResourceInfo(TrackedResource): :type creation_date: datetime :param auto_pause: Auto-pausing properties :type auto_pause: ~azure.mgmt.synapse.models.AutoPauseProperties + :param is_compute_isolation_enabled: Whether compute isolation is required + or not. + :type is_compute_isolation_enabled: bool :param spark_events_folder: The Spark events folder :type spark_events_folder: str :param node_count: The number of nodes in the Big Data pool. @@ -302,7 +305,8 @@ class BigDataPoolResourceInfo(TrackedResource): be written. :type default_spark_log_folder: str :param node_size: The level of compute power that each node in the Big - Data pool has. Possible values include: 'None', 'Small', 'Medium', 'Large' + Data pool has. Possible values include: 'None', 'Small', 'Medium', + 'Large', 'XLarge', 'XXLarge' :type node_size: str or ~azure.mgmt.synapse.models.NodeSize :param node_size_family: The kind of nodes that the Big Data pool provides. Possible values include: 'None', 'MemoryOptimized' @@ -326,6 +330,7 @@ class BigDataPoolResourceInfo(TrackedResource): 'auto_scale': {'key': 'properties.autoScale', 'type': 'AutoScaleProperties'}, 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, 'auto_pause': {'key': 'properties.autoPause', 'type': 'AutoPauseProperties'}, + 'is_compute_isolation_enabled': {'key': 'properties.isComputeIsolationEnabled', 'type': 'bool'}, 'spark_events_folder': {'key': 'properties.sparkEventsFolder', 'type': 'str'}, 'node_count': {'key': 'properties.nodeCount', 'type': 'int'}, 'library_requirements': {'key': 'properties.libraryRequirements', 'type': 'LibraryRequirements'}, @@ -335,12 +340,13 @@ class BigDataPoolResourceInfo(TrackedResource): 'node_size_family': {'key': 'properties.nodeSizeFamily', 'type': 'str'}, } - def __init__(self, *, location: str, tags=None, provisioning_state: str=None, auto_scale=None, creation_date=None, auto_pause=None, spark_events_folder: str=None, node_count: int=None, library_requirements=None, spark_version: str=None, default_spark_log_folder: str=None, node_size=None, node_size_family=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, provisioning_state: str=None, auto_scale=None, creation_date=None, auto_pause=None, is_compute_isolation_enabled: bool=None, spark_events_folder: str=None, node_count: int=None, library_requirements=None, spark_version: str=None, default_spark_log_folder: str=None, node_size=None, node_size_family=None, **kwargs) -> None: super(BigDataPoolResourceInfo, self).__init__(tags=tags, location=location, **kwargs) self.provisioning_state = provisioning_state self.auto_scale = auto_scale self.creation_date = creation_date self.auto_pause = auto_pause + self.is_compute_isolation_enabled = is_compute_isolation_enabled self.spark_events_folder = spark_events_folder self.node_count = node_count self.library_requirements = library_requirements @@ -1293,19 +1299,21 @@ def __init__(self, *, key_name=None, **kwargs) -> None: self.key_name = key_name -class SubResource(Model): - """Azure Synapse nested resource, which belongs to a factory. +class SubResource(AzureEntityResource): + """Azure Synapse nested resource, which belongs to a workspace. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The resource identifier. + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str - :ivar name: The resource name. + :ivar name: The name of the resource :vartype name: str - :ivar type: The resource type. + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str - :ivar etag: Etag identifies change in the resource. + :ivar etag: Resource Etag. :vartype etag: str """ @@ -1325,10 +1333,6 @@ class SubResource(Model): def __init__(self, **kwargs) -> None: super(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.etag = None class IntegrationRuntimeResource(SubResource): @@ -1339,13 +1343,15 @@ class IntegrationRuntimeResource(SubResource): All required parameters must be populated in order to send to Azure. - :ivar id: The resource identifier. + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str - :ivar name: The resource name. + :ivar name: The name of the resource :vartype name: str - :ivar type: The resource type. + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str - :ivar etag: Etag identifies change in the resource. + :ivar etag: Resource Etag. :vartype etag: str :param properties: Required. Integration runtime properties. :type properties: ~azure.mgmt.synapse.models.IntegrationRuntime @@ -3365,17 +3371,23 @@ class Sku(Model): :type tier: str :param name: The SKU name :type name: str + :param capacity: If the SKU supports scale out/in then the capacity + integer should be included. If scale out/in is not possible for the + resource this may be omitted. + :type capacity: int """ _attribute_map = { 'tier': {'key': 'tier', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, *, tier: str=None, name: str=None, **kwargs) -> None: + def __init__(self, *, tier: str=None, name: str=None, capacity: int=None, **kwargs) -> None: super(Sku, self).__init__(**kwargs) self.tier = tier self.name = name + self.capacity = capacity class SqlPool(TrackedResource): @@ -4989,8 +5001,13 @@ class Workspace(TrackedResource): ~azure.mgmt.synapse.models.DataLakeStorageAccountDetails :param sql_administrator_login_password: SQL administrator login password :type sql_administrator_login_password: str - :ivar managed_resource_group_name: Workspace managed resource group - :vartype managed_resource_group_name: str + :param managed_resource_group_name: Workspace managed resource group. The + resource group name uniquely identifies the resource group within the user + subscriptionId. The resource group name must be no longer than 90 + characters long, and must be alphanumeric characters + (Char.IsLetterOrDigit()) and '-', '_', '(', ')' and'.'. Note that the name + cannot end with '.' + :type managed_resource_group_name: str :ivar provisioning_state: Resource provisioning state :vartype provisioning_state: str :param sql_administrator_login: Login for workspace SQL active directory @@ -5009,6 +5026,8 @@ class Workspace(TrackedResource): workspace :type private_endpoint_connections: list[~azure.mgmt.synapse.models.PrivateEndpointConnection] + :ivar extra_properties: Workspace level configs and feature flags + :vartype extra_properties: dict[str, object] :param identity: Identity of the workspace :type identity: ~azure.mgmt.synapse.models.ManagedIdentity """ @@ -5018,8 +5037,8 @@ class Workspace(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'managed_resource_group_name': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'extra_properties': {'readonly': True}, } _attribute_map = { @@ -5037,20 +5056,22 @@ class Workspace(TrackedResource): 'connectivity_endpoints': {'key': 'properties.connectivityEndpoints', 'type': '{str}'}, 'managed_virtual_network': {'key': 'properties.managedVirtualNetwork', 'type': 'str'}, 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'extra_properties': {'key': 'properties.extraProperties', 'type': '{object}'}, 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, } - def __init__(self, *, location: str, tags=None, default_data_lake_storage=None, sql_administrator_login_password: str=None, sql_administrator_login: str=None, virtual_network_profile=None, connectivity_endpoints=None, managed_virtual_network: str=None, private_endpoint_connections=None, identity=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, default_data_lake_storage=None, sql_administrator_login_password: str=None, managed_resource_group_name: str=None, sql_administrator_login: str=None, virtual_network_profile=None, connectivity_endpoints=None, managed_virtual_network: str=None, private_endpoint_connections=None, identity=None, **kwargs) -> None: super(Workspace, self).__init__(tags=tags, location=location, **kwargs) self.default_data_lake_storage = default_data_lake_storage self.sql_administrator_login_password = sql_administrator_login_password - self.managed_resource_group_name = None + self.managed_resource_group_name = managed_resource_group_name self.provisioning_state = None self.sql_administrator_login = sql_administrator_login self.virtual_network_profile = virtual_network_profile self.connectivity_endpoints = connectivity_endpoints self.managed_virtual_network = managed_virtual_network self.private_endpoint_connections = private_endpoint_connections + self.extra_properties = None self.identity = identity diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_synapse_management_client_enums.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_synapse_management_client_enums.py index 8d1c0055e1d7..1f354d19a474 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_synapse_management_client_enums.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_synapse_management_client_enums.py @@ -18,6 +18,8 @@ class NodeSize(str, Enum): small = "Small" medium = "Medium" large = "Large" + xlarge = "XLarge" + xx_large = "XXLarge" class NodeSizeFamily(str, Enum): diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtimes_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtimes_operations.py index 356d7d0063fb..a62304fb3fac 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtimes_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtimes_operations.py @@ -12,6 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -195,35 +197,9 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}'} - def create( - self, resource_group_name, workspace_name, integration_runtime_name, properties, if_match=None, custom_headers=None, raw=False, **operation_config): - """Create integration runtime. - - Create an integration runtime. - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param workspace_name: The name of the workspace - :type workspace_name: str - :param integration_runtime_name: Integration runtime name - :type integration_runtime_name: str - :param properties: Integration runtime properties. - :type properties: ~azure.mgmt.synapse.models.IntegrationRuntime - :param if_match: ETag of the integration runtime entity. Should only - be specified for update, for which it should match existing entity or - can be * for unconditional update. - :type if_match: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: IntegrationRuntimeResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.synapse.models.IntegrationRuntimeResource or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _create_initial( + self, resource_group_name, workspace_name, integration_runtime_name, properties, if_match=None, custom_headers=None, raw=False, **operation_config): integration_runtime = models.IntegrationRuntimeResource(properties=properties) # Construct URL @@ -260,12 +236,13 @@ def create( request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None + if response.status_code == 200: deserialized = self._deserialize('IntegrationRuntimeResource', response) @@ -274,13 +251,12 @@ def create( return client_raw_response return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}'} - def delete( - self, resource_group_name, workspace_name, integration_runtime_name, custom_headers=None, raw=False, **operation_config): - """Delete integration runtime. + def create( + self, resource_group_name, workspace_name, integration_runtime_name, properties, if_match=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create integration runtime. - Delete an integration runtime. + Create an integration runtime. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -289,15 +265,58 @@ def delete( :type workspace_name: str :param integration_runtime_name: Integration runtime name :type integration_runtime_name: str + :param properties: Integration runtime properties. + :type properties: ~azure.mgmt.synapse.models.IntegrationRuntime + :param if_match: ETag of the integration runtime entity. Should only + be specified for update, for which it should match existing entity or + can be * for unconditional update. + :type if_match: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + IntegrationRuntimeResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.synapse.models.IntegrationRuntimeResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.synapse.models.IntegrationRuntimeResource]] :raises: :class:`CloudError` """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + integration_runtime_name=integration_runtime_name, + properties=properties, + if_match=if_match, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('IntegrationRuntimeResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}'} + + + def _delete_initial( + self, resource_group_name, workspace_name, integration_runtime_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -325,7 +344,7 @@ def delete( request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 204]: + if response.status_code not in [200, 202, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -333,6 +352,52 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + + def delete( + self, resource_group_name, workspace_name, integration_runtime_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete integration runtime. + + Delete an integration runtime. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param integration_runtime_name: Integration runtime name + :type integration_runtime_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + integration_runtime_name=integration_runtime_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}'} def upgrade( diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/version.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/version.py index 3e682bbd5fb1..85da2c00c1a6 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/version.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.3.0" +VERSION = "0.4.0"