0

我试图只过滤那些符合给定日期标准的对象。但我不能这样做!

consumption = ConsumptionManagementClient(credentials, subscription_id, base_url=None)
for obj in list(consumption.usage_details.list(filter=date_filter))
print(obj.usage_start)

我努力了:

date_filter = 'usage_start ge 2019-02-11T23:59:59Z'  
date_filter = 'properties/usage_start ge 2019-02-11T23:59:59Z'       
date_filter = 'usageStart ge 2019-02-11T23:59:59Z'    
date_filter = 'properties/usageStart ge 2019-02-11T23:59:59Z'    
date_filter = 'properties/UsageStart ge 2019-02-11T23:59:59Z'    
date_filter = 'UsageStart ge 2019-02-11'    
date_filter = 'usage_start ge 2019-02-11'    
date_filter = 'properties/usage_start ge 2019-02-11'    
date_filter = 'usageStart ge 2019-02-11'   
date_filter = 'properties/usageStart ge 2019-02-11'    
date_filter = 'properties/UsageStart ge 2019-02-11'    
date_filter = 'UsageStart ge 2019-02-11' 
4

1 回答 1

0

我在github中找到了 usage_details.list() 的测试方法。您可以按照那篇文章尝试一下。

日期定义:

在此处输入图像描述

然后像这样应用过滤器:date_filter ='usageEnd le '+ str(endDate)

在此处输入图像描述

希望能帮助到你。

于 2019-02-14T05:22:40.093 回答