Skip to main content

sdk for aliyun

Project description

aliyun_sdk

License: MIT

因为使用阿里云官方的 sdk 需要调用太多的包,而且写法上比较繁琐,故自己开发了一个比较简单的 sdk。

安装方式

pip install zy-aliyun-python-sdk

目前支持的产品

已适配的阿里云产品及 API 接口详情

功能介绍

  1. 支持主流的阿里云产品。
  2. 加入 请求超时 自动重新请求,上限 3 次。

产品限制:

  • 该接口仅适用于少次不频繁低速,其他限制及详细说明,请参考阿里云官方文档
  • 具体传参请参考官方文档。
  • 若需要添加或更新调用的 API 接口信息,请查看aliyun_sdk/common.py 文件,修改或添加PRODUCT_API_CONFIG_MAP中的字段。

API 接口详情如下:

产品名称 简称 API 版本 请求地址 端口 协议 添加日期
云服务器 ecs 2014-05-26 ecs.aliyuncs.com 80 http 2019-04-17
阿里云关系型数据库 rds 2014-08-15 rds.aliyuncs.com 80 http 2019-04-17
分布式关系型数据库 drds 2015-04-13 drds.aliyuncs.com 80 http 2019-04-17
负载均衡 slb 2014-05-15 slb.aliyuncs.com 80 http 2019-04-17
弹性伸缩 ess 2014-08-28 ess.aliyuncs.com 80 http 2019-04-17
媒体处理 mts 2014-06-18 mts.aliyuncs.com 80 http 2019-04-17
阿里云云盾 yundun 2014-09-24 yundun.aliyuncs.com 80 http 2019-04-17
CDN cdn 2018-05-10 cdn.aliyuncs.com 80 http 2019-04-17
访问控制 RAM ram 2015-05-01 ram.aliyuncs.com 443 https 2019-04-17
安全令牌 STS sts 2015-04-01 sts.aliyuncs.com 80 http 2019-04-17
短信服务 dysms 2017-05-25 dysmsapi.aliyuncs.com 80 http 2019-04-17
语音服务 dyvms 2017-05-25 dyvmsapi.aliyuncs.com 80 http 2019-04-17
消息接收1 dybase 2017-05-25 dybaseapi.aliyuncs.com 80 http 2019-04-17
云数据库Redis版 redis 2015-01-01 r-kvstore.aliyuncs.com 80 http 2019-04-17
云数据库 MongoDB 版 mongodb 2015-12-01 mongodb.aliyuncs.com 80 http 2019-04-17
数据传输服务DTS dts 2016-08-01 dts.aliyuncs.com 80 http 2019-04-17
VPC vpc 2016-04-28 vpc.aliyuncs.com 80 http 2019-04-17
云监控 cms 2019-01-01 metrics.aliyuncs.com 80 http 2019-07-12
Web 应用防火墙 waf 2018-01-17 wafopenapi.cn-hangzhou.aliyuncs.com 443 https 2019-04-17
域名 domain 2018-01-29 domain.aliyuncs.com 443 https 2019-04-17
交易与账单管理 business 2017-12-14 business.aliyuncs.com 443 https 2019-04-17
ddos 防护 ddospro 2017-07-25 ddospro.cn-hangzhou.aliyuncs.com 443 https 2019-04-17

example

# 非 oss 产品
from aliyun_sdk import client
ak = {
    "AccessKeyId":"example",
    "AccessKeySecret": "example"
}
aliyun_client = client.AliyunClient(ak)
status_code, response = aliyun_client.common('ecs', Action='DescribeRegions')

# response ==> (status_code, result)
print(status_code, response)

# example result
# (404, {'Recommend': 'https://error-center.aliyun.com/status/search?Keyword=InvalidAccessKeyId.NotFound&source=PopGw', 'Message': 'Specified access key is not found.', 'RequestId': 'AEA6AEB8-6F44-445B-Bd0E-9E5F706B5665', 'HostId': 'ecs.aliyuncs.com', 'Code': 'InvalidAccessKeyId.NotFound'})

# oss 产品
status_code, oss_response = aliyun_client.oss('GET', **{"max-keys": 1000})
print(status_code, oss_response)
status_code, oss_response = aliyun_client.oss('GET', BucketName='cxp-test', Query={'acl': None})
print(status_code, oss_response)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zy-aliyun-python-sdk-0.0.5.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zy_aliyun_python_sdk-0.0.5-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file zy-aliyun-python-sdk-0.0.5.tar.gz.

File metadata

  • Download URL: zy-aliyun-python-sdk-0.0.5.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

File hashes

Hashes for zy-aliyun-python-sdk-0.0.5.tar.gz
Algorithm Hash digest
SHA256 65696cb9dbbe939aa0cc47800d6e1140aa3e1b4b0a906d789df17939c3f4d7dc
MD5 f4927be473b9e9aa7e8e5fd1cfe1d018
BLAKE2b-256 15a20a588049fcdcde319af742559e9c45125a0ff03fd178b11254218290cebb

See more details on using hashes here.

File details

Details for the file zy_aliyun_python_sdk-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: zy_aliyun_python_sdk-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

File hashes

Hashes for zy_aliyun_python_sdk-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 44a31f31a189cb8757b25c7b4f54f88488ba64196051909fc48d1f13782b528f
MD5 3ebc9aadbc353ef0b188a0f0a62c25e2
BLAKE2b-256 5092a6bede22b87dff2969aa89f309e05dba723b15ad267433b8794b9c495151

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page