diff --git a/sdk/eventhub/azure-mgmt-eventhub/CHANGELOG.md b/sdk/eventhub/azure-mgmt-eventhub/CHANGELOG.md index a9f4e9895ba4..e3b804941383 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/CHANGELOG.md +++ b/sdk/eventhub/azure-mgmt-eventhub/CHANGELOG.md @@ -1,5 +1,23 @@ # Release History +## 4.0.0 (2020-06-12) + +**Features** + + - Model Cluster has a new parameter updated_at + - Model Cluster has a new parameter created_at + - Added operation ClustersOperations.update + - Added operation ClustersOperations.create_or_update + - Added operation ClustersOperations.list_available_cluster_region + +**Breaking changes** + + - Model Cluster no longer has parameter created + - Model Cluster no longer has parameter updated + - Removed operation ClustersOperations.put + - Removed operation ClustersOperations.list_available_clusters + - Removed operation ClustersOperations.patch + ## 3.1.0 (2020-05-13) **Features** @@ -198,4 +216,4 @@ This wheel package is built with the azure wheel extension ## 0.1.0 (2016-10-27) - - Initial Release \ No newline at end of file + - Initial Release diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models.py index 1047f0357e45..e9e511d87af7 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models.py @@ -414,10 +414,11 @@ class Cluster(TrackedResource): :type tags: dict[str, str] :param sku: Properties of the cluster SKU. :type sku: ~azure.mgmt.eventhub.v2018_01_01_preview.models.ClusterSku - :ivar created: The UTC time when the Event Hubs Cluster was created. - :vartype created: str - :ivar updated: The UTC time when the Event Hubs Cluster was last updated. - :vartype updated: str + :ivar created_at: The UTC time when the Event Hubs Cluster was created. + :vartype created_at: str + :ivar updated_at: The UTC time when the Event Hubs Cluster was last + updated. + :vartype updated_at: str :ivar metric_id: The metric ID of the cluster resource. Provided by the service and not modifiable by the user. :vartype metric_id: str @@ -429,8 +430,8 @@ class Cluster(TrackedResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'created': {'readonly': True}, - 'updated': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, 'metric_id': {'readonly': True}, 'status': {'readonly': True}, } @@ -442,8 +443,8 @@ class Cluster(TrackedResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'ClusterSku'}, - 'created': {'key': 'properties.created', 'type': 'str'}, - 'updated': {'key': 'properties.updated', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'str'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'str'}, 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, } @@ -451,8 +452,8 @@ class Cluster(TrackedResource): def __init__(self, **kwargs): super(Cluster, self).__init__(**kwargs) self.sku = kwargs.get('sku', None) - self.created = None - self.updated = None + self.created_at = None + self.updated_at = None self.metric_id = None self.status = None diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models_py3.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models_py3.py index 1e9a9f53bc3d..abdfe6cf97a9 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models_py3.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models_py3.py @@ -414,10 +414,11 @@ class Cluster(TrackedResource): :type tags: dict[str, str] :param sku: Properties of the cluster SKU. :type sku: ~azure.mgmt.eventhub.v2018_01_01_preview.models.ClusterSku - :ivar created: The UTC time when the Event Hubs Cluster was created. - :vartype created: str - :ivar updated: The UTC time when the Event Hubs Cluster was last updated. - :vartype updated: str + :ivar created_at: The UTC time when the Event Hubs Cluster was created. + :vartype created_at: str + :ivar updated_at: The UTC time when the Event Hubs Cluster was last + updated. + :vartype updated_at: str :ivar metric_id: The metric ID of the cluster resource. Provided by the service and not modifiable by the user. :vartype metric_id: str @@ -429,8 +430,8 @@ class Cluster(TrackedResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'created': {'readonly': True}, - 'updated': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, 'metric_id': {'readonly': True}, 'status': {'readonly': True}, } @@ -442,8 +443,8 @@ class Cluster(TrackedResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'ClusterSku'}, - 'created': {'key': 'properties.created', 'type': 'str'}, - 'updated': {'key': 'properties.updated', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'str'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'str'}, 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, } @@ -451,8 +452,8 @@ class Cluster(TrackedResource): def __init__(self, *, location: str=None, tags=None, sku=None, **kwargs) -> None: super(Cluster, self).__init__(location=location, tags=tags, **kwargs) self.sku = sku - self.created = None - self.updated = None + self.created_at = None + self.updated_at = None self.metric_id = None self.status = None diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_clusters_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_clusters_operations.py index addeb7bfb8eb..1fb30b476a2a 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_clusters_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_clusters_operations.py @@ -40,7 +40,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def list_available_clusters( + def list_available_cluster_region( self, custom_headers=None, raw=False, **operation_config): """List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. @@ -58,7 +58,7 @@ def list_available_clusters( :class:`ErrorResponseException` """ # Construct URL - url = self.list_available_clusters.metadata['url'] + url = self.list_available_cluster_region.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -94,7 +94,7 @@ def list_available_clusters( return client_raw_response return deserialized - list_available_clusters.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/availableClusterRegions'} + list_available_cluster_region.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/availableClusterRegions'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -227,10 +227,10 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} - def _put_initial( - self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + def _create_or_update_initial( + self, resource_group_name, cluster_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.put.metadata['url'] + url = self.create_or_update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -245,6 +245,7 @@ def _put_initial( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -252,8 +253,11 @@ def _put_initial( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + # Construct body + body_content = self._serialize.body(parameters, 'Cluster') + # Construct and send request - request = self._client.put(url, query_parameters, header_parameters) + 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, 201, 202]: @@ -272,8 +276,8 @@ def _put_initial( return deserialized - def put( - self, resource_group_name, cluster_name, custom_headers=None, raw=False, polling=True, **operation_config): + def create_or_update( + self, resource_group_name, cluster_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an instance of an Event Hubs Cluster. :param resource_group_name: Name of the resource group within the @@ -281,6 +285,10 @@ def put( :type resource_group_name: str :param cluster_name: The name of the Event Hubs Cluster. :type cluster_name: str + :param parameters: Parameters for creating a eventhub cluster + resource. + :type parameters: + ~azure.mgmt.eventhub.v2018_01_01_preview.models.Cluster :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 @@ -295,9 +303,10 @@ def put( :raises: :class:`ErrorResponseException` """ - raw_result = self._put_initial( + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, + parameters=parameters, custom_headers=custom_headers, raw=True, **operation_config @@ -319,13 +328,13 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} - def _patch_initial( + def _update_initial( self, resource_group_name, cluster_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.patch.metadata['url'] + url = self.update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -371,7 +380,7 @@ def _patch_initial( return deserialized - def patch( + def update( self, resource_group_name, cluster_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. @@ -399,7 +408,7 @@ def patch( :raises: :class:`ErrorResponseException` """ - raw_result = self._patch_initial( + raw_result = self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, parameters=parameters, @@ -424,7 +433,7 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} def _delete_initial( diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/version.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/version.py index 24a18964e554..828282207f04 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/version.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/version.py @@ -9,4 +9,4 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "3.1.0" +VERSION = "4.0.0"