Giter VIP home page Giter VIP logo

aliyun_api_demo's Introduction

aliyun_api_demo

学习阿里云 API调用方法:

  1. cdn_py2.py/ecs_py2.py/slb_py2.py 三个脚本分别针对每个服务API调用API;
  2. ali_api_py2.py/ali_api_py3.py 两个脚本是对1中服务API的组合写法;
  3. pipeline-sdk-v1.py/pipeline-sdk-v2.py 使用阿里云API SDK完成获取一个ELB服务后端ECS IP;

注意:

  • 1/2 脚本使用前需将AK信息写入aliyun.ini文件, 或通过执行脚本config 命令写入;
  • 3脚本执行前需安装Aliyun SDK, 参考requirements.txt; ref: https://github.com/aliyun/aliyun-openapi-python-sdk
  • 更多的API调用Action及参数需要参考阿里云API文档;

用法示例:

cdn


# python cdn_py2.py Action=DescribeCdnDomainLogs DomainName=appcdn.example.com LogDay=2018-05-20 PageSize=1000
# python cdn_py2.py Action=DescribeCdnDomainLogs DomainName=appcdn.example.com StartTime='2018-04-01T00:00:00Z'  EndTime='2018-05-01T00:00:00Z' PageSize=1000
# python cdn_py2.py Action=DescribeCdnDomainLogs DomainName=appcdn.example.com StartTime='2018-04-01T00:00:00Z'  EndTime='2018-05-01T00:00:00Z' PageSize=500 PageNumber=2

slb


# python slb_py2.py  Action=DescribeRegions
# python slb_py2.py  Action=DescribeLoadBalancers RegionId=cn-qingdao
# python slb_py2.py  Action=DescribeLoadBalancerAttribute RegionId=cn-qingdao LoadBalancerId=15af5f10b61-cn-qingdao-cm5-a01

ecs


# python ecs_py2.py  Action=DescribeInstances RegionId=cn-qingdao

ali_api:


# python ali_api_py2.py Service=slb Action=DescribeRegions
# python3 ali_api_py3.py Service=slb Action=DescribeRegions
# python ali_api_py2.py Service=ecs Action=DescribeInstances RegionId=cn-qingdao
# python ali_api_py2.py Service=cdn Action=DescribeCdnDomainLogs DomainName=appcdn.example.com LogDay=2018-05-20 PageSize=1000

aliyun_api_demo's People

Contributors

mixlee avatar

Watchers

 avatar

Forkers

piano-wow

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.