Skip to content

Commit

Permalink
release for mgmt eventhub (Azure#12044)
Browse files Browse the repository at this point in the history
Co-authored-by: Shixun Guan <[email protected]>
  • Loading branch information
Abyssknight and Shixun Guan authored Jun 15, 2020
1 parent 489eddf commit 49774f1
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 38 deletions.
20 changes: 19 additions & 1 deletion sdk/eventhub/azure-mgmt-eventhub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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**
Expand Down Expand Up @@ -198,4 +216,4 @@ This wheel package is built with the azure wheel extension

## 0.1.0 (2016-10-27)

- Initial Release
- Initial Release
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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},
}
Expand All @@ -442,17 +443,17 @@ 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'},
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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},
}
Expand All @@ -442,17 +443,17 @@ 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'},
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -58,7 +58,7 @@ def list_available_clusters(
:class:`ErrorResponseException<azure.mgmt.eventhub.v2018_01_01_preview.models.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')
}
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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),
Expand All @@ -245,15 +245,19 @@ 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:
header_parameters.update(custom_headers)
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]:
Expand All @@ -272,15 +276,19 @@ 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
azure subscription.
: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
Expand All @@ -295,9 +303,10 @@ def put(
:raises:
:class:`ErrorResponseException<azure.mgmt.eventhub.v2018_01_01_preview.models.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
Expand All @@ -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),
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -399,7 +408,7 @@ def patch(
:raises:
:class:`ErrorResponseException<azure.mgmt.eventhub.v2018_01_01_preview.models.ErrorResponseException>`
"""
raw_result = self._patch_initial(
raw_result = self._update_initial(
resource_group_name=resource_group_name,
cluster_name=cluster_name,
parameters=parameters,
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
# regenerated.
# --------------------------------------------------------------------------

VERSION = "3.1.0"
VERSION = "4.0.0"

0 comments on commit 49774f1

Please sign in to comment.