《Windows Azure Platform 系列文章目錄》
本文介紹的是國內由世紀互聯運維的Azure China
請讀者先看一下之前的文檔內容:Azure EA (1) 查看國內Azure賬單,熟悉和掌握CSV文件的字段名和字段值
我們知道,在使用EA Portal的時候,可以查看三種報表:
1.查看賬單使用量摘要
2.查看賬單每月報告
3.查看賬單高級報告下載
在開始使用Azure Billing API之前,我們需要准備:
1.拿到Azure EA的合同編號,以VS57開頭
(1)我們登錄https://ea.azure.cn,查看合約編號。如下圖:
2.拿到EA Billing API的API Key
點擊下圖的擴展秘鑰,把秘鑰保存到記事本上
請注意:上面的秘鑰有主密鑰和輔助秘鑰,兩個秘鑰都同時有效
我們在使用Postman訪問國內Azure Billing API,主要訪問的URL有:
一.查看賬單使用量摘要
1.REST API
Method | Download Request URI |
Get | https://ea.azure.cn/rest/{VSNumber}/usage-report?month={YYYY/MM/DD}&type=Summary |
舉例 | https://ea.azure.cn/rest/V570000000001/usage-report?month=2019/8/14&type=Summary |
2.Request Header
Request Header Key | Value |
Authorization | bearer {API Key} |
3.返回結果
二.查看賬單每月報告
1.REST API
方法 | Request URL |
Get | https://ea.azure.cn/rest/{VSNumber}/usage-reports |
舉例 | https://ea.azure.cn/rest/V570000000001/usage-reports |
2.Request Header
Request Header Key | Value |
Authorization | bearer {API Key} |
3.返回結果
我們想查看某個月的詳細信息,比如上圖紅色部分,想查看2018年6月份的信息
URL可以這樣拼起來:
https://ea.azure.cn/+上面的URL
比如說:https://ea.azure.cn/rest/V57000000001/usage-report?month=2018-06&type=detail&fmt=Csv
Request Header
Request Header Key | Value |
Authorization | bearer {API Key} |
返回結果:
三.查看賬單高級報告下載
目前還沒有看到相關的API