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..22a122118486 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 @@ -1293,19 +1293,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 +1327,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 +1337,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 +3365,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 +4995,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 +5020,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 +5031,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 +5050,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 +5058,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..17d96065fcd0 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 @@ -1293,19 +1293,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 +1327,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 +1337,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 +3365,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 +4995,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 +5020,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 +5031,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 +5050,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/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(