Skip to content

Commit 407e420

Browse files
azure-sdkmsyyc
andauthored
Refresh azure-mgmt-consumption after migrate to Typespec (#47108)
* Configurations: 'specification/consumption/resource-manager/Microsoft.Consumption/Consumption/tspconfig.yaml', API Version: 2024-08-01, SDK Release Type: beta, and CommitSHA: '833a2f8fe1b9c1df1cf4deb1981565b5acc79492' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6346017 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * Optimize changelog for azure-mgmt-consumption * Add live tests for azure-mgmt-consumption * Delete sdk/consumption/azure-mgmt-consumption/tests/test_budgets.py --------- Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com>
1 parent 32f34b9 commit 407e420

211 files changed

Lines changed: 19109 additions & 15174 deletions

File tree

Some content is hidden

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

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

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,100 @@
11
# Release History
22

3+
## 11.0.0b2 (2026-05-25)
4+
5+
### Features Added
6+
7+
- Client `ConsumptionManagementClient` added parameter `cloud_setting` in method `__init__`
8+
- Client `ConsumptionManagementClient` added method `send_request`
9+
- Model `Balance` added property `system_data`
10+
- Model `Budget` added property `system_data`
11+
- Model `ChargeSummary` added property `system_data`
12+
- Model `CreditSummary` added property `tags`
13+
- Model `CreditSummary` added property `system_data`
14+
- Model `EventSummary` added property `system_data`
15+
- Model `LegacyChargeSummary` added property `system_data`
16+
- Model `LegacyReservationRecommendation` added property `system_data`
17+
- Model `LegacyReservationRecommendationProperties` added property `last_usage_date`
18+
- Model `LegacyReservationRecommendationProperties` added property `total_hours`
19+
- Model `LegacySharedScopeReservationRecommendationProperties` added property `last_usage_date`
20+
- Model `LegacySharedScopeReservationRecommendationProperties` added property `total_hours`
21+
- Model `LegacySingleScopeReservationRecommendationProperties` added property `last_usage_date`
22+
- Model `LegacySingleScopeReservationRecommendationProperties` added property `total_hours`
23+
- Model `LegacyUsageDetail` added property `system_data`
24+
- Model `LotSummary` added property `system_data`
25+
- Model `ManagementGroupAggregatedCostResult` added property `system_data`
26+
- Model `Marketplace` added property `system_data`
27+
- Model `ModernChargeSummary` added property `system_data`
28+
- Model `ModernReservationRecommendation` added property `system_data`
29+
- Model `ModernReservationRecommendationProperties` added property `last_usage_date`
30+
- Model `ModernReservationRecommendationProperties` added property `total_hours`
31+
- Model `ModernReservationTransaction` added property `system_data`
32+
- Model `ModernSharedScopeReservationRecommendationProperties` added property `last_usage_date`
33+
- Model `ModernSharedScopeReservationRecommendationProperties` added property `total_hours`
34+
- Model `ModernSingleScopeReservationRecommendationProperties` added property `last_usage_date`
35+
- Model `ModernSingleScopeReservationRecommendationProperties` added property `total_hours`
36+
- Model `ModernUsageDetail` added property `system_data`
37+
- Model `PriceSheetProperties` added property `savings_plan`
38+
- Model `PriceSheetResult` added property `system_data`
39+
- Model `ProxyResource` added property `system_data`
40+
- Model `ReservationDetail` added property `system_data`
41+
- Model `ReservationRecommendation` added property `system_data`
42+
- Model `ReservationRecommendationDetailsModel` added property `system_data`
43+
- Model `ReservationSummary` added property `system_data`
44+
- Model `ReservationTransaction` added property `system_data`
45+
- Model `Resource` added property `system_data`
46+
- Model `TagsResult` added property `system_data`
47+
- Enum `Term` added member `P1_M`
48+
- Model `UsageDetail` added property `system_data`
49+
- Added enum `CreatedByType`
50+
- Added model `ErrorAdditionalInfo`
51+
- Added model `ErrorDetail`
52+
- Added model `ExtensionResource`
53+
- Added model `OperationStatus`
54+
- Added enum `OperationStatusType`
55+
- Added enum `OrganizationType`
56+
- Added model `PricesheetDownloadProperties`
57+
- Added model `SavingsPlan`
58+
- Added model `SystemData`
59+
- Operation group `PriceSheetOperations` added method `begin_download_by_billing_account_period`
60+
- Operation group `ReservationRecommendationDetailsOperations` added parameter `filter` in method `get`
61+
- Operation group `ReservationTransactionsOperations` added parameter `use_markup_if_partner` in method `list`
62+
- Operation group `ReservationTransactionsOperations` added parameter `preview_markup_percentage` in method `list`
63+
64+
### Breaking Changes
65+
66+
- This version introduces new hybrid models which have dual dictionary and model nature. Please follow https://aka.ms/azsdk/python/migrate/hybrid-models for migration.
67+
- For the method breakings, please refer to https://aka.ms/azsdk/python/migrate/operations for migration.
68+
- Model `BudgetComparisonExpression` renamed its instance variable `values` to `values_property`
69+
- Model `ChargeSummary` deleted or renamed its instance variable `tags`
70+
- Model `EventSummary` moved instance variable `transaction_date`, `description`, `new_credit`, `adjustments`, `credit_expired`, `charges`, `closed_balance`, `event_type`, `invoice_number`, `billing_profile_id`, `billing_profile_display_name`, `lot_id`, `lot_source`, `canceled_credit`, `credit_currency`, `billing_currency`, `reseller`, `credit_expired_in_billing_currency`, `new_credit_in_billing_currency`, `adjustments_in_billing_currency`, `charges_in_billing_currency`, `closed_balance_in_billing_currency` and `e_tag_properties_e_tag` under property `properties` whose type is `EventProperties`
71+
- Model `LegacyReservationRecommendation` moved instance variable `look_back_period`, `instance_flexibility_ratio`, `instance_flexibility_group`, `normalized_size`, `recommended_quantity_normalized`, `meter_id`, `resource_type`, `term`, `cost_with_no_reserved_instances`, `recommended_quantity`, `total_cost_with_reserved_instances`, `net_savings`, `first_usage_date`, `scope` and `sku_properties` under property `properties` whose type is `LegacyReservationRecommendationProperties`
72+
- Model `LotSummary` moved instance variable `original_amount`, `closed_balance`, `source`, `start_date`, `expiration_date`, `po_number`, `purchased_date`, `status`, `credit_currency`, `billing_currency`, `original_amount_in_billing_currency`, `closed_balance_in_billing_currency`, `reseller` and `e_tag_properties_e_tag` under property `properties` whose type is `LotProperties`
73+
- Model `ManagementGroupAggregatedCostResult` moved instance variable `billing_period_id`, `usage_start`, `usage_end`, `azure_charges`, `marketplace_charges`, `charges_billed_separately`, `currency`, `children`, `included_subscriptions` and `excluded_subscriptions` under property `properties` whose type is `ManagementGroupAggregatedCostProperties`
74+
- Model `ModernReservationRecommendation` moved instance variable `location_properties_location`, `look_back_period`, `instance_flexibility_ratio`, `instance_flexibility_group`, `normalized_size`, `recommended_quantity_normalized`, `meter_id`, `term`, `cost_with_no_reserved_instances`, `recommended_quantity`, `resource_type`, `total_cost_with_reserved_instances`, `net_savings`, `first_usage_date`, `scope`, `sku_properties` and `sku_name` under property `properties` whose type is `ModernReservationRecommendationProperties`
75+
- Model `PriceSheetResult` moved instance variable `pricesheets`, `next_link` and `download` under property `properties` whose type is `PriceSheetModel`
76+
- Model `ProxyResource` deleted or renamed its instance variable `e_tag`
77+
- Model `ReservationRecommendationDetailsModel` moved instance variable `currency`, `resource`, `resource_group`, `savings`, `scope` and `usage` under property `properties` whose type is `ReservationRecommendationDetailsProperties`
78+
- Model `ReservationTransaction` moved instance variable `event_date`, `reservation_order_id`, `description`, `event_type`, `quantity`, `amount`, `currency`, `reservation_order_name`, `purchasing_enrollment`, `purchasing_subscription_guid`, `purchasing_subscription_name`, `arm_sku_name`, `term`, `region`, `account_name`, `account_owner_email`, `department_name`, `cost_center`, `current_enrollment`, `billing_frequency`, `billing_month`, `monetary_commitment` and `overage` under property `properties` whose type is `LegacyReservationTransactionProperties`
79+
- Model `Resource` deleted or renamed its instance variable `etag`
80+
- Model `Resource` deleted or renamed its instance variable `tags`
81+
- Model `TagsResult` moved instance variable `tags`, `next_link` and `previous_link` under property `properties` whose type is `TagProperties`
82+
- Method `ChargesOperations.list` changed its parameter `start_date`/`end_date`/`apply` from `positional_or_keyword` to `keyword_only`
83+
- Method `EventsOperations.list_by_billing_profile` changed its parameter `start_date`/`end_date` from `positional_or_keyword` to `keyword_only`
84+
- Method `MarketplacesOperations.list` changed its parameter `skiptoken` from `positional_or_keyword` to `keyword_only`
85+
- Method `PriceSheetOperations.get` changed its parameter `expand`/`skiptoken` from `positional_or_keyword` to `keyword_only`
86+
- Method `PriceSheetOperations.get_by_billing_period` changed its parameter `expand`/`skiptoken` from `positional_or_keyword` to `keyword_only`
87+
- Method `ReservationRecommendationDetailsOperations.get` changed its parameter `scope`/`region`/`term`/`look_back_period`/`product` from `positional_or_keyword` to `keyword_only`
88+
- Method `ReservationsDetailsOperations.list` changed its parameter `start_date`/`end_date`/`reservation_id`/`reservation_order_id` from `positional_or_keyword` to `keyword_only`
89+
- Method `ReservationsSummariesOperations.list` changed its parameter `grain`/`start_date`/`end_date`/`reservation_id`/`reservation_order_id` from `positional_or_keyword` to `keyword_only`
90+
- Method `ReservationsSummariesOperations.list_by_reservation_order` changed its parameter `grain` from `positional_or_keyword` to `keyword_only`
91+
- Method `ReservationsSummariesOperations.list_by_reservation_order_and_reservation` changed its parameter `grain` from `positional_or_keyword` to `keyword_only`
92+
- Method `UsageDetailsOperations.list` changed its parameter `expand`/`skiptoken`/`metric` from `positional_or_keyword` to `keyword_only`
93+
94+
### Other Changes
95+
96+
- Deleted model `DownloadProperties`/`ErrorDetails`/`Events`/`LegacyReservationTransaction`/`Lots`/`ReservationTransactionResource`/`ResourceAttributes` which actually were not used by SDK users
97+
398
## 11.0.0b1 (2022-12-07)
499

5100
### Features Added
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
include _meta.json
2-
recursive-include tests *.py *.json
3-
recursive-include samples *.py *.md
41
include *.md
5-
include azure/__init__.py
6-
include azure/mgmt/__init__.py
72
include LICENSE
83
include azure/mgmt/consumption/py.typed
4+
recursive-include tests *.py
5+
recursive-include samples *.py *.md
6+
include azure/__init__.py
7+
include azure/mgmt/__init__.py
Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,61 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Consumption Client Library.
4-
This package has been tested with Python 3.7+.
4+
This package has been tested with Python 3.10+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
88

99
_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_
1010

11-
# Usage
11+
## Getting started
1212

13+
### Prerequisites
1314

14-
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
15-
16-
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/consumption)
17-
Code samples for this package can be found at [Consumption](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
18-
Additional code samples for different Azure services are available at [Samples Repo](https://github.com/Azure-Samples/azure-samples-python-management/tree/main/samples/consumption)
15+
- Python 3.10+ is required to use this package.
16+
- [Azure subscription](https://azure.microsoft.com/free/)
1917

18+
### Install the package
2019

21-
# Provide Feedback
20+
```bash
21+
pip install azure-mgmt-consumption
22+
pip install azure-identity
23+
```
2224

23-
If you encounter any bugs or have suggestions, please file an issue in the
24-
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
25-
section of the project.
25+
### Authentication
26+
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
28+
29+
- `AZURE_CLIENT_ID` for Azure client ID.
30+
- `AZURE_TENANT_ID` for Azure tenant ID.
31+
- `AZURE_CLIENT_SECRET` for Azure client secret.
32+
33+
In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
34+
35+
With above configuration, client can be authenticated by following code:
36+
37+
```python
38+
from azure.identity import DefaultAzureCredential
39+
from azure.mgmt.consumption import ConsumptionManagementClient
40+
import os
2641

42+
sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
43+
client = ConsumptionManagementClient(credential=DefaultAzureCredential(), subscription_id=sub_id)
44+
```
2745

46+
## Examples
2847

48+
Code samples for this package can be found at:
49+
- [Search Consumption](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com
50+
- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
51+
52+
53+
## Troubleshooting
54+
55+
## Next steps
56+
57+
## Provide Feedback
58+
59+
If you encounter any bugs or have suggestions, please file an issue in the
60+
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
61+
section of the project.

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

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"apiVersion": "2024-08-01",
3+
"apiVersions": {
4+
"Microsoft.Consumption": "2024-08-01"
5+
},
6+
"commit": "833a2f8fe1b9c1df1cf4deb1981565b5acc79492",
7+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
8+
"typespec_src": "specification/consumption/resource-manager/Microsoft.Consumption/Consumption",
9+
"emitterVersion": "0.62.1"
10+
}

0 commit comments

Comments
 (0)