Update README.md

This commit is contained in:
Zhong Lufan 2020-01-10 12:42:08 +08:00
parent 9e821cc3cc
commit c6ae46f33c
No known key found for this signature in database
GPG Key ID: 30191289A9BD0B15
1 changed files with 6 additions and 6 deletions

View File

@ -2,7 +2,7 @@
## 介绍
这是一个非官方的阿里云 OpenAPI Shell SDK为了方便 Shell 脚本调用阿里云 OpenAPISDK 主要实现了自动计算请求签名。
这是一个非官方的阿里云 OpenAPI Shell SDK方便 Shell 脚本调用阿里云 OpenAPISDK 主要实现了自动计算请求签名。
虽然阿里云官方有 [AliyunCLI](https://github.com/aliyun/aliyun-cli),可以在 Shell 环境下使用阿里云 OpenAPI不过某些 API (比如 SSL 证书) 它并不支持,或者说还没来得及支持,所以我就想写一个可能是最好用的阿里云 Shell SDK。
@ -15,9 +15,9 @@
## 使用
1. 导出 `AliAccessKeyId``AliAccessKeySecret` 环境变量
1. 导出环境变量 `AliAccessKeyId``AliAccessKeySecret`
2. 导入 `AliyunOpenApiSDK.sh`
3. 调用 `aliapi_rpi` 函数
3. 调用 `aliapi_rpc` 函数
函数签名:`aliapi_rpc(host, http_method, api_version, api_action, api_custom_key[], api_custom_value[]): JsonResult | ErrorCode`
@ -51,8 +51,8 @@ api_custom_value=(
)
# 获取 SSL 证书列表https://help.aliyun.com/document_detail/126511.html
aliapi_rpc "cas.aliyuncs.com" "GET" "2018-07-13" "DescribeUserCertificateList" "${api_custom_key[*]}" "${api_custom_value[*]}"
# 可以通过 $? 是否等于 0 判断是否执行成功HTTP CODE == 200
# 执行成功返回 JSON 格式的结果,执行失败返回 HTTP CODE 或 curl 的退出代码。
# $? (返回代码) 等于 0 (HTTP 状态码 == 200) 代表执行成功
# 执行成功返回 JSON 数据,执行失败返回 HTTP 状态码或 curl 的错误代码。
if [[ $? -eq 0 ]]; then
# 执行成功
else
@ -65,4 +65,4 @@ fi
如果你有好的示例,欢迎提交 [PR](https://github.com/Hill-98/aliyun-openapi-shell-sdk/pulls)
如果你有问题 / BUG 要反馈,也欢迎提交 [Issue](https://github.com/Hill-98/aliyun-openapi-shell-sdk/issues)
如果你有建议 / BUG 要反馈,也欢迎提交 [Issue](https://github.com/Hill-98/aliyun-openapi-shell-sdk/issues)