forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CodeGen from PR 22637 in Azure/azure-rest-api-specs
Merge c80b871abefc9725d7cccc14a0b2f56161629906 into 0b1805b3ce076549ba4e9285a4f0f8727caf53a5
- Loading branch information
SDKAuto
committed
Mar 2, 2023
1 parent
d33f020
commit 8a421d0
Showing
7 changed files
with
53 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"commit": "18e0a756cd948b08cec7d4264f2dbbbfa53246ac", | ||
"commit": "0fbb62af450af1d1bec07606db3b11d52c5b58ee", | ||
"repository_url": "https://github.com/Azure/azure-rest-api-specs", | ||
"autorest": "3.9.2", | ||
"use": [ | ||
"@autorest/[email protected]", | ||
"@autorest/[email protected]" | ||
], | ||
"autorest_command": "autorest specification/commerce/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False", | ||
"autorest_command": "autorest specification/commerce/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False", | ||
"readme": "specification/commerce/resource-manager/readme.md" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
sdk/commerce/azure-mgmt-commerce/generated_samples/get_usage_aggregates_list.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# 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. | ||
# -------------------------------------------------------------------------- | ||
|
||
import isodate | ||
|
||
from azure.identity import DefaultAzureCredential | ||
from azure.mgmt.commerce import UsageManagementClient | ||
|
||
""" | ||
# PREREQUISITES | ||
pip install azure-identity | ||
pip install azure-mgmt-commerce | ||
# USAGE | ||
python get_usage_aggregates_list.py | ||
Before run the sample, please set the values of the client ID, tenant ID and client secret | ||
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, | ||
AZURE_CLIENT_SECRET. For more info about how to get the value, please see: | ||
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal | ||
""" | ||
|
||
|
||
def main(): | ||
client = UsageManagementClient( | ||
credential=DefaultAzureCredential(), | ||
subscription_id="f68815e6-3c41-45ef-bbd8-5f83303c396b", | ||
) | ||
|
||
response = client.usage_aggregates.list( | ||
reported_start_time=isodate.parse_datetime("2014-05-01T00:00:00+00:00"), | ||
reported_end_time=isodate.parse_datetime("2015-06-01T00:00:00+00:00"), | ||
) | ||
for item in response: | ||
print(item) | ||
|
||
|
||
# x-ms-original-file: specification/commerce/resource-manager/Microsoft.Commerce/preview/2015-06-01-preview/examples/GetUsageAggregatesList.json | ||
if __name__ == "__main__": | ||
main() |