Microsoft Azure Cost Management Client Library for Python
项目描述
Microsoft Azure SDK for Python
这是Microsoft Azure Cost Management Client Library。此包已在Python 3.7+上进行了测试。要查看Azure库的完整视图,请参阅azure sdk python release。
免责声明
Azure SDK Python包对Python 2.7的支持已于2022年1月1日结束。有关更多信息和建议,请参阅https://github.com/Azure/azure-sdk-for-python/issues/20691
入门
先决条件
- 使用此包需要Python 3.7+。
- Azure订阅
安装包
pip install azure-mgmt-costmanagement
pip install azure-identity
身份验证
默认情况下,Azure Active Directory令牌身份验证依赖于以下环境变量的正确配置。
AZURE_CLIENT_ID
用于 Azure 客户端 ID。AZURE_TENANT_ID
用于 Azure 租户 ID。AZURE_CLIENT_SECRET
用于 Azure 客户端密钥。
配置以上后,客户端可以通过以下代码进行身份验证
from azure.identity import DefaultAzureCredential
from azure.mgmt.costmanagement import CostManagementClient
client = CostManagementClient(credential=DefaultAzureCredential())
示例
该包的代码示例可在以下位置找到
故障排除
下一步
提供反馈
如果您遇到任何错误或有任何建议,请在项目的问题部分提交问题。
发布历史
4.0.1 (2023-07-19)
修复的 bug
- 修复了一些操作在出错时发生的反序列化错误
4.0.0 (2023-05-22)
新增功能
- 添加了操作组 BenefitRecommendationsOperations
- 添加了操作组 BenefitUtilizationSummariesOperations
- 添加了操作组 GenerateCostDetailsReportOperations
- 添加了操作组 GenerateDetailedCostReportOperationResultsOperations
- 添加了操作组 GenerateDetailedCostReportOperationStatusOperations
- 添加了操作组 GenerateDetailedCostReportOperations
- 添加了操作组 PriceSheetOperations
- 添加了操作组 ScheduledActionsOperations
- 模型 Alert 新增参数 e_tag
- 模型 AlertPropertiesDetails 新增参数 company_name
- 模型 AlertPropertiesDetails 新增参数 department_name
- 模型 AlertPropertiesDetails 新增参数 enrollment_end_date
- 模型 AlertPropertiesDetails 新增参数 enrollment_number
- 模型 AlertPropertiesDetails 新增参数 enrollment_start_date
- 模型 AlertPropertiesDetails 新增参数 invoicing_threshold
- 模型 CommonExportProperties 新增参数 next_run_time_estimate
- 模型 CommonExportProperties 新增参数 partition_data
- 模型 CommonExportProperties 新增参数 run_history
- 模型 Dimension 新增参数 e_tag
- 模型 Dimension 新增参数 location
- 模型 Dimension 新增参数 sku
- 模型 Export 新增参数 next_run_time_estimate
- 模型 Export 新增参数 partition_data
- 模型 Export 新增参数 run_history
- 模型 ExportDeliveryDestination 新增参数 sas_token
- 模型 ExportDeliveryDestination 新增参数 storage_account
- 模型 ExportProperties 新增参数 next_run_time_estimate
- 模型 ExportProperties 新增参数 partition_data
- 模型 ExportProperties 新增参数 run_history
- 模型 Operation 新增参数 action_type
- 模型 Operation 新增参数 is_data_action
- 模型 Operation 新增参数 origin
- 模型 OperationDisplay 新增参数 description
- 操作 ExportsOperations.get 新增可选参数 expand
- 操作 ExportsOperations.list 新增可选参数 expand
破坏性更改
- 模型 Alert 不再具有参数 tags
- 模型 ProxyResource 不再具有参数 e_tag
- 模型 ReportConfigFilter 不再具有参数 tag_key
- 模型 ReportConfigFilter 不再具有参数 tag_value
- 模型 Resource 不再具有参数 tags
- 已移除操作组 SettingsOperations
4.0.0b1 (2022-11-07)
新增功能
- 添加了操作组 BenefitRecommendationsOperations
- 添加了操作组 BenefitUtilizationSummariesOperations
- 添加了操作组 GenerateCostDetailsReportOperations
- 添加了操作组 GenerateDetailedCostReportOperationResultsOperations
- 添加了操作组 GenerateDetailedCostReportOperationStatusOperations
- 添加了操作组 GenerateDetailedCostReportOperations
- 添加了操作组 PriceSheetOperations
- 添加了操作组 ScheduledActionsOperations
- 模型 Alert 新增参数 e_tag
- 模型 AlertPropertiesDetails 新增参数 company_name
- 模型 AlertPropertiesDetails 新增参数 department_name
- 模型 AlertPropertiesDetails 新增参数 enrollment_end_date
- 模型 AlertPropertiesDetails 新增参数 enrollment_number
- 模型 AlertPropertiesDetails 新增参数 enrollment_start_date
- 模型 AlertPropertiesDetails 新增参数 invoicing_threshold
- 模型 CommonExportProperties 新增参数 next_run_time_estimate
- 模型 CommonExportProperties 新增参数 partition_data
- 模型 CommonExportProperties 新增参数 run_history
- 模型 Dimension 新增参数 e_tag
- 模型 Dimension 新增参数 location
- 模型 Dimension 新增参数 sku
- 模型 Export 新增参数 next_run_time_estimate
- 模型 Export 新增参数 partition_data
- 模型 Export 新增参数 run_history
- 模型 ExportDeliveryDestination 新增参数 sas_token
- 模型 ExportDeliveryDestination 新增参数 storage_account
- 模型 ExportProperties 新增参数 next_run_time_estimate
- 模型 ExportProperties 新增参数 partition_data
- 模型 ExportProperties 新增参数 run_history
- 模型 Operation 新增参数 action_type
- 模型 Operation 新增参数 is_data_action
- 模型 Operation 新增参数 origin
- 模型 OperationDisplay 新增参数 description
破坏性更改
- 模型 Alert 不再具有参数 tags
- 模型 ProxyResource 不再具有参数 e_tag
- 模型 ReportConfigFilter 不再具有参数 tag_key
- 模型 ReportConfigFilter 不再具有参数 tag_value
- 模型 Resource 不再具有参数 tags
- 操作 ExportsOperations.get 新增参数 expand
- 操作 ExportsOperations.list 新增参数 expand
- 已移除操作组 SettingsOperations
3.0.0 (2021-07-27)
破坏性更改
- 模型 QueryDefinition 的参数 dataset 现在是必需的
- 模型 ForecastDefinition 的参数 dataset 现在是必需的
2.0.0 (2021-06-08)
功能
- 模型 QueryResult 新增参数 sku
- 模型 QueryResult 新增参数 e_tag
- 模型 QueryResult 新增参数 location
- 模型 View 新增参数 date_range
- 模型 View 新增参数 data_set
- 模型 View 新增参数 include_monetary_commitment
- 模型 View 新增参数 currency
- 模型 ExportExecution 新增参数 tags
- 添加了操作组 GenerateReservationDetailsReportOperations
- 添加了操作组 SettingsOperations
破坏性更改
- 模型 ExportSchedule 的参数 recurrence 现在是必需的
- 操作 ExportsOperations.list 具有新的签名
- 操作 ExportsOperations.get 具有新的签名
- 模型 Export 不再具有参数 run_history
- 模型 Export 不再具有参数 next_run_time_estimate
- 模型 View 不再具有参数 dataset
- 模型 ExportExecution 不再具有参数 e_tag
- 模型 ExportExecution 不再具有参数 error
- 模型 CommonExportProperties 不再具有参数 run_history
- 模型 CommonExportProperties 不再具有参数 next_run_time_estimate
- 模型 ExportProperties 不再具有参数 run_history
- 模型 ExportProperties 不再具有参数 next_run_time_estimate
- 模型 QueryFilter 具有新的签名
- 模型 ReportConfigFilter 具有新的签名
1.0.0 (2021-02-04)
功能
- 模型 ExportExecution 具有新的参数 e_tag
破坏性更改
- 模型 ExportExecution 不再具有参数 tags
1.0.0b1 (2020-12-09)
这是beta预览版本。
本版本使用新一代代码生成器,引入了重要的不兼容更改,但也引入了重要的新功能(如统一身份验证和异步编程)。
一般不兼容更改
-
凭证系统已完全重新设计
azure.common.credentials
或msrestazure.azure_active_directory
实例不再受支持,请使用azure-identity
类:[https://pypi.ac.cn/project/azure-identity/](https://pypi.ac.cn/project/azure-identity/)credentials
参数已被重命名为credential
-
客户端上的
config
属性不再存在,配置应作为关键字参数传递。例如:MyClient(credential, subscription_id, enable_logging=True)
。有关完整选项集,请参阅azure-core 初始化文档中接受参数 -
不再可以导入
version
模块,请使用__version__
代替 -
之前返回
msrest.polling.LROPoller
的操作现在返回azure.core.polling.LROPoller
并以begin_
为前缀。 -
异常树已简化,并且大多数异常现在都是
azure.core.exceptions.HttpResponseError
(已删除CloudError
)。 -
大多数操作关键字参数已更改。以下是一些最明显的更改
raw
已删除。等效功能可以通过使用cls
找到,这是一个将提供对内部 HTTP 响应访问的回调,适用于高级用户- 有关完整选项集,请参阅azure-core 请求文档中接受参数
0.2.0 (2020-04-08)
功能
- 添加了操作 DimensionsOperations.list
- 添加了操作 QueryOperations.usage
破坏性更改
- 模型 QueryDataset 不再具有参数 sorting
- 删除了操作 DimensionsOperations.list_by_subscription
- 删除了操作 QueryOperations.usage_by_scope
一般不兼容更改
本版本使用新一代代码生成器,可能会引入不兼容更改。总之,一些模块被错误地可见或可导入,并已重命名。这解决了由使用最初不应使用的类引起的一些问题。
- 无法从
azure.mgmt.costmanagement.cost_management_client
导入 CostManagementClient(从azure.mgmt.costmanagement
导入的工作方式与之前相同) - 已将 CostManagementClientConfiguration 导入从
azure.mgmt.costmanagement.cost_management_client
移至azure.mgmt.costmanagement
- 无法使用
azure.mgmt.costmanagement.models.my_class
从 "models" 子模块导入模型MyClass
(从azure.mgmt.costmanagement.models
导入的方式与之前相同) - 来自
operations
子模块的操作类MyClassOperations
现在无法使用azure.mgmt.costmanagement.operations.my_class_operations
进行导入(从azure.mgmt.costmanagement.operations
导入仍然像以前一样工作)
最后但同样重要的是,HTTP 连接池现在默认启用。您应始终将客户端用作上下文管理器,或调用 close(),或每个进程使用不超过一个客户端。
0.1.0 (2019-05-04)
- 初始发布
项目详情
下载文件
下载您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。
源分布
构建分布
azure-mgmt-costmanagement-4.0.1.zip 的散列
算法 | 散列摘要 | |
---|---|---|
SHA256 | a95734102450b6f01aaa938d78c00285b90fc52b866caae17efb5521ae986db7 |
|
MD5 | b071380d3b9389baf99e5b9b12face40 |
|
BLAKE2b-256 | 450ffca8cc1228c4d8acb7462b8cb7fb2bd68d7fa7dec3b13f1aaf6f612a9e89 |
azure-mgmt-costmanagement-4.0.1-py3-none-any.whl 的散列
算法 | 散列摘要 | |
---|---|---|
SHA256 | 23e77373427555e880ce938d468f87c6a8d66a5b237d7b2b0270bb192d61586f |
|
MD5 | 45c43e3fd1ad26e551ddb2b66ecfd92e |
|
BLAKE2b-256 | 3effbafa7f1f205922d871616f19bd8d3b49020d61286015b87c13379b26a8e7 |