This project has been archived by its maintainers, and is no longer receiving any updates.
Aliyun API Python
一个简单的阿里云API Python封装库
使用API封装库
import aliyun_api_py
# 创建API请求
request = aliyun_api_py.Api(access_key_id, access_key_secret, http_method, host, uri, x_acs_action, x_acs_version,algorithm)
request.param["your-param"] = "sth"
request.body["your-body"] = "sth"
try:
print(request.exec())
except ConnectionError as e:
print(e)
access_key_id:阿里云AccessKey ID
access_key_secret:阿里云AccessKey Secret
http_method:http请求方式,例如POST
host:服务地址,详见服务区域列表
uri:资源路径
x_acs_action:API名称
x_acs_version:API版本
algorithm:签名算法,默认为ACS3-HMAC-SHA256,一般情况下无需更改
更多参数信息详见请求结构和签名机制
返回格式
当请求正确发出时,返回格式如下:
{
"status_code": "状态码",
"headers": "响应头",
"body": "返回的内容,参见对应API文档"
}
若请求出错(不包括HTTPError),则会抛出异常
使用SDK
目前SDK随缘更新,碰到自己需要的API可能会随手写个SDK方便调用
API相关信息详见阿里云API文档
import aliyun_api_py
# 调用请求函数(以重启ECS为例)
request = aliyun_api_py.Ecs(access_key_id, access_key_secret, host)
print(request.reboot_instance(instance_id, force_stop, dry_run))
ECS
ecs.reboot_instance(instance_id, force_stop, dry_run):重启ECS实例
Metadata
Release files for aliyun-api-py 1.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aliyun_api_py-1.1.5.tar.gz | 4.6 kB | Without provenance | Details for aliyun_api_py-1.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aliyun_api_py-1.1.5-py3-none-any.whl | Python 3 | none | any | Details for aliyun_api_py-1.1.5-py3-none-any.whl |
Total release size: 9.6 kB
Release files / aliyun_api_py-1.1.5.tar.gz
| Download URL | aliyun_api_py-1.1.5.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4b71b4a59da0fbf4582a9a7bb3bb9954eaaaa5c151de97e9f05685e621e5002f
|
|
BLAKE2b-256 checksum How to use checksums |
cfe6bb05e2adc5bca8ac79ade83f8a06214c78930de806103f4e7abea4163ea1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.19
|
Release files / aliyun_api_py-1.1.5-py3-none-any.whl
| Download URL | aliyun_api_py-1.1.5-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
af99408c1d5d91dc390adb2243d05ceb8633fe87012666b96a231b84a60848cc
|
|
BLAKE2b-256 checksum How to use checksums |
369292c3bd64adf8e869d91f1ace33e6edab40343d38688cc5009d76c5ff30ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.19
|
Security for aliyun-api-py 1.1.5
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.