diff --git a/azure-mgmt-reservations/HISTORY.rst b/azure-mgmt-reservations/HISTORY.rst index 55cb77c2255e..62a9f6eacc50 100644 --- a/azure-mgmt-reservations/HISTORY.rst +++ b/azure-mgmt-reservations/HISTORY.rst @@ -3,6 +3,14 @@ Release History =============== +0.3.0 (2018-08-22) +++++++++++++++++++ + +**Features** + +* Model Patch has a new parameter 'name' +* Enum ReservedResourceType has a new value 'cosmos_db' + 0.2.1 (2018-06-14) ++++++++++++++++++ diff --git a/azure-mgmt-reservations/README.rst b/azure-mgmt-reservations/README.rst index b6e8b4249e6e..5fcb8d3294bf 100644 --- a/azure-mgmt-reservations/README.rst +++ b/azure-mgmt-reservations/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Reservations Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/azure_reservation_api.py b/azure-mgmt-reservations/azure/mgmt/reservations/azure_reservation_api.py index 7d4af5699647..2dccd62f8ab3 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/azure_reservation_api.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/azure_reservation_api.py @@ -127,7 +127,7 @@ def get_catalog( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -136,8 +136,8 @@ def get_catalog( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: raise models.ErrorException(self._deserialize, response) @@ -186,7 +186,7 @@ def get_applied_reservation_list( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -195,8 +195,8 @@ def get_applied_reservation_list( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: raise models.ErrorException(self._deserialize, response) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/azure_reservation_api_enums.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/azure_reservation_api_enums.py index 4f24e748f4b2..a3062f5067d3 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/azure_reservation_api_enums.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/azure_reservation_api_enums.py @@ -95,6 +95,7 @@ class ReservedResourceType(str, Enum): virtual_machines = "VirtualMachines" sql_databases = "SqlDatabases" suse_linux = "SuseLinux" + cosmos_db = "CosmosDb" class InstanceFlexibility(str, Enum): diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/patch.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/patch.py index 2175d418e98a..c455970383a2 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/patch.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/patch.py @@ -24,12 +24,15 @@ class Patch(Model): 'NotSupported' :type instance_flexibility: str or ~azure.mgmt.reservations.models.InstanceFlexibility + :param name: Name of the Reservation + :type name: str """ _attribute_map = { 'applied_scope_type': {'key': 'properties.appliedScopeType', 'type': 'str'}, 'applied_scopes': {'key': 'properties.appliedScopes', 'type': '[str]'}, 'instance_flexibility': {'key': 'properties.instanceFlexibility', 'type': 'str'}, + 'name': {'key': 'properties.name', 'type': 'str'}, } def __init__(self, **kwargs): @@ -37,3 +40,4 @@ def __init__(self, **kwargs): self.applied_scope_type = kwargs.get('applied_scope_type', None) self.applied_scopes = kwargs.get('applied_scopes', None) self.instance_flexibility = kwargs.get('instance_flexibility', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/patch_py3.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/patch_py3.py index 7e5a4d180951..5a02ee4558b3 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/patch_py3.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/patch_py3.py @@ -24,16 +24,20 @@ class Patch(Model): 'NotSupported' :type instance_flexibility: str or ~azure.mgmt.reservations.models.InstanceFlexibility + :param name: Name of the Reservation + :type name: str """ _attribute_map = { 'applied_scope_type': {'key': 'properties.appliedScopeType', 'type': 'str'}, 'applied_scopes': {'key': 'properties.appliedScopes', 'type': '[str]'}, 'instance_flexibility': {'key': 'properties.instanceFlexibility', 'type': 'str'}, + 'name': {'key': 'properties.name', 'type': 'str'}, } - def __init__(self, *, applied_scope_type=None, applied_scopes=None, instance_flexibility=None, **kwargs) -> None: + def __init__(self, *, applied_scope_type=None, applied_scopes=None, instance_flexibility=None, name: str=None, **kwargs) -> None: super(Patch, self).__init__(**kwargs) self.applied_scope_type = applied_scope_type self.applied_scopes = applied_scopes self.instance_flexibility = instance_flexibility + self.name = name diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_properties.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_properties.py index da4b9d135769..b5d5bd4ebce6 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_properties.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_properties.py @@ -19,7 +19,7 @@ class ReservationProperties(Model): sending a request. :param reserved_resource_type: Possible values include: 'VirtualMachines', - 'SqlDatabases', 'SuseLinux' + 'SqlDatabases', 'SuseLinux', 'CosmosDb' :type reserved_resource_type: str or ~azure.mgmt.reservations.models.ReservedResourceType :param instance_flexibility: Possible values include: 'On', 'Off', diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_properties_py3.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_properties_py3.py index db7a07c52317..cef413d8aa94 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_properties_py3.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_properties_py3.py @@ -19,7 +19,7 @@ class ReservationProperties(Model): sending a request. :param reserved_resource_type: Possible values include: 'VirtualMachines', - 'SqlDatabases', 'SuseLinux' + 'SqlDatabases', 'SuseLinux', 'CosmosDb' :type reserved_resource_type: str or ~azure.mgmt.reservations.models.ReservedResourceType :param instance_flexibility: Possible values include: 'On', 'Off', diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/operations/operation_operations.py b/azure-mgmt-reservations/azure/mgmt/reservations/operations/operation_operations.py index 2ee5d9c89dc4..5598347eef11 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/operations/operation_operations.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/operations/operation_operations.py @@ -69,7 +69,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -78,9 +78,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: raise models.ErrorException(self._deserialize, response) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/operations/reservation_operations.py b/azure-mgmt-reservations/azure/mgmt/reservations/operations/reservation_operations.py index 91853cadf859..4f2f06b72c33 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/operations/reservation_operations.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/operations/reservation_operations.py @@ -56,6 +56,7 @@ def _split_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()) @@ -68,9 +69,8 @@ def _split_initial( body_content = self._serialize.body(body, 'SplitRequest') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: raise models.ErrorException(self._deserialize, response) @@ -162,6 +162,7 @@ def _merge_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()) @@ -174,9 +175,8 @@ def _merge_initial( body_content = self._serialize.body(body, 'MergeRequest') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: raise models.ErrorException(self._deserialize, response) @@ -283,7 +283,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -292,9 +292,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: raise models.ErrorException(self._deserialize, response) @@ -347,7 +346,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -356,8 +355,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: raise models.ErrorException(self._deserialize, response) @@ -391,6 +390,7 @@ def _update_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()) @@ -403,9 +403,8 @@ def _update_initial( body_content = self._serialize.body(parameters, 'Patch') # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: raise models.ErrorException(self._deserialize, response) @@ -517,7 +516,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -526,9 +525,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: raise models.ErrorException(self._deserialize, response) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/operations/reservation_order_operations.py b/azure-mgmt-reservations/azure/mgmt/reservations/operations/reservation_order_operations.py index 4898d26d101e..ee76672b5963 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/operations/reservation_order_operations.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/operations/reservation_order_operations.py @@ -70,7 +70,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -79,9 +79,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: raise models.ErrorException(self._deserialize, response) @@ -131,7 +130,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -140,8 +139,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: raise models.ErrorException(self._deserialize, response) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/version.py b/azure-mgmt-reservations/azure/mgmt/reservations/version.py index 3da0f49f071f..3e682bbd5fb1 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/version.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.2.1" +VERSION = "0.3.0" diff --git a/azure-mgmt-reservations/setup.py b/azure-mgmt-reservations/setup.py index 78eeffa9dfe1..f6a88ee8d422 100644 --- a/azure-mgmt-reservations/setup.py +++ b/azure-mgmt-reservations/setup.py @@ -72,12 +72,14 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'License :: OSI Approved :: MIT License', ], zip_safe=False, packages=find_packages(exclude=["tests"]), install_requires=[ - 'msrestazure>=0.4.27,<2.0.0', + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', ], cmdclass=cmdclass