From a6afc40c60bd051d03513e641d7a84a798042a89 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Tue, 7 Jul 2020 19:56:11 +0000 Subject: [PATCH] Update from release/v3 --- .../azure-mgmt-timeseriesinsights/README.md | 31 ++-- .../timeseriesinsights/models/__init__.py | 3 + .../mgmt/timeseriesinsights/models/_models.py | 117 ++++++++++----- .../timeseriesinsights/models/_models_py3.py | 135 ++++++++++++------ .../_time_series_insights_client_enums.py | 2 - .../operations/_environments_operations.py | 17 +-- .../azure-mgmt-timeseriesinsights/setup.py | 4 +- 7 files changed, 193 insertions(+), 116 deletions(-) diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/README.md b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/README.md index 468ee76aec0..3cb8f6e5cf7 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/README.md +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/README.md @@ -1,30 +1,21 @@ -## Microsoft Azure SDK for Python - -This is the Microsoft Azure TimeSeriesInsights Management Client -Library. - -Azure Resource Manager (ARM) is the next generation of management APIs -that replace the old Azure Service Management (ASM). +# Microsoft Azure SDK for Python +This is the Microsoft Azure TimeSeriesInsights 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 [Github repo](https://github.com/Azure/azure-sdk-for-python/) -For the older Azure Service Management (ASM) libraries, see -[azure-servicemanagement-legacy](https://pypi.python.org/pypi/azure-servicemanagement-legacy) -library. - -For a more complete set of Azure libraries, see the -[azure](https://pypi.python.org/pypi/azure) bundle package. -## Usage +# Usage -For code examples, see [TimeSeriesInsights -Management](https://docs.microsoft.com/python/api/overview/azure/timeseriesinsights) +For code examples, see [TimeSeriesInsights Management](https://docs.microsoft.com/python/api/overview/azure/timeseriesinsights) on docs.microsoft.com. -## Provide Feedback -If you encounter any bugs or have suggestions, please file an issue in -the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. -![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-timeseriesinsights%2FREADME.png) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-timeseriesinsights%2FREADME.png) diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/__init__.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/__init__.py index 5e36e3b855a..6535f74b34e 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/__init__.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/__init__.py @@ -62,6 +62,7 @@ from ._models_py3 import TimeSeriesIdProperty from ._models_py3 import TrackedResource from ._models_py3 import WarmStorageEnvironmentStatus + from ._models_py3 import WarmStoreConfigurationProperties except (SyntaxError, ImportError): from ._models import AccessPolicyCreateOrUpdateParameters from ._models import AccessPolicyListResponse @@ -115,6 +116,7 @@ from ._models import TimeSeriesIdProperty from ._models import TrackedResource from ._models import WarmStorageEnvironmentStatus + from ._models import WarmStoreConfigurationProperties from ._paged_models import OperationPaged from ._time_series_insights_client_enums import ( ProvisioningState, @@ -182,6 +184,7 @@ 'TimeSeriesIdProperty', 'TrackedResource', 'WarmStorageEnvironmentStatus', + 'WarmStoreConfigurationProperties', 'OperationPaged', 'ProvisioningState', 'SkuName', diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_models.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_models.py index 2b70d8ff066..7fc5f3bf2d6 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_models.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_models.py @@ -709,6 +709,13 @@ class EventSourceCreateOrUpdateParameters(CreateOrUpdateTrackedResourcePropertie :type location: str :param tags: Key-value pairs of additional properties for the resource. :type tags: dict[str, str] + :param local_timestamp: An object that represents the local timestamp + property. It contains the format of local timestamp that needs to be used + and the corresponding timezone offset information. If a value isn't + specified for localTimestamp, or if null, then the local timestamp will + not be ingressed with the events. + :type local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp :param kind: Required. Constant filled by server. :type kind: str """ @@ -721,6 +728,7 @@ class EventSourceCreateOrUpdateParameters(CreateOrUpdateTrackedResourcePropertie _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, 'kind': {'key': 'kind', 'type': 'str'}, } @@ -730,6 +738,7 @@ class EventSourceCreateOrUpdateParameters(CreateOrUpdateTrackedResourcePropertie def __init__(self, **kwargs): super(EventSourceCreateOrUpdateParameters, self).__init__(**kwargs) + self.local_timestamp = kwargs.get('local_timestamp', None) self.kind = None self.kind = 'EventSourceCreateOrUpdateParameters' @@ -747,6 +756,13 @@ class EventHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParam :type location: str :param tags: Key-value pairs of additional properties for the resource. :type tags: dict[str, str] + :param local_timestamp: An object that represents the local timestamp + property. It contains the format of local timestamp that needs to be used + and the corresponding timezone offset information. If a value isn't + specified for localTimestamp, or if null, then the local timestamp will + not be ingressed with the events. + :type local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp :param kind: Required. Constant filled by server. :type kind: str :param provisioning_state: Provisioning state of the resource. Possible @@ -797,6 +813,7 @@ class EventHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParam _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, 'kind': {'key': 'kind', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, @@ -868,7 +885,7 @@ class EventSourceResource(TrackedResource): } _subtype_map = { - 'kind': {'Microsoft.EventHub': 'EventHubEventSourceResource', 'Microsoft.IotHub': 'IoTHubEventSourceResource'} + 'kind': {'Microsoft.EventHub': 'EventHubEventSourceResource', 'Microsoft.IoTHub': 'IoTHubEventSourceResource'} } def __init__(self, **kwargs): @@ -1169,6 +1186,13 @@ class IoTHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParamet :type location: str :param tags: Key-value pairs of additional properties for the resource. :type tags: dict[str, str] + :param local_timestamp: An object that represents the local timestamp + property. It contains the format of local timestamp that needs to be used + and the corresponding timezone offset information. If a value isn't + specified for localTimestamp, or if null, then the local timestamp will + not be ingressed with the events. + :type local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp :param kind: Required. Constant filled by server. :type kind: str :param provisioning_state: Provisioning state of the resource. Possible @@ -1215,6 +1239,7 @@ class IoTHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParamet _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, 'kind': {'key': 'kind', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, @@ -1323,7 +1348,7 @@ def __init__(self, **kwargs): self.iot_hub_name = kwargs.get('iot_hub_name', None) self.consumer_group_name = kwargs.get('consumer_group_name', None) self.key_name = kwargs.get('key_name', None) - self.kind = 'Microsoft.IotHub' + self.kind = 'Microsoft.IoTHub' class IoTHubEventSourceUpdateParameters(EventSourceUpdateParameters): @@ -1372,8 +1397,7 @@ class LocalTimestamp(Model): or if null, then the local timestamp will not be ingressed with the events. :param format: An enum that represents the format of the local timestamp - property that needs to be set. Possible values include: 'Embedded', - 'Iana', 'TimeSpan' + property that needs to be set. Possible values include: 'Embedded' :type format: str or ~azure.mgmt.timeseriesinsights.models.LocalTimestampFormat :param time_zone_offset: An object that represents the offset information @@ -1444,10 +1468,11 @@ class LongTermEnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParam environment's data. :type storage_configuration: ~azure.mgmt.timeseriesinsights.models.LongTermStorageConfigurationInput - :param data_retention: Required. ISO8601 timespan specifying the number of - days the environment's events will be available for query from the warm - store. - :type data_retention: timedelta + :param warm_store_configuration: The warm store configuration provides the + details to create a warm store cache that will retain a copy of the + environment's data available for faster query. + :type warm_store_configuration: + ~azure.mgmt.timeseriesinsights.models.WarmStoreConfigurationProperties """ _validation = { @@ -1456,7 +1481,6 @@ class LongTermEnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParam 'kind': {'required': True}, 'time_series_id_properties': {'required': True}, 'storage_configuration': {'required': True}, - 'data_retention': {'required': True}, } _attribute_map = { @@ -1466,14 +1490,14 @@ class LongTermEnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParam 'kind': {'key': 'kind', 'type': 'str'}, 'time_series_id_properties': {'key': 'properties.timeSeriesIdProperties', 'type': '[TimeSeriesIdProperty]'}, 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'LongTermStorageConfigurationInput'}, - 'data_retention': {'key': 'properties.warmStoreConfiguration.dataRetention', 'type': 'duration'}, + 'warm_store_configuration': {'key': 'properties.warmStoreConfiguration', 'type': 'WarmStoreConfigurationProperties'}, } def __init__(self, **kwargs): super(LongTermEnvironmentCreateOrUpdateParameters, self).__init__(**kwargs) self.time_series_id_properties = kwargs.get('time_series_id_properties', None) self.storage_configuration = kwargs.get('storage_configuration', None) - self.data_retention = kwargs.get('data_retention', None) + self.warm_store_configuration = kwargs.get('warm_store_configuration', None) self.kind = 'LongTerm' @@ -1532,10 +1556,11 @@ class LongTermEnvironmentResource(EnvironmentResource): environment's data. :type storage_configuration: ~azure.mgmt.timeseriesinsights.models.LongTermStorageConfigurationOutput - :param data_retention: Required. ISO8601 timespan specifying the number of - days the environment's events will be available for query from the warm - store. - :type data_retention: timedelta + :param warm_store_configuration: The warm store configuration provides the + details to create a warm store cache that will retain a copy of the + environment's data available for faster query. + :type warm_store_configuration: + ~azure.mgmt.timeseriesinsights.models.WarmStoreConfigurationProperties """ _validation = { @@ -1550,7 +1575,6 @@ class LongTermEnvironmentResource(EnvironmentResource): 'creation_time': {'readonly': True}, 'time_series_id_properties': {'required': True}, 'storage_configuration': {'required': True}, - 'data_retention': {'required': True}, } _attribute_map = { @@ -1568,7 +1592,7 @@ class LongTermEnvironmentResource(EnvironmentResource): 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, 'time_series_id_properties': {'key': 'properties.timeSeriesIdProperties', 'type': '[TimeSeriesIdProperty]'}, 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'LongTermStorageConfigurationOutput'}, - 'data_retention': {'key': 'properties.warmStoreConfiguration.dataRetention', 'type': 'duration'}, + 'warm_store_configuration': {'key': 'properties.warmStoreConfiguration', 'type': 'WarmStoreConfigurationProperties'}, } def __init__(self, **kwargs): @@ -1580,7 +1604,7 @@ def __init__(self, **kwargs): self.creation_time = None self.time_series_id_properties = kwargs.get('time_series_id_properties', None) self.storage_configuration = kwargs.get('storage_configuration', None) - self.data_retention = kwargs.get('data_retention', None) + self.warm_store_configuration = kwargs.get('warm_store_configuration', None) self.kind = 'LongTerm' @@ -1588,8 +1612,6 @@ class LongTermEnvironmentUpdateParameters(EnvironmentUpdateParameters): """Parameters supplied to the Update Environment operation to update a long-term environment. - All required parameters must be populated in order to send to Azure. - :param tags: Key-value pairs of additional properties for the environment. :type tags: dict[str, str] :param storage_configuration: The storage configuration provides the @@ -1598,26 +1620,23 @@ class LongTermEnvironmentUpdateParameters(EnvironmentUpdateParameters): data. :type storage_configuration: ~azure.mgmt.timeseriesinsights.models.LongTermStorageConfigurationMutableProperties - :param data_retention: Required. ISO8601 timespan specifying the number of - days the environment's events will be available for query from the warm - store. - :type data_retention: timedelta + :param warm_store_configuration: The warm store configuration provides the + details to create a warm store cache that will retain a copy of the + environment's data available for faster query. + :type warm_store_configuration: + ~azure.mgmt.timeseriesinsights.models.WarmStoreConfigurationProperties """ - _validation = { - 'data_retention': {'required': True}, - } - _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'LongTermStorageConfigurationMutableProperties'}, - 'data_retention': {'key': 'properties.warmStoreConfiguration.dataRetention', 'type': 'duration'}, + 'warm_store_configuration': {'key': 'properties.warmStoreConfiguration', 'type': 'WarmStoreConfigurationProperties'}, } def __init__(self, **kwargs): super(LongTermEnvironmentUpdateParameters, self).__init__(**kwargs) self.storage_configuration = kwargs.get('storage_configuration', None) - self.data_retention = kwargs.get('data_retention', None) + self.warm_store_configuration = kwargs.get('warm_store_configuration', None) class LongTermStorageConfigurationInput(Model): @@ -2004,7 +2023,8 @@ class StandardEnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParam :type storage_limit_exceeded_behavior: str or ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior :param partition_key_properties: The list of event properties which will - be used to partition data in the environment. + be used to partition data in the environment. Currently, only a single + partition key property is supported. :type partition_key_properties: list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] """ @@ -2075,7 +2095,8 @@ class StandardEnvironmentResource(EnvironmentResource): :type storage_limit_exceeded_behavior: str or ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior :param partition_key_properties: The list of event properties which will - be used to partition data in the environment. + be used to partition data in the environment. Currently, only a single + partition key property is supported. :type partition_key_properties: list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] :ivar data_access_id: An id used to access the environment data, e.g. to @@ -2162,10 +2183,6 @@ class StandardEnvironmentUpdateParameters(EnvironmentUpdateParameters): 'PauseIngress' :type storage_limit_exceeded_behavior: str or ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior - :param partition_key_properties: The list of event properties which will - be used to partition data in the environment. - :type partition_key_properties: - list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] """ _attribute_map = { @@ -2173,7 +2190,6 @@ class StandardEnvironmentUpdateParameters(EnvironmentUpdateParameters): 'sku': {'key': 'sku', 'type': 'Sku'}, 'data_retention_time': {'key': 'properties.dataRetentionTime', 'type': 'duration'}, 'storage_limit_exceeded_behavior': {'key': 'properties.storageLimitExceededBehavior', 'type': 'str'}, - 'partition_key_properties': {'key': 'properties.partitionKeyProperties', 'type': '[TimeSeriesIdProperty]'}, } def __init__(self, **kwargs): @@ -2181,7 +2197,6 @@ def __init__(self, **kwargs): self.sku = kwargs.get('sku', None) self.data_retention_time = kwargs.get('data_retention_time', None) self.storage_limit_exceeded_behavior = kwargs.get('storage_limit_exceeded_behavior', None) - self.partition_key_properties = kwargs.get('partition_key_properties', None) class TimeSeriesIdProperty(Model): @@ -2239,3 +2254,29 @@ def __init__(self, **kwargs): self.state = kwargs.get('state', None) self.current_count = kwargs.get('current_count', None) self.max_count = kwargs.get('max_count', None) + + +class WarmStoreConfigurationProperties(Model): + """The warm store configuration provides the details to create a warm store + cache that will retain a copy of the environment's data available for + faster query. + + All required parameters must be populated in order to send to Azure. + + :param data_retention: Required. ISO8601 timespan specifying the number of + days the environment's events will be available for query from the warm + store. + :type data_retention: timedelta + """ + + _validation = { + 'data_retention': {'required': True}, + } + + _attribute_map = { + 'data_retention': {'key': 'dataRetention', 'type': 'duration'}, + } + + def __init__(self, **kwargs): + super(WarmStoreConfigurationProperties, self).__init__(**kwargs) + self.data_retention = kwargs.get('data_retention', None) diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_models_py3.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_models_py3.py index 647a977fc06..07908cce1a1 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_models_py3.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_models_py3.py @@ -709,6 +709,13 @@ class EventSourceCreateOrUpdateParameters(CreateOrUpdateTrackedResourcePropertie :type location: str :param tags: Key-value pairs of additional properties for the resource. :type tags: dict[str, str] + :param local_timestamp: An object that represents the local timestamp + property. It contains the format of local timestamp that needs to be used + and the corresponding timezone offset information. If a value isn't + specified for localTimestamp, or if null, then the local timestamp will + not be ingressed with the events. + :type local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp :param kind: Required. Constant filled by server. :type kind: str """ @@ -721,6 +728,7 @@ class EventSourceCreateOrUpdateParameters(CreateOrUpdateTrackedResourcePropertie _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, 'kind': {'key': 'kind', 'type': 'str'}, } @@ -728,8 +736,9 @@ class EventSourceCreateOrUpdateParameters(CreateOrUpdateTrackedResourcePropertie 'kind': {'Microsoft.EventHub': 'EventHubEventSourceCreateOrUpdateParameters', 'Microsoft.IoTHub': 'IoTHubEventSourceCreateOrUpdateParameters'} } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, local_timestamp=None, **kwargs) -> None: super(EventSourceCreateOrUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + self.local_timestamp = local_timestamp self.kind = None self.kind = 'EventSourceCreateOrUpdateParameters' @@ -747,6 +756,13 @@ class EventHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParam :type location: str :param tags: Key-value pairs of additional properties for the resource. :type tags: dict[str, str] + :param local_timestamp: An object that represents the local timestamp + property. It contains the format of local timestamp that needs to be used + and the corresponding timezone offset information. If a value isn't + specified for localTimestamp, or if null, then the local timestamp will + not be ingressed with the events. + :type local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp :param kind: Required. Constant filled by server. :type kind: str :param provisioning_state: Provisioning state of the resource. Possible @@ -797,6 +813,7 @@ class EventHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParam _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, 'kind': {'key': 'kind', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, @@ -809,8 +826,8 @@ class EventHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParam 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, } - def __init__(self, *, location: str, event_source_resource_id: str, service_bus_namespace: str, event_hub_name: str, consumer_group_name: str, key_name: str, shared_access_key: str, tags=None, provisioning_state=None, timestamp_property_name: str=None, **kwargs) -> None: - super(EventHubEventSourceCreateOrUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + def __init__(self, *, location: str, event_source_resource_id: str, service_bus_namespace: str, event_hub_name: str, consumer_group_name: str, key_name: str, shared_access_key: str, tags=None, local_timestamp=None, provisioning_state=None, timestamp_property_name: str=None, **kwargs) -> None: + super(EventHubEventSourceCreateOrUpdateParameters, self).__init__(location=location, tags=tags, local_timestamp=local_timestamp, **kwargs) self.provisioning_state = provisioning_state self.creation_time = None self.timestamp_property_name = timestamp_property_name @@ -868,7 +885,7 @@ class EventSourceResource(TrackedResource): } _subtype_map = { - 'kind': {'Microsoft.EventHub': 'EventHubEventSourceResource', 'Microsoft.IotHub': 'IoTHubEventSourceResource'} + 'kind': {'Microsoft.EventHub': 'EventHubEventSourceResource', 'Microsoft.IoTHub': 'IoTHubEventSourceResource'} } def __init__(self, *, location: str, tags=None, **kwargs) -> None: @@ -1169,6 +1186,13 @@ class IoTHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParamet :type location: str :param tags: Key-value pairs of additional properties for the resource. :type tags: dict[str, str] + :param local_timestamp: An object that represents the local timestamp + property. It contains the format of local timestamp that needs to be used + and the corresponding timezone offset information. If a value isn't + specified for localTimestamp, or if null, then the local timestamp will + not be ingressed with the events. + :type local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp :param kind: Required. Constant filled by server. :type kind: str :param provisioning_state: Provisioning state of the resource. Possible @@ -1215,6 +1239,7 @@ class IoTHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParamet _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, 'kind': {'key': 'kind', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, @@ -1226,8 +1251,8 @@ class IoTHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParamet 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, } - def __init__(self, *, location: str, event_source_resource_id: str, iot_hub_name: str, consumer_group_name: str, key_name: str, shared_access_key: str, tags=None, provisioning_state=None, timestamp_property_name: str=None, **kwargs) -> None: - super(IoTHubEventSourceCreateOrUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + def __init__(self, *, location: str, event_source_resource_id: str, iot_hub_name: str, consumer_group_name: str, key_name: str, shared_access_key: str, tags=None, local_timestamp=None, provisioning_state=None, timestamp_property_name: str=None, **kwargs) -> None: + super(IoTHubEventSourceCreateOrUpdateParameters, self).__init__(location=location, tags=tags, local_timestamp=local_timestamp, **kwargs) self.provisioning_state = provisioning_state self.creation_time = None self.timestamp_property_name = timestamp_property_name @@ -1323,7 +1348,7 @@ def __init__(self, *, location: str, event_source_resource_id: str, iot_hub_name self.iot_hub_name = iot_hub_name self.consumer_group_name = consumer_group_name self.key_name = key_name - self.kind = 'Microsoft.IotHub' + self.kind = 'Microsoft.IoTHub' class IoTHubEventSourceUpdateParameters(EventSourceUpdateParameters): @@ -1372,8 +1397,7 @@ class LocalTimestamp(Model): or if null, then the local timestamp will not be ingressed with the events. :param format: An enum that represents the format of the local timestamp - property that needs to be set. Possible values include: 'Embedded', - 'Iana', 'TimeSpan' + property that needs to be set. Possible values include: 'Embedded' :type format: str or ~azure.mgmt.timeseriesinsights.models.LocalTimestampFormat :param time_zone_offset: An object that represents the offset information @@ -1444,10 +1468,11 @@ class LongTermEnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParam environment's data. :type storage_configuration: ~azure.mgmt.timeseriesinsights.models.LongTermStorageConfigurationInput - :param data_retention: Required. ISO8601 timespan specifying the number of - days the environment's events will be available for query from the warm - store. - :type data_retention: timedelta + :param warm_store_configuration: The warm store configuration provides the + details to create a warm store cache that will retain a copy of the + environment's data available for faster query. + :type warm_store_configuration: + ~azure.mgmt.timeseriesinsights.models.WarmStoreConfigurationProperties """ _validation = { @@ -1456,7 +1481,6 @@ class LongTermEnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParam 'kind': {'required': True}, 'time_series_id_properties': {'required': True}, 'storage_configuration': {'required': True}, - 'data_retention': {'required': True}, } _attribute_map = { @@ -1466,14 +1490,14 @@ class LongTermEnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParam 'kind': {'key': 'kind', 'type': 'str'}, 'time_series_id_properties': {'key': 'properties.timeSeriesIdProperties', 'type': '[TimeSeriesIdProperty]'}, 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'LongTermStorageConfigurationInput'}, - 'data_retention': {'key': 'properties.warmStoreConfiguration.dataRetention', 'type': 'duration'}, + 'warm_store_configuration': {'key': 'properties.warmStoreConfiguration', 'type': 'WarmStoreConfigurationProperties'}, } - def __init__(self, *, location: str, sku, time_series_id_properties, storage_configuration, data_retention, tags=None, **kwargs) -> None: + def __init__(self, *, location: str, sku, time_series_id_properties, storage_configuration, tags=None, warm_store_configuration=None, **kwargs) -> None: super(LongTermEnvironmentCreateOrUpdateParameters, self).__init__(location=location, tags=tags, sku=sku, **kwargs) self.time_series_id_properties = time_series_id_properties self.storage_configuration = storage_configuration - self.data_retention = data_retention + self.warm_store_configuration = warm_store_configuration self.kind = 'LongTerm' @@ -1532,10 +1556,11 @@ class LongTermEnvironmentResource(EnvironmentResource): environment's data. :type storage_configuration: ~azure.mgmt.timeseriesinsights.models.LongTermStorageConfigurationOutput - :param data_retention: Required. ISO8601 timespan specifying the number of - days the environment's events will be available for query from the warm - store. - :type data_retention: timedelta + :param warm_store_configuration: The warm store configuration provides the + details to create a warm store cache that will retain a copy of the + environment's data available for faster query. + :type warm_store_configuration: + ~azure.mgmt.timeseriesinsights.models.WarmStoreConfigurationProperties """ _validation = { @@ -1550,7 +1575,6 @@ class LongTermEnvironmentResource(EnvironmentResource): 'creation_time': {'readonly': True}, 'time_series_id_properties': {'required': True}, 'storage_configuration': {'required': True}, - 'data_retention': {'required': True}, } _attribute_map = { @@ -1568,10 +1592,10 @@ class LongTermEnvironmentResource(EnvironmentResource): 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, 'time_series_id_properties': {'key': 'properties.timeSeriesIdProperties', 'type': '[TimeSeriesIdProperty]'}, 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'LongTermStorageConfigurationOutput'}, - 'data_retention': {'key': 'properties.warmStoreConfiguration.dataRetention', 'type': 'duration'}, + 'warm_store_configuration': {'key': 'properties.warmStoreConfiguration', 'type': 'WarmStoreConfigurationProperties'}, } - def __init__(self, *, location: str, sku, time_series_id_properties, storage_configuration, data_retention, tags=None, status=None, provisioning_state=None, **kwargs) -> None: + def __init__(self, *, location: str, sku, time_series_id_properties, storage_configuration, tags=None, status=None, provisioning_state=None, warm_store_configuration=None, **kwargs) -> None: super(LongTermEnvironmentResource, self).__init__(location=location, tags=tags, sku=sku, **kwargs) self.data_access_id = None self.data_access_fqdn = None @@ -1580,7 +1604,7 @@ def __init__(self, *, location: str, sku, time_series_id_properties, storage_con self.creation_time = None self.time_series_id_properties = time_series_id_properties self.storage_configuration = storage_configuration - self.data_retention = data_retention + self.warm_store_configuration = warm_store_configuration self.kind = 'LongTerm' @@ -1588,8 +1612,6 @@ class LongTermEnvironmentUpdateParameters(EnvironmentUpdateParameters): """Parameters supplied to the Update Environment operation to update a long-term environment. - All required parameters must be populated in order to send to Azure. - :param tags: Key-value pairs of additional properties for the environment. :type tags: dict[str, str] :param storage_configuration: The storage configuration provides the @@ -1598,26 +1620,23 @@ class LongTermEnvironmentUpdateParameters(EnvironmentUpdateParameters): data. :type storage_configuration: ~azure.mgmt.timeseriesinsights.models.LongTermStorageConfigurationMutableProperties - :param data_retention: Required. ISO8601 timespan specifying the number of - days the environment's events will be available for query from the warm - store. - :type data_retention: timedelta + :param warm_store_configuration: The warm store configuration provides the + details to create a warm store cache that will retain a copy of the + environment's data available for faster query. + :type warm_store_configuration: + ~azure.mgmt.timeseriesinsights.models.WarmStoreConfigurationProperties """ - _validation = { - 'data_retention': {'required': True}, - } - _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'LongTermStorageConfigurationMutableProperties'}, - 'data_retention': {'key': 'properties.warmStoreConfiguration.dataRetention', 'type': 'duration'}, + 'warm_store_configuration': {'key': 'properties.warmStoreConfiguration', 'type': 'WarmStoreConfigurationProperties'}, } - def __init__(self, *, data_retention, tags=None, storage_configuration=None, **kwargs) -> None: + def __init__(self, *, tags=None, storage_configuration=None, warm_store_configuration=None, **kwargs) -> None: super(LongTermEnvironmentUpdateParameters, self).__init__(tags=tags, **kwargs) self.storage_configuration = storage_configuration - self.data_retention = data_retention + self.warm_store_configuration = warm_store_configuration class LongTermStorageConfigurationInput(Model): @@ -2004,7 +2023,8 @@ class StandardEnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParam :type storage_limit_exceeded_behavior: str or ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior :param partition_key_properties: The list of event properties which will - be used to partition data in the environment. + be used to partition data in the environment. Currently, only a single + partition key property is supported. :type partition_key_properties: list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] """ @@ -2075,7 +2095,8 @@ class StandardEnvironmentResource(EnvironmentResource): :type storage_limit_exceeded_behavior: str or ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior :param partition_key_properties: The list of event properties which will - be used to partition data in the environment. + be used to partition data in the environment. Currently, only a single + partition key property is supported. :type partition_key_properties: list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] :ivar data_access_id: An id used to access the environment data, e.g. to @@ -2162,10 +2183,6 @@ class StandardEnvironmentUpdateParameters(EnvironmentUpdateParameters): 'PauseIngress' :type storage_limit_exceeded_behavior: str or ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior - :param partition_key_properties: The list of event properties which will - be used to partition data in the environment. - :type partition_key_properties: - list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] """ _attribute_map = { @@ -2173,15 +2190,13 @@ class StandardEnvironmentUpdateParameters(EnvironmentUpdateParameters): 'sku': {'key': 'sku', 'type': 'Sku'}, 'data_retention_time': {'key': 'properties.dataRetentionTime', 'type': 'duration'}, 'storage_limit_exceeded_behavior': {'key': 'properties.storageLimitExceededBehavior', 'type': 'str'}, - 'partition_key_properties': {'key': 'properties.partitionKeyProperties', 'type': '[TimeSeriesIdProperty]'}, } - def __init__(self, *, tags=None, sku=None, data_retention_time=None, storage_limit_exceeded_behavior=None, partition_key_properties=None, **kwargs) -> None: + def __init__(self, *, tags=None, sku=None, data_retention_time=None, storage_limit_exceeded_behavior=None, **kwargs) -> None: super(StandardEnvironmentUpdateParameters, self).__init__(tags=tags, **kwargs) self.sku = sku self.data_retention_time = data_retention_time self.storage_limit_exceeded_behavior = storage_limit_exceeded_behavior - self.partition_key_properties = partition_key_properties class TimeSeriesIdProperty(Model): @@ -2239,3 +2254,29 @@ def __init__(self, *, state=None, current_count: int=None, max_count: int=None, self.state = state self.current_count = current_count self.max_count = max_count + + +class WarmStoreConfigurationProperties(Model): + """The warm store configuration provides the details to create a warm store + cache that will retain a copy of the environment's data available for + faster query. + + All required parameters must be populated in order to send to Azure. + + :param data_retention: Required. ISO8601 timespan specifying the number of + days the environment's events will be available for query from the warm + store. + :type data_retention: timedelta + """ + + _validation = { + 'data_retention': {'required': True}, + } + + _attribute_map = { + 'data_retention': {'key': 'dataRetention', 'type': 'duration'}, + } + + def __init__(self, *, data_retention, **kwargs) -> None: + super(WarmStoreConfigurationProperties, self).__init__(**kwargs) + self.data_retention = data_retention diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_time_series_insights_client_enums.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_time_series_insights_client_enums.py index 361e35e738e..dd3d704d750 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_time_series_insights_client_enums.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_time_series_insights_client_enums.py @@ -60,8 +60,6 @@ class WarmStoragePropertiesState(str, Enum): class LocalTimestampFormat(str, Enum): embedded = "Embedded" - iana = "Iana" - time_span = "TimeSpan" class ReferenceDataKeyPropertyType(str, Enum): diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_environments_operations.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_environments_operations.py index 356b06d6fdd..b986cb6856b 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_environments_operations.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_environments_operations.py @@ -216,7 +216,9 @@ def get( def _update_initial( - self, resource_group_name, environment_name, standard_environment_update_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, environment_name, tags=None, custom_headers=None, raw=False, **operation_config): + environment_update_parameters = models.EnvironmentUpdateParameters(tags=tags) + # Construct URL url = self.update.metadata['url'] path_format_arguments = { @@ -242,7 +244,7 @@ def _update_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(standard_environment_update_parameters, 'StandardEnvironmentUpdateParameters') + body_content = self._serialize.body(environment_update_parameters, 'EnvironmentUpdateParameters') # Construct and send request request = self._client.patch(url, query_parameters, header_parameters, body_content) @@ -265,7 +267,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, environment_name, standard_environment_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, environment_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates the environment with the specified name in the specified subscription and resource group. @@ -274,10 +276,9 @@ def update( :param environment_name: The name of the Time Series Insights environment associated with the specified resource group. :type environment_name: str - :param standard_environment_update_parameters: Request object that - contains the updated information for the environment. - :type standard_environment_update_parameters: - ~azure.mgmt.timeseriesinsights.models.StandardEnvironmentUpdateParameters + :param tags: Key-value pairs of additional properties for the + environment. + :type tags: dict[str, 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 @@ -294,7 +295,7 @@ def update( raw_result = self._update_initial( resource_group_name=resource_group_name, environment_name=environment_name, - standard_environment_update_parameters=standard_environment_update_parameters, + tags=tags, custom_headers=custom_headers, raw=True, **operation_config diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/setup.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/setup.py index 2565b1a74e0..952f08f5869 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/setup.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)