Skip to content

Commit

Permalink
[AutoPR reservations/resource-manager] Reservations RP 2018-06-01 spe…
Browse files Browse the repository at this point in the history
…cs (#2658)

* Generated from d5741e93743ec8a4a11072e2dcf61aa25c231070

copying all changes from private repo for 2018-06-01

* Generated from afb41ac0cf762818aeade34545af669b00fb9fd6

Update readme.md

* Generated from 324d0b9ba69e3d170c9ad9a23e4fa51648537f63

renaming autoFit to instanceFlexibility and its enum values
  • Loading branch information
AutorestCI authored Jun 6, 2018
1 parent 49020e1 commit b67f007
Show file tree
Hide file tree
Showing 50 changed files with 1,505 additions and 439 deletions.
6 changes: 5 additions & 1 deletion azure-mgmt-reservations/azure/mgmt/reservations/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# 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.
# --------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# 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.service_client import ServiceClient
from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_operation import AzureOperationPoller
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling
import uuid
from .operations.reservation_order_operations import ReservationOrderOperations
from .operations.reservation_operations import ReservationOperations
Expand Down Expand Up @@ -39,24 +44,24 @@ def __init__(

super(AzureReservationAPIConfiguration, self).__init__(base_url)

self.add_user_agent('azurereservationapi/{}'.format(VERSION))
self.add_user_agent('azure-mgmt-reservations/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials


class AzureReservationAPI(object):
class AzureReservationAPI(SDKClient):
"""This API describe Azure Reservation
:ivar config: Configuration for client.
:vartype config: AzureReservationAPIConfiguration
:ivar reservation_order: ReservationOrder operations
:vartype reservation_order: reservations.operations.ReservationOrderOperations
:vartype reservation_order: azure.mgmt.reservations.operations.ReservationOrderOperations
:ivar reservation: Reservation operations
:vartype reservation: reservations.operations.ReservationOperations
:vartype reservation: azure.mgmt.reservations.operations.ReservationOperations
:ivar operation: Operation operations
:vartype operation: reservations.operations.OperationOperations
:vartype operation: azure.mgmt.reservations.operations.OperationOperations
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
Expand All @@ -68,10 +73,10 @@ def __init__(
self, credentials, base_url=None):

self.config = AzureReservationAPIConfiguration(credentials, base_url)
self._client = ServiceClient(self.config.credentials, self.config)
super(AzureReservationAPI, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2017-11-01'
self.api_version = '2018-06-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand All @@ -83,26 +88,31 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)

def get_catalog(
self, subscription_id, custom_headers=None, raw=False, **operation_config):
self, subscription_id, reserved_resource_type, location=None, custom_headers=None, raw=False, **operation_config):
"""Get the regions and skus that are available for RI purchase for the
specified Azure subscription.
:param subscription_id: Id of the subscription
:type subscription_id: str
:param reserved_resource_type: The type of the resource for which the
skus should be provided.
:type reserved_resource_type: str
:param location: Filters the skus based on the location specified in
this parameter. This can be an azure region or global
:type location: 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<msrest:optionsforoperations>`.
:return: list of :class:`Catalog <reservations.models.Catalog>` or
:class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if
raw=true
:rtype: list of :class:`Catalog <reservations.models.Catalog>` or
:class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
:raises: :class:`ErrorException<reservations.models.ErrorException>`
:return: list or ClientRawResponse if raw=true
:rtype: list[~azure.mgmt.reservations.models.Catalog] or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorException<azure.mgmt.reservations.models.ErrorException>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs'
url = self.get_catalog.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str')
}
Expand All @@ -111,6 +121,9 @@ def get_catalog(
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
query_parameters['reservedResourceType'] = self._serialize.query("reserved_resource_type", reserved_resource_type, 'str')
if location is not None:
query_parameters['location'] = self._serialize.query("location", location, 'str')

# Construct headers
header_parameters = {}
Expand All @@ -124,7 +137,7 @@ def get_catalog(

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, **operation_config)
response = self._client.send(request, header_parameters, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ErrorException(self._deserialize, response)
Expand All @@ -139,6 +152,7 @@ def get_catalog(
return client_raw_response

return deserialized
get_catalog.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs'}

def get_applied_reservation_list(
self, subscription_id, custom_headers=None, raw=False, **operation_config):
Expand All @@ -153,17 +167,14 @@ def get_applied_reservation_list(
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: :class:`AppliedReservations
<reservations.models.AppliedReservations>` or
:class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if
raw=true
:rtype: :class:`AppliedReservations
<reservations.models.AppliedReservations>` or
:class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
:raises: :class:`ErrorException<reservations.models.ErrorException>`
:return: AppliedReservations or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.reservations.models.AppliedReservations or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorException<azure.mgmt.reservations.models.ErrorException>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/appliedReservations'
url = self.get_applied_reservation_list.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str')
}
Expand All @@ -185,7 +196,7 @@ def get_applied_reservation_list(

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, **operation_config)
response = self._client.send(request, header_parameters, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ErrorException(self._deserialize, response)
Expand All @@ -200,3 +211,4 @@ def get_applied_reservation_list(
return client_raw_response

return deserialized
get_applied_reservation_list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/appliedReservations'}
71 changes: 46 additions & 25 deletions azure-mgmt-reservations/azure/mgmt/reservations/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,61 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# 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 .sku_name import SkuName
from .sku_capability import SkuCapability
from .sku_restriction import SkuRestriction
from .catalog import Catalog
from .extended_status_info import ExtendedStatusInfo
from .reservation_split_properties import ReservationSplitProperties
from .reservation_merge_properties import ReservationMergeProperties
from .reservation_properties import ReservationProperties
from .reservation_response import ReservationResponse
from .reservation_order_response import ReservationOrderResponse
from .merge_request import MergeRequest
from .patch import Patch
from .split_request import SplitRequest
from .extended_error_info import ExtendedErrorInfo
from .error import Error, ErrorException
from .applied_reservation_list import AppliedReservationList
from .applied_reservations import AppliedReservations
from .operation_display import OperationDisplay
from .operation_response import OperationResponse
try:
from .sku_name_py3 import SkuName
from .sku_property_py3 import SkuProperty
from .sku_restriction_py3 import SkuRestriction
from .catalog_py3 import Catalog
from .extended_status_info_py3 import ExtendedStatusInfo
from .reservation_split_properties_py3 import ReservationSplitProperties
from .reservation_merge_properties_py3 import ReservationMergeProperties
from .reservation_properties_py3 import ReservationProperties
from .reservation_response_py3 import ReservationResponse
from .reservation_order_response_py3 import ReservationOrderResponse
from .merge_request_py3 import MergeRequest
from .patch_py3 import Patch
from .split_request_py3 import SplitRequest
from .extended_error_info_py3 import ExtendedErrorInfo
from .error_py3 import Error, ErrorException
from .applied_reservation_list_py3 import AppliedReservationList
from .applied_reservations_py3 import AppliedReservations
from .operation_display_py3 import OperationDisplay
from .operation_response_py3 import OperationResponse
except (SyntaxError, ImportError):
from .sku_name import SkuName
from .sku_property import SkuProperty
from .sku_restriction import SkuRestriction
from .catalog import Catalog
from .extended_status_info import ExtendedStatusInfo
from .reservation_split_properties import ReservationSplitProperties
from .reservation_merge_properties import ReservationMergeProperties
from .reservation_properties import ReservationProperties
from .reservation_response import ReservationResponse
from .reservation_order_response import ReservationOrderResponse
from .merge_request import MergeRequest
from .patch import Patch
from .split_request import SplitRequest
from .extended_error_info import ExtendedErrorInfo
from .error import Error, ErrorException
from .applied_reservation_list import AppliedReservationList
from .applied_reservations import AppliedReservations
from .operation_display import OperationDisplay
from .operation_response import OperationResponse
from .reservation_order_response_paged import ReservationOrderResponsePaged
from .reservation_response_paged import ReservationResponsePaged
from .operation_response_paged import OperationResponsePaged
from .azure_reservation_api_enums import (
Kind,
)

__all__ = [
'SkuName',
'SkuCapability',
'SkuProperty',
'SkuRestriction',
'Catalog',
'ExtendedStatusInfo',
Expand All @@ -54,5 +76,4 @@
'ReservationOrderResponsePaged',
'ReservationResponsePaged',
'OperationResponsePaged',
'Kind',
]
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# 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.
# --------------------------------------------------------------------------
Expand All @@ -12,7 +16,7 @@ class AppliedReservationList(Model):
"""AppliedReservationList.
:param value:
:type value: list of str
:type value: list[str]
:param next_link: Url to get the next page of reservations
:type next_link: str
"""
Expand All @@ -22,6 +26,7 @@ class AppliedReservationList(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}

def __init__(self, value=None, next_link=None):
self.value = value
self.next_link = next_link
def __init__(self, **kwargs):
super(AppliedReservationList, self).__init__(**kwargs)
self.value = kwargs.get('value', None)
self.next_link = kwargs.get('next_link', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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 AppliedReservationList(Model):
"""AppliedReservationList.
:param value:
:type value: list[str]
:param next_link: Url to get the next page of reservations
:type next_link: str
"""

_attribute_map = {
'value': {'key': 'value', 'type': '[str]'},
'next_link': {'key': 'nextLink', 'type': 'str'},
}

def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None:
super(AppliedReservationList, self).__init__(**kwargs)
self.value = value
self.next_link = next_link
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# 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.
# --------------------------------------------------------------------------
Expand All @@ -21,8 +25,8 @@ class AppliedReservations(Model):
:ivar type: Type of resource. "Microsoft.Capacity/AppliedReservations"
:vartype type: str
:param reservation_order_ids:
:type reservation_order_ids: :class:`AppliedReservationList
<reservations.models.AppliedReservationList>`
:type reservation_order_ids:
~azure.mgmt.reservations.models.AppliedReservationList
"""

_validation = {
Expand All @@ -38,8 +42,9 @@ class AppliedReservations(Model):
'reservation_order_ids': {'key': 'properties.reservationOrderIds', 'type': 'AppliedReservationList'},
}

def __init__(self, reservation_order_ids=None):
def __init__(self, **kwargs):
super(AppliedReservations, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None
self.reservation_order_ids = reservation_order_ids
self.reservation_order_ids = kwargs.get('reservation_order_ids', None)
Loading

0 comments on commit b67f007

Please sign in to comment.