Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-mgmt-datashare] Add stable version for Data Share and in place sharing support for Kusto #43

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __init__(
super(DataShareManagementClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2018-11-01-preview'
self.api_version = '2019-11-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
from ._models_py3 import DimensionProperties
from ._models_py3 import Identity
from ._models_py3 import Invitation
from ._models_py3 import KustoClusterDataSet
from ._models_py3 import KustoClusterDataSetMapping
from ._models_py3 import KustoDatabaseDataSet
from ._models_py3 import KustoDatabaseDataSetMapping
from ._models_py3 import OperationMetaLogSpecification
from ._models_py3 import OperationMetaMetricSpecification
from ._models_py3 import OperationMetaServiceSpecification
Expand Down Expand Up @@ -87,6 +91,10 @@
from ._models import DimensionProperties
from ._models import Identity
from ._models import Invitation
from ._models import KustoClusterDataSet
from ._models import KustoClusterDataSetMapping
from ._models import KustoDatabaseDataSet
from ._models import KustoDatabaseDataSetMapping
from ._models import OperationMetaLogSpecification
from ._models import OperationMetaMetricSpecification
from ._models import OperationMetaServiceSpecification
Expand Down Expand Up @@ -133,9 +141,9 @@
Status,
InvitationStatus,
ShareKind,
SynchronizationMode,
DataSetType,
ShareSubscriptionStatus,
SynchronizationMode,
RecurrenceInterval,
TriggerStatus,
DataSetMappingStatus,
Expand Down Expand Up @@ -169,6 +177,10 @@
'DimensionProperties',
'Identity',
'Invitation',
'KustoClusterDataSet',
'KustoClusterDataSetMapping',
'KustoDatabaseDataSet',
'KustoDatabaseDataSetMapping',
'OperationMetaLogSpecification',
'OperationMetaMetricSpecification',
'OperationMetaServiceSpecification',
Expand Down Expand Up @@ -203,9 +215,9 @@
'ShareSynchronizationPaged',
'SynchronizationDetailsPaged',
'ProviderShareSubscriptionPaged',
'ShareSubscriptionPaged',
'SourceShareSynchronizationSettingPaged',
'ShareSubscriptionSynchronizationPaged',
'ShareSubscriptionPaged',
'ConsumerSourceDataSetPaged',
'SynchronizationSettingPaged',
'TriggerPaged',
Expand All @@ -214,9 +226,9 @@
'Status',
'InvitationStatus',
'ShareKind',
'SynchronizationMode',
'DataSetType',
'ShareSubscriptionStatus',
'SynchronizationMode',
'RecurrenceInterval',
'TriggerStatus',
'DataSetMappingStatus',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ class InvitationStatus(str, Enum):
class ShareKind(str, Enum):

copy_based = "CopyBased"
in_place = "InPlace"


class SynchronizationMode(str, Enum):

incremental = "Incremental"
full_sync = "FullSync"


class DataSetType(str, Enum):
Expand All @@ -59,6 +66,8 @@ class DataSetType(str, Enum):
adls_gen2_file = "AdlsGen2File"
adls_gen1_folder = "AdlsGen1Folder"
adls_gen1_file = "AdlsGen1File"
kusto_cluster = "KustoCluster"
kusto_database = "KustoDatabase"
sql_db_table = "SqlDBTable"
sql_dw_table = "SqlDWTable"

Expand All @@ -71,12 +80,6 @@ class ShareSubscriptionStatus(str, Enum):
revoking = "Revoking"


class SynchronizationMode(str, Enum):

incremental = "Incremental"
full_sync = "FullSync"


class RecurrenceInterval(str, Enum):

hour = "Hour"
Expand Down
705 changes: 577 additions & 128 deletions sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/models/_models.py

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -142,45 +142,45 @@ class ProviderShareSubscriptionPaged(Paged):
def __init__(self, *args, **kwargs):

super(ProviderShareSubscriptionPaged, self).__init__(*args, **kwargs)
class SourceShareSynchronizationSettingPaged(Paged):
class ShareSubscriptionPaged(Paged):
"""
A paging container for iterating over a list of :class:`SourceShareSynchronizationSetting <azure.mgmt.datashare.models.SourceShareSynchronizationSetting>` object
A paging container for iterating over a list of :class:`ShareSubscription <azure.mgmt.datashare.models.ShareSubscription>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[SourceShareSynchronizationSetting]'}
'current_page': {'key': 'value', 'type': '[ShareSubscription]'}
}

def __init__(self, *args, **kwargs):

super(SourceShareSynchronizationSettingPaged, self).__init__(*args, **kwargs)
class ShareSubscriptionSynchronizationPaged(Paged):
super(ShareSubscriptionPaged, self).__init__(*args, **kwargs)
class SourceShareSynchronizationSettingPaged(Paged):
"""
A paging container for iterating over a list of :class:`ShareSubscriptionSynchronization <azure.mgmt.datashare.models.ShareSubscriptionSynchronization>` object
A paging container for iterating over a list of :class:`SourceShareSynchronizationSetting <azure.mgmt.datashare.models.SourceShareSynchronizationSetting>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[ShareSubscriptionSynchronization]'}
'current_page': {'key': 'value', 'type': '[SourceShareSynchronizationSetting]'}
}

def __init__(self, *args, **kwargs):

super(ShareSubscriptionSynchronizationPaged, self).__init__(*args, **kwargs)
class ShareSubscriptionPaged(Paged):
super(SourceShareSynchronizationSettingPaged, self).__init__(*args, **kwargs)
class ShareSubscriptionSynchronizationPaged(Paged):
"""
A paging container for iterating over a list of :class:`ShareSubscription <azure.mgmt.datashare.models.ShareSubscription>` object
A paging container for iterating over a list of :class:`ShareSubscriptionSynchronization <azure.mgmt.datashare.models.ShareSubscriptionSynchronization>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[ShareSubscription]'}
'current_page': {'key': 'value', 'type': '[ShareSubscriptionSynchronization]'}
}

def __init__(self, *args, **kwargs):

super(ShareSubscriptionPaged, self).__init__(*args, **kwargs)
super(ShareSubscriptionSynchronizationPaged, self).__init__(*args, **kwargs)
class ConsumerSourceDataSetPaged(Paged):
"""
A paging container for iterating over a list of :class:`ConsumerSourceDataSet <azure.mgmt.datashare.models.ConsumerSourceDataSet>` object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class AccountsOperations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: The api version to use. Constant value: "2018-11-01-preview".
:ivar api_version: The api version to use. Constant value: "2019-11-01".
"""

models = models
Expand All @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2018-11-01-preview"
self.api_version = "2019-11-01"

self.config = config

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ConsumerInvitationsOperations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: The api version to use. Constant value: "2018-11-01-preview".
:ivar api_version: The api version to use. Constant value: "2019-11-01".
"""

models = models
Expand All @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2018-11-01-preview"
self.api_version = "2019-11-01"

self.config = config

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ConsumerSourceDataSetsOperations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: The api version to use. Constant value: "2018-11-01-preview".
:ivar api_version: The api version to use. Constant value: "2019-11-01".
"""

models = models
Expand All @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2018-11-01-preview"
self.api_version = "2019-11-01"

self.config = config

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class DataSetMappingsOperations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: The api version to use. Constant value: "2018-11-01-preview".
:ivar api_version: The api version to use. Constant value: "2019-11-01".
"""

models = models
Expand All @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2018-11-01-preview"
self.api_version = "2019-11-01"

self.config = config

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

import uuid
from msrest.pipeline import ClientRawResponse
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling

from .. import models

Expand All @@ -24,7 +26,7 @@ class DataSetsOperations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: The api version to use. Constant value: "2018-11-01-preview".
:ivar api_version: The api version to use. Constant value: "2019-11-01".
"""

models = models
Expand All @@ -34,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2018-11-01-preview"
self.api_version = "2019-11-01"

self.config = config

Expand Down Expand Up @@ -182,30 +184,9 @@ def create(
return deserialized
create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'}

def delete(
self, resource_group_name, account_name, share_name, data_set_name, custom_headers=None, raw=False, **operation_config):
"""Delete DataSet in a share.

Delete a DataSet in a share.

:param resource_group_name: The resource group name.
:type resource_group_name: str
:param account_name: The name of the share account.
:type account_name: str
:param share_name: The name of the share.
:type share_name: str
:param data_set_name: The name of the dataSet.
:type data_set_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`DataShareErrorException<azure.mgmt.datashare.models.DataShareErrorException>`
"""
def _delete_initial(
self, resource_group_name, account_name, share_name, data_set_name, custom_headers=None, raw=False, **operation_config):
# Construct URL
url = self.delete.metadata['url']
path_format_arguments = {
Expand Down Expand Up @@ -234,12 +215,61 @@ 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]:
raise models.DataShareErrorException(self._deserialize, response)

if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response

def delete(
self, resource_group_name, account_name, share_name, data_set_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""Delete DataSet in a share.

Delete a DataSet in a share.

:param resource_group_name: The resource group name.
:type resource_group_name: str
:param account_name: The name of the share account.
:type account_name: str
:param share_name: The name of the share.
:type share_name: str
:param data_set_name: The name of the dataSet.
:type data_set_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<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises:
:class:`DataShareErrorException<azure.mgmt.datashare.models.DataShareErrorException>`
"""
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
account_name=account_name,
share_name=share_name,
data_set_name=data_set_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.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'}

def list_by_share(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class InvitationsOperations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: The api version to use. Constant value: "2018-11-01-preview".
:ivar api_version: The api version to use. Constant value: "2019-11-01".
"""

models = models
Expand All @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2018-11-01-preview"
self.api_version = "2019-11-01"

self.config = config

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Operations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: The api version to use. Constant value: "2018-11-01-preview".
:ivar api_version: The api version to use. Constant value: "2019-11-01".
"""

models = models
Expand All @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2018-11-01-preview"
self.api_version = "2019-11-01"

self.config = config

Expand Down
Loading