sdk for aliyun
Project description
aliyun_sdk
因为使用阿里云官方的 sdk 需要调用太多的包,而且写法上比较繁琐,故自己开发了一个比较简单的 sdk。
安装方式
pip install zy-aliyun-python-sdk
目前支持的产品
已适配的阿里云产品及 API 接口详情
功能介绍
- 支持主流的阿里云产品。
- 加入
请求超时自动重新请求,上限 3 次。
产品限制:
- 该接口仅适用于
少次、不频繁、低速,其他限制及详细说明,请参考阿里云官方文档 - 具体传参请参考官方文档。
- 若需要添加或更新调用的 API 接口信息,请查看
aliyun_sdk/common.py文件,修改或添加PRODUCT_API_CONFIG_MAP中的字段。
API 接口详情如下:
| 产品名称 | 简称 | API 版本 | 请求地址 | 端口 | 协议 | 添加日期 |
|---|---|---|---|---|---|---|
| 云服务器 | ecs | 2014-05-26 | ecs.aliyuncs.com | 443 | https | 2019-04-17 |
| 阿里云关系型数据库 | rds | 2014-08-15 | rds.aliyuncs.com | 443 | https | 2019-04-17 |
| 分布式关系型数据库 | drds | 2015-04-13 | drds.aliyuncs.com | 443 | https | 2019-04-17 |
| 负载均衡 | slb | 2014-05-15 | slb.aliyuncs.com | 443 | https | 2019-04-17 |
| 弹性伸缩 | ess | 2014-08-28 | ess.aliyuncs.com | 443 | https | 2019-04-17 |
| 媒体处理 | mts | 2014-06-18 | mts.aliyuncs.com | 443 | https | 2019-04-17 |
| 阿里云云盾 | yundun | 2014-09-24 | yundun.aliyuncs.com | 443 | https | 2019-04-17 |
| CDN | cdn | 2018-05-10 | cdn.aliyuncs.com | 443 | https | 2019-04-17 |
| 访问控制 RAM | ram | 2015-05-01 | ram.aliyuncs.com | 443 | https | 2019-04-17 |
| 安全令牌 STS | sts | 2015-04-01 | sts.aliyuncs.com | 443 | https | 2019-04-17 |
| 短信服务 | dysms | 2017-05-25 | dysmsapi.aliyuncs.com | 443 | https | 2019-04-17 |
| 语音服务 | dyvms | 2017-05-25 | dyvmsapi.aliyuncs.com | 443 | https | 2019-04-17 |
| 消息接收1 | dybase | 2017-05-25 | dybaseapi.aliyuncs.com | 443 | https | 2019-04-17 |
| 云数据库Redis版 | redis | 2015-01-01 | r-kvstore.aliyuncs.com | 443 | https | 2019-04-17 |
| 云数据库 MongoDB 版 | mongodb | 2015-12-01 | mongodb.aliyuncs.com | 443 | https | 2019-04-17 |
| 数据传输服务DTS | dts | 2016-08-01 | dts.aliyuncs.com | 443 | https | 2019-04-17 |
| VPC | vpc | 2016-04-28 | vpc.aliyuncs.com | 443 | https | 2019-04-17 |
| 云监控 | cms | 2019-01-01 | metrics.aliyuncs.com | 443 | https | 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zy-aliyun-python-sdk-0.0.8.tar.gz.
File metadata
- Download URL: zy-aliyun-python-sdk-0.0.8.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69ccbcebf714fb387186833fcdf786b16c9acc10969b60f5a6344d54ca37b51d
|
|
| MD5 |
314e4cef835374b0705a0e432808a5af
|
|
| BLAKE2b-256 |
9075b35fb15401f511a903c1b1cb330e72147e9b22fde567cb4d97c00cde14e9
|
File details
Details for the file zy_aliyun_python_sdk-0.0.8-py3-none-any.whl.
File metadata
- Download URL: zy_aliyun_python_sdk-0.0.8-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfb9b9002fa681fb9f048768b7e5951af04b82700fb84922d1ff210f49385016
|
|
| MD5 |
983580f095050c40e3d694b074ab1320
|
|
| BLAKE2b-256 |
35182e9b9d63ae54dee0142de8f45816ba87c43486dac1f99bcdcdf6396ade56
|