Skip to content

Commit cf18c2b

Browse files
AutorestCIZim Kalinowski
authored and
Zim Kalinowski
committed
[AutoPR] reservations/resource-manager (Azure#6861)
* Generated from 631cc8ef9ba25eddb465ba207157ff92ab4fa641 (Azure#6302) Task 4855805: ARM swagger update from lockedPriceTotal to billingCurrencyTotal & pricingCurrencyTotal. * Packaging update of azure-mgmt-reservations * Generated from 9c61d69a19c13e40a8468ea21c909aa677ac4678 (Azure#6502) Task 4957070: ARM swagger update to include term in get reservation response. * [AutoPR reservations/resource-manager] [Hub Generated] Review request for Microsoft.Capacity to add version preview/2019-04-01 (Azure#6860) * Generated from ea7847bd3538ded2d30c5c436a3f9f0464637d90 update * Generated from ecb712b6e6535b86e9283f57a1a65d63c3cbb04a update * Generated from a65461546a2e2b7d3391cda3ecbe437938540d32 update * updated test * fix test * updated history and version
1 parent 6aba868 commit cf18c2b

File tree

70 files changed

+2476
-2486
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2476
-2486
lines changed

sdk/reservations/azure-mgmt-reservations/HISTORY.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,39 @@
33
Release History
44
===============
55

6+
0.4.0 (2019-09-09)
7+
++++++++++++++++++
8+
9+
**Features**
10+
11+
- Model ReservationProperties has a new parameter term
12+
- Model ReservationProperties has a new parameter renew_properties
13+
- Model ReservationProperties has a new parameter renew_source
14+
- Model ReservationProperties has a new parameter billing_scope_id
15+
- Model ReservationProperties has a new parameter renew
16+
- Model ReservationProperties has a new parameter renew_destination
17+
- Model Patch has a new parameter renew_properties
18+
- Model Patch has a new parameter renew
19+
- Model PurchaseRequest has a new parameter renew
20+
- Added operation ReservationOperations.available_scopes
21+
- Added operation group AzureReservationAPIOperationsMixin
22+
23+
**Breaking changes**
24+
25+
- Operation ReservationOperations.get has a new signature
26+
27+
**General breaking changes**
28+
29+
This version uses a next-generation code generator that *might* introduce breaking changes if from some import.
30+
In summary, some modules were incorrectly visible/importable and have been renamed. This fixed several issues caused by usage of classes that were not supposed to be used in the first place.
31+
32+
- AzureReservationAPI cannot be imported from `azure.mgmt.reservations.azure_reservation_api` anymore (import from `azure.mgmt.reservations` works like before)
33+
- AzureReservationAPIConfiguration import has been moved from `azure.mgmt.reservations.azure_reservation_api` to `azure.mgmt.reservations`
34+
- A model `MyClass` from a "models" sub-module cannot be imported anymore using `azure.mgmt.reservations.models.my_class` (import from `azure.mgmt.reservations.models` works like before)
35+
- An operation class `MyClassOperations` from an `operations` sub-module cannot be imported anymore using `azure.mgmt.reservations.operations.my_class_operations` (import from `azure.mgmt.reservations.operations` works like before)
36+
37+
Last but not least, HTTP connection pooling is now enabled by default. You should always use a client as a context manager, or call close(), or use no more than one client per process.
38+
639
0.3.2 (2019-04-18)
740
++++++++++++++++++
841

sdk/reservations/azure-mgmt-reservations/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This is the Microsoft Azure Reservations Client Library.
66
Azure Resource Manager (ARM) is the next generation of management APIs that
77
replace the old Azure Service Management (ASM).
88

9-
This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.
9+
This package has been tested with Python 2.7, 3.5, 3.6 and 3.7.
1010

1111
For the older Azure Service Management (ASM) libraries, see
1212
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.

sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
from .azure_reservation_api import AzureReservationAPI
13-
from .version import VERSION
12+
from ._configuration import AzureReservationAPIConfiguration
13+
from ._azure_reservation_api import AzureReservationAPI
14+
__all__ = ['AzureReservationAPI', 'AzureReservationAPIConfiguration']
1415

15-
__all__ = ['AzureReservationAPI']
16+
from .version import VERSION
1617

1718
__version__ = VERSION
1819

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.service_client import SDKClient
13+
from msrest import Serializer, Deserializer
14+
15+
from ._configuration import AzureReservationAPIConfiguration
16+
from .operations import AzureReservationAPIOperationsMixin
17+
from .operations import ReservationOperations
18+
from .operations import ReservationOrderOperations
19+
from .operations import OperationOperations
20+
from . import models
21+
22+
23+
class AzureReservationAPI(AzureReservationAPIOperationsMixin, SDKClient):
24+
"""This API describe Azure Reservation
25+
26+
:ivar config: Configuration for client.
27+
:vartype config: AzureReservationAPIConfiguration
28+
29+
:ivar reservation: Reservation operations
30+
:vartype reservation: azure.mgmt.reservations.operations.ReservationOperations
31+
:ivar reservation_order: ReservationOrder operations
32+
:vartype reservation_order: azure.mgmt.reservations.operations.ReservationOrderOperations
33+
:ivar operation: Operation operations
34+
:vartype operation: azure.mgmt.reservations.operations.OperationOperations
35+
36+
:param credentials: Credentials needed for the client to connect to Azure.
37+
:type credentials: :mod:`A msrestazure Credentials
38+
object<msrestazure.azure_active_directory>`
39+
:param str base_url: Service URL
40+
"""
41+
42+
def __init__(
43+
self, credentials, base_url=None):
44+
45+
self.config = AzureReservationAPIConfiguration(credentials, base_url)
46+
super(AzureReservationAPI, self).__init__(self.config.credentials, self.config)
47+
48+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
49+
self.api_version = '2019-04-01'
50+
self._serialize = Serializer(client_models)
51+
self._deserialize = Deserializer(client_models)
52+
53+
self.reservation = ReservationOperations(
54+
self._client, self.config, self._serialize, self._deserialize)
55+
self.reservation_order = ReservationOrderOperations(
56+
self._client, self.config, self._serialize, self._deserialize)
57+
self.operation = OperationOperations(
58+
self._client, self.config, self._serialize, self._deserialize)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
from msrestazure import AzureConfiguration
12+
13+
from .version import VERSION
14+
15+
16+
class AzureReservationAPIConfiguration(AzureConfiguration):
17+
"""Configuration for AzureReservationAPI
18+
Note that all parameters used to create this instance are saved as instance
19+
attributes.
20+
21+
:param credentials: Credentials needed for the client to connect to Azure.
22+
:type credentials: :mod:`A msrestazure Credentials
23+
object<msrestazure.azure_active_directory>`
24+
:param str base_url: Service URL
25+
"""
26+
27+
def __init__(
28+
self, credentials, base_url=None):
29+
30+
if credentials is None:
31+
raise ValueError("Parameter 'credentials' must not be None.")
32+
if not base_url:
33+
base_url = 'https://management.azure.com'
34+
35+
super(AzureReservationAPIConfiguration, self).__init__(base_url)
36+
37+
# Starting Autorest.Python 4.0.64, make connection pool activated by default
38+
self.keep_alive = True
39+
40+
self.add_user_agent('azure-mgmt-reservations/{}'.format(VERSION))
41+
self.add_user_agent('Azure-SDK-For-Python')
42+
43+
self.credentials = credentials

sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/__init__.py

Lines changed: 95 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -10,61 +10,75 @@
1010
# --------------------------------------------------------------------------
1111

1212
try:
13-
from .sku_name_py3 import SkuName
14-
from .sku_property_py3 import SkuProperty
15-
from .sku_restriction_py3 import SkuRestriction
16-
from .catalog_py3 import Catalog
17-
from .extended_status_info_py3 import ExtendedStatusInfo
18-
from .reservation_split_properties_py3 import ReservationSplitProperties
19-
from .reservation_merge_properties_py3 import ReservationMergeProperties
20-
from .reservation_properties_py3 import ReservationProperties
21-
from .reservation_response_py3 import ReservationResponse
22-
from .reservation_order_response_py3 import ReservationOrderResponse
23-
from .calculate_price_response_properties_billing_currency_total_py3 import CalculatePriceResponsePropertiesBillingCurrencyTotal
24-
from .calculate_price_response_properties_pricing_currency_total_py3 import CalculatePriceResponsePropertiesPricingCurrencyTotal
25-
from .calculate_price_response_properties_py3 import CalculatePriceResponseProperties
26-
from .calculate_price_response_py3 import CalculatePriceResponse
27-
from .purchase_request_properties_reserved_resource_properties_py3 import PurchaseRequestPropertiesReservedResourceProperties
28-
from .merge_request_py3 import MergeRequest
29-
from .purchase_request_py3 import PurchaseRequest
30-
from .patch_py3 import Patch
31-
from .split_request_py3 import SplitRequest
32-
from .extended_error_info_py3 import ExtendedErrorInfo
33-
from .error_py3 import Error, ErrorException
34-
from .applied_reservation_list_py3 import AppliedReservationList
35-
from .applied_reservations_py3 import AppliedReservations
36-
from .operation_display_py3 import OperationDisplay
37-
from .operation_response_py3 import OperationResponse
13+
from ._models_py3 import AppliedReservationList
14+
from ._models_py3 import AppliedReservations
15+
from ._models_py3 import CalculatePriceResponse
16+
from ._models_py3 import CalculatePriceResponseProperties
17+
from ._models_py3 import CalculatePriceResponsePropertiesBillingCurrencyTotal
18+
from ._models_py3 import CalculatePriceResponsePropertiesPricingCurrencyTotal
19+
from ._models_py3 import Catalog
20+
from ._models_py3 import Error, ErrorException
21+
from ._models_py3 import ExtendedErrorInfo
22+
from ._models_py3 import ExtendedStatusInfo
23+
from ._models_py3 import MergeRequest
24+
from ._models_py3 import OperationDisplay
25+
from ._models_py3 import OperationResponse
26+
from ._models_py3 import Patch
27+
from ._models_py3 import PatchPropertiesRenewProperties
28+
from ._models_py3 import Properties
29+
from ._models_py3 import PurchaseRequest
30+
from ._models_py3 import PurchaseRequestPropertiesReservedResourceProperties
31+
from ._models_py3 import RenewPropertiesResponse
32+
from ._models_py3 import RenewPropertiesResponseBillingCurrencyTotal
33+
from ._models_py3 import RenewPropertiesResponsePricingCurrencyTotal
34+
from ._models_py3 import ReservationMergeProperties
35+
from ._models_py3 import ReservationOrderResponse
36+
from ._models_py3 import ReservationProperties
37+
from ._models_py3 import ReservationResponse
38+
from ._models_py3 import ReservationSplitProperties
39+
from ._models_py3 import ScopeProperties
40+
from ._models_py3 import SkuName
41+
from ._models_py3 import SkuProperty
42+
from ._models_py3 import SkuRestriction
43+
from ._models_py3 import SplitRequest
44+
from ._models_py3 import SubscriptionScopeProperties
3845
except (SyntaxError, ImportError):
39-
from .sku_name import SkuName
40-
from .sku_property import SkuProperty
41-
from .sku_restriction import SkuRestriction
42-
from .catalog import Catalog
43-
from .extended_status_info import ExtendedStatusInfo
44-
from .reservation_split_properties import ReservationSplitProperties
45-
from .reservation_merge_properties import ReservationMergeProperties
46-
from .reservation_properties import ReservationProperties
47-
from .reservation_response import ReservationResponse
48-
from .reservation_order_response import ReservationOrderResponse
49-
from .calculate_price_response_properties_billing_currency_total import CalculatePriceResponsePropertiesBillingCurrencyTotal
50-
from .calculate_price_response_properties_pricing_currency_total import CalculatePriceResponsePropertiesPricingCurrencyTotal
51-
from .calculate_price_response_properties import CalculatePriceResponseProperties
52-
from .calculate_price_response import CalculatePriceResponse
53-
from .purchase_request_properties_reserved_resource_properties import PurchaseRequestPropertiesReservedResourceProperties
54-
from .merge_request import MergeRequest
55-
from .purchase_request import PurchaseRequest
56-
from .patch import Patch
57-
from .split_request import SplitRequest
58-
from .extended_error_info import ExtendedErrorInfo
59-
from .error import Error, ErrorException
60-
from .applied_reservation_list import AppliedReservationList
61-
from .applied_reservations import AppliedReservations
62-
from .operation_display import OperationDisplay
63-
from .operation_response import OperationResponse
64-
from .reservation_order_response_paged import ReservationOrderResponsePaged
65-
from .reservation_response_paged import ReservationResponsePaged
66-
from .operation_response_paged import OperationResponsePaged
67-
from .azure_reservation_api_enums import (
46+
from ._models import AppliedReservationList
47+
from ._models import AppliedReservations
48+
from ._models import CalculatePriceResponse
49+
from ._models import CalculatePriceResponseProperties
50+
from ._models import CalculatePriceResponsePropertiesBillingCurrencyTotal
51+
from ._models import CalculatePriceResponsePropertiesPricingCurrencyTotal
52+
from ._models import Catalog
53+
from ._models import Error, ErrorException
54+
from ._models import ExtendedErrorInfo
55+
from ._models import ExtendedStatusInfo
56+
from ._models import MergeRequest
57+
from ._models import OperationDisplay
58+
from ._models import OperationResponse
59+
from ._models import Patch
60+
from ._models import PatchPropertiesRenewProperties
61+
from ._models import Properties
62+
from ._models import PurchaseRequest
63+
from ._models import PurchaseRequestPropertiesReservedResourceProperties
64+
from ._models import RenewPropertiesResponse
65+
from ._models import RenewPropertiesResponseBillingCurrencyTotal
66+
from ._models import RenewPropertiesResponsePricingCurrencyTotal
67+
from ._models import ReservationMergeProperties
68+
from ._models import ReservationOrderResponse
69+
from ._models import ReservationProperties
70+
from ._models import ReservationResponse
71+
from ._models import ReservationSplitProperties
72+
from ._models import ScopeProperties
73+
from ._models import SkuName
74+
from ._models import SkuProperty
75+
from ._models import SkuRestriction
76+
from ._models import SplitRequest
77+
from ._models import SubscriptionScopeProperties
78+
from ._paged_models import OperationResponsePaged
79+
from ._paged_models import ReservationOrderResponsePaged
80+
from ._paged_models import ReservationResponsePaged
81+
from ._azure_reservation_api_enums import (
6882
ReservationStatusCode,
6983
ErrorResponseCode,
7084
ReservationTerm,
@@ -74,33 +88,40 @@
7488
)
7589

7690
__all__ = [
77-
'SkuName',
78-
'SkuProperty',
79-
'SkuRestriction',
91+
'AppliedReservationList',
92+
'AppliedReservations',
93+
'CalculatePriceResponse',
94+
'CalculatePriceResponseProperties',
95+
'CalculatePriceResponsePropertiesBillingCurrencyTotal',
96+
'CalculatePriceResponsePropertiesPricingCurrencyTotal',
8097
'Catalog',
98+
'Error', 'ErrorException',
99+
'ExtendedErrorInfo',
81100
'ExtendedStatusInfo',
82-
'ReservationSplitProperties',
101+
'MergeRequest',
102+
'OperationDisplay',
103+
'OperationResponse',
104+
'Patch',
105+
'PatchPropertiesRenewProperties',
106+
'Properties',
107+
'PurchaseRequest',
108+
'PurchaseRequestPropertiesReservedResourceProperties',
109+
'RenewPropertiesResponse',
110+
'RenewPropertiesResponseBillingCurrencyTotal',
111+
'RenewPropertiesResponsePricingCurrencyTotal',
83112
'ReservationMergeProperties',
113+
'ReservationOrderResponse',
84114
'ReservationProperties',
85115
'ReservationResponse',
86-
'ReservationOrderResponse',
87-
'CalculatePriceResponsePropertiesBillingCurrencyTotal',
88-
'CalculatePriceResponsePropertiesPricingCurrencyTotal',
89-
'CalculatePriceResponseProperties',
90-
'CalculatePriceResponse',
91-
'PurchaseRequestPropertiesReservedResourceProperties',
92-
'MergeRequest',
93-
'PurchaseRequest',
94-
'Patch',
116+
'ReservationSplitProperties',
117+
'ScopeProperties',
118+
'SkuName',
119+
'SkuProperty',
120+
'SkuRestriction',
95121
'SplitRequest',
96-
'ExtendedErrorInfo',
97-
'Error', 'ErrorException',
98-
'AppliedReservationList',
99-
'AppliedReservations',
100-
'OperationDisplay',
101-
'OperationResponse',
102-
'ReservationOrderResponsePaged',
122+
'SubscriptionScopeProperties',
103123
'ReservationResponsePaged',
124+
'ReservationOrderResponsePaged',
104125
'OperationResponsePaged',
105126
'ReservationStatusCode',
106127
'ErrorResponseCode',
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ class ReservedResourceType(str, Enum):
9696
sql_databases = "SqlDatabases"
9797
suse_linux = "SuseLinux"
9898
cosmos_db = "CosmosDb"
99+
red_hat = "RedHat"
100+
sql_data_warehouse = "SqlDataWarehouse"
101+
vmware_cloud_simple = "VMwareCloudSimple"
102+
red_hat_osa = "RedHatOsa"
99103

100104

101105
class InstanceFlexibility(str, Enum):

0 commit comments

Comments
 (0)