Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR] reservations/resource-manager #3185

Merged
merged 4 commits into from
Aug 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions azure-mgmt-reservations/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
++++++++++++++++++

Expand Down
2 changes: 1 addition & 1 deletion azure-mgmt-reservations/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down Expand Up @@ -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:
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class ReservedResourceType(str, Enum):
virtual_machines = "VirtualMachines"
sql_databases = "SqlDatabases"
suse_linux = "SuseLinux"
cosmos_db = "CosmosDb"


class InstanceFlexibility(str, Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, **kwargs):
super(Patch, self).__init__(**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)
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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)
Expand Down Expand Up @@ -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())
Expand All @@ -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)
Expand Down Expand Up @@ -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:
Expand All @@ -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)
Expand Down Expand Up @@ -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:
Expand All @@ -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)
Expand Down Expand Up @@ -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())
Expand All @@ -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)
Expand Down Expand Up @@ -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:
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down Expand Up @@ -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:
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion azure-mgmt-reservations/azure/mgmt/reservations/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
# regenerated.
# --------------------------------------------------------------------------

VERSION = "0.2.1"
VERSION = "0.3.0"

4 changes: 3 additions & 1 deletion azure-mgmt-reservations/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down