Azure EA (2) 使用Postman访问国内Azure Billing API

  《Windows Azure Platform 系列文章目录html

 

  本文介绍的是国内由世纪互联运维的Azure China运维

 

  请读者先看一下以前的文档内容:Azure EA (1) 查看国内Azure帐单,熟悉和掌握CSV文件的字段名和字段值post

 

  咱们知道,在使用EA Portal的时候,能够查看三种报表:url

  1.查看帐单使用量摘要spa

  2.查看帐单每个月报告3d

  3.查看帐单高级报告下载rest

 

  在开始使用Azure Billing API以前,咱们须要准备:orm

  1.拿到Azure EA的合同编号,以VS57开头htm

  (1)咱们登陆https://ea.azure.cn,查看合约编号。以下图:blog

  

  

  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

相关文章
相关标签/搜索