From 781ddec4b61c79ff884367654d2b075b7086c54e Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 10 Apr 2019 20:51:09 +0000 Subject: [PATCH 1/6] Generated from e71f68ed3742748809be56268abd685f2efbc1ce Update specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/EventHub-preview.json Co-Authored-By: FBettati --- .../v2018_01_01_preview/models/__init__.py | 3 + .../models/eh_namespace_id_list_result.py | 28 +++ .../models/eh_namespace_id_list_result_py3.py | 28 +++ .../operations/clusters_operations.py | 237 ++++++++++++++++++ 4 files changed, 296 insertions(+) create mode 100644 azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_list_result.py create mode 100644 azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_list_result_py3.py diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py index 5f3b6f3d7395..60e86253e128 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py @@ -18,6 +18,7 @@ from .error_response_py3 import ErrorResponse, ErrorResponseException from .tracked_resource_py3 import TrackedResource from .resource_py3 import Resource + from .eh_namespace_id_list_result_py3 import EHNamespaceIdListResult from .sku_py3 import Sku from .eh_namespace_py3 import EHNamespace from .ip_filter_rule_py3 import IpFilterRule @@ -35,6 +36,7 @@ from .error_response import ErrorResponse, ErrorResponseException from .tracked_resource import TrackedResource from .resource import Resource + from .eh_namespace_id_list_result import EHNamespaceIdListResult from .sku import Sku from .eh_namespace import EHNamespace from .ip_filter_rule import IpFilterRule @@ -65,6 +67,7 @@ 'ErrorResponse', 'ErrorResponseException', 'TrackedResource', 'Resource', + 'EHNamespaceIdListResult', 'Sku', 'EHNamespace', 'IpFilterRule', diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_list_result.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_list_result.py new file mode 100644 index 000000000000..814ba17164c8 --- /dev/null +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_list_result.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EHNamespaceIdListResult(Model): + """The response of the List Namespace IDs operation. + + :param value: Result of the List Namespace IDs operation + :type value: list[str] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(EHNamespaceIdListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_list_result_py3.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_list_result_py3.py new file mode 100644 index 000000000000..43402c98cd03 --- /dev/null +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_list_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EHNamespaceIdListResult(Model): + """The response of the List Namespace IDs operation. + + :param value: Result of the List Namespace IDs operation + :type value: list[str] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[str]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(EHNamespaceIdListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py index 385a18ca86c4..b696306365a7 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py @@ -168,6 +168,101 @@ 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): + # Construct URL + url = self.put.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), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 and send request + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Cluster', response) + if response.status_code == 201: + deserialized = self._deserialize('Cluster', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def put( + self, resource_group_name, cluster_name, 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 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 Cluster or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventhub.v2018_01_01_preview.models.Cluster] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventhub.v2018_01_01_preview.models.Cluster]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._put_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Cluster', 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) + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} + + def _patch_initial( self, resource_group_name, cluster_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL @@ -271,3 +366,145 @@ def get_long_running_output(response): 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}'} + + + def _delete_initial( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.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), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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 and send request + 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, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an existing Event Hubs Cluster. This operation is idempotent. + + :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 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:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_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.EventHub/clusters/{clusterName}'} + + def namespace_list( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + """List all Event Hubs Namespace IDs in an Event Hubs Dedicated 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 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: EHNamespaceIdListResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.eventhub.v2018_01_01_preview.models.EHNamespaceIdListResult + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.namespace_list.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), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('EHNamespaceIdListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + namespace_list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}/namespaces'} From f0bec279403909a890457fe2f6c2c8800b86d616 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 10 Apr 2019 21:37:26 +0000 Subject: [PATCH 2/6] Generated from ee9ddc961f6d6ebea5af98299f6659b762efeb8a Merge pull request #1 from FBettati/AvailableRegions Adding Available Regions API --- .../v2018_01_01_preview/models/__init__.py | 3 + .../models/available_clusters_list.py | 30 ++++++++++ .../models/available_clusters_list_py3.py | 30 ++++++++++ .../operations/clusters_operations.py | 59 ++++++++++++++++++- 4 files changed, 119 insertions(+), 3 deletions(-) create mode 100644 azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list.py create mode 100644 azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list_py3.py diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py index 60e86253e128..acacaf9a3281 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py @@ -14,6 +14,7 @@ from .operation_py3 import Operation from .cluster_sku_py3 import ClusterSku from .cluster_py3 import Cluster + from .available_clusters_list_py3 import AvailableClustersList from .cluster_quota_configuration_properties_py3 import ClusterQuotaConfigurationProperties from .error_response_py3 import ErrorResponse, ErrorResponseException from .tracked_resource_py3 import TrackedResource @@ -32,6 +33,7 @@ from .operation import Operation from .cluster_sku import ClusterSku from .cluster import Cluster + from .available_clusters_list import AvailableClustersList from .cluster_quota_configuration_properties import ClusterQuotaConfigurationProperties from .error_response import ErrorResponse, ErrorResponseException from .tracked_resource import TrackedResource @@ -63,6 +65,7 @@ 'Operation', 'ClusterSku', 'Cluster', + 'AvailableClustersList', 'ClusterQuotaConfigurationProperties', 'ErrorResponse', 'ErrorResponseException', 'TrackedResource', diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list.py new file mode 100644 index 000000000000..397b9385d426 --- /dev/null +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableClustersList(Model): + """Enumeration of the pre-provisioned Event Hubs Cluster count per region with + clusters readily available. + + :param available_clusters: Pre-provisioned Event Hubs Cluster count per + region with such clusters available. + :type available_clusters: dict[str, int] + """ + + _attribute_map = { + 'available_clusters': {'key': 'availableClusters', 'type': '{int}'}, + } + + def __init__(self, **kwargs): + super(AvailableClustersList, self).__init__(**kwargs) + self.available_clusters = kwargs.get('available_clusters', None) diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list_py3.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list_py3.py new file mode 100644 index 000000000000..3710f61f4e82 --- /dev/null +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableClustersList(Model): + """Enumeration of the pre-provisioned Event Hubs Cluster count per region with + clusters readily available. + + :param available_clusters: Pre-provisioned Event Hubs Cluster count per + region with such clusters available. + :type available_clusters: dict[str, int] + """ + + _attribute_map = { + 'available_clusters': {'key': 'availableClusters', 'type': '{int}'}, + } + + def __init__(self, *, available_clusters=None, **kwargs) -> None: + super(AvailableClustersList, self).__init__(**kwargs) + self.available_clusters = available_clusters diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py index b696306365a7..a7e58f2dd0e8 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py @@ -38,6 +38,59 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def list_available_clusters( + self, custom_headers=None, raw=False, **operation_config): + """List the quantity of available pre-provisioned Event Hubs Clusters, + indexed by Azure region. + + :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: AvailableClustersList or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.eventhub.v2018_01_01_preview.models.AvailableClustersList + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_available_clusters.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AvailableClustersList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_available_clusters.metadata = {'url': '/providers/Microsoft.EventHub/availableClusters'} + def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): """Lists the available Event Hubs Clusters within an ARM resource group. @@ -446,7 +499,7 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} - def namespace_list( + def list_namespaces( self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): """List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. @@ -468,7 +521,7 @@ def namespace_list( :class:`ErrorResponseException` """ # Construct URL - url = self.namespace_list.metadata['url'] + url = self.list_namespaces.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), @@ -507,4 +560,4 @@ def namespace_list( return client_raw_response return deserialized - namespace_list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}/namespaces'} + list_namespaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}/namespaces'} From 0729d6277373d45e0b8511190d622ac7d54face4 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 11 Apr 2019 00:07:50 +0000 Subject: [PATCH 3/6] Generated from 2f8c68e56c5c458fb5619cd0060512bf56efed48 Modifying response in AvailableClusterList --- .../v2018_01_01_preview/models/__init__.py | 3 -- .../models/available_clusters_list.py | 30 ------------------- .../models/available_clusters_list_py3.py | 30 ------------------- .../operations/clusters_operations.py | 8 ++--- 4 files changed, 3 insertions(+), 68 deletions(-) delete mode 100644 azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list.py delete mode 100644 azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list_py3.py diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py index acacaf9a3281..60e86253e128 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py @@ -14,7 +14,6 @@ from .operation_py3 import Operation from .cluster_sku_py3 import ClusterSku from .cluster_py3 import Cluster - from .available_clusters_list_py3 import AvailableClustersList from .cluster_quota_configuration_properties_py3 import ClusterQuotaConfigurationProperties from .error_response_py3 import ErrorResponse, ErrorResponseException from .tracked_resource_py3 import TrackedResource @@ -33,7 +32,6 @@ from .operation import Operation from .cluster_sku import ClusterSku from .cluster import Cluster - from .available_clusters_list import AvailableClustersList from .cluster_quota_configuration_properties import ClusterQuotaConfigurationProperties from .error_response import ErrorResponse, ErrorResponseException from .tracked_resource import TrackedResource @@ -65,7 +63,6 @@ 'Operation', 'ClusterSku', 'Cluster', - 'AvailableClustersList', 'ClusterQuotaConfigurationProperties', 'ErrorResponse', 'ErrorResponseException', 'TrackedResource', diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list.py deleted file mode 100644 index 397b9385d426..000000000000 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class AvailableClustersList(Model): - """Enumeration of the pre-provisioned Event Hubs Cluster count per region with - clusters readily available. - - :param available_clusters: Pre-provisioned Event Hubs Cluster count per - region with such clusters available. - :type available_clusters: dict[str, int] - """ - - _attribute_map = { - 'available_clusters': {'key': 'availableClusters', 'type': '{int}'}, - } - - def __init__(self, **kwargs): - super(AvailableClustersList, self).__init__(**kwargs) - self.available_clusters = kwargs.get('available_clusters', None) diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list_py3.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list_py3.py deleted file mode 100644 index 3710f61f4e82..000000000000 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class AvailableClustersList(Model): - """Enumeration of the pre-provisioned Event Hubs Cluster count per region with - clusters readily available. - - :param available_clusters: Pre-provisioned Event Hubs Cluster count per - region with such clusters available. - :type available_clusters: dict[str, int] - """ - - _attribute_map = { - 'available_clusters': {'key': 'availableClusters', 'type': '{int}'}, - } - - def __init__(self, *, available_clusters=None, **kwargs) -> None: - super(AvailableClustersList, self).__init__(**kwargs) - self.available_clusters = available_clusters diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py index a7e58f2dd0e8..1f9b30b95525 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py @@ -48,10 +48,8 @@ def list_available_clusters( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: AvailableClustersList or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.eventhub.v2018_01_01_preview.models.AvailableClustersList - or ~msrest.pipeline.ClientRawResponse + :return: dict or ClientRawResponse if raw=true + :rtype: dict[str, int] or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -82,7 +80,7 @@ def list_available_clusters( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('AvailableClustersList', response) + deserialized = self._deserialize('{int}', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) From 8ad93d5b36f3eb114b1d9634065c147e267f0162 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 11 Apr 2019 17:38:20 +0000 Subject: [PATCH 4/6] Generated from 437b61a0f4527d5adf932d648c587f09872c3a70 Merge pull request #2 from FBettati/frbettat-clusters Move POSTs to GETs for namespace enumeration and available cluster enumeration --- .../v2018_01_01_preview/operations/clusters_operations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py index 1f9b30b95525..d7f719a72a6c 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py @@ -71,7 +71,7 @@ def list_available_clusters( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -542,7 +542,7 @@ def list_namespaces( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: From ed150ae08dbb945dade4e5745814b528cc8de10d Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 22 Apr 2019 21:27:30 +0000 Subject: [PATCH 5/6] Generated from de66598d5b247c2309c05d25f06af83dd2d306b1 Merge pull request #3 from FBettati/availableClusterCollection Modify availableClusters API to have a valid ARM collection response --- .../v2018_01_01_preview/models/__init__.py | 3 ++ .../models/available_clusters_list.py | 29 +++++++++++++++++++ .../models/available_clusters_list_py3.py | 29 +++++++++++++++++++ .../operations/clusters_operations.py | 8 +++-- 4 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list.py create mode 100644 azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list_py3.py diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py index 60e86253e128..acacaf9a3281 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py @@ -14,6 +14,7 @@ from .operation_py3 import Operation from .cluster_sku_py3 import ClusterSku from .cluster_py3 import Cluster + from .available_clusters_list_py3 import AvailableClustersList from .cluster_quota_configuration_properties_py3 import ClusterQuotaConfigurationProperties from .error_response_py3 import ErrorResponse, ErrorResponseException from .tracked_resource_py3 import TrackedResource @@ -32,6 +33,7 @@ from .operation import Operation from .cluster_sku import ClusterSku from .cluster import Cluster + from .available_clusters_list import AvailableClustersList from .cluster_quota_configuration_properties import ClusterQuotaConfigurationProperties from .error_response import ErrorResponse, ErrorResponseException from .tracked_resource import TrackedResource @@ -63,6 +65,7 @@ 'Operation', 'ClusterSku', 'Cluster', + 'AvailableClustersList', 'ClusterQuotaConfigurationProperties', 'ErrorResponse', 'ErrorResponseException', 'TrackedResource', diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list.py new file mode 100644 index 000000000000..b3abbf8f4469 --- /dev/null +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableClustersList(Model): + """The response of the List Available Clusters operation. + + :param value: The count of readily available and pre-provisioned Event + Hubs Clusters per region. + :type value: list[dict[str, int]] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[{int}]'}, + } + + def __init__(self, **kwargs): + super(AvailableClustersList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list_py3.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list_py3.py new file mode 100644 index 000000000000..4df27efffa53 --- /dev/null +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/available_clusters_list_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableClustersList(Model): + """The response of the List Available Clusters operation. + + :param value: The count of readily available and pre-provisioned Event + Hubs Clusters per region. + :type value: list[dict[str, int]] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[{int}]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(AvailableClustersList, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py index d7f719a72a6c..24d25b0ec3eb 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py @@ -48,8 +48,10 @@ def list_available_clusters( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: dict or ClientRawResponse if raw=true - :rtype: dict[str, int] or ~msrest.pipeline.ClientRawResponse + :return: AvailableClustersList or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.eventhub.v2018_01_01_preview.models.AvailableClustersList + or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -80,7 +82,7 @@ def list_available_clusters( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('{int}', response) + deserialized = self._deserialize('AvailableClustersList', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) From 5b23b4d79273bfa7188331558cb9eb3d775e13aa Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sat, 27 Apr 2019 00:15:44 +0000 Subject: [PATCH 6/6] Generated from 98a19e0024ab5bc5bb422ddbfb96bfed85bf984c Updating /cluster/namespaces and /availableClusters calls --- .../v2018_01_01_preview/models/__init__.py | 3 ++ .../models/eh_namespace_id_container.py | 28 +++++++++++++++++++ .../models/eh_namespace_id_container_py3.py | 28 +++++++++++++++++++ .../models/eh_namespace_id_list_result.py | 5 ++-- .../models/eh_namespace_id_list_result_py3.py | 5 ++-- .../operations/clusters_operations.py | 6 +++- 6 files changed, 70 insertions(+), 5 deletions(-) create mode 100644 azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_container.py create mode 100644 azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_container_py3.py diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py index acacaf9a3281..9dd46622d872 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py @@ -19,6 +19,7 @@ from .error_response_py3 import ErrorResponse, ErrorResponseException from .tracked_resource_py3 import TrackedResource from .resource_py3 import Resource + from .eh_namespace_id_container_py3 import EHNamespaceIdContainer from .eh_namespace_id_list_result_py3 import EHNamespaceIdListResult from .sku_py3 import Sku from .eh_namespace_py3 import EHNamespace @@ -38,6 +39,7 @@ from .error_response import ErrorResponse, ErrorResponseException from .tracked_resource import TrackedResource from .resource import Resource + from .eh_namespace_id_container import EHNamespaceIdContainer from .eh_namespace_id_list_result import EHNamespaceIdListResult from .sku import Sku from .eh_namespace import EHNamespace @@ -70,6 +72,7 @@ 'ErrorResponse', 'ErrorResponseException', 'TrackedResource', 'Resource', + 'EHNamespaceIdContainer', 'EHNamespaceIdListResult', 'Sku', 'EHNamespace', diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_container.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_container.py new file mode 100644 index 000000000000..aa188d48e93a --- /dev/null +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_container.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EHNamespaceIdContainer(Model): + """The full ARM ID of an Event Hubs Namespace. + + :param id: + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EHNamespaceIdContainer, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_container_py3.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_container_py3.py new file mode 100644 index 000000000000..a822ffe85794 --- /dev/null +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_container_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EHNamespaceIdContainer(Model): + """The full ARM ID of an Event Hubs Namespace. + + :param id: + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(EHNamespaceIdContainer, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_list_result.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_list_result.py index 814ba17164c8..2f0a6b3986f8 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_list_result.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_list_result.py @@ -16,11 +16,12 @@ class EHNamespaceIdListResult(Model): """The response of the List Namespace IDs operation. :param value: Result of the List Namespace IDs operation - :type value: list[str] + :type value: + list[~azure.mgmt.eventhub.v2018_01_01_preview.models.EHNamespaceIdContainer] """ _attribute_map = { - 'value': {'key': 'value', 'type': '[str]'}, + 'value': {'key': 'value', 'type': '[EHNamespaceIdContainer]'}, } def __init__(self, **kwargs): diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_list_result_py3.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_list_result_py3.py index 43402c98cd03..7d123b15f13e 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_list_result_py3.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/eh_namespace_id_list_result_py3.py @@ -16,11 +16,12 @@ class EHNamespaceIdListResult(Model): """The response of the List Namespace IDs operation. :param value: Result of the List Namespace IDs operation - :type value: list[str] + :type value: + list[~azure.mgmt.eventhub.v2018_01_01_preview.models.EHNamespaceIdContainer] """ _attribute_map = { - 'value': {'key': 'value', 'type': '[str]'}, + 'value': {'key': 'value', 'type': '[EHNamespaceIdContainer]'}, } def __init__(self, *, value=None, **kwargs) -> None: diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py index 24d25b0ec3eb..78d70c105f91 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/clusters_operations.py @@ -57,6 +57,10 @@ def list_available_clusters( """ # Construct URL url = self.list_available_clusters.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} @@ -89,7 +93,7 @@ def list_available_clusters( return client_raw_response return deserialized - list_available_clusters.metadata = {'url': '/providers/Microsoft.EventHub/availableClusters'} + list_available_clusters.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/availableClusters'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config):