Skip to main content

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 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)

Metadata

Release files for zy-aliyun-python-sdk 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zy-aliyun-python-sdk 0.1.6
File Size Uploaded Provenance Actions
zy-aliyun-python-sdk-0.1.6.tar.gz 7.0 kB Without provenance Details for zy-aliyun-python-sdk-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for zy-aliyun-python-sdk 0.1.6
File Interpreter ABI Platform Actions
zy_aliyun_python_sdk-0.1.6-py3-none-any.whl Python 3 none any Details for zy_aliyun_python_sdk-0.1.6-py3-none-any.whl

Total release size: 16.1 kB

Release files / zy-aliyun-python-sdk-0.1.6.tar.gz

Download URL zy-aliyun-python-sdk-0.1.6.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c40b332b5e09d077655bb76efdc990c03c0268fe447e48c52696a77c5062ae33
BLAKE2b-256 checksum
How to use checksums
3f98addb8944100205c3f98fc92f4ab098e35bf4d6e3d729989ac4b39decf35e
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / zy_aliyun_python_sdk-0.1.6-py3-none-any.whl

Download URL zy_aliyun_python_sdk-0.1.6-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86f8ef9e8cfecb8eb64e1ee5b462c07f78c26ebcdc50f1b56d7a33d3bad134b6
BLAKE2b-256 checksum
How to use checksums
df78cca41cb4f075e878c81a6af25c366731d4018f33d7c99d92e2943baf087b
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for zy-aliyun-python-sdk 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page