Skip to content

Commit a02c1e3

Browse files
[AutoRelease] t2-consumption-2022-12-07-03549(can only be merged by SDK owner) (Azure#27846)
* code and test * Update CHANGELOG.md * Update CHANGELOG.md * Update _version.py * Update CHANGELOG.md * Update _version.py Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: zhenbiao wei <[email protected]>
1 parent 5a6d2bb commit a02c1e3

File tree

5 files changed

+341
-37
lines changed

5 files changed

+341
-37
lines changed

sdk/consumption/azure-mgmt-consumption/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release History
22

3-
## 11.0.0b1 (2022-11-30)
3+
## 11.0.0b1 (2022-12-07)
44

55
### Features Added
66

sdk/consumption/azure-mgmt-consumption/_meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"commit": "2f2e48923cebd95f7d184608a29bcd06d9cb3653",
2+
"commit": "1be09531e4c6edeafde41d6562371566d39669e8",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.9.2",
55
"use": [

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,11 @@
4646
from ._models_py3 import MeterDetailsResponse
4747
from ._models_py3 import ModernChargeSummary
4848
from ._models_py3 import ModernReservationRecommendation
49+
from ._models_py3 import ModernReservationRecommendationProperties
4950
from ._models_py3 import ModernReservationTransaction
5051
from ._models_py3 import ModernReservationTransactionsListResult
52+
from ._models_py3 import ModernSharedScopeReservationRecommendationProperties
53+
from ._models_py3 import ModernSingleScopeReservationRecommendationProperties
5154
from ._models_py3 import ModernUsageDetail
5255
from ._models_py3 import Notification
5356
from ._models_py3 import Operation
@@ -143,8 +146,11 @@
143146
"MeterDetailsResponse",
144147
"ModernChargeSummary",
145148
"ModernReservationRecommendation",
149+
"ModernReservationRecommendationProperties",
146150
"ModernReservationTransaction",
147151
"ModernReservationTransactionsListResult",
152+
"ModernSharedScopeReservationRecommendationProperties",
153+
"ModernSingleScopeReservationRecommendationProperties",
148154
"ModernUsageDetail",
149155
"Notification",
150156
"Operation",

sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models_py3.py

Lines changed: 306 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3195,14 +3195,12 @@ class ModernReservationRecommendation(ReservationRecommendation): # pylint: dis
31953195
:vartype net_savings: ~azure.mgmt.consumption.models.Amount
31963196
:ivar first_usage_date: The usage date for looking back.
31973197
:vartype first_usage_date: ~datetime.datetime
3198-
:ivar scope: Shared or single recommendation.
3198+
:ivar scope: Shared or single recommendation. Required.
31993199
:vartype scope: str
32003200
:ivar sku_properties: List of sku properties.
32013201
:vartype sku_properties: list[~azure.mgmt.consumption.models.SkuProperty]
32023202
:ivar sku_name: This is the ARM Sku name.
32033203
:vartype sku_name: str
3204-
:ivar subscription_id: Subscription ID.
3205-
:vartype subscription_id: str
32063204
"""
32073205

32083206
_validation = {
@@ -3228,10 +3226,9 @@ class ModernReservationRecommendation(ReservationRecommendation): # pylint: dis
32283226
"total_cost_with_reserved_instances": {"readonly": True},
32293227
"net_savings": {"readonly": True},
32303228
"first_usage_date": {"readonly": True},
3231-
"scope": {"readonly": True},
3229+
"scope": {"required": True},
32323230
"sku_properties": {"readonly": True},
32333231
"sku_name": {"readonly": True},
3234-
"subscription_id": {"readonly": True},
32353232
}
32363233

32373234
_attribute_map = {
@@ -3260,7 +3257,6 @@ class ModernReservationRecommendation(ReservationRecommendation): # pylint: dis
32603257
"scope": {"key": "properties.scope", "type": "str"},
32613258
"sku_properties": {"key": "properties.skuProperties", "type": "[SkuProperty]"},
32623259
"sku_name": {"key": "properties.skuName", "type": "str"},
3263-
"subscription_id": {"key": "properties.subscriptionId", "type": "str"},
32643260
}
32653261

32663262
def __init__(self, **kwargs): # pylint: disable=too-many-locals
@@ -3281,10 +3277,125 @@ def __init__(self, **kwargs): # pylint: disable=too-many-locals
32813277
self.total_cost_with_reserved_instances = None
32823278
self.net_savings = None
32833279
self.first_usage_date = None
3284-
self.scope = None
3280+
self.scope: str = "modern"
3281+
self.sku_properties = None
3282+
self.sku_name = None
3283+
3284+
3285+
class ModernReservationRecommendationProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes
3286+
"""The properties of the reservation recommendation.
3287+
3288+
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
3289+
ModernSharedScopeReservationRecommendationProperties,
3290+
ModernSingleScopeReservationRecommendationProperties
3291+
3292+
Variables are only populated by the server, and will be ignored when sending a request.
3293+
3294+
All required parameters must be populated in order to send to Azure.
3295+
3296+
:ivar location: Resource Location.
3297+
:vartype location: str
3298+
:ivar look_back_period: The number of days of usage to look back for recommendation.
3299+
:vartype look_back_period: int
3300+
:ivar instance_flexibility_ratio: The instance Flexibility Ratio.
3301+
:vartype instance_flexibility_ratio: float
3302+
:ivar instance_flexibility_group: The instance Flexibility Group.
3303+
:vartype instance_flexibility_group: str
3304+
:ivar normalized_size: The normalized Size.
3305+
:vartype normalized_size: str
3306+
:ivar recommended_quantity_normalized: The recommended Quantity Normalized.
3307+
:vartype recommended_quantity_normalized: float
3308+
:ivar meter_id: The meter id (GUID).
3309+
:vartype meter_id: str
3310+
:ivar term: RI recommendations in one or three year terms.
3311+
:vartype term: str
3312+
:ivar cost_with_no_reserved_instances: The total amount of cost without reserved instances.
3313+
:vartype cost_with_no_reserved_instances: ~azure.mgmt.consumption.models.Amount
3314+
:ivar recommended_quantity: Recommended quality for reserved instances.
3315+
:vartype recommended_quantity: float
3316+
:ivar resource_type: Resource type.
3317+
:vartype resource_type: str
3318+
:ivar total_cost_with_reserved_instances: The total amount of cost with reserved instances.
3319+
:vartype total_cost_with_reserved_instances: ~azure.mgmt.consumption.models.Amount
3320+
:ivar net_savings: Total estimated savings with reserved instances.
3321+
:vartype net_savings: ~azure.mgmt.consumption.models.Amount
3322+
:ivar first_usage_date: The usage date for looking back.
3323+
:vartype first_usage_date: ~datetime.datetime
3324+
:ivar scope: Shared or single recommendation. Required.
3325+
:vartype scope: str
3326+
:ivar sku_properties: List of sku properties.
3327+
:vartype sku_properties: list[~azure.mgmt.consumption.models.SkuProperty]
3328+
:ivar sku_name: This is the ARM Sku name.
3329+
:vartype sku_name: str
3330+
"""
3331+
3332+
_validation = {
3333+
"location": {"readonly": True},
3334+
"look_back_period": {"readonly": True},
3335+
"instance_flexibility_ratio": {"readonly": True},
3336+
"instance_flexibility_group": {"readonly": True},
3337+
"normalized_size": {"readonly": True},
3338+
"recommended_quantity_normalized": {"readonly": True},
3339+
"meter_id": {"readonly": True},
3340+
"term": {"readonly": True},
3341+
"cost_with_no_reserved_instances": {"readonly": True},
3342+
"recommended_quantity": {"readonly": True},
3343+
"resource_type": {"readonly": True},
3344+
"total_cost_with_reserved_instances": {"readonly": True},
3345+
"net_savings": {"readonly": True},
3346+
"first_usage_date": {"readonly": True},
3347+
"scope": {"required": True},
3348+
"sku_properties": {"readonly": True},
3349+
"sku_name": {"readonly": True},
3350+
}
3351+
3352+
_attribute_map = {
3353+
"location": {"key": "location", "type": "str"},
3354+
"look_back_period": {"key": "lookBackPeriod", "type": "int"},
3355+
"instance_flexibility_ratio": {"key": "instanceFlexibilityRatio", "type": "float"},
3356+
"instance_flexibility_group": {"key": "instanceFlexibilityGroup", "type": "str"},
3357+
"normalized_size": {"key": "normalizedSize", "type": "str"},
3358+
"recommended_quantity_normalized": {"key": "recommendedQuantityNormalized", "type": "float"},
3359+
"meter_id": {"key": "meterId", "type": "str"},
3360+
"term": {"key": "term", "type": "str"},
3361+
"cost_with_no_reserved_instances": {"key": "costWithNoReservedInstances", "type": "Amount"},
3362+
"recommended_quantity": {"key": "recommendedQuantity", "type": "float"},
3363+
"resource_type": {"key": "resourceType", "type": "str"},
3364+
"total_cost_with_reserved_instances": {"key": "totalCostWithReservedInstances", "type": "Amount"},
3365+
"net_savings": {"key": "netSavings", "type": "Amount"},
3366+
"first_usage_date": {"key": "firstUsageDate", "type": "iso-8601"},
3367+
"scope": {"key": "scope", "type": "str"},
3368+
"sku_properties": {"key": "skuProperties", "type": "[SkuProperty]"},
3369+
"sku_name": {"key": "skuName", "type": "str"},
3370+
}
3371+
3372+
_subtype_map = {
3373+
"scope": {
3374+
"Shared": "ModernSharedScopeReservationRecommendationProperties",
3375+
"Single": "ModernSingleScopeReservationRecommendationProperties",
3376+
}
3377+
}
3378+
3379+
def __init__(self, **kwargs):
3380+
""" """
3381+
super().__init__(**kwargs)
3382+
self.location = None
3383+
self.look_back_period = None
3384+
self.instance_flexibility_ratio = None
3385+
self.instance_flexibility_group = None
3386+
self.normalized_size = None
3387+
self.recommended_quantity_normalized = None
3388+
self.meter_id = None
3389+
self.term = None
3390+
self.cost_with_no_reserved_instances = None
3391+
self.recommended_quantity = None
3392+
self.resource_type = None
3393+
self.total_cost_with_reserved_instances = None
3394+
self.net_savings = None
3395+
self.first_usage_date = None
3396+
self.scope: Optional[str] = None
32853397
self.sku_properties = None
32863398
self.sku_name = None
3287-
self.subscription_id = None
32883399

32893400

32903401
class ModernReservationTransaction(ReservationTransactionResource): # pylint: disable=too-many-instance-attributes
@@ -3453,6 +3564,193 @@ def __init__(self, **kwargs):
34533564
self.next_link = None
34543565

34553566

3567+
class ModernSharedScopeReservationRecommendationProperties(
3568+
ModernReservationRecommendationProperties
3569+
): # pylint: disable=too-many-instance-attributes
3570+
"""The properties of the modern reservation recommendation for shared scope.
3571+
3572+
Variables are only populated by the server, and will be ignored when sending a request.
3573+
3574+
All required parameters must be populated in order to send to Azure.
3575+
3576+
:ivar location: Resource Location.
3577+
:vartype location: str
3578+
:ivar look_back_period: The number of days of usage to look back for recommendation.
3579+
:vartype look_back_period: int
3580+
:ivar instance_flexibility_ratio: The instance Flexibility Ratio.
3581+
:vartype instance_flexibility_ratio: float
3582+
:ivar instance_flexibility_group: The instance Flexibility Group.
3583+
:vartype instance_flexibility_group: str
3584+
:ivar normalized_size: The normalized Size.
3585+
:vartype normalized_size: str
3586+
:ivar recommended_quantity_normalized: The recommended Quantity Normalized.
3587+
:vartype recommended_quantity_normalized: float
3588+
:ivar meter_id: The meter id (GUID).
3589+
:vartype meter_id: str
3590+
:ivar term: RI recommendations in one or three year terms.
3591+
:vartype term: str
3592+
:ivar cost_with_no_reserved_instances: The total amount of cost without reserved instances.
3593+
:vartype cost_with_no_reserved_instances: ~azure.mgmt.consumption.models.Amount
3594+
:ivar recommended_quantity: Recommended quality for reserved instances.
3595+
:vartype recommended_quantity: float
3596+
:ivar resource_type: Resource type.
3597+
:vartype resource_type: str
3598+
:ivar total_cost_with_reserved_instances: The total amount of cost with reserved instances.
3599+
:vartype total_cost_with_reserved_instances: ~azure.mgmt.consumption.models.Amount
3600+
:ivar net_savings: Total estimated savings with reserved instances.
3601+
:vartype net_savings: ~azure.mgmt.consumption.models.Amount
3602+
:ivar first_usage_date: The usage date for looking back.
3603+
:vartype first_usage_date: ~datetime.datetime
3604+
:ivar scope: Shared or single recommendation. Required.
3605+
:vartype scope: str
3606+
:ivar sku_properties: List of sku properties.
3607+
:vartype sku_properties: list[~azure.mgmt.consumption.models.SkuProperty]
3608+
:ivar sku_name: This is the ARM Sku name.
3609+
:vartype sku_name: str
3610+
"""
3611+
3612+
_validation = {
3613+
"location": {"readonly": True},
3614+
"look_back_period": {"readonly": True},
3615+
"instance_flexibility_ratio": {"readonly": True},
3616+
"instance_flexibility_group": {"readonly": True},
3617+
"normalized_size": {"readonly": True},
3618+
"recommended_quantity_normalized": {"readonly": True},
3619+
"meter_id": {"readonly": True},
3620+
"term": {"readonly": True},
3621+
"cost_with_no_reserved_instances": {"readonly": True},
3622+
"recommended_quantity": {"readonly": True},
3623+
"resource_type": {"readonly": True},
3624+
"total_cost_with_reserved_instances": {"readonly": True},
3625+
"net_savings": {"readonly": True},
3626+
"first_usage_date": {"readonly": True},
3627+
"scope": {"required": True},
3628+
"sku_properties": {"readonly": True},
3629+
"sku_name": {"readonly": True},
3630+
}
3631+
3632+
_attribute_map = {
3633+
"location": {"key": "location", "type": "str"},
3634+
"look_back_period": {"key": "lookBackPeriod", "type": "int"},
3635+
"instance_flexibility_ratio": {"key": "instanceFlexibilityRatio", "type": "float"},
3636+
"instance_flexibility_group": {"key": "instanceFlexibilityGroup", "type": "str"},
3637+
"normalized_size": {"key": "normalizedSize", "type": "str"},
3638+
"recommended_quantity_normalized": {"key": "recommendedQuantityNormalized", "type": "float"},
3639+
"meter_id": {"key": "meterId", "type": "str"},
3640+
"term": {"key": "term", "type": "str"},
3641+
"cost_with_no_reserved_instances": {"key": "costWithNoReservedInstances", "type": "Amount"},
3642+
"recommended_quantity": {"key": "recommendedQuantity", "type": "float"},
3643+
"resource_type": {"key": "resourceType", "type": "str"},
3644+
"total_cost_with_reserved_instances": {"key": "totalCostWithReservedInstances", "type": "Amount"},
3645+
"net_savings": {"key": "netSavings", "type": "Amount"},
3646+
"first_usage_date": {"key": "firstUsageDate", "type": "iso-8601"},
3647+
"scope": {"key": "scope", "type": "str"},
3648+
"sku_properties": {"key": "skuProperties", "type": "[SkuProperty]"},
3649+
"sku_name": {"key": "skuName", "type": "str"},
3650+
}
3651+
3652+
def __init__(self, **kwargs):
3653+
""" """
3654+
super().__init__(**kwargs)
3655+
self.scope: str = "Shared"
3656+
3657+
3658+
class ModernSingleScopeReservationRecommendationProperties(
3659+
ModernReservationRecommendationProperties
3660+
): # pylint: disable=too-many-instance-attributes
3661+
"""The properties of the modern reservation recommendation for single scope.
3662+
3663+
Variables are only populated by the server, and will be ignored when sending a request.
3664+
3665+
All required parameters must be populated in order to send to Azure.
3666+
3667+
:ivar location: Resource Location.
3668+
:vartype location: str
3669+
:ivar look_back_period: The number of days of usage to look back for recommendation.
3670+
:vartype look_back_period: int
3671+
:ivar instance_flexibility_ratio: The instance Flexibility Ratio.
3672+
:vartype instance_flexibility_ratio: float
3673+
:ivar instance_flexibility_group: The instance Flexibility Group.
3674+
:vartype instance_flexibility_group: str
3675+
:ivar normalized_size: The normalized Size.
3676+
:vartype normalized_size: str
3677+
:ivar recommended_quantity_normalized: The recommended Quantity Normalized.
3678+
:vartype recommended_quantity_normalized: float
3679+
:ivar meter_id: The meter id (GUID).
3680+
:vartype meter_id: str
3681+
:ivar term: RI recommendations in one or three year terms.
3682+
:vartype term: str
3683+
:ivar cost_with_no_reserved_instances: The total amount of cost without reserved instances.
3684+
:vartype cost_with_no_reserved_instances: ~azure.mgmt.consumption.models.Amount
3685+
:ivar recommended_quantity: Recommended quality for reserved instances.
3686+
:vartype recommended_quantity: float
3687+
:ivar resource_type: Resource type.
3688+
:vartype resource_type: str
3689+
:ivar total_cost_with_reserved_instances: The total amount of cost with reserved instances.
3690+
:vartype total_cost_with_reserved_instances: ~azure.mgmt.consumption.models.Amount
3691+
:ivar net_savings: Total estimated savings with reserved instances.
3692+
:vartype net_savings: ~azure.mgmt.consumption.models.Amount
3693+
:ivar first_usage_date: The usage date for looking back.
3694+
:vartype first_usage_date: ~datetime.datetime
3695+
:ivar scope: Shared or single recommendation. Required.
3696+
:vartype scope: str
3697+
:ivar sku_properties: List of sku properties.
3698+
:vartype sku_properties: list[~azure.mgmt.consumption.models.SkuProperty]
3699+
:ivar sku_name: This is the ARM Sku name.
3700+
:vartype sku_name: str
3701+
:ivar subscription_id: Subscription ID associated with single scoped recommendation.
3702+
:vartype subscription_id: str
3703+
"""
3704+
3705+
_validation = {
3706+
"location": {"readonly": True},
3707+
"look_back_period": {"readonly": True},
3708+
"instance_flexibility_ratio": {"readonly": True},
3709+
"instance_flexibility_group": {"readonly": True},
3710+
"normalized_size": {"readonly": True},
3711+
"recommended_quantity_normalized": {"readonly": True},
3712+
"meter_id": {"readonly": True},
3713+
"term": {"readonly": True},
3714+
"cost_with_no_reserved_instances": {"readonly": True},
3715+
"recommended_quantity": {"readonly": True},
3716+
"resource_type": {"readonly": True},
3717+
"total_cost_with_reserved_instances": {"readonly": True},
3718+
"net_savings": {"readonly": True},
3719+
"first_usage_date": {"readonly": True},
3720+
"scope": {"required": True},
3721+
"sku_properties": {"readonly": True},
3722+
"sku_name": {"readonly": True},
3723+
"subscription_id": {"readonly": True},
3724+
}
3725+
3726+
_attribute_map = {
3727+
"location": {"key": "location", "type": "str"},
3728+
"look_back_period": {"key": "lookBackPeriod", "type": "int"},
3729+
"instance_flexibility_ratio": {"key": "instanceFlexibilityRatio", "type": "float"},
3730+
"instance_flexibility_group": {"key": "instanceFlexibilityGroup", "type": "str"},
3731+
"normalized_size": {"key": "normalizedSize", "type": "str"},
3732+
"recommended_quantity_normalized": {"key": "recommendedQuantityNormalized", "type": "float"},
3733+
"meter_id": {"key": "meterId", "type": "str"},
3734+
"term": {"key": "term", "type": "str"},
3735+
"cost_with_no_reserved_instances": {"key": "costWithNoReservedInstances", "type": "Amount"},
3736+
"recommended_quantity": {"key": "recommendedQuantity", "type": "float"},
3737+
"resource_type": {"key": "resourceType", "type": "str"},
3738+
"total_cost_with_reserved_instances": {"key": "totalCostWithReservedInstances", "type": "Amount"},
3739+
"net_savings": {"key": "netSavings", "type": "Amount"},
3740+
"first_usage_date": {"key": "firstUsageDate", "type": "iso-8601"},
3741+
"scope": {"key": "scope", "type": "str"},
3742+
"sku_properties": {"key": "skuProperties", "type": "[SkuProperty]"},
3743+
"sku_name": {"key": "skuName", "type": "str"},
3744+
"subscription_id": {"key": "subscriptionId", "type": "str"},
3745+
}
3746+
3747+
def __init__(self, **kwargs):
3748+
""" """
3749+
super().__init__(**kwargs)
3750+
self.scope: str = "Single"
3751+
self.subscription_id = None
3752+
3753+
34563754
class ModernUsageDetail(UsageDetail): # pylint: disable=too-many-instance-attributes
34573755
"""Modern usage detail.
34583756

0 commit comments

Comments
 (0)