소스 검색

视频图片附件id验证迁移到qfw

weixianghui 5 년 전
부모
커밋
62da709209
100개의 변경된 파일11221개의 추가작업 그리고 0개의 파일을 삭제
  1. 29 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/.appveyor.yml
  2. 24 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/.github/ISSUE_TEMPLATE/Bug_Report.md
  3. 23 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/.github/ISSUE_TEMPLATE/Bug_Report_zh.md
  4. 27 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/.travis.yml
  5. 15 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/CONTRIBUTING.md
  6. 3969 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/ChangeLog.txt
  7. 95 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/Gopkg.lock
  8. 50 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/Gopkg.toml
  9. 201 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/LICENSE
  10. 9 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/Makefile
  11. 142 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/README-CN.md
  12. 145 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/README.md
  13. 2 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/doc.go
  14. 11 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/0-Requirements-CN.md
  15. 11 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/0-Requirements-EN.md
  16. 24 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/1-Installation-CN.md
  17. 25 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/1-Installation-EN.md
  18. 24 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/10-Package-Management-CN.md
  19. 25 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/10-Package-Management-EN.md
  20. 116 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/2-Client-CN.md
  21. 120 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/2-Client-EN.md
  22. 32 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/3-Verify-CN.md
  23. 32 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/3-Verify-EN.md
  24. 31 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/4-Proxy-CN.md
  25. 31 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/4-Proxy-EN.md
  26. 35 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/5-Timeout-CN.md
  27. 35 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/5-Timeout-EN.md
  28. 8 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/6-Debug-CN.md
  29. 8 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/6-Debug-EN.md
  30. 56 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/7-Logger-CN.md
  31. 57 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/7-Logger-EN.md
  32. 29 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/8-Concurrent-CN.md
  33. 29 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/8-Concurrent-EN.md
  34. 30 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/9-Asynchronous-CN.md
  35. 30 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/9-Asynchronous-EN.md
  36. 15 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/go.mod
  37. 33 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/go.sum
  38. 272 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/integration/api_test.go
  39. 206 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/integration/base.go
  40. 347 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/integration/core_test.go
  41. 100 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/integration/cr_test.go
  42. 156 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/integration/credential_test.go
  43. BIN
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/integration/encyptfile
  44. 93 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/integration/error_test.go
  45. 249 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/api_timeout.go
  46. 22 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/api_timeout_test.go
  47. 18 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credential.go
  48. 1 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credential_test.go
  49. 34 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/access_key_credential.go
  50. 19 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/access_key_credential_test.go
  51. 12 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/bearer_token_credential.go
  52. 12 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/bearer_token_credential_test.go
  53. 29 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/ecs_ram_role.go
  54. 16 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/ecs_ram_role_test.go
  55. 30 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/env.go
  56. 30 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/env_test.go
  57. 92 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/instance_credentials.go
  58. 136 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/instance_credentials_test.go
  59. 159 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/profile_credentials.go
  60. 236 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/profile_credentials_test.go
  61. 19 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider.go
  62. 34 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider_chain.go
  63. 37 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider_chain_test.go
  64. 34 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/providers/chain.go
  65. 122 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/providers/chain_test.go
  66. 62 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/providers/configuration.go
  67. 165 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/providers/configuration_test.go
  68. 2 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/providers/doc.go
  69. 65 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/providers/env.go
  70. 215 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/providers/env_test.go
  71. 106 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/providers/instance_metadata.go
  72. 245 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/providers/instance_metadata_test.go
  73. 15 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/rsa_key_pair_credential.go
  74. 14 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/rsa_key_pair_credential_test.go
  75. 15 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_credential.go
  76. 14 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_credential_test.go
  77. 61 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_role_arn_credential.go
  78. 35 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_role_arn_credential_test.go
  79. 138 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/roa_signature_composer.go
  80. 94 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/roa_signature_composer_test.go
  81. 94 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/rpc_signature_composer.go
  82. 76 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/rpc_signature_composer_test.go
  83. 98 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signer.go
  84. 113 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signer_test.go
  85. 57 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/algorithms.go
  86. 56 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/algorithms_test.go
  87. 54 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/credential_updater.go
  88. 80 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/credential_updater_test.go
  89. 7 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/session_credential.go
  90. 54 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_access_key.go
  91. 22 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_access_key_test.go
  92. 35 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_bearer_token.go
  93. 31 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_bearer_token_test.go
  94. 167 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ecs_ram_role.go
  95. 183 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ecs_ram_role_test.go
  96. 148 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_key_pair.go
  97. 174 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_key_pair_test.go
  98. 175 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ram_role_arn.go
  99. 204 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ram_role_arn_test.go
  100. 54 0
      common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_sts_token.go

+ 29 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/.appveyor.yml

@@ -0,0 +1,29 @@
+
+    
+build: off
+
+clone_folder: c:\gopath\src\github.com\aliyun\alibaba-cloud-sdk-go
+
+environment:
+  GOPATH: c:\gopath
+  matrix:
+    - go: 1.10.x
+    - go: 1.11.x
+    - go: 1.12.x
+
+platform:
+  - x64
+
+install:
+  - set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
+
+test_script:
+  - go vet ./sdk
+  - go vet ./services/...
+  - go build ./sdk
+  - go build ./services/...
+  - go test -race -coverprofile=coverage.txt -covermode=atomic ./sdk/...
+  - IF DEFINED ACCESS_KEY_ID (go test -v -timeout 120s ./integration/...)
+
+after_test:
+  - bash <(curl -s https://codecov.io/bash)

+ 24 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/.github/ISSUE_TEMPLATE/Bug_Report.md

@@ -0,0 +1,24 @@
+---
+name: "Bug Report"
+about: Create a report to help us improve
+---
+
+<!--
+Thank you for reporting a possible bug in Alibaba Cloud GO SDK
+Please fill in as much of the template below as you can.
+
+Product and API: the product and API you are working on when bug occurs
+Platform: output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows)
+How to Reproduce: If possible, please provide code that demonstrates the problem,
+keeping it as simple and free of external dependencies as you can.
+
+If crash, please provide the stack trace.
+
+If build error, please provide compiler information: compiler and version, etc
+-->
+
+* **Product and API**:
+* **Platform**:
+* **How to Reproduce**
+
+<!-- Please provide more details below this comment. -->

+ 23 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/.github/ISSUE_TEMPLATE/Bug_Report_zh.md

@@ -0,0 +1,23 @@
+---
+name: "缺陷问题反馈"
+about: 提交缺陷问题反馈
+
+---
+
+<!--
+感谢提交问题反馈。
+请提供尽量全面的信息协助问题定位修复。
+
+产品和接口:问题发生时工作所在的产品和调用的API
+最小代码: 如果可能,请提供一份最小问题复现代码
+平台:操作系统信息,类型,版本
+
+如果崩溃,请提供错误栈。
+如果编译出错,请提供 cmake 版本,编译器版本,编译命令等信息。
+-->
+
+* **产品和接口**:
+* **平台**:
+* **最小代码**:
+
+<!-- 请提供其他可能协助问题定位的信息 -->

+ 27 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/.travis.yml

@@ -0,0 +1,27 @@
+language: go
+
+go:
+  - 1.10.x
+  - 1.11.x
+  - 1.12.x
+
+branches: # build only on these branches
+  only:
+    - master
+
+notifications:
+    webhooks: https://oapi.dingtalk.com/robot/send?access_token=096ed387df243a6d60835aadeccc47165f3813bc7cb81cdd0cfeadfd28e3acc1
+    email: false
+    on_success: change
+    on_failure: always
+
+script:
+  - go vet ./sdk
+  - go vet ./services/...
+  - go build ./sdk
+  - go build ./services/...
+  - go test -race -coverprofile=coverage.txt -covermode=atomic ./sdk/...
+  - test -z $ACCESS_KEY_ID -a -z $ACCESS_KEY_SECRET || go test -v -timeout 120s ./integration/...
+
+after_success:
+  - bash <(curl -s https://codecov.io/bash)

+ 15 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/CONTRIBUTING.md

@@ -0,0 +1,15 @@
+# Contributing to the Alibaba Cloud SDK for Go
+
+We work hard to provide a high-quality and useful SDK for Alibaba Cloud, and we greatly value feedback and contributions from our community. Please submit your [issues][issues] or [pull requests][pull-requests] through GitHub.
+
+## Tips
+
+- The SDK is released under the [Apache license][license]. Any code you submit will be released under that license. For substantial contributions, we may ask you to sign a [Alibaba Documentation Corporate Contributor License Agreement (CLA)][cla].
+- We maintain a high percentage of code coverage in our unit tests. If you make changes to the code, please add, update, and/or remove tests as appropriate.
+- If your code does not conform to the standards, does not include adequate tests, we may ask you to update your pull requests before we accept them. We also reserve the right to deny any pull requests that do not align with our standards or goals.
+
+
+[issues]: https://github.com/aliyun/alibaba-cloud-sdk-go/issues
+[pull-requests]: https://github.com/aliyun/alibaba-cloud-sdk-go/pulls
+[license]: http://www.apache.org/licenses/LICENSE-2.0
+[cla]: https://alibaba-cla-2018.oss-cn-beijing.aliyuncs.com/Alibaba_Documentation_Open_Source_Corporate_CLA.pdf

+ 3969 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/ChangeLog.txt

@@ -0,0 +1,3969 @@
+2020-04-30 Version: v1.61.170
+- Generated 2019-10-23 for `Sls`.
+- App intefaces.
+
+2020-04-30 Version: v1.61.169
+- Generated 2018-06-13 for `Sls`.
+- App intefaces.
+
+2020-04-30 Version: v1.61.168
+- Generated 2019-08-08 for `ARMS`.
+- Add prometheus ListDashboards api.
+
+2020-04-29 Version: v1.61.167
+- Generated 2019-08-08 for `ARMS`.
+- Add prometheus ListDashboards api.
+
+2020-04-29 Version: v1.61.166
+- Generated 2019-08-08 for `ARMS`.
+- Build 20190808 release sdk.
+
+2020-04-29 Version: v1.61.165
+- Generated 2017-09-06 for `imm`.
+- Supported VideoProduce.
+
+2020-04-29 Version: v1.61.164
+- Generated 2017-09-06 for `imm`.
+- Supported VideoProduce.
+
+2020-04-29 Version: v1.61.163
+- Generated 2019-09-10 for `waf-openapi`.
+
+
+2020-04-29 Version: v1.61.162
+- Generated 2019-06-01 for `oos`.
+- Add ListTemplateVersions API.
+- GenerateExecutionPolicy supports TemplateVersion.
+- CreateTemplate and UpdateTemplate support VersionName.
+
+
+2020-04-29 Version: v1.61.161
+- Generated 2020-04-20 for `OnsMqtt`.
+- Support groupId operations.
+
+2020-04-29 Version: v1.61.160
+- Generated 2014-11-11, 2018-05-10 for `Cdn`.
+- Add ExportTas apis.
+
+2020-04-29 Version: v1.61.159
+- Generated 2018-10-12 for `alimt`.
+- Support Document Translation.
+- Support Lanuage Detection.
+
+2020-04-29 Version: v1.61.158
+- Generated 2018-01-15 for `dcdn`.
+- Sync cdn APIs.
+
+2020-04-29 Version: v1.61.157
+- Generated 2019-09-10 for `waf-openapi`.
+
+
+2020-04-29 Version: v1.61.156
+- Generated 2017-11-15 for `scdn`.
+- Add Scdn APIS.
+- Sync cdn APIS.
+
+2020-04-28 Version: v1.61.155
+- Generated 2019-03-07 for `Cloudauth`.
+- Add CompareFaceVerify API.
+
+2020-04-28 Version: v1.61.154
+- Generated 2019-03-15 for `fnf`.
+
+
+2020-04-28 Version: v1.61.153
+- Generated 2019-09-10 for `waf-openapi`.
+
+
+2020-04-27 Version: v1.61.152
+- Generated 2017-09-06 for `imm`.
+- Support watermark.
+
+2020-04-27 Version: v1.61.151
+- Generated 2019-01-01 for `HBase`.
+- Describe describeAvailableResource.
+
+2020-04-27 Version: v1.61.150
+- Generated 2019-03-07 for `Cloudauth`.
+- ContrastFaceVerify Return SubCode.
+
+2020-04-27 Version: v1.61.149
+- Generated 2019-10-10 for `LRG`.
+- New api.
+
+2020-04-27 Version: v1.61.148
+- Generated 2019-08-08 for `ARMS`.
+- Build 20190808 release sdk.
+
+2020-04-27 Version: v1.61.147
+- Generated 2019-08-08 for `ARMS`.
+- Build 20190808 release sdk.
+
+2020-04-27 Version: v1.61.146
+- Generated 2019-01-01 for `Cassandra`.
+
+
+2020-04-27 Version: v1.61.145
+- Generated 2020-03-31 for `ResourceManager`.
+- The first open version.
+
+2020-04-26 Version: v1.61.144
+- Generated 2019-10-23 for `Sls`.
+- App intefaces.
+
+2020-04-26 Version: v1.61.143
+- Generated 2020-03-26 for `Workorder`.
+- New api publish.
+
+2020-04-25 Version: v1.61.142
+- Generated 2015-01-01 for `R-kvstore`.
+- Generated 2015-01-01 for `R-kvstore`.
+- Add RestoreTime for CreateInstance API.
+
+2020-04-24 Version: v1.61.141
+- Generated 2019-08-10 for `multimediaai`.
+- Template update.
+
+2020-04-24 Version: v1.61.140
+- Generated 2019-11-22 for `ledgerdb`.
+- Publish apis for ledger instances.
+- Publish apis for members.
+- Publish apis for time anchors.
+- Publish apis for endpoints.
+
+2020-04-24 Version: v1.61.139
+- Generated 2019-11-22 for `ledgerdb`.
+- Publish apis for ledger instances.
+- Publish apis for members.
+- Publish apis for time anchors.
+- Publish apis for endpoints.
+
+2020-04-23 Version: v1.61.138
+- Generated 2018-11-01 for `dms-enterprise`.
+- GetUser API return user execute query count information.
+
+2020-04-23 Version: v1.61.137
+- Generated 2016-08-01 for `Push`.
+- Fixed bugs for MassPush API.
+
+2020-04-23 Version: v1.61.136
+- Generated 2020-01-01 for `geoip`.
+- Add location info.
+
+2020-04-23 Version: v1.61.135
+- Generated 2020-04-20 for `OnsMqtt`.
+- Support groupId operations.
+
+2020-04-22 Version: v1.61.134
+- Generated 2018-11-01 for `dms-enterprise`.
+
+
+2020-04-22 Version: v1.61.133
+- Generated 2019-01-01 for `Cassandra`.
+
+
+2020-04-22 Version: v1.61.132
+- Generated 2019-01-01 for `Cassandra`.
+
+
+2020-04-21 Version: v1.61.131
+- Generated 2020-02-25 for `videosearch`.
+- VideoSearch deploy SDK.
+
+2020-04-21 Version: v1.61.130
+- Generated 2015-01-09 for `Alidns`.
+- Supported API for DescribeTags.
+- Supported API for ListTagResources.
+- Supported API for TagResources.
+- Supported API for UntagResources.
+
+2020-04-21 Version: v1.61.129
+- Generated 2019-06-25 for `ivpd`.
+- Supported PackageDesign Apis.
+- Supported Api ListPackageDesignModelTypes.
+- Supported Api PreviewModelForPackageDesign.
+- Supported Api RenderImageForPackageDesign.
+- Supported Api GetRenderResult.
+
+2020-04-21 Version: v1.61.128
+- Generated 2017-11-18 for `CSB`.
+- Add Statistics API.
+
+2020-04-20 Version: v1.61.127
+- Generated 2014-06-18 for `Mts`.
+- Add TemplateId.
+
+2020-04-20 Version: v1.61.126
+- Generated 2019-03-07 for `Cloudauth`.
+- Fix FaceContrastPicture.
+
+2020-04-20 Version: v1.61.125
+- Generated 2017-06-13 for `elasticsearch`.
+- Add kibana network white Ips.
+
+2020-04-19 Version: v1.61.124
+- Generated 2019-08-10 for `multimediaai`.
+- Multimedia poc modified.
+
+2020-04-17 Version: v1.61.123
+- Generated 2014-05-26 for `Ecs`.
+- DescribeInstanceTypes support TotalEniQueueQuantity.
+
+2020-04-16 Version: v1.61.122
+- Generated 2014-06-18 for `Mts`.
+- Modify `SubmitSmarttagJob`.
+
+2020-04-16 Version: v1.61.121
+- Generated 2017-06-13 for `elasticsearch`.
+- Add ModifyWhiteIps.
+
+2020-04-16 Version: v1.61.120
+- Generated 2014-05-26 for `Ecs`.
+- Add BatchOptimization param in Stop and Start Instances.
+- Add RemoveSymbols in GetInstanceConsoleOutput.
+- Add ImageFamily in ModifyImageAttribute.
+- Customize InstanceType on DedicatedHosts is supported.
+- Add StorageCapacityUnit interfaces.
+- Add param Tag in CreateAutoSnapshotPolicy.
+
+2020-04-16 Version: v1.61.119
+- Generated 2017-07-05 for `CCC`.
+
+
+2020-04-16 Version: v1.61.118
+- Generated 2017-07-05 for `CCC`.
+- Add features for open api.
+
+2020-04-16 Version: v1.61.117
+- Generated 2017-08-01 for `Edas`.
+- Increase the elastic expansion pop interface.
+- Increase the service method list pop interface.
+
+2020-04-15 Version: v1.61.116
+- Generated 2019-11-11 for `nlp-automl`.
+- Add pre train service api.
+
+2020-04-15 Version: v1.61.115
+- Generated 2015-12-01 for `Dds`.
+- CreateNode API add return NodeId.
+
+2020-04-15 Version: v1.61.114
+- Generated 2020-04-08 for `visionai-poc`.
+- Vision-poc response modified.
+
+2020-04-14 Version: v1.61.113
+- Generated 2019-06-25 for `ivpd`.
+- Supported CreateSegmentBodyJob.
+
+2020-04-13 Version: v1.61.112
+- Generated 2017-06-26 for `NAS`.
+
+2020-04-13 Version: v1.61.111
+- Generated 2019-06-01 for `oos`.
+- Fix ListTaskExecutions SDK error.
+
+2020-04-13 Version: v1.61.110
+- Generated 2019-09-10 for `waf-openapi`.
+
+
+2020-04-11 Version: v1.61.109
+- Generated 2019-08-08 for `ARMS`.
+
+
+2020-04-10 Version: v1.61.108
+- Generated 2017-09-06 for `imm`.
+- Support GetOfficeEditURL.
+- Support RefreshOfficeEditToken.
+
+2020-04-10 Version: v1.61.107
+- Generated 2020-01-01 for `geoip`.
+- Support DescribeIpv4Location.
+
+2020-04-09 Version: v1.61.106
+- Generated 2019-08-08 for `ARMS`.
+- Add prometheus api AddGrafana and AddIntegration.
+
+2020-04-09 Version: v1.61.105
+- Generated 2017-06-26 for `NAS`.
+
+2020-04-09 Version: v1.61.104
+- Generated 2017-08-01 for `polardb`.
+
+
+2020-04-09 Version: v1.61.103
+- Generated 2018-03-13 for `retailcloud`.
+
+
+2020-04-09 Version: v1.61.102
+- Generated 2019-09-10 for `waf-openapi`.
+
+
+2020-04-09 Version: v1.61.101
+- Generated 2015-12-01 for `Dds`.
+- Add DescribePrice API.
+
+2020-04-09 Version: v1.61.100
+- Generated 2015-01-01 for `R-kvstore`.
+- Generated 2015-01-01 for `R-kvstore`.
+- Add DescribePrice API.
+
+2020-04-09 Version: v1.61.99
+- Generated 2019-09-10 for `waf-openapi`.
+- WAF OpenApi SDK Release.
+
+2020-04-09 Version: v1.61.98
+- Generated 2017-08-01 for `polardb`.
+- Add DescribeDBClusterAvailableResources.
+
+2020-04-08 Version: v1.61.97
+- Generated 2019-03-07 for `Cloudauth`.
+- Add SubCode for DescribeFaceVerify.
+
+2020-04-08 Version: v1.61.96
+- Generated 2019-09-10 for `waf-openapi`.
+
+
+2020-04-07 Version: v1.61.95
+- Generated 2020-02-06 for `acm`.
+- Support namespaces.
+
+2020-04-07 Version: v1.61.94
+- Generated 2020-03-20 for `imgsearch`.
+
+
+2020-04-07 Version: v1.61.93
+- Generated 2019-12-30 for `facebody`.
+
+
+2020-04-07 Version: v1.61.92
+- Generated 2020-02-06 for `acm`.
+- Support namespaces.
+
+2020-04-07 Version: v1.61.91
+- Generated 2019-08-08 for `ARMS`.
+- Update SearchAlertRules response struct.
+
+2020-04-03 Version: v1.61.90
+- Generated 2019-08-08 for `ARMS`.
+- Add trace api.
+- Add prometheus api.
+
+2020-04-03 Version: v1.61.89
+- Generated 2020-02-01 for `cloudesl`.
+- Support shelf type for planogram position.
+
+2020-04-03 Version: v1.61.88
+- Generated 2017-12-25 for `OpenSearch`.
+- Support sort script.
+
+2020-04-02 Version: v1.61.87
+- Generated 2017-11-18 for `CSB`.
+- Add slo metrics.
+
+2020-04-02 Version: v1.61.86
+- Generated 2019-03-07 for `Cloudauth`.
+- Add API ContrastFaceVerify.
+
+2020-04-02 Version: v1.61.85
+- Generated 2019-03-15 for `fnf`.
+- Support for WaitTimeSeconds for DescribeExecution.
+
+2020-04-01 Version: v1.61.84
+- Generated 2019-03-07 for `Cloudauth`.
+- DescribeVerifyToken API Add Parameters-UserIp and UserPhoneNumber and UserRegistTime.
+
+2020-04-01 Version: v1.61.83
+- Generated 2019-09-10 for `waf-openapi`.
+
+
+2020-04-01 Version: v1.61.82
+- Generated 2019-09-10 for `waf-openapi`.
+
+
+2020-04-01 Version: v1.61.81
+- Generated 2019-06-01 for `oos`.
+- Parameters is string in StartExecution Response.
+
+2020-04-01 Version: v1.61.80
+- Generated 2019-06-01 for `oos`.
+- Counters and Parameters are changed to Map in ListExections and StartExecution.
+
+2020-04-01 Version: v1.61.79
+- Generated 2018-08-01 for `dts`.
+
+2020-03-25 Version: v1.61.78
+- Generated 2018-01-11 for `rtc`.
+- Supported describe appkey for rtc application.
+- Supported set property for rtc channel.
+- Fixed the missing error code description for rtc removeterminal.
+
+2020-03-24 Version: v1.61.77
+- Generated 2014-05-26 for `Ecs`.
+- DescribeInstanceTypes Supports EniIpv6AddressQuantity.
+
+2020-03-24 Version: v1.61.76
+- Generated 2014-05-26 for `Ecs`.
+- DescribeInstanceTypes Supports EniIpv6AddressQuantity.
+
+2020-03-24 Version: v1.61.75
+- Generated 2019-09-01 for `ahas-openapi`.
+
+
+2020-03-24 Version: v1.61.74
+- Generated 2018-10-10 for `Yundun-bastionhost`.
+
+
+2020-03-24 Version: v1.61.73
+- Generated 2018-10-29 for `Yundun-dbaudit`.
+
+
+2020-03-23 Version: v1.61.72
+- Generated 2015-01-01 for `R-kvstore`.
+- Generated 2015-01-01 for `R-kvstore`.
+- Add DescribeSecurityGroupConfiguration API.
+- Add ModifySecurityGroupConfiguration API.
+
+2020-03-23 Version: v1.61.71
+- Generated 2014-08-15 for `Rds`.
+- Generated 2014-08-15 for `Rds`.
+
+2020-03-22 Version: v1.61.70
+- Generated 2014-08-15 for `Rds`.
+
+
+2020-03-20 Version: v1.61.69
+- Generated 2018-05-22 for `eas`.
+- Add GetNetworkInterface interface.
+
+2020-03-20 Version: v1.61.68
+- Generated 2015-05-01 for `Ram`.
+- RAM role support MaxSessionDuration.
+
+2020-03-18 Version: v1.61.67
+- Generated 2015-01-09 for `Alidns`.
+- Supported API for DescribeInstanceDomains.
+
+2020-03-18 Version: v1.61.66
+- Generated 2020-02-06 for `acm`.
+- ACM POP SDK.
+
+2020-03-18 Version: v1.61.65
+- Generated 2019-11-18 for `address-purification`.
+- Support product addrp.
+
+2020-03-18 Version: v1.61.64
+- Generated 2017-08-24 for `faas`.
+- Support GO-SDK for 20170824 version.
+
+2020-03-18 Version: v1.61.63
+- Generated 2018-08-28 for `Tag`.
+
+
+2020-03-16 Version: v1.61.62
+- Generated 2019-03-07 for `Cloudauth`.
+- DescribeFaceVerify API Return DeviceToken Field.
+
+2020-03-16 Version: v1.61.61
+- Generated 2019-01-01 for `Cms`.
+- Add exporter related API.
+
+2020-03-16 Version: v1.61.60
+- Generated 2019-12-12 for `amqp-open`.
+- Release.
+- Add virtual host modification API.
+- Add exchange modification API.
+- Add queue modification API.
+- Add binding modification API.
+
+2020-03-16 Version: v1.61.59
+- Generated 2014-05-26 for `Ecs`.
+- Add ImageFamily paramters and apis, in Instance creation apis and Image query apis, and add DescribeImageFromFamily.
+- Add Instance batch operation apis RebootInstances StartInstances and StopInstances.
+- Add EncryptAlgorithm paramter in instance creati
+
+2020-03-13 Version: v1.61.58
+- Generated 2020-02-06 for `acms-open`.
+- ACM POP SDK.
+
+2020-03-12 Version: v1.61.57
+- Generated 2019-06-12 for `MaxCompute`.
+- Apply delete project api.
+- Apply get project api.
+
+2020-03-12 Version: v1.61.56
+- Generated 2014-08-28 for `Ess`.
+- Add ListTagKeys, ListTagValues etc.
+
+2020-03-12 Version: v1.61.55
+- Generated 2014-08-28 for `Ess`.
+- Add ListTagKeys, ListTagValues etc.
+
+2020-03-12 Version: v1.61.54
+- Generated 2014-08-28 for `Ess`.
+- Add ListTagKeys, ListTagValues etc.
+
+2020-03-12 Version: v1.61.53
+- Generated 2014-08-28 for `Ess`.
+- Add ListTagKeys, ListTagValues etc.
+
+2020-03-12 Version: v1.61.52
+- Generated 2019-06-25 for `ivpd`.
+- Add new Api SegmentBody.
+
+2020-03-11 Version: v1.61.51
+- Generated 2018-08-08 for `Eci`.
+
+2020-03-11 Version: v1.61.50
+- Generated 2018-08-08 for `Eci`.
+
+2020-03-11 Version: v1.61.49
+- Generated 2015-12-01 for `Dds`.
+- Update structure for DescribeAvailableResource without compatible.
+
+2020-03-11 Version: v1.61.48
+- Generated 2019-06-25 for `ivpd`.
+- Add new Api SegmentBody.
+
+2020-03-11 Version: v1.61.47
+- Generated 2018-10-12 for `alimt`.
+- Support certificate translate.
+
+2020-03-11 Version: v1.61.46
+- Generated 2018-10-12 for `alimt`.
+- Support certificate translate.
+
+2020-03-10 Version: v1.61.45
+- Generated 2020-02-06 for `acms-open`.
+- ACM POP SDK.
+
+2020-03-10 Version: v1.61.44
+- Generated 2014-11-11, 2018-05-10 for `Cdn`.
+- Add ExportTas apis.
+
+2020-03-10 Version: v1.61.43
+- Generated 2014-11-11, 2018-05-10 for `Cdn`.
+- Add ExportTas apis.
+
+2020-03-09 Version: v1.61.42
+- Generated 2019-03-06 for `Dbs`.
+- Add BackupStorageType.
+
+2020-03-09 Version: v1.61.41
+- Generated 2017-09-06 for `imm`.
+- Add EmotionConfidence to GetImage.
+
+2020-03-09 Version: v1.61.40
+- Generated 2019-11-11 for `nlp-automl`.
+- NlpAutoml update contract api.
+
+2020-03-09 Version: v1.61.39
+- Generated 2019-11-11 for `nlp-automl`.
+- NlpAutoml update contract api.
+
+2020-03-09 Version: v1.61.38
+- Generated 2019-11-11 for `nlp-automl`.
+- NlpAutoml update contract api.
+
+2020-03-06 Version: v1.61.37
+- Generated 2018-01-20 for `Iot`.
+- Add LinkIoTEdge CreateEdgeOssPreSignedAddress API.
+
+2020-03-06 Version: v1.61.36
+- Generated 2018-01-20 for `Iot`.
+- Add LinkIoTEdge CreateEdgeOssPreSignedAddress API.
+
+2020-03-06 Version: v1.61.35
+- Generated 2018-09-19 for `saf`.
+- Supported Saf for cn.
+
+2020-03-06 Version: v1.61.34
+- Generated 2018-09-19 for `saf`.
+- Supported Saf for cn.
+
+2020-03-06 Version: v1.61.33
+- Generated 2019-05-21 for `saf`.
+- Supported Saf for oversea.
+
+2020-03-06 Version: v1.61.32
+- Generated 2019-02-14 for `Ons`.
+- Add request parameter groupType for OnsGroupCreate.
+- Add request parameter groupType for OnsGroupList.
+
+2020-03-05 Version: v1.61.31
+- Generated 2017-09-12 for `Cbn`.
+- Support flow log.
+- Support route map.
+
+2020-03-05 Version: v1.61.30
+- Generated 2018-04-12 for `EHPC`.
+- Add param InstanceType for ListImages and ListCustomImages.
+- Fix error codes for SubmitJobs and so on.
+
+2020-03-05 Version: v1.61.29
+- Generated 2018-01-20 for `Iot`.
+- Add CreateEdgeDriver, DeleteEdgeDriver, BatchGetEdgeDriver, QueryEdgeDriver, CreateEdgeDriverVersion, DeleteEdgeDriverVersion, UpdateEdgeDriverVersion, GetEdgeDriverVersion, QueryEdgeDriverVersion API.
+- Add ResetThing API, support reset thing topo and 
+
+2020-03-05 Version: v1.61.28
+- Generated 2019-12-11 for `OnsMqtt`.
+- Update send message noPresistFlag param.
+
+2020-03-04 Version: v1.61.27
+- Generated 2017-08-01 for `Edas`.
+- Add UpdateK8sResource API.
+
+2020-03-04 Version: v1.61.26
+- Generated 2019-09-28 for `reid`.
+- Update.
+
+2020-03-04 Version: v1.61.25
+- Generated 2017-08-01 for `Edas`.
+- Add UpdateK8sResource API.
+
+2020-03-04 Version: v1.61.24
+- Generated 2019-10-30 for `aliyuncvc`.
+- Public beta version.
+- Add Api GetMeetingMebers.
+
+2020-03-03 Version: v1.61.23
+- Generated 2016-01-20 for `Kms`.
+- Supported secretmanager stable version for kms.
+
+2020-03-03 Version: v1.61.22
+- Generated 2016-01-20 for `Kms`.
+- Supported secretmanager stable version for kms.
+
+2020-03-03 Version: v1.61.21
+- Generated 2020-01-08 for `PartnerBill`.
+- Add first bill method of GetPartnerInstancesMonthBill.
+
+2020-03-03 Version: v1.61.20
+- Generated 2020-01-01 for `geoip`.
+- GeoIP Databases SDK initial release.
+
+2020-03-03 Version: v1.61.19
+- Generated 2016-01-20 for `Kms`.
+- Supported secretmanager for kms.
+
+2020-02-28 Version: v1.61.18
+- Generated 2017-05-25 for `Dyplsapi`.
+- Add QueryPhoneNoAByTrackNo  and AddAxnTrackNo.
+
+2020-02-28 Version: v1.61.17
+- Generated 2016-04-28 for `Vpc`.
+- Supported for eip operation idempotence.
+
+2020-02-28 Version: v1.61.16
+- Generated 2016-01-20 for `Kms`.
+- Supported secretmanager for kms.
+
+2020-02-28 Version: v1.61.15
+- Generated 2016-04-28 for `Vpc`.
+- Supported for eip operation idempotence.
+
+2020-02-28 Version: v1.61.14
+- Generated 2018-10-12 for `alimt`.
+- Add translate api.
+
+2020-02-27 Version: v1.61.13
+- Generated 2018-07-13 for `Ft`.
+- Release Ft SDK.
+
+2020-02-27 Version: v1.61.12
+- Generated 2018-07-13 for `Ft`.
+- Release Ft SDK.
+
+2020-02-26 Version: v1.61.11
+- Generated 2017-06-13 for `elasticsearch`.
+- Fix tag upper case parameters.
+- Fix patch.
+
+2020-02-26 Version: v1.61.10
+- Generated 2015-01-01 for `R-kvstore`.
+- Generated 2015-01-01 for `R-kvstore`.
+- Add VpcCloudInstanceId for DescribeInstanceAttribute.
+
+2020-02-26 Version: v1.61.9
+- Generated 2019-03-07 for `Cloudauth`.
+- Add InitFaceVerify and DescribeFaceVerify API.
+
+2020-02-25 Version: v1.61.8
+- Generated 2018-11-01 for `dms-enterprise`.
+- Fix ListWorkFlowTemplates, ListWorkFlowNodes API Go SDK build error.
+
+2020-02-25 Version: v1.61.7
+- Generated 2019-03-06 for `Dbs`.
+- Update backupsetDownloadset fun.
+
+2020-02-24 Version: v1.61.6
+- Generated 2019-01-01 for `HBase`.
+- ImmediateDelete.
+- DescribeInstance CreateTimeUTC ExpireTimeUTC.
+- DescribeInstances CreateTimeUTC ExpireTimeUTC.
+- DescribeIpWhitelist Groups GroupName.
+- CreateCluster.
+
+2020-02-24 Version: v1.61.5
+- Generated 2018-07-13 for `Ft`.
+- Release Ft SDK.
+
+2020-02-24 Version: v1.61.4
+- Generated 2015-12-01 for `Dds`.
+- Update endpoints.
+
+2020-02-24 Version: v1.61.3
+- Generated 2015-12-01 for `Dds`.
+- Update endpoints.
+
+2020-02-24 Version: v1.61.2
+- Generated 2018-07-13 for `Ft`.
+- Release Ft SDK.
+
+2020-02-24 Version: v1.61.1
+- Add PATCH into requests.
+
+2020-02-24 Version: v1.60.392
+- Generated 2017-06-13 for `elasticsearch`.
+- Add tag of list instance parameters.
+
+2020-02-24 Version: v1.60.391
+- Generated 2017-06-13 for `elasticsearch`.
+- Add tag of list instance parameters.
+
+2020-02-24 Version: v1.60.390
+- Generated 2018-06-12 for `VoiceNavigator`.
+
+
+2020-02-24 Version: v1.60.389
+- Generated 2019-12-26 for `OutboundBot`.
+
+
+2020-02-24 Version: v1.60.388
+- Generated 2019-12-26 for `OutboundBot`.
+
+
+2020-02-21 Version: v1.60.387
+- Generated 2019-09-10 for `waf-openapi`.
+
+
+2020-02-21 Version: v1.60.386
+- Support TAG API.
+
+2020-02-20 Version: v1.60.385
+- Generated 2019-09-28 for `reid`.
+
+
+2020-02-20 Version: v1.60.384
+- Generated 2019-01-01 for `Cms`.
+- Fix the problem that the three APIs, disablesitemonitors, enablesitemonitors and modifysitemonitor, return result fields are not fully define.
+
+2020-02-20 Version: v1.60.383
+- Generated 2018-03-13 for `retailcloud`.
+- Add new api ListUsers.
+- Supported userRole setting for api, CreateApp, UpdateApp, DescribeAppDetail.
+
+2020-02-19 Version: v1.60.382
+- Generated 2017-09-12 for `Cbn`.
+- Support terraform.
+- Support flow log.
+- Support route map.
+
+2020-02-15 Version: v1.60.381
+- Generated 2018-11-01 for `dms-enterprise`.
+- Supported ListWorkFlowTemplates, ListWorkFlowNodes API.
+
+2020-02-15 Version: v1.60.380
+- Generated 2017-08-01 for `polardb`.
+- Add DescribeDBClusterSSL.
+- Add ModifyDBClusterSSL.
+
+2020-02-14 Version: v1.60.379
+- Generated 2015-01-09 for `Alidns`.
+- Update default endpoints.
+
+2020-02-14 Version: v1.60.378
+- Generated 2019-03-15 for `fnf`.
+- Add callback params to StartExecution API.
+- Support ListExecutions with Status API.
+
+2020-02-14 Version: v1.60.377
+- Generated 2015-04-01 for `Sts`.
+- Use standard endpoints.
+
+2020-02-14 Version: v1.60.376
+- Generated 2018-01-01 for `pvtz`.
+- Update default endpoints.
+
+2020-02-14 Version: v1.60.375
+- Generated 2019-01-01 for `Cms`.
+- Fix the field definition for the site monitoring option OptionJson.
+
+2020-02-13 Version: v1.60.374
+- Generated 2014-05-26 for `Ecs`.
+- ModifyNetworkInterfaceAttribute support modify QueueNumber.
+- DescribeNetworkInterfaces support QueueNumber.
+
+2020-02-13 Version: v1.60.373
+- Generated 2014-11-11, 2018-05-10 for `Cdn`.
+- Add Staging apis.
+
+2020-02-13 Version: v1.60.372
+- Generated 2014-05-26 for `Ecs`.
+- ModifyNetworkInterfaceAttribute support modify QueueNumber.
+- DescribeNetworkInterfaces support QueueNumber.
+
+2020-02-13 Version: v1.60.371
+- Generated 2014-05-26 for `Ecs`.
+- ModifyNetworkInterfaceAttribute support modify QueueNumber.
+- DescribeNetworkInterfaces support QueueNumber.
+
+2020-02-13 Version: v1.60.370
+- Generated 2014-05-26 for `Ecs`.
+- ModifyNetworkInterfaceAttribute support modify QueueNumber.
+- DescribeNetworkInterfaces support QueueNumber.
+
+2020-02-13 Version: v1.60.369
+- Generated 2014-05-26 for `Ecs`.
+- ModifyNetworkInterfaceAttribute support modify QueueNumber.
+- DescribeNetworkInterfaces support QueueNumber.
+
+2020-02-13 Version: v1.60.368
+- Generated 2014-05-26 for `Ecs`.
+- ModifyNetworkInterfaceAttribute support modify QueueNumber.
+- DescribeNetworkInterfaces support QueueNumber.
+
+2020-02-13 Version: v1.60.367
+- Generated 2014-11-11, 2018-05-10 for `Cdn`.
+- Add Staging apis.
+
+2020-02-13 Version: v1.60.366
+- Generated 2014-11-11, 2018-05-10 for `Cdn`.
+- Add Staging apis.
+
+2020-02-13 Version: v1.60.365
+- Generated 2014-11-11, 2018-05-10 for `Cdn`.
+- Add Staging apis.
+
+2020-02-13 Version: v1.60.364
+- Generated 2014-11-11, 2018-05-10 for `Cdn`.
+- Add Staging apis.
+
+2020-02-13 Version: v1.60.363
+- Generated 2014-11-11, 2018-05-10 for `Cdn`.
+- Add Staging apis.
+
+2020-02-13 Version: v1.60.362
+- Generated 2018-11-01 for `dms-enterprise`.
+- Fix GetDataCorrectOrderDetail API return empty database information.
+
+2020-02-13 Version: v1.60.361
+- Init MQTT SDK .
+
+2020-02-12 Version: v1.60.360
+- Generated 2020-01-21 for `DemoCenter`.
+- Support to create, describe and expire demo access token.
+
+2020-02-12 Version: v1.60.359
+- Generated 2017-08-01 for `polardb`.
+- Return `VpcInstanceId ` for DescribeDBClusterEndpoints.
+- Add DescribeBackupLogs.
+
+2020-02-12 Version: v1.60.358
+- Generated 2019-03-06 for `Dbs`.
+- Add Full showStorageTyp.
+
+2020-02-12 Version: v1.60.357
+- Generated 2018-01-11 for `rtc`.
+- Support mau.
+
+2020-02-11 Version: v1.60.356
+- Generated 2018-01-20 for `Iot`.
+- Add Thing Model APIs, including CreateThingModel, UpdateThingModel, etc.
+- Add OTA API ListOTATaskByJob.
+- Update OTA API ListOTAJobByFirmware.
+- Update Thing Core Model API InvokeThingsService.
+
+2020-02-11 Version: v1.60.355
+- Generated 2018-01-01 for `pvtz`.
+- Update default endpoints.
+
+2020-02-10 Version: v1.60.354
+- Generated 2017-09-06 for `imm`.
+- Supported address for GetMediaMeta.
+
+2020-02-09 Version: v1.60.353
+- Generated 2019-12-30 for `facebody`.
+- Sdk version 104.
+
+2020-02-07 Version: v1.60.352
+- Generated 2018-01-01 for `pvtz`.
+- Fix bug for DescribeZoneInfo, delete return result of reionId.
+- Fix bug for DeleteZone, parameter zoneId change to compulsory.
+- Fix bug for SetProxyPattern, parameter zoneId change to compulsory.
+
+2020-02-05 Version: v1.60.351
+- Generated 2017-09-06 for `imm`.
+- Supported GetOfficePreviewURL.
+- Supported RefreshOfficePreviewToken.
+
+2020-02-04 Version: v1.60.350
+- Generated 2015-01-09 for `Alidns`.
+- Update default endpoints.
+
+2020-02-04 Version: v1.60.349
+- Generated 2015-01-01 for `R-kvstore`.
+- Generated 2015-01-01 for `R-kvstore`.
+- Update endpoint for `R-kvstore`.
+
+2020-01-21 Version: v1.60.348
+- Generated 2015-01-01 for `R-kvstore`.
+- Generated 2015-01-01 for `R-kvstore`.
+- Update endpoint for `R-kvstore`.
+
+2020-01-20 Version: v1.60.347
+- Generated 2018-01-20 for `Iot`.
+- Add Thing Model APIs, including QueryThingModel, PublishThingModel, etc.
+
+2020-01-20 Version: v1.60.346
+- Generated 2019-06-25 for `hiknoengine`.
+- Release on full language support.
+
+2020-01-17 Version: v1.60.345
+- Generated 2014-08-15 for `Rds`.
+- Supported Add the history event signature function.
+
+2020-01-17 Version: v1.60.344
+- Generated 2018-03-13 for `retailcloud`.
+- Supported AAA for BBB.
+- Fixed bugs for CCC.
+
+2020-01-16 Version: v1.60.343
+- Generated 2019-01-01 for `Cms`.
+- Fix the result value of DeleteSiteMonitors.
+
+2020-01-16 Version: v1.60.342
+- Generated 2015-01-01 for `R-kvstore`.
+- Generated 2015-01-01 for `R-kvstore`.
+- Update DescribeAvailableResource.
+
+2020-01-16 Version: v1.60.341
+- Generated 2019-01-23 for `Drds`.
+
+
+2020-01-16 Version: v1.60.340
+- Generated 2019-03-07 for `Cloudauth`.
+- Add fields faceComparisonScore for DescribeVerifyResult and VerifyMaterials interface.
+
+2020-01-16 Version: v1.60.339
+- Generated 2019-01-23 for `Drds`.
+
+
+2020-01-15 Version: v1.60.338
+- Generated 2018-11-01 for `dms-enterprise`.
+- Fix SignatureDoesNotMatch issue of GetOrderBaseInfo API.
+
+2020-01-15 Version: v1.60.337
+- Generated 2019-01-01 for `Cms`.
+- Fix parameter issues for label synchronization group.
+
+2020-01-15 Version: v1.60.336
+- Generated 2019-01-01 for `Cms`.
+- Fix parameter issues for label synchronization group.
+
+2020-01-15 Version: v1.60.335
+- Generated 2015-12-15 for `CS`.
+- Support A csk.
+
+2020-01-14 Version: v1.60.334
+- Generated 2019-09-16 for `alikafka`.
+- Support modity topic remark.
+- Support modify topic partitions.
+
+2020-01-13 Version: v1.60.333
+- Generated 2015-12-01 for `Dds`.
+- New API DescribeAvailableResource.
+
+2020-01-13 Version: v1.60.332
+- Generated 2014-05-26 for `Ecs`.
+- Solve conflict.
+
+2020-01-13 Version: v1.60.331
+- Generated 2017-08-23, 2018-05-09, 2016-12-22 for `Green`.
+- Fixed bugs for CreateKeywordResponse ValidKeywordList type.
+
+2020-01-13 Version: v1.60.330
+- Generated 2017-08-23, 2018-05-09, 2016-12-22 for `Green`.
+- Fixed bugs for CreateKeywordResponse ValidKeywordList type.
+
+2020-01-13 Version: v1.60.329
+- Generated 2019-01-01 for `Cms`.
+- Add Dynamic Tag API.
+
+2020-01-13 Version: v1.60.328
+- Generated 2014-05-26 for `Ecs`.
+- Supported InstanceMaintenanceAtrributes for maintening the attributes of instances.
+- Deleted MaintenanceProperty.
+- Supported RedeployDedicatedHost for redeploying dedicated host in under-assessment status.
+
+2020-01-10 Version: v1.60.327
+- Generated 2017-08-01 for `polardb`.
+- Return `ConsistentTime` for DescribeBackups.
+- Return `DBNodeIds` for CreateDBNodes.
+
+2020-01-09 Version: v1.60.326
+- Generated 2017-12-14 for `BssOpenApi`.
+- Support DAILY report in QueryInstanBill.
+
+2020-01-09 Version: v1.60.325
+- Generated 2017-11-10 for `Ens`.
+- Add New Interface DescribeInstanceTypes.
+- Deprecated New Interface DescribeReservedResource.
+- Add New Interface DescribeAvailableResourceInfo.
+- Add New Interface AttachEnsInstances.
+
+2020-01-08 Version: v1.60.324
+- Generated 2017-09-06 for `imm`.
+- Add TagLevel to ListSetTags.
+
+2020-01-08 Version: v1.60.323
+- Generated 2014-05-15 for `Slb`.
+- Supported upload Regional AlicloudCertificate.
+
+2020-01-08 Version: v1.60.322
+- Generated 2014-08-15 for `Rds`.
+
+
+2020-01-08 Version: v1.60.321
+- Generated 2014-08-15 for `Rds`.
+
+
+2020-01-08 Version: v1.60.320
+- Generated 2018-03-13 for `retailcloud`.
+- Supported AAA for BBB.
+- Fixed bugs for CCC.
+
+2020-01-07 Version: v1.60.319
+- Generated 2017-06-13 for `elasticsearch`.
+- Modify desribeInstance return dict item.
+
+2020-01-07 Version: v1.60.318
+- Generated 2014-08-15 for `Rds`.
+
+
+2020-01-03 Version: v1.60.317
+- Generated 2018-04-12 for `EHPC`.
+- Add GWS serie apis.
+- Add QueryReport.
+- Fix ListJobs.
+- Etc.
+
+2020-01-03 Version: v1.60.316
+- Generated 2015-12-01 for `Dds`.
+- New API DescribeAvailableResource.
+
+2020-01-03 Version: v1.60.315
+- Generated 2019-01-01 for `HBase`.
+- ImmediateDelete.
+- DescribeInstance CreateTimeUTC ExpireTimeUTC.
+- DescribeInstances CreateTimeUTC ExpireTimeUTC.
+- DescribeIpWhitelist Groups GroupName.
+
+2019-01-02 Version: v1.60.314
+- Remove r-kvstore.
+
+2019-12-31 Version: v1.60.313
+- Generated 2018-01-20 for `Iot`.
+- Add OTA APIs, including GenerateOTAUploadURL, CreateOTAFirmware, etc.
+- Add UpdateProductFilterConfig interface, support setting product filter config.
+
+2019-12-31 Version: v1.60.312
+- Generated 2019-12-30 for `ocr`.
+- First version.
+
+2019-12-31 Version: v1.60.311
+- Generated 2014-08-15 for `Rds`.
+- Supported SQL SERVER support delete backup set according to time range.
+
+2019-12-31 Version: v1.60.310
+- Generated 2016-01-20 for `Kms`.
+- Support asymmetric keys.
+
+2019-12-31 Version: v1.60.309
+- Generated 2019-02-14 for `Ons`.
+- Add request parameter groupType for OnsGroupCreate.
+
+2019-12-31 Version: v1.60.308
+- Generated 2017-09-06 for `imm`.
+- Supported image for process.
+
+2019-12-31 Version: v1.60.307
+- Generated 2019-09-28 for `reid`.
+
+
+2019-12-31 Version: v1.60.306
+- Generated 2019-03-15 for `adb`.
+- Support DeleteDBCluster.
+- Support ModifyDBCluster.
+- Support DescribeAvailableResource.
+
+2019-12-30 Version: v1.60.305
+- Generated 2018-01-20 for `Iot`.
+- Supported 2018-01-20 for Golang.
+
+2019-12-26 Version: v1.60.304
+- Generated 2019-11-11 for `nlp-automl`.
+- NlpAutoml add async api.
+
+2019-12-26 Version: v1.60.303
+- Generated 2019-03-06 for `Dbs`.
+- Modify CreateRestoreTask.
+
+2019-12-23 Version: v1.60.302
+- Generated 2016-04-08 for `Emr`.
+- Bugfix.
+
+2019-12-20 Version: v1.60.301
+- Generated 2018-11-01 for `dms-enterprise`.
+- Supported Authorization API, includes GrantUserPermission, RevokeUserPermission, ListDatabaseUserPermssions, ListUserPermissions.
+- Supported Database or Table Metadata synchronization API, includes SyncInstanceMeta, SyncDatabaseMeta.
+- Supported Database or Table Owner set up API.
+- Supported GetUser API to get information of one DMS user.
+- Supported set Dingding mobile number with RegisterUser API.
+
+2019-12-20 Version: v1.60.300
+- Generated 2019-03-08 for `ivision`.
+- Supported Search stream predict task list use modelId for IVISION.
+
+2019-12-20 Version: v1.60.299
+- Generated 2019-02-14 for `Ons`.
+- Add result value for OnsConsumerStatus.
+
+2019-12-19 Version: v1.60.298
+- Generated 2017-08-01 for `polardb`.
+- Add DescribeSlowLogRecords,DescribeSlowLogs for SlowLog.
+
+2019-12-19 Version: v1.60.297
+- Generated 2019-09-28 for `reid`.
+
+
+2019-12-19 Version: v1.60.296
+- Generated 2014-05-26 for `Ecs`.
+- DescribeNetworkInterfaces Supports NextToken.
+
+2019-12-18 Version: v1.60.295
+- Generated 2014-08-15 for `Rds`.
+
+
+2019-12-18 Version: v1.60.294
+- Generated 2019-09-16 for `alikafka`.
+- Support sasl and acl.
+
+2019-12-16 Version: v1.60.293
+- DescribeTransferDomains add query param, TargetUserId, FromUserId, DomainName.
+
+2019-12-16 Version: v1.60.292
+- Update tag related api to publically visable.
+
+2019-12-16 Version: v1.60.291
+- Update tag related api to publically visable.
+
+2019-12-14 Version: v1.60.290
+- Generated 2015-01-01 for `R-kvstore`.
+
+2019-12-14 Version: v1.60.289
+- Update DescribeAvailableResource.
+
+2019-12-14 Version: v1.60.288
+- Update DescribeAvailableResource.
+
+2019-12-11 Version: v1.60.287
+- Add tag API.
+- Add group process monitoring API.
+- Add API for batch setting alarm rules.
+
+2019-12-11 Version: v1.60.286
+- Support GroupDeletionProtection.
+
+2019-12-05 Version: v1.60.285
+- Add api QueryMetric.
+
+2019-12-04 Version: v1.60.284
+- Delete invalid Api.
+
+2019-12-04 Version: v1.60.283
+- Generated 2019-01-01 for `HBase`.
+
+2019-12-04 Version: v1.60.282
+- Supported ModifyDBInstanceSpec for Direction param.
+
+2019-12-03 Version: v1.60.281
+- Supported face library operation.
+- Supported task template and words.
+
+2019-12-03 Version: v1.60.280
+- Bugfix for DescribeTrails.
+
+2019-12-02 Version: v1.60.279
+- Generated 2019-01-23 for `Drds`.
+
+2019-12-02 Version: v1.60.278
+- Update go sdk.
+
+2019-12-02 Version: v1.60.277
+- Remove QuerySmsProdStatus OpenAPI.
+
+2019-11-29 Version: v1.60.276
+- Add RenewInstance.
+- Add RenewLogstash.
+- Add UpdateInstanceChargeType.
+- Add UpdateLogstashChargeType.
+
+2019-11-29 Version: v1.60.275
+- Add RWMutex to AddEndpointMapping and GetEndpointFromMap.
+
+2019-11-28 Version: v1.60.274
+- Supported API GetTxtRecordForVerify.
+- Supported API RetrieveDomain.
+
+2019-11-28 Version: v1.60.273
+- Supported dash for compress.
+
+2019-11-28 Version: v1.60.272
+- Eni Supports Multi-SecurityGroup.
+
+2019-11-28 Version: v1.60.271
+- Support Order Basis API, include CreateOrder, CloseOrder, ListOrders, GetOrderBaseInfo.
+- Support Order Approval API, include SubmitOrderApproval, ApproveOrder, GetApprovalDetail.
+- Support DataCorrect Order Operation API, include ExecuteDataCorrect, GetDataCorrectOrderDetail, GetDataCorrectBackupFiles.
+- Support DDL Order Operation API, include CreatePublishGroupTask.
+- Support DataExport Operation API, include ExecuteDataExport, GetDataExportOrderDetail, GetDataExportDownloadURL.
+
+2019-11-27 Version: v1.60.270
+- Add Tag API.
+
+2019-11-27 Version: v1.60.269
+- CreateReplicationJob API supports the specified instance type.
+
+2019-11-27 Version: v1.60.268
+- Add enhanced natgateway sdk.
+
+2019-11-26 Version: v1.60.267
+- Modify QueryBill, add SubOrderId in item of response.
+
+2019-11-26 Version: v1.60.266
+- Generated 2015-12-01 for `Dds`.
+
+2019-11-26 Version: v1.60.265
+- Supported API BindInstanceDomains.
+- Supported API UnbindInstanceDomains.
+- Supported API AddCustomLine.
+- Supported API UpdateCustomLine.
+- Supported API DeleteCustomLines.
+- Supported API DescribeCustomLine.
+- Supported API DescribeCustomLines.
+
+2019-11-26 Version: v1.60.264
+- Generated 2015-12-01 for `Dds`.
+
+2019-11-26 Version: v1.60.263
+- Refresh endpoint.
+
+2019-11-26 Version: v1.60.262
+- Generated 2014-08-15 for `Rds`.
+
+2019-11-25 Version: v1.60.261
+- Add v to release version.
+
+2019-11-25 Version: 1.60.260
+- One or more people can be subscribed when creating tasks.
+
+2019-11-22 Version: 1.60.259
+- Update Api Request And Response structure.
+
+2019-11-22 Version: 1.60.258
+- First version.
+
+2019-11-21 Version: 1.60.257
+- Add ConvertPayType.
+- Add ConvertLogstashPayType.
+
+2019-11-21 Version: 1.60.256
+- Update Nlp Automl SDK.
+
+2019-11-21 Version: 1.60.255
+- Add OpenAPI DescribeAvailableResourceInfo.
+- Deprecated OpenApi DescribeAvailableResource.
+
+2019-11-21 Version: 1.60.254
+- First version.
+
+2019-11-20 Version: 1.60.253
+- Add new pop api.
+
+2019-11-20 Version: 1.60.252
+- Supported ecsDemand CreateDemand, ModifyDemand, DeleteDemand API.
+- Modify ecsDemand DescribesDemands API.
+
+2019-11-20 Version: 1.60.251
+- Generated 2019-01-01 for `HBase`.
+
+2019-11-20 Version: 1.60.250
+- Add API ReportVoipProblems.
+- Add API QueryVoipNumberBindINfos.
+
+2019-11-19 Version: 1.60.249
+- Generated 2018-01-20 for `Iot`.
+
+2019-11-15 Version: 1.60.248
+- Nlp Automl SDK.
+
+2019-11-15 Version: 1.60.247
+- Support tags.
+- Support create pre paid alikafka instance.
+
+2019-11-15 Version: 1.60.246
+- Sync cdn APIs.
+
+2019-11-15 Version: 1.60.245
+- Fixed bugs.
+
+2019-11-15 Version: 1.60.244
+- Add Scdn APIS.
+- Sync cdn APIS.
+
+2019-11-15 Version: 1.60.243
+- Modify QueryAccountBill, support group by product.
+
+2019-11-15 Version: 1.60.242
+- Modify DescribeRestoreRangeInfo.
+
+2019-11-15 Version: 1.60.241
+- Add DescribeRestoreRangeInfo.
+
+2019-11-14 Version: 1.60.240
+- Released dysms OpenAPI.
+
+2019-11-14 Version: 1.60.239
+- Support Tag OpenAPI.
+- Fix endpoint problem.
+
+2019-11-14 Version: 1.60.238
+- Initial construction.
+- Public beta version.
+- Supported AliyunController for Interface.
+- Supported ConsoleController for Interface.
+- Supported AccountController for Interface.
+
+2019-11-13 Version: 1.60.237
+- Supported Stream analyse.
+
+2019-11-13 Version: 1.60.236
+- Fix ResourceId type from Long to String on QueryCostUnitResource.
+
+2019-11-13 Version: 1.60.235
+- Fix ResourceId type from Long to String on QueryCostUnitResource.
+
+2019-11-13 Version: 1.60.234
+- Add new API QueryBillToOSSSubscription.
+
+2019-11-13 Version: 1.60.233
+- Supported API UpdateDomainRemark for Update Domain Remark.
+- Supported API UpdateDomainRecordRemark for Update Record Remark.
+- Unsupported API CheckDomainRecord.
+
+2019-11-13 Version: 1.60.232
+- Support Go SDK.
+- Support C SDK.
+- Support PHP SDK.
+
+2019-11-12 Version: 1.60.231
+- Generated 2018-08-21, 2018-08-16 for `Rdc`.
+
+2019-11-12 Version: 1.60.230
+- Generated 2018-08-21 for `Rdc`.
+
+2019-11-08 Version: 1.60.229
+- Add DescribeJobErrorCode.
+
+2019-11-05 Version: 1.60.228
+- Add OperateBlackNo.
+
+2019-11-04 Version: 1.60.227
+- Supported Qos for smartag.
+
+2019-11-04 Version: 1.60.226
+- Support console api for cloud bastionhost.
+
+2019-11-02 Version: 1.60.225
+- Generated 2017-05-25 for `Dyvmsapi`.
+
+2019-10-31 Version: 1.60.224
+- Initial construction.
+- Public beta version.
+- Supported AliyunController for Interface.
+- Supported ConsoleController for Interface.
+- Supported AccountController for Interface.
+
+2019-10-31 Version: 1.60.223
+- Initial construction.
+- Public beta version.
+- Supported AliyunController for Interface.
+- Supported ConsoleController for Interface.
+- Supported AccountController for Interface.
+
+2019-10-31 Version: 1.60.222
+- Support ListTagResources for tag fuzzy filter.
+
+2019-10-30 Version: 1.60.221
+- Update interface params of the cloudauth.
+
+2019-10-29 Version: 1.60.220
+- Add a new Alibaba Cloud Bill API named QueryAccountBill.
+
+2019-10-28 Version: 1.60.219
+- FIX RefundInstance.
+
+2019-10-25 Version: 1.60.218
+- ADD RefundInstance.
+
+2019-10-25 Version: 1.60.217
+- Initial construction.
+- Public beta version.
+- Supported AliyunController for Interface.
+- Supported ConsoleController for Interface.
+- Supported AccountController for Interface.
+
+2019-10-25 Version: 1.60.216
+- Supported query push records.
+
+2019-10-25 Version: 1.60.215
+- Add DescribeDBClusterPerformance, DescribeDBNodePerformance for performance.
+
+2019-10-24 Version: 1.60.214
+- Optimize instance relevant interface.
+
+2019-10-24 Version: 1.60.213
+- Generated 2017-12-14 for `BssOpenApi`.
+
+2019-10-24 Version: 1.60.212
+- Generated 2017-12-14 for `BssOpenApi`.
+
+2019-10-23 Version: 1.60.211
+- Add a new api named SubmitDynamicImageJob capture a certain part of the video as a dynamic image.
+- Add a new api named SubmitWorkflowJob to initiate the VoD workflow processing for audio and video.
+- Add a new field AuditStatus in the structure ImageInfo to GetImageInfo api response, which is used to identify the audit status of the image.
+- Modify the data type of return field StorageLocation to String.
+- Add a new field named MediaType to SubmitAIMediaAuditJob api request.
+
+2019-10-23 Version: 1.60.210
+- Add a new api named SubmitDynamicImageJob capture a certain part of the video as a dynamic image.
+- Add a new api named SubmitWorkflowJob to initiate the VoD workflow processing for audio and video.
+- Add a new field AuditStatus in the structure ImageInfo to GetImageInfo api response, which is used to identify the audit status of the image.
+- Modify the data type of return field StorageLocation to String.
+- Add a new field named MediaType to SubmitAIMediaAuditJob api request.
+
+2019-10-23 Version: 1.60.209
+- Add a new api named SubmitDynamicImageJob capture a certain part of the video as a dynamic image.
+- Add a new api named SubmitWorkflowJob to initiate the VoD workflow processing for audio and video.
+- Add a new field AuditStatus in the structure ImageInfo to GetImageInfo api response, which is used to identify the audit status of the image.
+- Modify the data type of return field StorageLocation to String.
+- Add a new field named MediaType to SubmitAIMediaAuditJob api request.
+
+2019-10-22 Version: 1.60.208
+- Supported Sync predict for Image.
+- Supported Set Frame Frequency for Stream Predict.
+- Fixed Errore Code For APIs.
+
+2019-10-22 Version: 1.60.207
+- RunInstances support AutoSnapshotPolicyId.
+
+2019-10-22 Version: 1.60.206
+- Fix ListDatabases CatalogName dataType integer to string.
+- Remove GetLogicDatabase invalid output param named TotalCount.
+- Remove ListIndexes invalid output param named ColumnList.
+- Support SearchTable API to filter searchTarget.
+
+2019-10-22 Version: 1.60.205
+- Supported ExternalId IMM.
+
+2019-10-21 Version: 1.60.204
+- Release first version.
+
+2019-10-21 Version: 1.60.203
+- Init the standard baas sdk.
+
+2019-10-18 Version: 1.60.202
+- Generated 2019-09-10 for `DnsKnocker`.
+
+2019-10-18 Version: 1.60.201
+- Modify Yundun-dbaudit DescribeInstanceAttribute InstanceStatus Type.
+
+2019-10-17 Version: 1.60.200
+- Support instance manage API, includes UpdateInstance and DeleteInstance.
+- Support user manage API, includes ListUsers and UpdateUser.
+- Support meta data information API, includes ListInstances, ListDatabases, ListLogicDatabases, ListTables, ListLogicTables, ListColumns, ListIndexes.
+- Support meta data search API, inclues SearchDatabase, SearcTable.
+- Support RegisterInstance API to set datalinkName and useDsql option.
+
+2019-10-16 Version: 1.60.199
+- Optimize instance relevant interface.
+
+2019-10-16 Version: 1.60.198
+- Add ListTagResources OpenApi.
+- Add TagResources OpenApi.
+- Add UntagResources OpenApi.
+- Add ModifyDBInstanceAutoUpgradeMinorVersion OpenApi.
+
+2019-10-14 Version: 1.60.197
+- Optimize instance relevant interface.
+
+2019-10-14 Version: 1.60.196
+- Support continuous pushing.
+
+2019-10-13 Version: 1.60.195
+- Add instance relevant interface.
+
+2019-10-12 Version: 1.60.194
+- Add new api.
+
+2019-10-11 Version: 1.60.193
+- Add response paramete for DescribeDomainExtensionAttribute.
+
+2019-10-11 Version: 1.60.192
+- Add new interface DescribeDomainExtensionAttribute.
+
+2019-10-10 Version: 1.60.191
+- Generated 2014-05-15 for `Slb`.
+
+2019-10-10 Version: 1.60.190
+- Generated 2015-04-01 for `Sts`.
+
+2019-10-09 Version: 1.60.189
+- Add VideoCancelScan Api.
+
+2019-10-09 Version: 1.60.188
+- Support API RecognizeImageColor.
+- Support API DetectImageElements.
+- Support API RecolorImage.
+- Support API SegmentImage.
+- Support API ChangeImageSize.
+- Support API ExtendImageStyle.
+- Support API RecognizeImageStyle.
+- Support API MakeSuperResolution.
+
+2019-10-09 Version: 1.60.187
+- Generated 2018-11-11 for `PTS`.
+
+2019-10-09 Version: 1.60.186
+- DescribeIntance status type modification.
+
+2019-10-08 Version: 1.60.185
+- Supported Grab Frame IMM.
+
+2019-10-08 Version: 1.60.184
+- Supported API MassPush for Push Message or Notice.
+
+2019-10-08 Version: 1.60.183
+- Generated 2016-01-20 for `Kms`.
+
+2019-09-29 Version: 1.60.182
+- Generated 2015-01-01 for `R-kvstore`.
+
+2019-09-29 Version: 1.60.181
+- Add new api.
+
+2019-09-26 Version: 1.60.180
+- Update AHAS GetSentinelAppSumMetric API.
+
+2019-09-26 Version: 1.60.179
+- Supported RingConfig for BindAxb,BindAxn,BindAxg,BindAxnExtension.
+- Add QuerySubsId.
+
+2019-09-25 Version: 1.60.178
+- Add new api.
+
+2019-09-25 Version: 1.60.177
+- Update AHAS GetSentinelAppSumMetric API.
+
+2019-09-25 Version: 1.60.176
+- Fix the capitalization problem of Describe Site Monitor Data.
+
+2019-09-24 Version: 1.60.175
+- Generated 2019-08-10 for `multimediaai`.
+
+2019-09-23 Version: 1.60.174
+- Generated 2019-06-12 for `MaxCompute`.
+
+2019-09-23 Version: 1.60.173
+- Add param, DescribePrice supprot ReservedInstance.
+
+2019-09-20 Version: 1.60.172
+- Generated 2017-12-14 for `BssOpenApi`.
+
+2019-09-20 Version: 1.60.171
+- Generated 2018-02-01, 2018-07-20 for `ddosbgp`.
+
+2019-09-19 Version: 1.60.170
+- Supported Video Abstract for IMM.
+
+2019-09-19 Version: 1.60.169
+- Supported Video Abstract for IMM.
+
+2019-09-19 Version: 1.60.168
+- Add bizSubCode and so on.
+
+2019-09-18 Version: 1.60.167
+- Support to update layout in task for MPU.
+
+2019-09-18 Version: 1.60.166
+- Optimize error code.
+
+2019-09-18 Version: 1.60.165
+- Supported Video Abstract for IMM.
+
+2019-09-18 Version: 1.60.164
+- Generated 2019-09-10 for `waf-openapi`.
+
+2019-09-18 Version: 1.60.163
+- Generated 2016-11-01 for `live`.
+
+2019-09-18 Version: 1.60.162
+- Add AHAS OpenAPI version 2019-09-01.
+
+2019-09-16 Version: 1.60.161
+- Generated 2019-09-10 for `waf-openapi`.
+
+2019-09-16 Version: 1.60.160
+- Add Region List.
+
+2019-09-16 Version: 1.60.159
+- Fixed go struct file.
+
+2019-09-16 Version: 1.60.158
+- Generated 2019-09-10 for `waf-openapi`.
+
+2019-09-16 Version: 1.60.157
+- Generated 2019-09-10 for `waf-openapi`.
+
+2019-09-12 Version: 1.60.156
+- Add DescribePrePaidInstanceStock.
+
+2019-09-12 Version: 1.60.155
+- Support RDS.
+
+2019-09-09 Version: 1.60.154
+- CreateInstance add toen.
+- UpdateInstance add toen.
+
+2019-09-09 Version: 1.60.153
+- Generated 2017-05-25 for `Dysmsapi`.
+
+2019-09-06 Version: 1.60.152
+- Generated 2018-01-17 for `waf-openapi`.
+
+2019-09-06 Version: 1.60.151
+- Supported specifying vswitch when creating vpngateway.
+
+2019-09-06 Version: 1.60.150
+- Update endpoint data.
+
+2019-09-06 Version: 1.60.149
+- Add ReleasePostPaidInstance.
+- Add ReleasePrePaidInstance.
+
+2019-09-06 Version: 1.60.148
+- Generated 2016-04-28 for `Vpc`.
+
+2019-09-06 Version: 1.60.147
+- Generated 2014-05-15 for `Slb`.
+
+2019-09-05 Version: 1.60.146
+- Supported for setEndpoint method.
+
+2019-09-05 Version: 1.60.145
+- Generated 2014-05-15 for `Slb`.
+
+2019-09-05 Version: 1.60.144
+- Generated 2017-07-05 for `CCC`.
+
+2019-09-05 Version: 1.60.143
+- Generated 2018-11-11 for `foas`.
+
+2019-09-05 Version: 1.60.142
+- Add DescribeInstanceTypes.
+- Add DescribeReservedResource.
+- Add DescribeInstances.
+
+2019-09-05 Version: 1.60.141
+- Generated 2019-05-24 for `cusanalytic_sc_online`.
+
+2019-09-05 Version: 1.60.140
+- Generated 2015-11-01 for `Market`.
+
+2019-09-05 Version: 1.60.139
+- Generated 2016-07-14 for `CloudAPI`.
+
+2019-09-05 Version: 1.60.138
+- Generated 2017-08-01 for `polardb`.
+
+2019-09-05 Version: 1.60.137
+- Generated 2017-12-14 for `BssOpenApi`.
+
+2019-09-05 Version: 1.60.136
+- Generated 2014-05-26 for `Ecs`.
+
+2019-09-03 Version: 1.60.135
+- Generated 2018-02-01, 2018-07-20 for `ddosbgp`.
+
+2019-09-03 Version: 1.60.134
+- Generated 2018-02-01 for `ddosbgp`.
+
+2019-09-03 Version: 1.60.133
+- Generated 2014-08-15 for `Rds`.
+
+2019-08-30 Version: 1.60.132
+- Add describeRegions.
+- Add toen.
+
+2019-08-30 Version: 1.60.131
+- Revert to 2015-09-01.
+
+2019-08-30 Version: 1.60.130
+- Release Apis of Version 2019-09-10.
+
+2019-08-30 Version: 1.60.129
+- Support latest DRDS Open API for version 2019-01-23.
+
+2019-08-30 Version: 1.60.128
+- Supported Meida complex for IMM.
+
+2019-08-30 Version: 1.60.127
+- Add api for getTrace and searchTracelist.
+
+2019-08-29 Version: 1.60.126
+- Move StopExecution params to body.
+
+2019-08-29 Version: 1.60.125
+- Bugfix.
+
+2019-08-29 Version: 1.60.124
+- For publish.
+
+2019-08-28 Version: 1.60.123
+- Update emr go api.
+
+2019-08-28 Version: 1.60.122
+- Add DBS API UpgradeBackupPlan.
+- Add DBS API DescribePreCheckProgressList.
+
+2019-08-28 Version: 1.60.121
+- Add NamespaceId for listApplication.
+
+2019-08-27 Version: 1.60.120
+- Add ModifyDBInstanceAutoUpgradeMinorVersion Openapi.
+
+2019-08-26 Version: 1.60.119
+- QueryInstanceBillResponse change ownerId type from Long to String.
+- QueryInstanceBillResponse change usage type from float to String.
+- QueryInstanceBillResponse change listPrice type from float to String.
+- QueryInstanceBillResponse change deductedByResourcePackage type from float to String.
+
+2019-08-22 Version: 1.60.118
+- Support API RecognizeImageColor.
+- Support API DetectImageElements.
+- Support API RecolorImage.
+- Support API SegmentImage.
+- Support API ChangeImageSize.
+- Support API ExtendImageStyle.
+- Support API RecognizeImageStyle.
+- Support API MakeSuperResolutionImage.
+
+2019-08-22 Version: 1.60.117
+- Api release 2019-08-08 public sdk 2-5-2 sdk release 20190822 shichun-fsc.
+
+2019-08-22 Version: 1.60.116
+- Api getTopicList add a new return value.
+
+2019-08-21 Version: 1.60.115
+- Supported for CPFS new feature of client evict.
+
+2019-08-21 Version: 1.60.114
+- Move StartExecution params to body.
+
+2019-08-21 Version: 1.60.113
+- Return backup job id when create backup.
+- Return backup set size when describe backups.
+
+2019-08-21 Version: 1.60.112
+- Modify getTopicList and getConsumerList response.
+
+2019-08-21 Version: 1.60.111
+- Modify getInstanceList response.
+
+2019-08-20 Version: 1.60.110
+- API TaobaoFilmGetSchedules retrun col add hallId.
+
+2019-08-19 Version: 1.60.109
+- Optimize topic create parameters.
+
+2019-08-19 Version: 1.60.108
+- Optimize topic create parameters.
+
+2019-08-18 Version: 1.60.107
+- Support go sdk.
+
+2019-08-16 Version: 1.60.106
+- Generated 2018-02-01 for `ddosbgp`.
+
+2019-08-15 Version: 1.60.105
+- FnF public version.
+- Add Report task api.
+
+2019-08-15 Version: 1.60.104
+- Add API BatchStartCdnDomain, BatchStopCdnDomain, DescribeTagResources, DescribeUserTags, TagResources, UntagResources.
+
+2019-08-15 Version: 1.60.103
+- QueryInstanceBillResponse add ServicePeriod.
+
+2019-08-14 Version: 1.60.102
+- Expose the interface to the yundun-console.
+- Update interface definitions of the cloudauth.
+
+2019-08-13 Version: 1.60.101
+- Optimize return code.
+- Edit QueryDataset.
+
+2019-08-13 Version: 1.60.100
+- Supported for openapi new version.
+
+2019-08-13 Version: 1.60.99
+- Support latest DRDS Open API for version 2019-01-23.
+
+2019-08-13 Version: 1.60.98
+- Generated 2018-07-20 for `ddosbgp`.
+
+2019-08-12 Version: 1.60.97
+- Supported create routeEntry with routeEntryName.
+
+2019-08-12 Version: 1.60.96
+- Support Defect Face API.
+
+2019-08-08 Version: 1.60.95
+- Supported DryRun for Vpc and VSwitch.
+
+2019-08-08 Version: 1.60.94
+- Add CreateStorageSet api to support storageSet.
+- Add DeleteStorageSet api to support storageSet.
+- Add ModifyStorageSetAttribute api to support storageSet.
+- Add DescribeStorageSets api to support storageSet.
+- Add DescribeStorageSetDetails api to support storageSet.
+- Add parameter StorageSetId,StorageSetPartitionNumber to api CreateDisk,RunInstances,CreateInstance support storageSet.
+- Add StorageSetId,StorageSetPartitionNumber with response of api DescribeDisks.
+- Add DescribeNetworkInterfaces to support filter by PrivateIpAddress.
+
+2019-08-08 Version: 1.60.93
+- Group, Plugin support tag authentication.
+
+2019-08-07 Version: 1.60.92
+- Generated 2019-03-20 for `WebPlus`.
+
+2019-08-06 Version: 1.60.91
+- Supported GetMediaMeta for IMM.
+
+2019-08-06 Version: 1.60.90
+- Supported GetMediaMeta for IMM.
+
+2019-08-06 Version: 1.60.89
+- Supported GetMediaMeta for IMM.
+
+2019-08-06 Version: 1.60.88
+- Supported GetMediaMeta for IMM.
+
+2019-08-06 Version: 1.60.87
+- Supported GetMediaMeta for IMM.
+
+2019-08-06 Version: 1.60.86
+- Enhencement for CostOptimized scaling group.
+
+2019-08-05 Version: 1.60.85
+- Add response parameter LoadBalancerId for DescribeMasterSlaveServerGroupAttribute interface.
+
+2019-08-05 Version: 1.60.84
+- GetOrderDetail add originalConfig param.
+
+2019-08-05 Version: 1.60.83
+- GetOrderDetail add originalConfig param.
+
+2019-08-05 Version: 1.60.82
+- Modify DBS API DescribeFullBackupList.
+
+2019-08-02 Version: 1.60.81
+- Add a lot of new API.
+
+2019-08-02 Version: 1.60.80
+- SubscribeBillToOSSRequest add multAccountRelSubscribe, bucketOwnerId.
+- UnsubscribeBillToOSSRequest add multAccountRelSubscribe.
+
+2019-07-31 Version: 1.60.79
+- Endpoint auto route.
+
+2019-07-31 Version: 1.60.78
+- Generated 2014-06-18 for `Mts`.
+
+2019-07-30 Version: 1.60.77
+- Generated 2014-06-18 for `Mts`.
+
+2019-07-26 Version: 1.60.76
+- Generated 2019-05-24 for `cusanalytic_sc_online`.
+
+2019-07-26 Version: 1.60.75
+- Generated 2019-05-24 for `cusanalytic_sc_online`.
+
+2019-07-25 Version: 1.60.74
+- Api createKey add optional parameter `ProtectionLevel`.
+- Api describeKey add a field `ProtectionLevel` in the response.
+- Add Api `DescribeService`.
+
+2019-07-25 Version: 1.60.73
+- Generated 2016-07-14 for `CloudAPI`.
+
+2019-07-25 Version: 1.60.72
+- App-related actions support tag authentication.
+
+2019-07-23 Version: 1.60.71
+- Supported CreationOption of CreateDBCluster with `CloneFromPolarDB `,`CloneFromRDS`,`MigrationFromRDS`.
+
+2019-07-19 Version: 1.60.70
+- QueryMonthlyBillResponse add roundDownDiscount.
+- QueryBillResponse add roundDownDiscount.
+- QueryInstanceBillResponse add item.
+
+2019-07-18 Version: 1.60.69
+- Fix resolve wrong tagname IOS to iOS.
+
+2019-07-18 Version: 1.60.68
+- Add a new field named Input to SubmitAIJob api request to set the input file of AI job.
+- Change the field MediaId of SubmitAIJob api to non-mandatory.
+
+2019-07-18 Version: 1.60.67
+- Supported open api for dbaudit management.
+
+2019-07-15 Version: 1.60.66
+- Add filed `internalDomain` for api `get token`.
+
+2019-07-12 Version: 1.60.65
+- Public api AddLivePullStreamInfoConfig.
+
+2019-07-11 Version: 1.60.64
+- Modify CreateBackupPlan.
+- Modify ConfigureBackupPlan.
+- Modify DescribeFullBackupList.
+- Modify DescribeRestoreTaskList.
+- Add ModifyBackupSourceEndpoint.
+- Add ModifyBackupStrategy.
+- Add ModifyBackupPlanName.
+
+2019-07-08 Version: 1.60.63
+- ActionName change to OOSActionName from ListActions API param and response.
+
+2019-07-05 Version: 1.60.62
+- Add TaskCancelStatus for QueryTaskList api.
+
+2019-07-05 Version: 1.60.61
+- Generated 2015-04-01 for `Sts`.
+
+2019-07-05 Version: 1.60.60
+- Generated 2015-04-01 for `Sts`.
+
+2019-07-04 Version: 1.60.59
+- Supported API DescribeRecordStatisticsy for Query Volume.
+- Supported API DescribeDomainStatistics for Query Volume.
+
+2019-07-03 Version: 1.60.58
+- Supported API DescribeRecordStatisticsSummary for Query Volume.
+- Supported API DescribeDomainStatisticsSummary for Query Volume.
+- Supported API DescribeRecordStatisticsHistory for Query Volume.
+- Supported API DescribeDomainDnsStatistics for Query Volume.
+
+2019-07-02 Version: 1.60.57
+- FnF public version.
+
+2019-07-01 Version: 1.60.56
+- Support cloud_essd disk category for API CreateDisk, CreateInstance and RunInstances, and support configurating PerformanceLevel when choose cloud_essd.
+- Add ModifyDiskSpec API to support cloud_essd PerformanceLevel modification.
+- Add AutoProvisioningGroup interfaces, provide AutoProvisioningGroup function.
+- Add RetentionDays to snapshot creating.
+
+2019-06-27 Version: 1.60.55
+- Added setting of crop_mode parameter.
+
+2019-06-25 Version: 1.60.54
+- Enhencement for CostOptimized scaling group.
+
+2019-06-24 Version: 1.60.53
+- Add some new apis to manage VoD domain, such as AddVodDomain, UpdateVodDomain, DeleteVodDomain, BatchStartVodDomain, BatchStopVodDomain, DescribeVodUserDomains, DescribeVodDomainDetail.
+- Add some new apis to manage VoD domain config, such as BatchSetVodDomainConfigs, DescribeVodDomainConfigs, DeleteVodSpecificConfig, SetVodDomainCertificate, DescribeVodCertificateList, DescribeVodDomainCertificateInfo.
+- Add a new field named AppId to some apis supporting the VoD App feature, such as AddWorkFlow, GetWorkFlow, ListWorkFlow, AddVodTemplate, GetVodTemplate, ListVodTemplate, AddTranscodeTemplateGroup, GetTranscodeTemplateGroup, ListTranscodeTemplateGroup, AddWatermark, GetWatermark, ListWatermark, UploadMediaByURL.
+- Add a new field named UserData to SubmitTranscodeJobs api request to support user-defined extension fields, which can be used for transparent return when callbacks.
+
+2019-06-24 Version: 1.60.52
+- Add some new apis to manage VoD domain, such as AddVodDomain, UpdateVodDomain, DeleteVodDomain, BatchStartVodDomain, BatchStopVodDomain, DescribeVodUserDomains, DescribeVodDomainDetail.
+- Add some new apis to manage VoD domain config, such as BatchSetVodDomainConfigs, DescribeVodDomainConfigs, DeleteVodSpecificConfig, SetVodDomainCertificate, DescribeVodCertificateList, DescribeVodDomainCertificateInfo.
+- Add a new field named AppId to some apis supporting the VoD App feature, such as AddWorkFlow, GetWorkFlow, ListWorkFlow, AddVodTemplate, GetVodTemplate, ListVodTemplate, AddTranscodeTemplateGroup, GetTranscodeTemplateGroup, ListTranscodeTemplateGroup, AddWatermark, GetWatermark, ListWatermark, UploadMediaByURL.
+- Add a new field named UserData to SubmitTranscodeJobs api request to support user-defined extension fields, which can be used for transparent return when callbacks.
+
+2019-06-21 Version: 1.60.51
+- Support DeleteProtection api.
+
+2019-06-20 Version: 1.60.50
+- OOS SDK first release for managing of templates, executions and actions.
+
+2019-06-19 Version: 1.60.49
+1, Add DefaultPolicyVersion as return field to GetPolicy interface, Facilitating to get policy document from this interface.
+2, Add RotateStrategy as input field to CreatePolicyVersion interface for rotating policy version when reaching policy version limit.
+
+2019-06-18 Version: 1.60.48
+1. Supported the related recommend.
+2. Supported exposure time controll and exposure filter by scene.
+
+2019-06-17 Version: 1.60.47
+companyreg release
+
+2019-06-14 Version: 1.60.46
+- Generated 2018-01-20 for `Iot`
+
+2019-06-14 Version: 1.60.45
+1. govendor rds sdk code problem.
+
+2019-06-13 Version: 1.60.44
+1, fixed DescribeAvailableResource OpenApi AvailableZones value problem.
+
+2019-06-13 Version: 1.60.43
+- Generated 2015-01-01 for `R-kvstore`
+
+2019-06-13 Version: 1.60.42
+Add Network Assistant openapi sdk
+
+2019-06-13 Version: 1.60.41
+1, add DescribeAvailableResource OpenApi.
+2, upgrade version to 2.3.8 
+
+2019-06-12 Version: 1.60.40
+1, Add RenewBackupPlan DBS interface.
+
+2019-06-12 Version: 1.60.39
+1.Fix bug
+
+2019-06-12 Version: 1.60.38
+1, Add InvokeDataAPIService interface, support invoke service of data api to get sql query result.
+2, Add GetDataAPIServiceDetail interface, support get data api's detail information.
+3, Add CreateDataAPIService interface, support create data api with sql statement.
+
+2019-06-06 Version: 1.60.37
+1, Add RuleId in DescribeRuleAttribute.
+
+2019-06-05 Version: 1.60.36
+1, Update DescribeDataLimitDetail interface, add password for response
+
+2019-06-04 Version: 1.60.35
+1, Add new API: UpdateLivePullStreamInfoConfig
+
+2019-06-03 Version: 1.60.34
+1, Add openapi of ACL.
+
+2019-06-03 Version: 1.60.33
+1, Order info add relatedOrderId.
+
+2019-05-31 Version: 1.60.32
+1, add api 'search traces count' 
+2, add page index for api 'searchTraces'
+
+2019-05-31 Version: 1.60.31
+1, Add authority in GetMaterials API.
+
+2019-05-30 Version: 1.60.30
+Fix: Handle the repeatlist parameter correctly
+
+2019-05-30 Version: 1.60.29
+1.Fix: Handle the repeatlist parameter correctly
+
+2019-05-30 Version: 1.60.28
+1. Re-generate for STS-2015-04-01.
+
+2019-05-30 Version: 1.60.27
+1. Re-generate for STS 2015-04-01.
+
+2019-05-29 Version: 1.60.26
+1, Fix ServiceCode typo in request
+
+2019-05-29 Version: 1.60.25
+1, Modify DescribeRestoreTaskList DBS interface.
+2, Modify DescribeFullBackupList DBS interface.
+
+2019-05-28 Version: 1.60.24
+1, CreateDBInstance now support autoRenew
+
+2019-05-27 Version: 1.60.23
+1, Support video transcode.
+
+2019-05-27 Version: 1.60.22
+1, Initial release of api, including data management api, rule configuration api and system configuration api.
+
+2019-05-24 Version: 1.60.21
+1, The list of site monitoring probes adds ISP and city fields in English.
+2, Fixed the capitalization problem of Describe MetricData and Describe Site Monitor Statistics API metricName.
+
+2019-05-23 Version: 1.60.20
+1, Fixed bug of the JSON list in GO sdk.
+
+2019-05-22 Version: 1.60.19
+1, Add EndTime parameter to api ModifyPrepayInstanceSpec
+2, Add RebootTime parameter to api ModifyPrepayInstanceSpec
+
+2019-05-20 Version: 1.60.18
+1, Added the cross zones supported.
+
+2019-05-20 Version: 1.60.17
+1, Add both api, ListNotaryInfos
+
+2019-05-20 Version: 1.60.16
+1, Initial release of api, including data management api, rule configuration api and system configuration api.
+
+2019-05-20 Version: 1.60.15
+1,  DescribeRouteTableList add route table status
+2,  DescribeRouteTables add route table  status
+
+2019-05-18 Version: 1.60.14
+1, Add ModifyBackupObjects DBS interface.
+
+2019-05-16 Version: 1.60.13
+1, Update SDK Version
+2, Change api UpgradeClusterAddons, UpgradeClusterComponents, DescribeClusterAddonsVersion to public
+
+
+2019-05-16 Version: 1.60.12
+1, Add some new apis to fetch the usage data from VoD, such as DescribeVodDomainUsageData, DescribeVodStorageData, DescribeVodTranscodeData, DescribeVodAIData.
+2, Add a new api named GetUploadDetails to describe the upload detail, such as uploading time and uploading source.
+3, Add a new api named GetAIVideoTagResult to describe the result of AI tag.
+4, Add new field Icon and OnlineStatus to some apis to manage short video materials, such as SearchMedia, GetAttachedMediaInfo, CreateUploadAttachedMedia.
+5, Add a new field RegionId to the response of GetAttachedMediaInfo and GetImageInfo.
+6, Add the field named UserData to SubmitSnapshotJob api request.
+
+2019-05-16 Version: 1.60.11
+1, Update SDK Version
+2, Change api UpgradeClusterAddons, UpgradeClusterComponents, DescribeClusterAddonsVersion to public
+
+
+2019-05-16 Version: 1.60.10
+1, Update SDK version
+2, Add api DescribeClusterAddonsVersion
+
+
+2019-05-16 Version: 1.60.9
+1, This is an example of release-log.
+2, Please strictly follow this format to edit in English.
+3, Format:Number + , + Space + Description
+
+2019-05-16 Version: 1.60.8
+1, Scaling configuration add security group ids 
+
+2019-05-15 Version: 1.60.7
+1, Add InstanceId parameter to api CreateDisk
+2, Add parameter Affinity and Tenancy in ECS instance DedicatedHost related apis.
+3, Add SecurityGroupIds parameter to Instance creation apis.
+
+2019-05-14 Version: 1.60.6
+1, Support body detect.
+
+2019-05-14 Version: 1.60.5
+1, support body detect
+
+2019-05-14 Version: 1.60.4
+1, Support body detect.
+
+2019-05-14 Version: 1.60.3
+1, Support body detect.
+
+2019-05-14 Version: 1.60.2
+1, Support body detect.
+
+2019-05-14 Version: 1.60.1
+1, Support body detect.
+
+2019-05-13 Version: 1.60.0
+1, Add three new apis, SaveSingleTaskForSaveArtExtension, QueryArtExtension and CancelTask.
+
+2019-05-13 Version: 1.59.0
+1, Add three new apis, SaveSingleTaskForSaveArtExtension, QueryArtExtension and CancelTask.
+
+2019-05-13 Version: 1.58.11
+1, Support for creating instances and joining multiple security groups at the same time.
+
+2019-05-13 Version: 1.58.10
+1, Add Vpc openapi interface,Support for new fields.
+2, Support for nacl openapi.
+3, Fixed some problems of the vpc openapi.
+
+2019-05-13 Version: 1.58.9
+1, Modify CreateRestoreTaskRequest DBS interface.
+
+2019-05-05 Version: 1.58.8
+1, CreateInstance add ClientToken parameter.
+
+2019-04-29 Version: 1.58.7
+1, add new api
+
+2019-04-28 Version: 1.58.6
+1, Publish DescribeAvailableResource.
+
+2019-04-26 Version: 1.58.5
+1, Add resource describe api.
+
+2019-04-26 Version: 1.58.4
+1, add new openapi.
+
+2019-04-25 Version: 1.58.3
+1, The alarm contact interface increases paging parameters
+
+2019-04-25 Version: 1.58.2
+1, upgrade sdk version.
+
+2019-04-23 Version: 1.58.1
+1, Support mounting multiple volumes using different protocol
+2, Support scaling out cross AZ
+
+2019-04-23 Version: 1.58.0
+1, Add a new api, QueryDomainByDomainName.
+
+2019-04-22 Version: 1.57.1
+1, Add interface ModifyDBNodeClass.
+2, Add interface ModifyAutoRenewAttribute and DescribeAutoRenewAttribute.
+3, Param AutoRenew is supported in interface CreateDBCluster.
+
+2019-04-22 Version: 1.57.0
+1, Add a new api, QueryDomainByDomainName.
+
+2019-04-22 Version: 1.56.14
+1, This is an example of release-log.
+2, Please strictly follow this format to edit in English.
+3, Format:Number + , + Space + Description
+
+2019-04-22 Version: 1.56.13
+1, Add CreateDBCluster interface;
+2, Add CreateDBNodes interface;
+
+2019-04-18 Version: 1.56.12
+1, New service
+
+2019-04-18 Version: 1.56.11
+1, CreateCacheAnalysisTask prop modify
+
+2019-04-18 Version: 1.56.10
+1, add ReservedInstance API.
+
+2019-04-17 Version: 1.56.9
+1, Add DescribeRestoreTaskList DBS interface.
+2, Add DescribeNodeCidrList DBS interface.
+
+2019-04-16 Version: 1.56.8
+1, Fixed DescribeAccounts response type error.
+
+2019-04-16 Version: 1.56.7
+1, Add api about pushing security check commands
+
+2019-04-16 Version: 1.56.6
+1, Fixed describeAccounts response type error
+
+2019-04-16 Version: 1.56.5
+1, Mark CreateDiagnosticReport as public api.
+2, ModifySecurityIps support modifyMode parameter.
+
+2019-04-16 Version: 1.56.4
+1, Add group api.
+
+2019-04-16 Version: 1.56.3
+1, Add group api.
+
+2019-04-16 Version: 1.56.2
+1, Add group api.
+
+2019-04-16 Version: 1.56.1
+1, Add group api.
+
+2019-04-16 Version: 1.56.0
+1, Add the go version of sdk.
+
+2019-04-15 Version: 1.55.7
+1, Add SDK for goLang version.
+
+2019-04-15 Version: 1.55.6
+1, Add CreateRestoreTask DBS interface.
+2, Add StartRestoreTask DBS interface.
+
+2019-04-15 Version: 1.55.5
+1, add arns parameter to CreateDisk/CreateInstance API in order to support disk encryption by performing a sts role play.
+
+2019-04-15 Version: 1.55.4
+1, Add apis, DescribeScreenHostStatistics、DescribeScreenSummaryInfo、DescribeScreenAttackAnalysisData、DescribeScreenAttackAnalysisData、DescribeScreenAttackAnalysisData
+
+2019-04-15 Version: 1.55.3
+1, Add Group Api.
+
+
+2019-04-11 Version: 1.55.2
+1, The ‘CreateProject’ interface adds the ‘ModelId’ parameter
+
+2019-04-11 Version: 1.55.1
+1, Add some new apis to manage VoD's App, such as CreateAppInfo, GetAppInfos, ListAppInfos, UpdateAppInfo, DeleteAppInfo, AttachAppPolicyToIdentity, DetachAppPolicyFromIdentity, ListAppPoliciesForIdentity and MoveAppResource.
+2, Add new apis SetMessageCallback, GetMessageCallback and DeleteMessageCallback to manage message callback configuration.
+3, Add new apis GetAttachedMedia, UpdateAttachedMediaInfos and DeleteAttachedMedia to manage attached media information.
+4, Add a new api named DeleteMultipartUpload to clean up the fragmented files generated during the upload process.
+5, Add a new field named AppId to some apis supporting the VoD App feature, such as CreateUploadVideo, SearchMedia, GetVideoInfo, GetVideoInfos; Add new fields named NonExistVideoIds and ForbiddenVideoIds to DeleteVideo api response; Add a new field named ForbiddenVideoIds to UpdateVideoInfos api response.
+6, The Editing supports multi-region and multi-materials. Add new fields named StorageLocation and RegionId in Project struct to GetEditingProject api response; Add new fields named StorageLocation, RegionId and Duration in ProjectList struct to SearchEditingProject api response; Add a new field named MaterialType to GetEditingProjectMaterials api request.
+7, Add new fields named TranscodeFileRegular, Clip and Rotate to GetTranscodeTemplateGroup api response to support the custom file path feature.
+8, Add a new field named AttachedMedia to api response to support the attached media feature.
+9, Add a new field named SubTotal to GetCategories response to show the number of sub category.
+10, Add a new field named AdditionType to GetVideoInfo and GetVideoInfos api request to fetch the custom media info and the corresponding field is CustomMediaInfo.
+
+2019-04-11 Version: 1.55.0
+1, Release AddImage/SearchImage/DeleteImage OpenApi.
+2, Add 'SearchByName' feature to SearchImage
+
+2019-04-10 Version: 1.54.1
+1, Modify DescribeBackupGatewayList DBS interface.
+
+2019-04-10 Version: 1.54.0
+1, New APIs for visual service (VNC).
+2, New APIs for software management.
+3, New APIs for CPFS filesystem.
+
+2019-04-09 Version: 1.53.93
+1, Add APIs: TagResource, UntagResource, ListResourceTags.
+2, Remove the optional parameter 'STSToken'  and replace it with 'SecurityToken'.
+
+2019-04-09 Version: 1.53.92
+1, support service account management networkInterface function.
+
+2019-04-09 Version: 1.53.91
+1, Add Apis for offline VerifySDK.
+
+2019-04-08 Version: 1.53.90
+1, Modify DescribeBackupPlanList DBS interface.
+2, Modify DescribeFullBackupList DBS interface.
+3, Modify DescribeIncrementBackupList DBS interface.
+4, Modify DescribeBackupGatewayList DBS interface.
+
+2019-04-08 Version: 1.53.89
+1, Add StopBackupPlan DBS interface.
+2, Add DescribeBackupPlanList DBS interface.
+3, Add DescribeFullBackupList DBS interface.
+4, Add DescribeIncrementBackupList DBS interface.
+5, Add DescribeBackupGatewayList DBS interface.
+
+2019-04-04 Version: 1.53.88
+1, ScalingConf systemDisk add DiskName and Description  parameters.
+2, ScalingConf dataDisk add DiskName & Description & Encrypted & KMSKeyId  parameters.
+
+2019-04-03 Version: 1.53.87
+1, Support DNAT/ENI/Online user count features.
+
+
+2019-04-03 Version: 1.53.86
+1, Add interfaces related to vulnerability whitelist
+2, Add interfaces related to vulnerability auto-del configuration
+3, Add interfaces related to vulnerability fix advise
+4, Add interfaces searching and operating vulnerability
+
+2019-03-29 Version: 1.53.85
+1, fix MNS Query params
+
+2019-03-29 Version: 1.53.84
+1, Fix error version
+
+2019-03-29 Version: 1.53.83
+1, Add DLQ message openAPI.
+2, Add Query the subscription relational openAPI.
+3, Remove white list restrictions.
+
+2019-03-28 Version: 1.53.82
+1, EDAS serverless support Pandora application deployment in war/jar mode
+
+2019-03-28 Version: 1.53.81
+1, Add multiple language support in DescribeZones
+2, Add gray parameter in CreateDisk
+
+2019-03-28 Version: 1.53.80
+1, Add instance remark modify api.
+
+2019-03-28 Version: 1.53.79
+1, Add logo detect.
+
+2019-03-27 Version: 1.53.78
+1, Add Project interface.
+2, Add Tag interface.
+3, Add TrainData interface.
+4, Add Train interface.
+5, Add Iteration interface.
+6, Add Predict interface.
+7, Add PredictData interface.
+
+2019-03-27 Version: 1.53.77
+1, Add Project interface.
+2, Add Tag interface.
+3, Add TrainData interface.
+4, Add Train interface.
+5, Add Iteration interface.
+6, Add Predict interface.
+7, Add PredictData interface.
+
+2019-03-27 Version: 1.53.76
+1, Add DLQ message openAPI.
+2, Add Query the subscription relational openAPI.
+3, Remove white list restrictions.
+
+2019-03-27 Version: 1.53.75
+1, Add DLQ message openAPI.
+2, Add Query the subscription relational openAPI.
+3, Remove white list restrictions.
+
+2019-03-21 Version: 1.53.74
+1, Update Dependency
+
+2019-03-21 Version: 1.53.73
+1,  Update Dependency
+
+2019-03-20 Version: 1.53.72
+1, Update the Dependency
+
+2019-03-20 Version: 1.53.71
+1, Update the Dependency
+
+2019-03-20 Version: 1.53.70
+1, Update the Dependency
+
+2019-03-20 Version: 1.53.69
+1, Update the Dependency
+
+2019-03-20 Version: 1.53.68
+1, Update Dependency
+
+2019-03-19 Version: 1.53.67
+1, Support ' fc ' Source DomainName
+
+2019-03-19 Version: 1.53.66
+1, move fields: tag, associate_person, cid
+
+2019-03-19 Version: 1.53.65
+1, format fields: tags, associatePerson
+
+2019-03-19 Version: 1.53.63
+1, Update Dependency
+
+2019-03-19 Version: 1.53.62
+1, Update Dependency
+
+2019-03-19 Version: 1.53.61
+1, This is an example of release-log.
+2, Please strictly follow this format to edit in English.
+3, Format:Number + , + Space + Description
+
+2019-03-18 Version: 1.53.60
+1, Signature Document SDK.
+2, First version publish.
+3, Beta Version SDK
+
+2019-03-18 Version: 1.53.59
+1, Update Dependency
+
+2019-03-18 Version: 1.53.58
+1, move AssociatePerson\Tag field
+2, Optimize RealName field
+
+2019-03-18 Version: 1.53.57
+1, Update Dependency
+
+2019-03-18 Version: 1.53.56
+1, Update Dependency
+
+2019-03-18 Version: 1.53.55
+1, Update Dependency
+
+2019-03-18 Version: 1.53.54
+1,  Update Dependency
+
+2019-03-15 Version: 1.53.53
+1,  update api info
+
+2019-03-15 Version: 1.53.52
+1,  Update Dependency
+
+2019-03-15 Version: 1.53.51
+1,  Update Dependency
+
+2019-03-15 Version: 1.53.50
+1,  Update Dependency
+
+2019-03-15 Version: 1.53.49
+1,  Update Dependency
+
+2019-03-15 Version: 1.53.48
+1,  Update Dependency
+
+2019-03-15 Version: 1.53.47
+1,  Update Dependency
+
+2019-03-15 Version: 1.53.46
+1, update RemoveInstances, support  to delete 50 instances at a time. 
+
+2019-03-15 Version: 1.53.45
+1, Update Dependency
+
+2019-03-15 Version: 1.53.44
+1,  Update Dependency
+
+2019-03-15 Version: 1.53.43
+1, Update Dependency
+
+2019-03-15 Version: 1.53.42
+1, Update Dependency
+
+2019-03-14 Version: 1.53.41
+1, Update Dependency
+
+2019-03-14 Version: 1.53.40
+1, Update Dependency
+
+2019-03-14 Version: 1.53.39
+1, Update Dependency
+
+2019-03-14 Version: 1.53.38
+1, Update Dependency
+
+2019-03-14 Version: 1.53.37
+1,  Update Dependency
+
+2019-03-14 Version: 1.53.36
+1, Update Dependency
+
+2019-03-14 Version: 1.53.35
+1, Update Dependency
+
+2019-03-14 Version: 1.53.34
+1, Update Dependency
+
+2019-03-14 Version: 1.53.33
+1, Update Dependency
+
+2019-03-13 Version: 1.53.32
+1, Update Dependency
+
+2019-03-13 Version: 1.53.31
+1, Update Dependency
+
+2019-03-13 Version: 1.53.30
+1, Update Dependency
+
+2019-03-13 Version: 1.53.29
+1, Distinguish between system and service parameters
+
+2019-03-13 Version: 1.53.28
+1, add DescribeDemands interface
+
+2019-03-13 Version: 1.53.27
+1, Distinguish between system and service parameters
+
+2019-03-13 Version: 1.53.26
+1, Distinguish between system and service parameters
+
+2019-03-12 Version: 1.53.25
+1, Add application name support for config center APIs.
+2, Add GetCluster API.
+3, Support debug switch in user region APIs.
+
+2019-03-12 Version: 1.53.24
+1, Add Vpc openapi interface,Support for new fields.
+2, Support for ipv6 gateway openapi.
+3, Fixed some problems of the vpc openapi.
+
+2019-03-12 Version: 1.53.23
+1,  add agency infomation
+2,  update sdk core resources
+
+2019-03-11 Version: 1.53.22
+1,  add agency infomation
+2,  update sdk core resources
+
+2019-03-11 Version: 1.53.21
+1, Add face grouping feature .
+2, Add head pose and face quality.
+
+
+2019-03-11 Version: 1.53.20
+1, Update aliyun-java-sdk-core version.
+
+2019-03-08 Version: 1.53.19
+1, Publish instance spec describe api.
+
+2019-03-08 Version: 1.53.18
+1, This is an example of release-log.
+2, Please strictly follow this format to edit in English.
+3, Format:Number + , + Space + Description
+
+2019-03-07 Version: 1.53.17
+1, Fix go api miss service_code problem
+
+2019-03-07 Version: 1.53.16
+1, Change service code to acr
+
+2019-03-07 Version: 1.53.15
+1, Publish instance describe and release apis.
+
+2019-03-06 Version: 1.53.14
+1, Release ActionTrail Go API.
+
+2019-03-06 Version: 1.53.13
+1, Update Service Code.
+
+2019-03-05 Version: 1.53.12
+1, Update the SDK version to 1.2.4
+
+2019-03-04 Version: 1.53.11
+1, This is an example of release-log.
+2, Please strictly follow this format to edit in English.
+3, Format:Number + , + Space + Description
+
+2019-03-01 Version: 1.53.10
+1, This is an example of release-log.
+2, Please strictly follow this format to edit in English.
+3, Format:Number + , + Space + Description
+
+2019-03-01 Version: 1.53.9
+1, Support Build Function Compute Backend By SDK
+
+2019-03-01 Version: 1.53.8
+1, Add API QueryRegionConfig
+2, Add API SynchronizeResource
+
+2019-02-28 Version: 1.53.7
+1, Add new apis named ListTranscodeTask, GetTranscodeTask, GetTranscodeSummary.
+2, Add the new field named TranscodeTemplateIds and ForceDelGroup to DeleteTranscodeTemplateGroup api request, and add a new field named NonExistTranscodeTemplateIds to the api response.
+3, Add a new field named Rotate in VideoStream of Mezzanine struct to GetMezzanineInfo api response .
+4, Add a new field named Status in ImageInfo to GetImageInfo api response.
+5, Add a new field named CustomMediaInfo to UpdateVideoInfo, GetVideoInfo and SearchMedia api to support the custom mediaInfo feature.
+6, Add a new filed named PlayInfoList and some Audit fields to SearchMedia api response.
+7, Clean up an api named DeleteTranscodeTemplates, which is replaced with the api named DeleteTranscodeTemplateGroup.
+
+2019-02-27 Version: 1.53.6
+1, Add three APIs for tag. APIs : TagResources, UntagResources, ListTagResources.
+
+2019-02-27 Version: 1.53.5
+1, Update Config API.
+
+2019-02-26 Version: 1.53.4
+1, Industry brain v1.3.7 release
+2, Add asynchronous APIs
+3, version 1.3.7
+
+2019-02-26 Version: 1.53.3
+1, Add interface of tag.
+2, Add tag info in DescribeDBClusters and DescribeDBClusterAttribute.
+
+2019-02-25 Version: 1.53.2
+1, add opensearch to GO sdk
+
+2019-02-22 Version: 1.53.1
+1, Fixed QueryAvailableInstances response unmarshal problem
+
+2019-02-21 Version: 1.53.0
+1, New DeleteDeviceGroup interface.
+2, New DeleteDeviceAllGroup interface.
+3, New GroupId fields for QuerySyncPicSchedule input parameter.
+4, New GroupId fields for QueryAddUserInfo input parameter.
+
+2019-02-20 Version: 1.52.2
+1, Add code and message to inovkeService API
+2, User could check code and message to get more specific information
+3, 1.0.0 alpha release
+
+2019-02-18 Version: 1.52.1
+1, Initialization release SDK. EDAS now supports SDK implemented by current programming language.
+
+2019-02-18 Version: 1.52.0
+1, Instantiation: adding the property of instance.
+2, Replace the "ProducerId" and "ConsumerId" properties with "GROUP_ID".
+3, Remove parameter OnsRegionId to simplified usage.
+
+2019-02-18 Version: 1.51.28
+1, industrial-brain release.
+2, publish SDK to public package stores.
+3, 1.0.0 including all APIs in doc.
+
+2019-02-18 Version: 1.51.27
+1, Add DryRun into StartInstance, StopInstance and RebootInstance.
+2, Add snapshot operations: ExportSnapshot and ImportSnapshot
+
+2019-02-17 Version: 1.51.26
+1,  API definition support 'ForceNonceCheck', 'DisableInternet' parameter settings
+
+
+2019-02-15 Version: 1.51.25
+1, Modify DescribeDBInstances LastDowngradeTime DataType
+
+2019-02-14 Version: 1.51.24
+1, Update DescribeCdnTypes.
+
+2019-02-14 Version: 1.51.23
+1, Update DescribeTopDomainsByFlow.
+
+2019-01-30 Version: 1.51.22
+1, Add a new api called GetURLUploadInfos to query the upload task of UploadMediaByURL.
+2, Clean up the old api related to the CDN of VoD that is going offline, such as DescribeDomainBpsData, is replaced with the new CDN api.
+3, Clean up the old AI related apis of VoD, such as SubmitAIASRJob, is replaced with the new AI api.
+4, Clean up an api called GetVideoPlayInfo, which is used by the old player SDKs that are no longer supported.
+5, Clean up some apis that used only by the VoD console to avoid misuse, such as OpenVodService.
+
+2019-01-30 Version: 1.51.21
+1, Add a new pop interface to support deleting item by skuId which is defined by users to distinguish items
+
+2019-01-30 Version: 1.51.20
+1, Add a new pop interface to support deleting item by skuId which is defined by users to distinguish items
+
+2019-01-30 Version: 1.51.19
+1, Add a new pop interface to support deleting item by skuId which is defined by users to distinguish items
+
+2019-01-30 Version: 1.51.18
+1, Add a new pop interface to support deleting item by skuId which is defined by users to distinguish items
+
+2019-01-30 Version: 1.51.17
+1, Add a new pop interface to support deleting item by skuId which is defined by users to distinguish items
+
+2019-01-29 Version: 1.51.16
+1, Add a new pop interface to support deleting item by skuId which is defined by users to distinguish items
+
+2019-01-29 Version: 1.51.15
+1, This is an example of release-log.
+2, Please strictly follow this format to edit in English.
+3, Format:Number + , + Space + Description
+
+2019-01-29 Version: 1.51.14
+1, Make obsolete api offline.
+2, Fix some bug.
+
+
+2019-01-28 Version: 1.51.13
+1, Release 3 new Alibaba Cloud Bill API(QueryBillOverview、QueryBill、QueryInstanceBill). 
+2, Kindly suggest replace to new APIs who is using the old ones(QueryMonthlyBill、QuerySettlementBill、QueryMonthlyInstanceConsumption).
+
+2019-01-28 Version: 1.51.12
+1, Support modify vSwitch of scalingGroup.
+2, Support new target tracking scaling rule.
+
+2019-01-28 Version: 1.51.11
+1, modify DescribeSlowLogs OpenApi.
+
+
+2019-01-23 Version: 1.51.10
+1, release new version
+
+2019-01-23 Version: 1.51.9
+1, release new version
+
+2019-01-23 Version: 1.51.8
+1, new go version
+
+2019-01-23 Version: 1.51.7
+1, Add model relevant parameter
+1, Add plugin relevant parameter
+
+2019-01-23 Version: 1.51.6
+1, Add model relevant parameter
+
+2019-01-23 Version: 1.51.5
+1, support plugin
+2, support model
+
+2019-01-23 Version: 1.51.4
+1, Add model relevant parameter
+
+2019-01-22 Version: 1.51.3
+1, Add model relevant parameters
+
+2019-01-22 Version: 1.51.2
+1, support Stack Policy setting .
+
+2019-01-21 Version: 1.51.1
+1, Interface DescribePluginApis returns the modification
+
+
+2019-01-17 Version: 1.51.0
+1, Add api AcceptInquiredSystemEvent.
+2, Add ExtendedAttribute to response of api DescribeInstanceHistoryEvents.
+3, Add ExtendedAttribute to response of api DescribeInstancesFullStatus.
+
+2019-01-16 Version: 1.50.10
+1, The plugin feature is released and supports a variety of plugins, as follows:trafficControl、backendSignature、ipControl、jwtAuth、cors、caching
+
+2019-01-15 Version: 1.50.9
+1, Add SubmitVerification API for RPMin solution.
+2, Return authority comparison score in GetStatus, SubmitMaterials and SubmitVerification.
+
+2019-01-15 Version: 1.50.8
+1, Go Lang API release
+2, Support UploadCertificate,CertficateList function;
+
+2019-01-15 Version: 1.50.7
+1, Add new apis called AddTranscodeTemplateGroup, UpdateTranscodeTemplateGroup, ListTranscodeTemplateGroup, GetTranscodeTemplateGroup, SetDefaultTranscodeTemplateGroup ,DeleteTranscodeTemplateGroup and DeleteTranscodeTemplates which support transcode template feature.
+2, Add new apis called AddAITemplate, DeleteAITemplate, UpdateAITemplate, GetAITemplate, ListAITemplate, GetDefaultAITemplate and SetDefaultAITemplate which support AI template feature.
+3, Add new apis called SubmitAIMediaAuditJob, GetAIMediaAuditJob, GetMediaAuditResult, GetMediaAuditResultTimeline which support AIMediaAudit feature.
+4, Add the field named Priority to SubmitTranscodeJobs api request.
+5, Add the field named UserData to UploadMediaByURL api request.
+6, Add the field named UserData to CreateUploadImage api request.
+7, Add the field named UserData to CreateUploadAttachedMedia api request.
+
+2019-01-14 Version: 1.50.6
+1, Release Go SDK for CR
+
+2019-01-11 Version: 1.50.5
+1, CreateOfficeConversionTask, ConvertOfficeFormat support Hidecomments
+
+2019-01-10 Version: 1.50.4
+1, regenerated for ECS/2014-05-26
+
+2019-01-10 Version: 1.50.3
+1, Add fields for QueryBrokerDemand api.
+
+2019-01-09 Version: 1.50.2
+1, Add user role support.
+
+2019-01-09 Version: 1.50.1
+1, Add user role support.
+2, Add new APIs for IMM.
+
+2019-01-07 Version: 1.50.0
+1, Airec SDK Release Version 1.0.0.
+
+2019-01-04 Version: 1.49.4
+1, modify DescribeSlowLogs, support query param SQLHASH, remove SQLID query param.
+2, modify DescribeSlowLogRecords, response values add SQLHASH, remove SQLID.
+3, upgrade rds sdk version 2.3.1.
+
+2019-01-04 Version: 1.49.3
+1, Change the DescribeInstance response esConfig List => Map
+
+2018-12-29 Version: 1.49.2
+1, re-generate go sdk for sts.
+
+2018-12-29 Version: 1.49.1
+1, re-generate Go SDK for RAM
+
+2018-12-29 Version: 1.49.0
+1, Add EnableUser interface, Support admin user to enable another user.
+2, Add DisableUser Interface, Support admin user to disable another user.
+3, Add DeleteUser Interface, Support admin user to delete another user.
+
+2018-12-29 Version: 1.48.8
+1, Add new set image video api
+
+2018-12-28 Version: 1.48.7
+1, Add new set image video api
+
+2018-12-28 Version: 1.48.6
+1, Add new set image video api
+
+2018-12-28 Version: 1.48.5
+1, Add new set image video api
+
+2018-12-28 Version: 1.48.4
+1, Add new set image video api.
+
+
+2018-12-28 Version: 1.48.3
+1, Add new set image video api.
+2, Add video async task api.
+
+2018-12-27 Version: 1.48.2
+1, fix php sdk
+
+2018-12-27 Version: 1.48.1
+1, Add DescribeZones Api.
+
+2018-12-27 Version: 1.48.0
+1, Elasticsearch GO sdk release.
+
+2018-12-25 Version: 1.47.3
+1, Add interface of endpoint.
+2, Add interface of cluster parameter.
+
+2018-12-21 Version: 1.47.2
+1, ARMS SDK 2018-12-19 go sdk upload
+
+2018-12-20 Version: 1.47.1
+1, Sync CDN API.
+
+2018-12-20 Version: 1.47.0
+1, Add Dns Sec apis.
+2, Add coupon and promotion fields for order apis.
+
+2018-12-20 Version: 1.46.0
+1, Add Dns Sec apis.
+2, Add coupon and promotion fields for order apis.
+
+2018-12-17 Version: 1.45.3
+1, Add EnableBillGeneration interface.
+2, Authorization for Virtual Network Operator.
+
+
+2018-12-17 Version: 1.45.2
+1, First Release
+
+2018-12-16 Version: 1.45.1
+1, Add a new api called AddMediaSequences to add media sequences of vod videos with in/out or live streams with start time/end time.
+
+2018-12-15 Version: 1.45.0
+1, first release
+2, this SDK is for control purposes, programmatic interface of HTTPDNS console: https://httpdns.console.aliyun.com
+
+2018-12-14 Version: 1.44.2
+1, fixed sdk unit loute .
+2, upgrade rds sdk version 2.2.0.
+
+2018-12-14 Version: 1.44.1
+1, fix service code to rds
+
+2018-12-13 Version: 1.44.0
+1, Add SystemDiskSize in CreateCluster and AddNodes, add more parameters in RecoverCluster
+
+2018-12-12 Version: 1.43.15
+1, Add interface GrantAccountPrivilege;
+2, Add interface RevokeAccountPrivilege;
+
+2018-12-12 Version: 1.43.14
+1, Sync CDN API.
+
+2018-12-12 Version: 1.43.13
+1, Fix a bug.
+
+2018-12-12 Version: 1.43.12
+1, Sync CDN API.
+
+2018-12-11 Version: 1.43.11
+1, Sync CDN API.
+
+2018-12-11 Version: 1.43.10
+1, Sync CDN API.
+
+2018-12-11 Version: 1.43.9
+1, Release Location Go SDK
+
+2018-12-11 Version: 1.43.8
+1, DescribeAccount support OwnerAccount params.
+2, Upgrade Rds SDK Version to 2.3.0
+
+2018-12-11 Version: 1.43.7
+1, Modify DescribeDBInstances OpenApi lastDowngradeTime dataType. 
+2, Upgrade SDK Version to 2.0.3.
+
+2018-12-11 Version: 1.43.6
+1, Sync CDN API.
+
+2018-12-11 Version: 1.43.5
+1, Add ModifyInstanceVpcAuthMode OpenApi.
+2, Upgrade SDK Version to 2.0.4.
+
+2018-12-06 Version: 1.43.4
+1, Add api RedeployInstance
+
+2018-12-06 Version: 1.43.3
+1, Add DescribeLiveDomainRealTimeBpsData, DescribeLiveDomainRealTimeHttpCodeData,DescribeLiveDomainRealTimeTrafficData.
+2, Update DescirbeCasterChannels and DescribeCasterStreamUrl.
+
+
+2018-12-05 Version: 1.43.2
+1, Scaling group support vServerGroup.
+
+2018-12-05 Version: 1.43.1
+1, Add image async job.
+2, Fix group bug.
+
+2018-12-04 Version: 1.43.0
+1, The first release of Alibaba Cloud BaaS SDK
+
+2018-12-03 Version: 1.42.10
+1, Sync CDN API.
+
+2018-12-03 Version: 1.42.9
+1, Sync CDN API.
+
+2018-12-03 Version: 1.42.8
+1, Update 2014-11-11 API.
+
+2018-12-03 Version: 1.42.7
+1,  Add a parameter to RemoveInstances.
+
+2018-11-30 Version: 1.42.6
+1, Add new apis called AddVodTemplate, UpdateVodTemplate, DeleteVodTemplate, ListVodTemplate, GetVodTemplate and SetDefaultVodTemplate which support vodtemplate feature.
+2, Add a new api called CreateUploadAttachedMedia to get upload auth for attached media
+3, Add new apis called AddWorkFlow, UpdateWorkFlow, DeleteWorkFlow, ListWorkFlow, GetWorkFlow  which support workflow feature.
+
+2018-11-29 Version: 1.42.5
+1, This is the first version of Uis service.
+
+2018-11-28 Version: 1.42.4
+1, Add RedeployInstance interface, and support to migrate ecs instance with specified maintenance events actively
+
+2018-11-27 Version: 1.42.3
+1, ConvertOfficeFormat support TgtFilePrefix, TgtFileSuffix, TgtFilePages, FitToPagesTall, FitToPagesWide
+
+2018-11-27 Version: 1.42.2
+1, add doc index api
+
+2018-11-27 Version: 1.42.1
+1, api for custom keyword lib、similartext lib、voice keyword lib
+2, api for custom image lib
+3, support client file detect for image detection scenes、voice detection scenes、video detection scenes、file detection scenes
+
+2018-11-26 Version: 1.42.0
+1, Add RegisterInstance interface, Support admin or DBA user to register new db instance.
+2, Add RegisterUser Interface, Support admin user to register new user.
+3, Add GetOpLog Interface, Support admin user to get operation log.
+
+2018-11-22 Version: 1.41.2
+1, Increase the scene field
+
+2018-11-22 Version: 1.41.1
+1, Provide attribute info for DescribePricingModule api.
+
+2018-11-22 Version: 1.41.0
+1, Add ScrollDomainList api.
+2, Add email filter for QueryRegistrantProfile.
+
+2018-11-22 Version: 1.40.4
+1, Add parameter DeletionProtection when creating instance and modifying instance attribute
+
+
+2018-11-21 Version: 1.40.3
+1, Add new apis called AddWatermark, UpdateWatermark, DeleteWatermark, ListWatermarks, GetWatermark and SetDefaultWatermark which support watermark feature.
+2, Add a new api called RegisterMedia which supports registration of audio and video media files that already exist in the OSS bucket.
+3, Add the field named OverrideParams to SubmitTranscodeJobs api request.
+
+2018-11-20 Version: 1.40.2
+1, Fix Compatibility Problems
+
+2018-11-20 Version: 1.40.1
+1, Add MNS STS Token Query API
+2, Add MNS Minimal Package
+
+2018-11-19 Version: 1.40.0
+1, Add field BargainSellerPrice and BargainSellerMobile
+
+2018-11-19 Version: 1.39.3
+1, Fixed some problems.
+
+2018-11-19 Version: 1.39.2
+1, Add query support for redeem
+
+2018-11-16 Version: 1.39.1
+1, update version
+
+2018-11-15 Version: 1.39.0
+1, ECS support ipv6Address
+
+2018-11-15 Version: 1.38.3
+1, update version
+
+2018-11-15 Version: 1.38.2
+1, update version.
+
+2018-11-15 Version: 1.38.1
+1, Remove FaceCompare, FaceRegist, FaceSearch api.
+2, Add DetectLogo api.
+3, CreateOfficeConversionTask support IdempotentToken.
+
+2018-11-14 Version: 1.38.0
+1, Better support for hybrid cluster.
+
+2018-11-13 Version: 1.37.0
+1, Add FuzzyMatchDomainSensitiveWord interface,Support fuzzy matching sensitive words.
+2, Add BatchFuzzyMatchDomainSensitiveWord interface,Support batch fuzzy matching sensitive words.
+3, Add DynamicCheck properties for results of CheckDomain interface.
+
+2018-11-13 Version: 1.36.0
+1, Add FuzzyMatchDomainSensitiveWord interface,Support fuzzy matching sensitive words.
+2, Add BatchFuzzyMatchDomainSensitiveWord interface,Support batch fuzzy matching sensitive words.
+3, Add DynamicCheck properties for results of CheckDomain interface.
+
+2018-11-10 Version: 1.35.4
+1, Update SetWaitingRoomConfig.
+
+2018-11-08 Version: 1.35.3
+1, Update Version.
+
+
+2018-11-07 Version: 1.35.2
+1, Add API CreateTemplate,DeleteTemplate,GetAllTemplate,GetTemplateInfo.
+2, Add API  GetTaskStatus,StartTask,StopTask.
+3, Add API GetTaskParam,UpdateTaskParam.
+
+
+2018-11-02 Version: 1.35.1
+1, deviceName and productKey can be used instead of iotId.
+2, New productKey fields for queryauthentication output parameter.
+3, New deviceName fields for queryauthentication output parameter.
+
+2018-11-02 Version: 1.35.0
+1, first version
+
+2018-10-31 Version: 1.34.13
+1, update
+
+2018-10-31 Version: 1.34.12
+1, Update SetWaitingRoomConfig.
+
+2018-10-31 Version: 1.34.11
+1, Add SetWaitingRoomConfig.
+
+2018-10-31 Version: 1.34.10
+1, Add SetWaitingRoomConfig.
+
+2018-10-31 Version: 1.34.9
+1, The DescribeDBInstanceAttribute add replicaSets response value.
+2, The DescribeDBInstances support engine query.
+
+2018-10-30 Version: 1.34.8
+1, Add API DescribeLiveDomainBpsData,DescribeLiveDomainTrafficData.
+
+
+2018-10-29 Version: 1.34.7
+1, Add ots trigger api interface.
+
+2018-10-29 Version: 1.34.6
+1, update
+
+2018-10-26 Version: 1.34.5
+1, Remove useless parameters QueryDomainAdminDivision api.
+
+2018-10-26 Version: 1.34.4
+1, Add apis for trademark domains.
+2, Retry publish SDK.
+
+2018-10-26 Version: 1.34.3
+1, Add apis for trademark domains.
+
+2018-10-26 Version: 1.34.2
+1, Return AuditConclusions in SubmitMaterials API.
+
+2018-10-25 Version: 1.34.1
+1, Add apis for trademark domains.
+
+2018-10-25 Version: 1.34.0
+1, Add apis for trademark domains.
+
+2018-10-25 Version: 1.33.0
+1, Add apis for trademark domains.
+2, Add QueryDomainAdminDivision api.
+
+2018-10-16 Version: 1.32.3
+1, This version add MetricQuery interface to support retcode and apm metric query.
+
+2018-10-16 Version: 1.32.2
+1, This version add MetricQuery interface to support retcode and apm metric query.
+
+2018-10-16 Version: 1.32.1
+1, This version add MetricQuery interface to support retcode and apm metric query.
+
+2018-10-16 Version: 1.32.0
+1, Delete deprecated and unusable apis : AddIpRange, UnbindIpRange, BindIpRange, DescribeIntranetAttributeKb, DescribeIpRanges, ModifyIntranetBandwidthKb, DescribeEventDetail, CheckAutoSnapshotPolicy, CheckDiskEnableAutoSnapshotValidation, DescribeAutoSnapshotPolicy
+2, Add instance topology api DescribeInstanceTopology
+3, Add mount point in DescribeDisksFullStatus
+
+
+2018-10-12 Version: 1.31.8
+1, ModifyCenAttribute supports ProtectionLevel.
+2, New APIs: PublishRouteEntries/WithdrawPublishedRouteEntries/DescribePublishedRouteEntries
+
+2018-10-11 Version: 1.31.7
+1, Add a new api called DeleteMezzanines to clear mezzanine infos and storages.
+2, Add the field called PlayConfig to GetVideoPlayAuth and GetPlayInfo api request.
+3, Add a new api called UpdateImageInfos to update image information.
+
+2018-10-10 Version: 1.31.6
+1, add UpdateProject api, support update CU, ServiceRole
+2, PutProject not support edit
+3, CreateOfficeConversionTask api now supports FitToPagesTall, FitToPagesWide
+4, Remove paramater Engines, Indexers from project apis
+
+2018-10-09 Version: 1.31.5
+1, v1.0.0-->v1.0.1
+2, provider new region:beijing/shenzhen/zhangjiakou
+3, provider service for VPC user;
+
+2018-09-30 Version: 1.31.4
+1, This is an example of release-log.
+2, Please strictly follow this format to edit in English.
+3, Format:Number + , + Space + Description
+
+2018-09-29 Version: 1.31.3
+1, Sync cdn api.
+
+2018-09-29 Version: 1.31.2
+1, This is an example of release-log.
+2, Please strictly follow this format to edit in English.
+3, Format:Number + , + Space + Description
+
+2018-09-29 Version: 1.31.1
+1, This is an example of release-log.
+2, Please strictly follow this format to edit in English.
+3, Format:Number + , + Space + Description
+
+2018-09-27 Version: 1.31.0
+1, Add new API ListQueues, modify API SetAutoScaleConfig to support queue related features.
+
+2018-09-27 Version: 1.30.8
+1, modify getFaces Api
+
+2018-09-27 Version: 1.30.7
+1, modify getFaces Api
+
+2018-09-25 Version: 1.30.6
+1, Add GetHotlineRecord and QueryHotlineRecord interface, version 1.0.0
+
+2018-09-25 Version: 1.30.5
+1, Fix bug in GetVerifyToken and SubmitMaterials API.
+
+2018-09-22 Version: 1.30.4
+1, update
+
+2018-09-20 Version: 1.30.3
+1, Fix publish failure for Java, Python and C# SDK.
+
+2018-09-20 Version: 1.30.2
+1, BssOpenApi first deploy.
+
+2018-09-20 Version: 1.30.1
+1, BssOpenApi first deploy.
+
+2018-09-19 Version: 1.30.0
+1, Add ens api, include SaveSingleTaskForDisassociatingEns, SaveSingleTaskForAssociatingEns, QueryLocalEnsAssociation and QueryEnsAssociation.
+
+2018-09-17 Version: 1.29.10
+1, Add field for AddCasterVideoResource, DescribeCasterVideoResources, ModifyCasterVideoResource.
+
+
+2018-09-17 Version: 1.29.9
+1, describeRegions modify.
+
+2018-09-17 Version: 1.29.8
+1, ModifySecurityIps support WhitelistNetworkType 
+
+2018-09-16 Version: 1.29.7
+1, add CheckInstanceExist OpenApi.
+
+2018-09-14 Version: 1.29.6
+1, Add DedicatedHost Feature
+
+2018-09-13 Version: 1.29.5
+1, modify CheckDBInstance OpenApi
+
+2018-09-13 Version: 1.29.4
+1, Add CreateChannelToken.
+
+
+2018-09-11 Version: 1.29.3
+1, add CheckDBInstance OpenApi.
+
+2018-09-06 Version: 1.29.2
+1, fixed DescirbeRegions zoneId date type.
+
+2018-09-06 Version: 1.29.1
+1, AutoScaling support launchTemplate.
+
+2018-09-05 Version: 1.29.0
+1, Add new APIs with control policy for querying price
+
+2018-09-03 Version: 1.28.3
+1, voice identify interface
+2, client upload credentials interface
+
+2018-09-03 Version: 1.28.2
+1, Add new service API:FindServiceStatisticalData, which can support query service statistical data.
+
+2018-08-31 Version: 1.28.1
+1, The CreateInstance supported VPC IpAddress.
+
+2018-08-28 Version: 1.28.0
+1, Add new APIs for profiling application performance: GetCloudMetricProfiling, etc.
+2, Add new APIs to support Shifter container applications: AddContainerApp, etc.
+
+2018-08-28 Version: 1.27.6
+1, Add param for DescribeRegions,support AcceptLanguage,RegionEndpoint.
+
+2018-08-27 Version: 1.27.5
+1, add Ess alarm task api, CreateAlarm, DeleteAlarm, DescribeAlarms, DeleteAlarm, EnableAlarm, DisableAlarm
+
+
+2018-08-27 Version: 1.27.4
+1, createInstance supported IpAddress param.
+
+2018-08-24 Version: 1.27.3
+1, Add api: DetectQRCode
+
+2018-08-23 Version: 1.27.2
+1, RunInstance add privateIpAddress.
+
+2018-08-23 Version: 1.27.1
+1, This is an example of release-log.
+2, Please strictly follow this format to edit in English.
+3, Format:Number + , + Space + Description
+
+2018-08-23 Version: 1.27.0
+1, Add CreateVpnGateway API.
+2, Add product Ipv6Translator.
+
+
+2018-08-22 Version: 1.26.2
+1, upgrade mongodb sdk.
+
+2018-08-22 Version: 1.26.0
+1, Add api CreateSimulatedSystemEvents, support creating one or more simulated system events.
+2, Add api CancelSimulatedSystemEvents, support cancelling one or more simulated system events.
+
+2018-08-21 Version: 1.25.8
+1, DeleteFaceSearchImageByIdRequest add field: srcUri(String).
+2, CreateFaceSetResponse  add field: faces(Long).
+3, GetFaceSetResponse add field: faces(Long).
+4, Fix class Blurness in IndexFaceResponse.
+
+2018-08-21 Version: 1.25.7
+1, Repair describeLaunchTemplateVersions securityEnhancementStrategy type
+
+2018-08-17 Version: 1.25.6
+1, Add a new api called DeleteImage to clear the image resource.
+2, Add the field called AdditionType and OutputType to GetMezzanineInfo api request.
+3, Add the field called OutputType to GetMezzanineInfo api response.
+4, Add the field called CreationTime and ModificationTime to GetPlayInfo api response.
+
+2018-08-17 Version: 1.25.5
+1, New apkpubkey fields for queryauthentication output parameter.
+2, New packagename fields for queryauthentication output parameter.
+3, New clientId fields for queryauthentication output parameter.
+
+2018-08-16 Version: 1.25.4
+1, ModifyScalingConfiguration add imageName.
+2, CreateScalingConfiguration add imageName.
+
+2018-08-15 Version: 1.25.3
+1, Fix bug in GetMaterials API.
+2, GetVerifyToken added a new param VerifyConfigs
+
+2018-08-15 Version: 1.25.2
+1, Add domain operation api AddLiveDomain,DeleteLiveDomain,DescribeLiveDomainDetail,StartLiveDomain,StopLiveDomain.
+2, Add certificate operation api DescribeLiveCertificateDetail,DescribeLiveCertificateList,SetLiveDomainCertificate.
+3, Add domain config api BatchSetLiveDomainConfigs,BatchDeleteLiveDomainConfigs,DeleteLiveSpecificConfig,DescribeLiveDomainConfigs.
+
+2018-08-15 Version: 1.25.1
+1, Update ecs tag to 20 maximum
+
+
+2018-08-13 Version: 1.25.0
+1, New userinfo fields for registerface input parameter.
+2, New userinfo fields for updateface input parameter.
+3, New userinfo fields for queryface output parameter.
+
+2018-08-13 Version: 1.24.7
+1, Add cross domain support.
+2, Add parameter SerialNumber to interface RebootSmartAccessGateway.
+
+2018-08-08 Version: 1.24.6
+1, The official release 4.0.0
+
+2018-08-08 Version: 1.24.5
+1, Update FC apis.
+
+2018-08-08 Version: 1.24.4
+1, First release.
+
+2018-08-05 Version: 1.24.3
+1, Add Interface SubmitSubtitleJob
+2, Support convert ttml、stl subtitle to vtt
+
+2018-08-04 Version: 1.24.2
+1, Add a new api called SetAuditSecurityIp to set audit security ip.
+2, Add a new api called ListAuditSecurityIp to query audit security ip list.
+3, Add a new api called UploadMediaByURL to bulk upload media based on urls.
+4, Add the field called StorageLocation and TemplateGroupId to GetVideoInfo api response.
+5, Add the field called StorageLocation and TemplateGroupId to GetVideoInfos api response.
+6, Add the field called OutputType and Status to GetPlayInfo api response.
+
+2018-08-04 Version: 1.24.1
+1, CreateOfficeConversionTask add TgtFilePages field to specify the final uploaded page
+
+2018-08-03 Version: 1.24.0
+1, Add new API AddLocalNodes, for adding local machine to a hybrid cluster
+
+2018-08-02 Version: 1.23.7
+1, Add parameter(GroupId) for CreateNotifyPolicy,GetNotifyPolicy,DeleteNotifyPolicy,ListNotifyPolicy.
+
+2018-08-01 Version: 1.23.6
+1, Add parameter(DryRun) for CreateAlarm and UpdateAlarm.
+
+2018-08-01 Version: 1.23.5
+1, Add api: MoPenQueryCanvas, MoPenDoRecognize, MoPenSendMqttMessage, MoPenFindGroup
+
+2018-08-01 Version: 1.23.4
+1, Support describePrice for market image, add return detailInfo in interface describePrice
+
+2018-07-26 Version: 1.23.3
+1, Add RemoveTerminals API.
+
+2018-07-26 Version: 1.23.2
+1, Add new API: SendDryRunSystemEvent,PutMetricAlarm,DescribeAlarmsForDimensions,DescribeAlarms.
+
+2018-07-26 Version: 1.23.1
+1, Add BatchGetJobMetricInfo API.
+2, Add BatchGetPluginConfigInfo API.
+3, Add GetJobTopology API.
+
+2018-07-13 Version: 1.23.0
+1, New APIs for batch executing commands in cluster: InvokeShellCommand, ListCommands, etc.
+2, New APIs for HybridCluster (link E-HPC with cluster in local IDC): CreateHybridCluster, etc.
+3, New APIs for Container applications: AddContainerApp, etc.
+
+2018-07-13 Version: 1.22.6
+1, Release 2016-06-20 TableStore Open API
+
+2018-07-11 Version: 1.22.5
+1, new function: Attach and Detach Rds instance of scalingGroup.
+
+
+2018-07-11 Version: 1.22.4
+1, Add DetectFaceAttributesService.
+2, Add cloudauthPageUrl to GetVerifyTokenResponse.
+
+2018-07-10 Version: 1.22.3
+1, Add new API: EnableEventRule,DisableEventRule,DeleteEventTargets,DeleteEventRule,ListEventRules.
+2, Modify the structured parameters for API: PutEventTargets,PutEventRule,DescribeEventRule.
+
+2018-07-09 Version: 1.22.2
+1, Add new API: DescribeEventRule,ListEventTargetsByRule,PutEventRule,PutEventTargets.
+2, Add return value(Id) for NodeProcessCreate.
+
+2018-07-05 Version: 1.22.1
+1, new function, attach/detach load balancer of scalingGroup
+
+2018-07-05 Version: 1.22.0
+1, A new optional parameter 'Perspectives' is introduced to the 'Chat' API. By filling this parameter when calling 'Chat', you'll get the knowledge base content within the specified perspectives.
+
+2018-06-28 Version: 1.21.1
+1, ScalingConfiguration support hostName and passwordInherit
+2, ScalingConfiguration support modify
+
+2018-06-27 Version: 1.21.0
+1, Modify QueryDomainRealNameVerificationInfo Api, add a return value IdentityCredentialUrl, which is domain real name verification image, you can download it via a HTTP get request,It has validity for 30 seconds.
+2, Modify QueryRegistrantProfileRealNameVerificationInfo Api, add a return value IdentityCredentialUrl, which is domain real name verification image, you can download it via a HTTP get request,It has validity for 30 seconds
+
+
+2018-06-27 Version: 1.20.6
+1, DescribeNetworkInterfaces support query with vpcId
+
+2018-06-22 Version: 1.20.5
+1, rtc openapi
+
+
+2018-06-22 Version: 1.20.4
+1, Add new API: DeleteGroupDynamicRule,ListGroupDynamicRule,ApplyTemplate,PutGroupDynamicRule.
+2, Add parameter(AlertIds) for CreateTask and ModifyTask.
+
+2018-06-21 Version: 1.20.3
+1, This is add InstanceList.
+
+2018-06-21 Version: 1.20.2
+1, This is add InstanceList.
+
+2018-06-20 Version: 1.20.1
+1, Add InstanceList in product security information query.
+
+2018-06-20 Version: 1.20.0
+1, This is the first version of jarvis-public.
+
+2018-06-20 Version: 1.19.6
+1, Add InstanceList in product security information query.
+
+2018-06-14 Version: 1.19.5
+1, Add passwordInherit.
+
+2018-06-13 Version: 1.19.4
+1, Add API AddCasterEpisodeGroupContent,CreateCaster.
+2, Add Parameter fillMode for AddCasterLayout,ModifyCasterLayout.
+3, Add return value fillMode DescribeCasterLayouts.
+4, Update ErrorCode for StartCaster,StartCasterScene,DescribeCasters,CopyCaster.
+5, Update ErrorCode for ModifyCasterLayout,DeleteCasterLayout,DeleteLiveAppRecordConfig.
+6, Update ForbidLiveStream,DescribeLiveStreamsPublishList,DescribeLiveStreamsOnlineList.
+
+2018-06-13 Version: 1.19.3
+1, Add lifecycleHook.
+
+2018-06-08 Version: 1.19.2
+1, Add scdn interface,support scdn.
+
+2018-06-06 Version: 1.19.1
+1, Change the type of srcUid to int.
+
+2018-06-06 Version: 1.19.0
+1, Add interface DescribePhoneInfo, DescribeDdosDefenseInfo, DescribeRiskListDetail, DescribePunishList.
+
+2018-05-30 Version: 1.18.1
+1, Add new API: DescribeContact and GetContacts.
+2, Add return value: alertRule for CreateTask.
+
+2018-05-29 Version: 1.18.0
+1, Add new interface DescribePhoneInfo to SDK.
+
+2018-05-28 Version: 1.17.0
+1, Add face 1-N,1-1 scan interface.
+
+2018-05-28 Version: 1.16.0
+1, ValidateSecurityGroup API
+
+2018-05-28 Version: 1.15.1
+1, add new openapi .
+
+2018-05-28 Version: 1.15.0
+1, This is an example of release-log.
+2, Please strictly follow this format to edit in English.
+3, Format:Number + , + Space + Description
+
+2018-05-26 Version: 1.14.2
+1, Add new interface InstallCloudAssistant, support Cloud Assistant client installation.
+2, Add new interface DescribeCloudAssistantStatus, support Cloud Assistant client status detection.
+
+2018-05-25 Version: 1.14.1
+1, CreateAlarm,DeleteAlarm,UpdateAlarm,DisableAlarm,EnableAlarm,ListAlarm,ListAlarmHistory,ListContactGroup,PutMetricData,QueryMetricData,QueryMetricLast,QueryMetricList,QueryMetricTop remove useless parameter: callby_cms_owner. 
+2, QueryMetricList remove useless parameter: Page.
+3, UpdateMyGroupMembers add parameter: Readers.
+4, StopTasks,StartTasks,DeleteTasks add return value: Data.
+5, ModifyTask remove invalid parameter: TaskType.
+6, CreateTask fix bug: TaskName maybe duplicated.
+7, Add lost return value for CreateTask.
+8, DescribeISPAreaCity add parameter: isp and city.
+9, remove api: PutMetricData.
+
+2018-05-23 Version: 1.14.0
+1, Add CreateDrdsAccount API, to support creating account for all databases of a DRDS instance.
+
+2018-05-23 Version: 1.13.1
+1, Add Function Compute interface,support Function Compute.
+
+2018-05-23 Version: 1.13.0
+1, Update API version to 2018-04-12. 
+2, New APIs in this new version: StartCluster, StopCluster, RecoverCluster, StartNodes, StopNodes, ListCustomImages. Support stopping a post-paid cluster or partial nodes of a cluster to save cost.
+3, New parameters for CreateCluster API: EcsChargeType. Support creating a pre-paid cluster.
+4, New parameters for CreateCluster API: DeploymentMode. Support creating a cluster with fewer manager nodes.
+
+2018-05-23 Version: 1.12.5
+1, This is an example of release-log.
+2, Please strictly follow this format to edit in English.
+3, Format:Number + , + Space + Description
+
+2018-05-22 Version: 1.12.4
+1, add DescribeMigrateTasks,DescribeOssDownloads,CheckRecoveryConditions.
+2, modify DescribeDBInstanceAttribute.
+
+2018-05-17 Version: 1.12.3
+1, Supporting ethnicGroup and idCardStartDate fields in GetMaterials api
+
+2018-05-17 Version: 1.12.2
+1, the first version of private dns SDK
+
+2018-05-11 Version: 1.12.1
+1, Add Function Compute interface,support Function Compute.
+
+2018-05-09 Version: 1.12.0
+1, Add apis for domain broker.
+
+2018-05-08 Version: 1.11.3
+1, Add instance params.
+
+2018-05-08 Version: 1.11.2
+1, Remove DescribeAccountAttributes.
+
+2018-05-03 Version: 1.11.1
+1, Publish DRDS go sdk for the first time.
+2, Support for creation/modification/deletion/description operation for DRDS instances and databases.
+
+2018-05-02 Version: 1.11.0
+1, Add new interface InstallCloudAssistant, support Cloud Assistant client installation.
+2, Add new interface DescribeCloudAssistantStatus, support Cloud Assistant client status detection.
+
+2018-04-28 Version: 1.10.3
+1, Add api: DescribeTasks、StartTasks、StopTasks、DeleteTasks、ModifyTask、CreateTask、DescribeTaskDetail、DescribeISPAreaCity.
+
+2018-04-28 Version: 1.10.2
+1, Add dcdn domain interface,Support add、modify、delete、query dcdn domain.
+2, Add dcdn config interface,Support set、delete、query domain config.
+
+2018-04-27 Version: 1.10.1
+1, release hsm open api
+2, hsm open api includes DescribeRegions, DescribeInstances, ModityInstance, ConfigNetwork, ConfigWhiteList
+
+2018-04-26 Version: 1.10.0
+1, Add apis for domain group.
+3, Add fields for QueryDomainList.
+
+2018-04-25 Version: 1.9.6
+1, CreateMyGroups add parameter "options"
+
+2018-04-24 Version: 1.9.5
+1, Add api:UpdateMyGroupMembers
+
+2018-04-24 Version: 1.9.4
+1, add interface FetchPhotos
+2, add xflush log param unixTimestamp
+
+2018-04-23 Version: 1.9.3
+1, DescribeInstanceHistoryEvents adds parameter instanceEventTypes and instanceEventCycleStatuss.
+2, InstanceId parameter is not necessary for DescribeInstanceHistoryEvents now.
+3, DescribeInstancesFullStatus adds parameter instanceEventTypes.
+
+2018-04-23 Version: 1.9.2
+1, Add notificationConfiguration.
+2, Add standby status.
+
+2018-04-20 Version: 1.9.1
+1, Interface DescribeAlarmHistory/ListAlarmHistory Add return value instanceName.
+
+2018-04-17 Version: 1.8.3
+1, EditPhotos add input param TakenAt
+2, add FetchMomentPhotos
+3, ListAlbums add return param Remark
+
+2018-04-16 Version: 1.8.2
+1, Release go sdk
+
+
+2018-04-11 Version: 1.8.1
+1, GetLibrary/FetchLibraries add return ctime
+2, Editphotos add input param takenAt
+
+2018-04-10 Version: 1.8.0
+1, Add three interfaces CreateNetworkInterfacePermission DeleteNetworkInterfacePermission DescribeNetworkInterfacePermissions.
+
+2018-04-10 Version: 1.7.3
+1, publish Project API.
+2, publish Service API.
+3, publish Service order API.
+4, publish Credential API.
+5, publish CAS API.
+
+2018-04-09 Version: 1.7.2
+1, Add api: QueryMetricData, QueryMetricTop, TaskConfigCreate, TaskConfigDelete, TaskConfigEnable, TaskConfigList, TaskConfigModify, TaskConfigUnhealthy
+2, Remove api: PutSystemEvent 
+
+2018-04-08 Version: 1.7.0
+1, Add voice asynchronous scan interface.
+
+2018-04-04 Version: 1.6.1
+1, add tablestore trigger pop api and sample code
+
+2018-04-04 Version: 1.6.0
+1, Add APIs for domain transfer in and transfer out.
+2, Add APIs for poll and acknowledge domain task.
+
+2018-04-03 Version: 1.5.0
+1, Add APIs for domain transfer in and transfer out.
+2, Add APIs for poll and acknowledge domain task.
+3, Add API for query domain group list.
+
+2018-03-30 Version: 1.4.11
+1, API QueryCustomerSaleInfo arguments update.
+
+2018-03-29 Version: 1.4.10
+1, edit FetchLibraries return param format
+
+2018-03-29 Version: 1.4.9
+1, Add APIs: CreateAlias, UpdateAlias, DeleteAlias, ListAliases, ListAliasesByKeyId.
+2, Add APIs: GetParametersForImport, ImportKeyMaterial, DeleteKeyMaterial.
+3, Update KeyMetadata for CreateKey and DescribeKey.
+
+2018-03-29 Version: 1.4.8
+1, Cloud Enterprise Network SDK initial release.
+
+2018-03-29 Version: 1.4.7
+1, Cloud Enterprise Network SDK initial release.
+
+2018-03-27 Version: 1.4.6
+1, Rename QueryCustomerSaleInfo to RegionName.
+
+2018-03-27 Version: 1.4.5
+1, publish Project API.
+2, publish Service API.
+3, publish Service order API.
+4, publish Credential API.
+5, publish CAS API.
+
+2018-03-27 Version: 1.4.4
+1, add interface FetchLibraries
+
+2018-03-23 Version: 1.4.3
+1, interface DescribeInstanceTypes output InstancePpsRx InstancePpsTx
+
+2018-03-23 Version: 1.4.2
+1, interface DescribeInstanceTypes output InstancePpsRx InstancePpsTx
+
+2018-03-23 Version: 1.4.1
+1, ModifyPrepayInstanceSpec support migrateAcrossZone.
+
+2018-03-23 Version: 1.4.0
+1, Add 'QueryDevicesByAccount' and 'QueryDevicesByAlias'  Api.
+2, Remove 'QueryPushDetail' Api.
+
+2018-03-20 Version: 1.2.7
+1, add FetchAlbumTagPhotos
+2, CreatePhoto add optional param TakenAt
+
+2018-03-16 Version: 1.2.6
+1, Update GetQuotaInstance API.
+
+2018-03-16 Version: 1.2.5
+1, Synchronize to the latest api list
+
+
+2018-03-15 Version: 1.2.4
+1, Add QueryCustomerSaleInfo API.
+
+
+2018-03-09 Version:1.2.3
+1, fix bug:modify error message when roleArn is wrong
+
+2018-03-13 Version: 1.2.2
+1, API GetQuotaHistoryInfo fix field error.
+
+2018-03-09 Version: 1.2.1
+1, complete api comments
+
+2018-03-09 Version: 1.2.0
+1, improve endpoint resolver
+
+2018-03-07 Version: 1.1.7
+1, add GetAlbumsByNames
+2, add ListEvent/CreateEvent/EditEvent/DeleteEvent/GetEvent
+3, add return IdStr for string
+
+2018-03-06 Version: 1.1.6
+1, add GetAlbumsByNames
+2, add ListEvent/CreateEvent/EditEvent/DeleteEvent/GetEvent
+3, add return IdStr for string
+
+
+2018-03-06 Version: 1.1.5
+1, add GetAlbumsByNames
+2, add ListEvent/CreateEvent/EditEvent/DeleteEvent/GetEvent
+3, add return IdStr for string
+
+2018-02-28 Version: 1.1.3
+1, Add query resource inventory API.
+2, Add query topology API.
+
+2018-02-28 Version: 1.1.2
+1, Add query topology API.
+
+2018-02-27 Version: 1.1.1
+1, Add Action API.
+
+2018-02-27 Version: 1.1.0
+1, add new api DescribeClusters,DescribeClusterLogs,DescribeClusterNodes,UpgradeClusterComponents
+
+2018-02-12 Version: 1.0.0
+1. Optimize the nested structs in all response, this will bring the following incompatibilities:
+    * Api response struct changes, conclude:
+        * ecs.DescribeNetworkInterfaces
+        * ecs.DescribeDeploymentSetTopology
+        * rds.DescribeDBInstanceIPArrayList
+        * rds.DescribeDBInstancesAsCsv
+        * slb.DescribeLoadBalancersRelatedEcs
+        * vpc.DescribeVpcAttribute
+        * vpc.DescribeVirtualBorderRouters
+        * mts.RegisterMediaDetailPerson
+        * mts.QueryEditingJobList
+        * mts.SubmitEditingJobs
+        * mts.QueryMediaListByURL
+        * mts.ListJob
+        * mts.QueryMediaList
+        * mts.QueryJobList
+        * mts.SubmitJobs
+        * ehpc.DescribeCluster
+        * aegis.GetEntityList
+        * aegis.DescribeStratety
+
+
+2018-02-09 Version: 0.12.0
+1, Aliyun E-HPC service SDK, initial version.
+2, Include APIs of E-HPC clusters, nodes, users, jobs, job templates etc.
+
+2018-02-07 Version: 0.11.4
+1, add the access interface of logs such as vulnerabilities, baselines, exceptions, etc.
+
+2018-02-06 Version: 0.11.3
+1, ModifyInstanceChargeType add instanceChargeType param, support prepay instance to postpay instance.
+2, ModifyPrepayInstanceSpec add operatorType param, support downgrade prepay ecs.
+
+2018-02-02 Version: 0.11.2
+1, this version is new of captcha management and nvc analyze
+
+2018-01-31 Version: 0.11.1
+1. Fixed bugs that could cause signature errors while a ROA request contains lots of special symbols
+2. Optimization of the serverError.Error() interface
+3. When there is an error of "SignatureDoseNotMatch", it is now possible to tell user if the AccessKeySecret is wrong or caused by a sdk bug
+
+2018-01-29 Version: 0.11.0
+1, Support dep
+2, Add 4 usage of credentials for each services
+3, Standard interface naming
+
+2018-01-29 Version: 0.10.0
+1, Add 'notificationChannel' parameter to Push API
+
+2018-01-24 Version: 0.9.3
+1,  Fixed a problem that the ActiveAlert interface name is not standard
+2,  Update ActiveAlert interface : ListProductOfActiveAlert / DisableActiveAlert / EnableActiveAlert
+
+2018-01-24 Version: 0.9.2
+1, Add ActiveAlert API : ListActiveAlertRuleRequest/ListProductOfActiceAlertRequest/EnableActiceAlertRequest/DisableActiceAlertRequest
+
+2018-01-24 Version: 0.9.1
+1. improve: asyncWithChan avoid panic of "write on closed channel"
+2. improve: asyncWithChan support select case usage
+3. bug fix: repeated signature nonce while retry
+4. bug fix: calling request.GetUrl() ahead of client.DoAction() will cause problems
+
+2018-01-24 Version: 0.9.0
+1, Publish domain config interface, allow users to create or delete a domain protect config under DDoS Pro.
+2, Publish domain config query interface, allow users to query a list of domain config or a single domain config.
+3, Publish domain proxy modify interface, allow users to set domain transmit proxy.
+4, Publish domain transmit rule config interface, including modify and delete type.
+5, Publish domain black and white list config interface.
+6, Publish domain cname auto status config interface.
+7, Publish domain certificate upload interface.
+8, Publish domain qps graph query interface.
+9, Publish ip attack events and traffic graph query interface.
+
+
+2018-01-23 Version: 0.8.3
+1, Tesla Dam API release.
+2, Add ActionDiskCheck, ActionDiskMask, ActionDiskRma, HostGets.
+
+
+2018-01-18 Version: 0.8.2
+1. Set default timeout to 10s
+2. Make integration tests more stable
+3. Fix the problem of LocationResolver in concurrency
+4. Modifying the naming specification
+
+2018-01-18 Version: 0.8.1
+1, Update ECS go SDK to catch up with other langs.
+2, DescribeImageSupportInstanceTypes add new param Filter and ActionType
+
+2018-01-16 Version: 0.8.0
+1,  Add TriggerMode param in AddMediaWorkflow.
+2, Add TriggerMode param in QueryMediaWorkflowList/SearchMediaWorkflow/UpdateMediaWorkflow.
+3, Add interface UpdateMediaWorkflowTriggerMode.
+
+2018-01-11 Version: 0.7.8
+1. complete partly missed service codes
+2. add default http method for roa requests
+
+2018-01-11 Version: 0.7.7
+1, Bug fix: Replenish user interface
+
+2018-01-11 Version: 0.7.6
+1, replace photo tag 2000 upgrade to 5000
+2, add TrashQuota
+
+2018-01-11 Version: 0.7.5
+1, Make the json.Unmarshal more robust
+
+2018-01-09 Version: 0.7.4
+1, Add integration tests
+
+2018-01-04 Version: 0.7.3
+1, Remove get entity info API, replaced by get entity instance.
+
+2018-01-03 Version: 0.7.2
+1, Bug fix: fix the ecs unmarshal bug
+
+2018-01-03 Version: 0.7.1
+1, Bug fix: fix the unmarshal bug
+
+2017-12-29 Version: 0.7.0
+1, First release for Domain-intl.
+2, Add interfaces for domain name registration and management.
+
+2017-12-29 Version: 0.6.8
+1, Allow the setting of AcceptFormat in the Request.
+
+2017-12-26 Version: 0.6.5
+1, Add video AI service interface.
+
+2017-12-26 Version: 0.6.4
+1, Add video AI service interface.
+
+2017-12-20 Version: 0.6.3
+1, support tile dataset
+2, use dimension value type to replace isDrillDown
+
+2017-12-20 Version: 0.6.2
+1, support tile dataset
+2, use dimension value type to replace isDrillDown
+
+
+2017-12-19 Version: 0.6.1
+1, InactivatePhotos support customer inactiveTime
+2, support customer tags
+3, ListPhotoTags、ListTags add param lang
+
+2017-12-18 Version: 0.6.0
+1, Add Scdn API.
+
+2017-12-18 Version: 0.5.7
+1, This is the first release of CCC Open API.
+
+2017-12-15 Version: 0.5.6
+1, Update SetReqAuthConfig.
+2, Add Scdn API.
+
+2017-12-15 Version: 0.5.5
+1, fix test cases
+
+2017-12-15 Version: 0.5.4
+1, Add scdn API.
+2, Update SetReqAuthConfig.
+
+2017-12-12 Version: 0.5.1
+1, remove unused fmt.print
+
+2017-12-08 Version: 0.5.0
+1, Add ARMSQueryDataSet, WhereInDimQuery interface.
+
+2017-12-08 Version: 0.4.0
+1, support endpoint.xml resolver
+
+2017-12-08 Version: 0.3.1
+1, Add ARMSQueryDataSet, WhereInDimQuery interface.
+
+2017-12-01 Version: 0.2.2
+1, Fix ineffassign problems
+
+2017-12-01 Version: 0.2.1
+1, Fix capitalizes the first letter in each word of header
+
+2017-11-28 Version: 0.2.0
+1, AK2.0 & StsToken
+
+2017-11-27 Version: 0.1.3
+1, format ft code with gofmt
+
+2017-11-27 Version: 0.1.2
+1, format code with gofmt
+
+2017-11-27 Version: 0.1.1
+1, add glide files
+

+ 95 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/Gopkg.lock

@@ -0,0 +1,95 @@
+# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
+
+
+[[projects]]
+  digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec"
+  name = "github.com/davecgh/go-spew"
+  packages = ["spew"]
+  pruneopts = "UT"
+  revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73"
+  version = "v1.1.1"
+
+[[projects]]
+  branch = "master"
+  digest = "1:205b3c069003f9d1458e4304427ab3652d8d7bac3bde1568a2d5486451e453bd"
+  name = "github.com/goji/httpauth"
+  packages = ["."]
+  pruneopts = "UT"
+  revision = "2da839ab0f4df05a6db5eb277995589dadbd4fb9"
+
+[[projects]]
+  digest = "1:b87714e57a511d88f307aba7d5b63522da12bed0a050889c81272fc50f71100e"
+  name = "github.com/jmespath/go-jmespath"
+  packages = ["."]
+  pruneopts = "UT"
+  revision = "3433f3ea46d9f8019119e7dd41274e112a2359a9"
+  version = "0.2.2"
+
+[[projects]]
+  digest = "1:709cd2a2c29cc9b89732f6c24846bbb9d6270f28ef5ef2128cc73bd0d6d7bff9"
+  name = "github.com/json-iterator/go"
+  packages = ["."]
+  pruneopts = "UT"
+  revision = "27518f6661eba504be5a7a9a9f6d9460d892ade3"
+  version = "v1.1.7"
+
+[[projects]]
+  digest = "1:33422d238f147d247752996a26574ac48dcf472976eda7f5134015f06bf16563"
+  name = "github.com/modern-go/concurrent"
+  packages = ["."]
+  pruneopts = "UT"
+  revision = "bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94"
+  version = "1.0.3"
+
+[[projects]]
+  digest = "1:e32bdbdb7c377a07a9a46378290059822efdce5c8d96fe71940d87cb4f918855"
+  name = "github.com/modern-go/reflect2"
+  packages = ["."]
+  pruneopts = "UT"
+  revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd"
+  version = "1.0.1"
+
+[[projects]]
+  digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe"
+  name = "github.com/pmezard/go-difflib"
+  packages = ["difflib"]
+  pruneopts = "UT"
+  revision = "792786c7400a136282c1664665ae0a8db921c6c2"
+  version = "v1.0.0"
+
+[[projects]]
+  digest = "1:8548c309c65a85933a625be5e7d52b6ac927ca30c56869fae58123b8a77a75e1"
+  name = "github.com/stretchr/testify"
+  packages = ["assert"]
+  pruneopts = "UT"
+  revision = "221dbe5ed46703ee255b1da0dec05086f5035f62"
+  version = "v1.4.0"
+
+[[projects]]
+  digest = "1:6c56c50b13fd3cb33b692b264727c1c89198274f5dcabaa077e3b2472037e0f9"
+  name = "gopkg.in/ini.v1"
+  packages = ["."]
+  pruneopts = "UT"
+  revision = "d4cae42d398bc0095297fc3315669590d29166ea"
+  version = "v1.46.0"
+
+[[projects]]
+  digest = "1:4d2e5a73dc1500038e504a8d78b986630e3626dc027bc030ba5c75da257cdb96"
+  name = "gopkg.in/yaml.v2"
+  packages = ["."]
+  pruneopts = "UT"
+  revision = "51d6538a90f86fe93ac480b35f37b2be17fef232"
+  version = "v2.2.2"
+
+[solve-meta]
+  analyzer-name = "dep"
+  analyzer-version = 1
+  input-imports = [
+    "github.com/goji/httpauth",
+    "github.com/jmespath/go-jmespath",
+    "github.com/json-iterator/go",
+    "github.com/stretchr/testify/assert",
+    "gopkg.in/ini.v1",
+  ]
+  solver-name = "gps-cdcl"
+  solver-version = 1

+ 50 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/Gopkg.toml

@@ -0,0 +1,50 @@
+# Gopkg.toml example
+#
+# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
+# for detailed Gopkg.toml documentation.
+#
+# required = ["github.com/user/thing/cmd/thing"]
+# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
+#
+# [[constraint]]
+#   name = "github.com/user/project"
+#   version = "1.0.0"
+#
+# [[constraint]]
+#   name = "github.com/user/project2"
+#   branch = "dev"
+#   source = "github.com/myfork/project2"
+#
+# [[override]]
+#   name = "github.com/x/y"
+#   version = "2.4.0"
+#
+# [prune]
+#   non-go = false
+#   go-tests = true
+#   unused-packages = true
+
+
+[[constraint]]
+  branch = "master"
+  name = "github.com/goji/httpauth"
+
+[[constraint]]
+  name = "github.com/jmespath/go-jmespath"
+  version = "0.2.2"
+
+[[constraint]]
+  name = "github.com/json-iterator/go"
+  version = "1.1.7"
+
+[[constraint]]
+  name = "github.com/stretchr/testify"
+  version = "1.4.0"
+
+[[constraint]]
+  name = "gopkg.in/ini.v1"
+  version = "1.46.0"
+
+[prune]
+  go-tests = true
+  unused-packages = true

+ 201 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/LICENSE

@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

+ 9 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/Makefile

@@ -0,0 +1,9 @@
+
+all:
+
+fmt:
+	go fmt ./sdk ./integration ./services/...
+
+test:
+	go test -race -coverprofile=coverage.txt -covermode=atomic ./sdk/...
+	go tool cover -html=coverage.txt -o coverage.html

+ 142 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/README-CN.md

@@ -0,0 +1,142 @@
+[English](./README.md) | 简体中文
+
+<p align="center">
+<a href=" https://www.alibabacloud.com"><img src="https://aliyunsdk-pages.alicdn.com/icons/Aliyun.svg"></a>
+</p>
+
+<h1 align="center">Alibaba Cloud SDK for Go</h1>
+
+<p align="center">
+<a href="https://badge.fury.io/gh/aliyun%2Falibaba-cloud-sdk-go"><img src="https://badge.fury.io/gh/aliyun%2Falibaba-cloud-sdk-go.svg" alt="Latest Stable Version"></a>
+<a href="https://app.fossa.io/projects/git%2Bgithub.com%2Faliyun%2Falibaba-cloud-sdk-go?ref=badge_shield"><img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2Faliyun%2Falibaba-cloud-sdk-go.svg?type=shield" alt="License"></a>
+<br/>
+<a href="https://codecov.io/gh/aliyun/alibaba-cloud-sdk-go"><img src="https://codecov.io/gh/aliyun/alibaba-cloud-sdk-go/branch/master/graph/badge.svg" alt="codecov"></a>
+<a href="https://travis-ci.org/aliyun/alibaba-cloud-sdk-go"><img src="https://travis-ci.org/aliyun/alibaba-cloud-sdk-go.svg?branch=master" alt="Travis Build Status"></a>
+<a href="https://ci.appveyor.com/project/aliyun/alibaba-cloud-sdk-go/branch/master"><img src="https://ci.appveyor.com/api/projects/status/gn17u48i53ktblfp/branch/master?svg=true" alt="Appveyor Build Status"></a>
+<a href="https://app.codacy.com/app/aliyun/alibaba-cloud-sdk-go?utm_source=github.com&utm_medium=referral&utm_content=aliyun/alibaba-cloud-sdk-go&utm_campaign=Badge_Grade_Dashboard"><img src="https://api.codacy.com/project/badge/Grade/291a39e242364b04ad442f0cce0e30d5" alt="Codacy Badge"></a>
+<a href="https://goreportcard.com/report/github.com/aliyun/alibaba-cloud-sdk-go"><img src="https://goreportcard.com/badge/github.com/aliyun/alibaba-cloud-sdk-go" alt="Go Report Card"></a>
+</p>
+
+欢迎使用 Alibaba Cloud SDK for Go。Alibaba Cloud SDK for Go 让您不用复杂编程即可访问云服务器、云监控等多个阿里云服务。
+这里向您介绍如何获取 [Alibaba Cloud SDK for Go][SDK] 并开始调用。
+
+## 在线示例
+[API Explorer][open-api] 提供在线调用阿里云产品,并动态生成 SDK 代码和快速检索接口等能力,能显著降低使用云 API 的难度。
+
+
+## 环境要求
+- 您的系统需要达到 [环境要求][Requirements], 例如,安装了不低于 1.10.x 版本的 Go 环境。
+
+## 安装
+使用 `go get` 下载安装 SDK
+
+```sh
+$ go get -u github.com/aliyun/alibaba-cloud-sdk-go/sdk
+```
+
+如果您使用了 glide 管理依赖,您也可以使用 glide 来安装 Alibaba Cloud SDK for Go
+
+```sh
+$ glide get github.com/aliyun/alibaba-cloud-sdk-go
+```
+
+另外,Alibaba Cloud SDK for Go 也会发布在 https://develop.aliyun.com/tools/sdk#/go 这个地址。
+
+## 快速使用
+在您开始之前,您需要注册阿里云帐户并获取您的[凭证](https://usercenter.console.aliyun.com/#/manage/ak)。
+
+### 创建客户端
+```go
+package main
+
+import "github.com/aliyun/alibaba-cloud-sdk-go/sdk"
+
+func main() {
+
+	client, err := sdk.NewClientWithAccessKey("REGION_ID", "ACCESS_KEY_ID", "ACCESS_KEY_SECRET")
+	if err != nil {
+		// Handle exceptions
+		panic(err)
+	}
+}
+```
+
+### ROA 请求
+```go
+package main
+
+import "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+
+func main() {
+	request := requests.NewCommonRequest()        // 构造一个公共请求
+	request.Method = "GET"                        // 设置请求方式
+	request.Product = "CS"                        // 指定产品
+	request.Domain = "cs.aliyuncs.com"            // 指定域名则不会寻址,如认证方式为 Bearer Token 的服务则需要指定
+	request.Version = "2015-12-15"                // 指定产品版本
+	request.PathPattern = "/clusters/[ClusterId]" // 指定ROA风格路径规则
+	request.ApiName = "DescribeCluster"           // 指定接口名
+	request.QueryParams["ClusterId"] = "123456"   // 设置参数值
+	request.QueryParams["RegionId"] = "region_id" // 指定请求的区域,不指定则使用客户端区域、默认区域
+	request.TransToAcsRequest()                   // 把公共请求转化为acs请求
+}
+```
+
+### RPC 请求
+```go
+package main
+
+import "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+
+func main() {
+	request := requests.NewCommonRequest()                // 构造一个公共请求
+	request.Method = "POST"                               // 设置请求方式
+	request.Product = "Ecs"                               // 指定产品
+	request.Domain = "ecs.aliyuncs.com"                   // 指定域名则不会寻址,如认证方式为 Bearer Token 的服务则需要指定
+	request.Version = "2014-05-26"                        // 指定产品版本
+	request.ApiName = "CreateInstance"                    // 指定接口名
+	request.QueryParams["InstanceType"] = "ecs.g5.large"  // 设置参数值
+	request.QueryParams["RegionId"] = "region_id"         // 指定请求的区域,不指定则使用客户端区域、默认区域
+	request.TransToAcsRequest()                           // 把公共请求转化为acs请求
+}
+```
+
+
+## 文档
+* [Requirements](docs/0-Requirements-CN.md)
+* [Installation](docs/1-Installation-CN.md)
+* [Client](docs/2-Client-CN.md)
+* [SSL Verify](docs/3-Verify-CN.md)
+* [Proxy](docs/4-Proxy-CN.md)
+* [Timeout](docs/5-Timeout-CN.md)
+* [Debug](docs/6-Debug-CN.md)
+* [Logger](docs/7-Logger-CN.md)
+* [Concurrent](docs/8-Concurrent-CN.md)
+* [Asynchronous Call](docs/9-Asynchronous-CN.md)
+* [Package Management](docs/10-Package-Management-CN.md)
+
+
+## 问题
+[提交 Issue][issue] 不符合指南的问题可能会立即关闭。
+
+
+## 贡献
+提交 Pull Request 之前请阅读[贡献指南](CONTRIBUTING.md)。
+
+## 相关
+* [阿里云服务 Regions & Endpoints][endpoints]
+* [OpenAPI Explorer][open-api]
+* [Go][go]
+* [最新发行版本][latest-release]
+
+
+## 许可证
+[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Faliyun%2Falibaba-cloud-sdk-go.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Faliyun%2Falibaba-cloud-sdk-go?ref=badge_large)
+
+[SDK]: https://github.com/aliyun/alibaba-cloud-sdk-go
+[apache]: http://www.apache.org/licenses/LICENSE-2.0
+[issue]: https://github.com/aliyun/alibaba-cloud-sdk-go/issues/new
+[open-api]: https://api.aliyun.com/
+[latest-release]: https://github.com/aliyun/alibaba-cloud-sdk-go/releases
+[go]: https://golang.org/dl/
+[endpoints]: https://developer.aliyun.com/endpoints
+[Requirements]: docs/0-Requirements-CN.md

+ 145 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/README.md

@@ -0,0 +1,145 @@
+English | [简体中文](README-CN.md)
+
+
+<p align="center">
+<a href=" https://www.alibabacloud.com"><img src="https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg"></a>
+</p>
+
+<h1 align="center">Alibaba Cloud SDK for Go</h1>
+
+<p align="center">
+<a href="https://badge.fury.io/gh/aliyun%2Falibaba-cloud-sdk-go"><img src="https://badge.fury.io/gh/aliyun%2Falibaba-cloud-sdk-go.svg" alt="Latest Stable Version"></a>
+<a href="https://app.fossa.io/projects/git%2Bgithub.com%2Faliyun%2Falibaba-cloud-sdk-go?ref=badge_shield"><img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2Faliyun%2Falibaba-cloud-sdk-go.svg?type=shield" alt="License"></a>
+<br/>
+<a href="https://codecov.io/gh/aliyun/alibaba-cloud-sdk-go"><img src="https://codecov.io/gh/aliyun/alibaba-cloud-sdk-go/branch/master/graph/badge.svg" alt="codecov"></a>
+<a href="https://travis-ci.org/aliyun/alibaba-cloud-sdk-go"><img src="https://travis-ci.org/aliyun/alibaba-cloud-sdk-go.svg?branch=master" alt="Travis Build Status"></a>
+<a href="https://ci.appveyor.com/project/aliyun/alibaba-cloud-sdk-go/branch/master"><img src="https://ci.appveyor.com/api/projects/status/gn17u48i53ktblfp/branch/master?svg=true" alt="Appveyor Build Status"></a>
+<a href="https://app.codacy.com/app/aliyun/alibaba-cloud-sdk-go?utm_source=github.com&utm_medium=referral&utm_content=aliyun/alibaba-cloud-sdk-go&utm_campaign=Badge_Grade_Dashboard"><img src="https://api.codacy.com/project/badge/Grade/291a39e242364b04ad442f0cce0e30d5" alt="Codacy Badge"></a>
+<a href="https://goreportcard.com/report/github.com/aliyun/alibaba-cloud-sdk-go"><img src="https://goreportcard.com/badge/github.com/aliyun/alibaba-cloud-sdk-go" alt="Go Report Card"></a>
+</p>
+
+
+Alibaba Cloud SDK for Go allows you to access Alibaba Cloud services such as Elastic Compute Service (ECS), Server Load Balancer (SLB), and CloudMonitor. You can access Alibaba Cloud services without the need to handle API related tasks, such as signing and constructing your requests.
+                         
+This document introduces how to obtain and call [Alibaba Cloud SDK for Go][SDK].
+
+## Online Demo
+[API Explorer][open-api] provides the ability to call the cloud product OpenAPI online, and dynamically generate SDK Example code and quick retrieval interface, which can significantly reduce the difficulty of using the cloud API.
+
+
+## Requirements
+- It's necessary for you to make sure your system meet the [Requirements][Requirements], such as installing a Go environment which is new than 1.10.x.
+
+## Installation
+Use `go get` to install SDK:
+
+```sh
+$ go get -u github.com/aliyun/alibaba-cloud-sdk-go/sdk
+```
+
+If you have used glide to manage dependence,you can also use glide to install Alibaba Cloud SDK for Go:
+
+```sh
+$ glide get github.com/aliyun/alibaba-cloud-sdk-go
+```
+
+## Quick Examples
+Before you begin, you need to sign up for an Alibaba Cloud account and retrieve your [Credentials](https://usercenter.console.aliyun.com/#/manage/ak).
+
+### Create Client
+```go
+package main
+
+import "github.com/aliyun/alibaba-cloud-sdk-go/sdk"
+
+func main() {
+
+	client, err := sdk.NewClientWithAccessKey("REGION_ID", "ACCESS_KEY_ID", "ACCESS_KEY_SECRET")
+	if err != nil {
+		// Handle exceptions
+		panic(err)
+	}
+}
+```
+
+### ROA Request
+```go
+package main
+
+import "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+
+func main() {
+	request := requests.NewCommonRequest()        // Make a common request
+	request.Method = "GET"                        // Set request method
+	request.Product = "CS"                        // Specify product
+	request.Domain = "cs.aliyuncs.com"            // Location Service will not be enabled if the host is specified. For example, service with a Certification type-Bearer Token should be specified
+	request.Version = "2015-12-15"                // Specify product version
+	request.PathPattern = "/clusters/[ClusterId]" // Specify path rule with ROA-style
+	request.Scheme = "https"                      // Set request scheme. Default: http
+	request.ApiName = "DescribeCluster"           // Specify product interface
+	request.QueryParams["ClusterId"] = "123456"   // Assign values to parameters in the path
+	request.QueryParams["RegionId"] = "region_id" // Specify the requested regionId, if not specified, use the client regionId, then default regionId
+	request.TransToAcsRequest()                   // Trans commonrequest to acsRequest, which is used by client.
+}
+```
+
+### RPC Request
+```go
+package main
+
+import "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+
+func main() {
+	request := requests.NewCommonRequest()                // Make a common request
+	request.Method = "POST"                               // Set request method
+	request.Product = "Ecs"                               // Specify product
+	request.Domain = "ecs.aliyuncs.com"                   // Location Service will not be enabled if the host is specified. For example, service with a Certification type-Bearer Token should be specified
+	request.Version = "2014-05-26"                        // Specify product version
+	request.Scheme = "https"                              // Set request scheme. Default: http
+	request.ApiName = "CreateInstance"                    // Specify product interface
+	request.QueryParams["InstanceType"] = "ecs.g5.large"  // Assign values to parameters in the path
+	request.QueryParams["RegionId"] = "region_id"         // Specify the requested regionId, if not specified, use the client regionId, then default regionId
+	request.TransToAcsRequest()                           // Trans commonrequest to acsRequest, which is used by client.
+}
+```
+
+
+## Documentation
+* [Requirements](docs/0-Requirements-EN.md)
+* [Installation](docs/1-Installation-EN.md)
+* [Client](docs/2-Client-EN.md)
+* [SSL Verify](docs/3-Verify-EN.md)
+* [Proxy](docs/4-Proxy-EN.md)
+* [Timeout](docs/5-Timeout-EN.md)
+* [Debug](docs/6-Debug-EN.md)
+* [Logger](docs/7-Logger-EN.md)
+* [Concurrent](docs/8-Concurrent-EN.md)
+* [Asynchronous Call](docs/9-Asynchronous-EN.md)
+* [Package Management](docs/10-Package-Management-EN.md)
+
+
+## Issues
+[Opening an Issue][issue], Issues not conforming to the guidelines may be closed immediately.
+
+
+## Contribution
+Please make sure to read the [Contributing Guide](CONTRIBUTING.md) before making a pull request.
+
+
+## References
+* [Alibaba Cloud Regions & Endpoints][endpoints]
+* [OpenAPI Explorer][open-api]
+* [Go][go]
+* [Latest Release][latest-release]
+
+
+## License
+[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Faliyun%2Falibaba-cloud-sdk-go.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Faliyun%2Falibaba-cloud-sdk-go?ref=badge_large)
+
+[SDK]: https://github.com/aliyun/alibaba-cloud-sdk-go
+[issue]: https://github.com/aliyun/alibaba-cloud-sdk-go/issues/new
+[open-api]: https://api.aliyun.com/#/
+[latest-release]: https://github.com/aliyun/alibaba-cloud-sdk-go/releases
+[go]: https://golang.org/dl/
+[endpoints]: https://developer.aliyun.com/endpoints
+[Requirements]: docs/0-Requirements-EN.md

+ 2 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/doc.go

@@ -0,0 +1,2 @@
+// This file is created for depping ensure.
+package doc

+ 11 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/0-Requirements-CN.md

@@ -0,0 +1,11 @@
+[← 首页](../README-CN.md) | 环境要求[(English)](0-Requirements-EN.md) | [安装 →](1-Installation-CN.md)
+***
+
+## 要求
+- Go 环境版本必须不低于 1.10.x.
+
+## 建议
+- 请确保您的项目中没有其他依赖跟 Alibaba Cloud SDK for Go 存在冲突。你可以在[Gopkg.toml](../Gopkg.toml)查看相关的约束。
+
+***
+[← 首页](../README-CN.md) | 环境要求[(English)](0-Requirements-EN.md) | [安装 →](1-Installation-CN.md)

+ 11 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/0-Requirements-EN.md

@@ -0,0 +1,11 @@
+[← Home](../README.md) | Requirements[(中文)](0-Requirements-CN.md) | [Installation →](1-Installation-EN.md)
+***
+
+## Requirements
+- You must use Go 1.10.x or later.
+
+## Recommendations
+- Please make sure there will be no conflict between Alibaba Cloud SDK for Go and other. You can see specific constraints in [Gopkg.toml](../Gopkg.toml).
+
+***
+[← Home](../README.md) | Requirements[(中文)](0-Requirements-CN.md) | [Installation →](1-Installation-EN.md)

+ 24 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/1-Installation-CN.md

@@ -0,0 +1,24 @@
+[← 环境要求](0-Requirements-CN.md) | 安装[(English)](1-Installation-EN.md) | [客户端 →](2-Client-CN.md)
+***
+
+## 通过命令安装
+使用 `go get` 下载安装 SDK
+
+```sh
+$ go get -u github.com/aliyun/alibaba-cloud-sdk-go/sdk
+```
+
+如果您使用了 glide 管理依赖,您也可以使用 glide 来安装 Alibaba Cloud SDK for Go
+
+```sh
+$ glide get github.com/aliyun/alibaba-cloud-sdk-go
+```
+
+## 通过压缩文件安装
+Alibaba Cloud SDK for Go 中的一个 ZIP 文件包含运行开发工具包所需的所有类和依赖项。
+下载这个 [文件][Go-release], 然后在项目中的选定位置进行解压缩。
+
+***
+[← 环境要求](0-Requirements-CN.md) | 安装[(English)](1-Installation-EN.md) | [客户端 →](2-Client-CN.md)
+
+[Go-release]: https://github.com/aliyun/alibaba-cloud-sdk-go/releases

+ 25 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/1-Installation-EN.md

@@ -0,0 +1,25 @@
+[← Requirements](0-Requirements-EN.md) | Installation[(中文)](1-Installation-CN.md) | [Client →](2-Client-EN.md)
+***
+
+## Installation by Using command
+Use `go get` to install SDK:
+
+```sh
+$ go get -u github.com/aliyun/alibaba-cloud-sdk-go/sdk
+```
+
+If you have used glide to manage dependence,you can also use glide to install Alibaba Cloud SDK for Go:
+
+```sh
+$ glide get github.com/aliyun/alibaba-cloud-sdk-go
+```
+
+## Installing by Using the ZIP file
+The Alibaba Cloud SDK for Go includes a ZIP file containing all the classes and dependencies you need to run.
+
+Download the [file][Go-release], and then extract it into your project at a location you choose.
+
+***
+[← Requirements](0-Requirements-EN.md) | Installation[(中文)](1-Installation-CN.md) | [Client →](2-Client-EN.md)
+
+[Go-release]: https://github.com/aliyun/alibaba-cloud-sdk-go/releases

+ 24 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/10-Package-Management-CN.md

@@ -0,0 +1,24 @@
+[← 异步调用](9-Asynchronous-CN.md) | 包管理[(English)](10-Package-Management-EN.md) | [首页 →](../README-CN.md)
+***
+## 包管理
+
+Alibaba Cloud SDK for Go 支持两种方式的包管理.
+
+### dep
+
+在 alibaba-cloud-sdk-go 目录下执行以下命令:
+```bash
+# 当存在 Gopkg.lock 及 Gopkg.toml 时, 该指令会去拉取依赖包并放入 vendor 目录下.
+dep ensure
+```
+
+### go modules
+
+在 alibaba-cloud-sdk-go 目录下执行以下命令:
+```bash
+# 当存在 go.mod 及 go.sum 时, 该指令会去拉取依赖包并放入 $GOPATH/pkg/mod 目录下.
+go mod tidy
+```
+
+***
+[← 异步调用](9-Asynchronous-CN.md) | 包管理[(English)](10-Package-Management-EN.md) | [首页 →](../README-CN.md)

+ 25 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/10-Package-Management-EN.md

@@ -0,0 +1,25 @@
+[← Asynchronous Call](9-Asynchronous-EN.md) | Package Management[(中文)](10-Package-Management-CN.md) | [Home →](../README.md)
+***
+## Package Management
+
+Alibaba Cloud SDK for Go supports two ways for package management.
+
+### dep
+
+Execute the following command in the alibaba-cloud-sdk-go directory:
+```bash
+# When gopkg.lock and gopkg.toml exist, this instruction will pull the dependency package and put it into the vendor directory.
+dep ensure 
+```
+
+### go modules
+
+Execute the following command in the alibaba-cloud-sdk-go directory:
+```bash
+# When go.mod and go.sum exist, the command will pull the dependent package and put it into the $GOPATH/pkg/mod directory.
+go mod tidy
+```
+
+***
+[← Asynchronous Call](9-Asynchronous-EN.md) | Package Management[(中文)](10-Package-Management-CN.md) | [Home →](../README.md)
+ 

+ 116 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/2-Client-CN.md

@@ -0,0 +1,116 @@
+[← 安装](1-Installation-CN.md) | 客户端[(English)](2-Client-EN.md) | [SSL 验证 →](3-Verify-CN.md)
+***
+
+# 客户端
+您可以同时创建多个不同的客户端,每个客户端都可以有独立的配置,每一个请求都可以指定发送的客户端,如果不指定则使用默认客户端。客户端可以通过配置文件自动加载创建,也可以手动创建、管理。不同类型的客户端需要不同的凭证 `Credential`,内部也选取不同的签名算法 `Signature`,您也可以自定义客户端:即传入自定义的凭证和签名。
+## 客户端类型
+
+### AccessKey 客户端
+通过[用户信息管理][ak]设置AccessKey,它们具有该账户完全的权限,请妥善保管。有时出于安全考虑,您不能把具有完全访问权限的主账户 AccessKey 交于一个项目的开发者使用,您可以[创建RAM子账户][ram]并为子账户[授权][permissions],使用RAM子用户的 AccessKey 来进行API调用。 
+
+```go
+client, err := sdk.NewClientWithAccessKey("regionId", "accessKeyId", "accessKeySecret")
+
+```
+
+### STS 客户端
+通过安全令牌服务(Security Token Service,简称 STS),申请临时安全凭证(Temporary Security Credentials,简称 TSC),创建临时安全客户端。
+
+```go
+client, err := sdk.NewClientWithStsToken("regionId", "subaccessKeyId", "subaccessKeySecret", "stsToken")
+```
+
+
+### RamRoleArn 客户端
+通过指定[RAM角色][RAM Role],让客户端在发起请求前自动申请维护 STS Token,自动转变为一个有时限性的STS客户端。您也可以自行申请维护 STS Token,再创建 `STS客户端`。  
+> 示例代码:创建一个 RamRoleArn 方式认证的客户端。
+
+```go
+client, err := sdk.NewClientWithRamRoleArn("regionId", "subaccessKeyId", "subaccessKeySecret", "roleArn", "roleSession")
+```
+
+如果你想限制生成的 STS Token 的权限([构建Policy][policy]), 你可以使用如下方式创建客户端:
+```go
+client, err := sdk.NewClientWithRamRoleArnAndPolicy("regionId", "subaccessKeyId", "subaccessKeySecret", "roleArn", "roleSession", "policy")
+```
+
+
+### EcsRamRole 客户端
+通过指定角色名称,让客户端在发起请求前自动申请维护 STS Token,自动转变为一个有时限性的STS客户端。您也可以自行申请维护 STS Token,再创建 `STS客户端`。  
+> 示例代码:创建一个 EcsRamRole 方式认证的客户端。
+
+```go
+client, err := NewClientWithEcsRamRole("regionid", "roleName")
+```
+
+
+### Bearer Token 客户端
+如呼叫中心(CCC)需用此类认证方式的客户端,请自行申请维护 Bearer Token。  
+> 示例代码:创建一个 Bearer Token 方式认证的客户端。
+
+```go
+client, err := NewClientWithBearerToken("regionId", "bearerToken")
+```
+
+
+### RsaKeyPair 客户端
+通过指定公钥ID和私钥文件,让客户端在发起请求前自动申请维护 AccessKey,自动转变成为一个有时限性的AccessKey客户端,仅支持日本站。  
+> 示例代码:创建一个 RsaKeyPair 方式认证的客户端。
+
+
+```go
+client, err := NewClientWithRsaKeyPair("regionid", "publicKey", "privateKey", 3600)
+```
+
+## 自动创建客户端
+在发送请求前,如果没有创建任何客户端,将使用默认凭证提供程序链创建客户端,也可以自定义程序链。
+
+### 默认凭证提供程序链
+默认凭证提供程序链查找可用的客户端,寻找顺序如下:
+
+#### 1. 环境凭证
+程序首先会在环境变量里寻找环境凭证,如果定义了 `ALIBABA_CLOUD_ACCESS_KEY_ID`  和 `ALIBABA_CLOUD_ACCESS_KEY_SECRET` 环境变量且不为空,程序将使用他们创建默认客户端。如果请求指定的客户端不是默认客户端,程序会在配置文件中加载和寻找客户端。
+
+#### 2. 配置文件
+> 如果用户主目录存在默认文件 `~/.alibabacloud/credentials` (Windows 为 `C:\Users\USER_NAME\.alibabacloud\credentials`),程序会自动创建指定类型和名称的客户端。默认文件可以不存在,但解析错误会抛出异常。  客户端名称不分大小写,若客户端同名,后者会覆盖前者。也可以手动加载指定文件: `AlibabaCloud::load('/data/credentials', 'vfs://AlibabaCloud/credentials', ...);` 不同的项目、工具之间可以共用这个配置文件,因为超出项目之外,也不会被意外提交到版本控制。Windows 上可以使用环境变量引用到主目录 %UserProfile%。类 Unix 的系统可以使用环境变量 $HOME 或 ~ (tilde)。 可以通过定义 `ALIBABA_CLOUD_CREDENTIALS_FILE` 环境变量修改默认文件的路径。
+
+```ini
+[default]                          # 默认客户端
+type = access_key                  # 认证方式为 access_key
+access_key_id = foo                # Key
+access_key_secret = bar            # Secret
+
+[client1]                          # 命名为 `client1` 的客户端
+type = ecs_ram_role                # 认证方式为 ecs_ram_role
+role_name = EcsRamRoleTest         # Role Name
+
+[client2]                          # 命名为 `client2` 的客户端
+type = ram_role_arn                # 认证方式为 ram_role_arn
+access_key_id = foo
+access_key_secret = bar
+role_arn = role_arn
+role_session_name = session_name
+
+[client3]                          # 命名为 `client3` 的客户端
+type = rsa_key_pair                # 认证方式为 rsa_key_pair
+public_key_id = publicKeyId        # Public Key ID
+private_key_file = /your/pk.pem    # Private Key 文件
+
+```
+
+#### 3. 实例 RAM 角色
+如果定义了环境变量 `ALIBABA_CLOUD_ECS_METADATA` 且不为空,程序会将该环境变量的值作为角色名称,请求 `http://100.100.100.200/latest/meta-data/ram/security-credentials/` 获取临时安全凭证,再创建一个默认客户端。
+
+### 自定义凭证提供程序链
+可通过自定义程序链代替默认程序链的寻找顺序,也可以自行编写闭包传入提供者。
+```go
+client, err := sdk.NewClientWithProvider("regionId", ProviderInstance, ProviderProfile, ProviderEnv)
+```
+
+***
+[← 安装](1-Installation-CN.md) | 客户端[(English)](2-Client-EN.md) | [SSL 验证 →](3-Verify-CN.md)
+
+[ak]: https://usercenter.console.aliyun.com/#/manage/ak
+[ram]: https://ram.console.aliyun.com/users
+[permissions]: https://ram.console.aliyun.com/permissions
+[RAM Role]: https://ram.console.aliyun.com/#/role/list

+ 120 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/2-Client-EN.md

@@ -0,0 +1,120 @@
+[← Installation](1-Installation-EN.md) | Client[(中文)](2-Client-CN.md) | [SSL Verify →](3-Verify-EN.md)
+***
+
+# Client
+You may create multiple different clients simultaneously. Each client can have its own configuration, and each request can be sent by specified client. Use the Default Client if it is not specified. The client can be created by auto-loading of the configuration files, or created and managed manually. Different types of clients require different `Credential`,and different `Signature` algorithms that are selected. You may also customize the client: that is, pass in custom credentials and signatures.
+
+## Client Type
+
+### AccessKey Client
+Setup AccessKey through [User Information Management][ak], they have full authority over the account, please keep them safe. Sometimes for security reasons, you cannot hand over a primary account AccessKey with full access to the developer of a project. You may create a sub-account [RAM Sub-account][ram] , grant its [authorization][permissions],and use the AccessKey of RAM Sub-account to make API calls.
+> Sample Code: Create a client with a certification type AccessKey.
+
+```go
+client, err := sdk.NewClientWithAccessKey("regionId", "accessKeyId", "accessKeySecret")
+
+```
+
+
+### STS Client
+Create a temporary security client by applying Temporary Security Credentials (TSC) through the Security Token Service (STS).
+> Sample Code: Create a client with a certification type StsToken.
+
+```go
+client, err := sdk.NewClientWithStsToken("regionId", "subaccessKeyId", "subaccessKeySecret", "stsToken")
+```
+
+
+### RamRoleArn Client
+By specifying [RAM Role][RAM Role], the client will be able to automatically request maintenance of STS Token before making a request, and be automatically converted to a time-limited STS client. You may also apply for Token maintenance by yourself before creating `STS Client`.  
+> Sample Code: Create a client with a certification type RamRoleArn.
+
+```go
+client, err := sdk.NewClientWithRamRoleArn("regionId", "subaccessKeyId", "subaccessKeySecret", "roleArn", "roleSession")
+```
+
+If you want to limit the policy([How to make a policy][policy]) of STS Token, you can create a client as following:
+```go
+client, err := sdk.NewClientWithRamRoleArnAndPolicy("regionId", "subaccessKeyId", "subaccessKeySecret", "roleArn", "roleSession", "policy")
+```
+
+### EcsRamRole Client
+By specifying the role name, the client will be able to automatically request maintenance of STS Token before making a request, and be automatically converted to a time-limited STS client. You may also apply for Token maintenance by yourself before creating `STS Client`.  
+> Sample Code: Create a client with a certification type EcsRamRole.
+
+```go
+client, err := NewClientWithEcsRamRole("regionid", "roleName")
+```
+
+
+### Bearer Token Client
+If clients with this certification type are required by the Cloud Call Centre (CCC), please apply for Bearer Token maintenance by yourself.
+> Sample Code: Create a client with a certification type Bearer Token.
+
+```go
+client, err := NewClientWithBearerToken("regionId", "bearerToken")
+```
+
+
+### RsaKeyPair Client
+By specifying the public key ID and the private key file, the client will be able to automatically request maintenance of the AccessKey before sending the request, and be automatically converted to a time-limited AccessKey client. Only Japan station is supported. 
+> Sample Code: Create a client with a certification type RsaKeyPair.
+
+```go
+client, err := NewClientWithRsaKeyPair("regionid", "publicKey", "privateKey", 3600)
+```
+
+## Create the client automatically
+If no client is created before the request is sent, the client will be created using the default credential provider chain, or the program chain can be customized.
+
+### Default Credential Provider Chain
+The default credential provider chain looks for available clients, looking in the following order:
+
+#### 1. Environment Credentials
+The program first looks for environment credentials in the environment variable. If the `ALIBABA_CLOUD_ACCESS_KEY_ID` and `ALIBABA_CLOUD_ACCESS_KEY_SECRET` environment variables are defined and are not empty, the program will use them to create the default client. If the client specified by the request is not the default client, the program loads and looks for the client in the configuration file.
+
+#### 2. Credentials File
+> If there is `~/.alibabacloud/credentials` default file (Windows shows `C:\Users\USER_NAME\.alibabacloud\credentials`), the program will automatically create clients with the specified type and name. The default file may not exist, but a parse error throws an exception. The client name is case-insensitive, and if the clients have the same name, the latter will override the former. The specified files can also be loaded indefinitely: `AlibabaCloud::load('/data/credentials', 'vfs://AlibabaCloud/credentials', ...);` This configuration file can be shared between different projects and between different tools.  Because it is outside the project and will not be accidentally committed to the version control. Environment variables can be used on Windows to refer to the home directory %UserProfile%. Unix-like systems can use the environment variable $HOME or ~ (tilde). The path to the default file can be modified by defining the `ALIBABA_CLOUD_CREDENTIALS_FILE` environment variable.
+
+```ini
+[default]                          # Default client
+type = access_key                  # Certification type: access_key
+access_key_id = foo                # Key
+access_key_secret = bar            # Secret
+
+[client1]                          # Client that is named as `client1`
+type = ecs_ram_role                # Certification type: ecs_ram_role
+role_name = EcsRamRoleTest         # Role Name
+
+[client2]                          # Client that is named as `client2` 
+type = ram_role_arn                # Certification type: ram_role_arn
+access_key_id = foo
+access_key_secret = bar
+role_arn = role_arn
+role_session_name = session_name
+
+
+[client3]                          # Client that is named as `client3`
+type = rsa_key_pair                # Certification type: rsa_key_pair
+public_key_id = publicKeyId        # Public Key ID
+private_key_file = /your/pk.pem    # Private Key file
+
+```
+
+#### 3. Instance RAM Role
+If the environment variable `ALIBABA_CLOUD_ECS_METADATA` is defined and not empty, the program will take the value of the environment variable as the role name and request `http://100.100.100.200/latest/meta-data/ram/security-credentials/` to get the temporary Security credentials, then create a default client.
+
+### Custom Credential Provider Chain
+You can replace the default order of the program chain by customizing the program chain, or you can write the closure to the provider.
+```go
+client, err := sdk.NewClientWithProvider("regionId", ProviderInstance, ProviderProfile, ProviderEnv)
+```
+
+***
+[← Installation](1-Installation-EN.md) | Client[(中文)](2-Client-CN.md) | [SSL Verify →](3-Verify-EN.md)
+
+[ak]: https://usercenter.console.aliyun.com/#/manage/ak
+[ram]: https://ram.console.aliyun.com/users
+[policy]: https://www.alibabacloud.com/help/doc-detail/28664.htm?spm=a2c63.p38356.a3.3.27a63b01khWgdh
+[permissions]: https://ram.console.aliyun.com/permissions
+[RAM Role]: https://ram.console.aliyun.com/#/role/list

+ 32 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/3-Verify-CN.md

@@ -0,0 +1,32 @@
+[← 客户端](2-Client-CN.md) | SSL 验证[(English)](3-Verify-EN.md) | [代理 →](4-Proxy-CN.md)
+***
+
+# SSL 验证
+
+## 摘要
+请求时验证SSL证书行为。
+- 设置成 `true` 禁用证书验证,(这是不安全的,请设置证书!)。
+- 设置成 `false` 启用SSL证书验证,默认使用操作系统提供的CA包。
+
+## 默认值
+- `false` 
+
+## 设置
+### 通过请求设置
+```go
+// 设置请求 HTTPSInsecure (只影响当前)
+request.SetHTTPSInsecure(true)                           // 设置请求 HTTPSInsecure 为 true
+isInsecure := request.GetHTTPSInsecure()                 // 获取请求 HTTPSInsecure
+```
+
+### 通过客户端设置
+> 当请求未设置时,客户端设置才能生效.
+
+```go
+// 设置客户端 HTTPSInsecure (用于客户端发送的所有请求)。
+client.SetHTTPSInsecure(true)                         // 设置客户端 HTTPSInsecure 为 true
+isInsecure := client.GetHTTPSInsecure()               // 获取客户端 HTTPSInsecure
+```
+
+***
+[← 客户端](2-Client-CN.md) | SSL 验证[(English)](3-Verify-EN.md) | [代理 →](4-Proxy-CN.md)

+ 32 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/3-Verify-EN.md

@@ -0,0 +1,32 @@
+[← Client](2-Client-EN.md) | SSL Verify[(中文)](3-Verify-CN.md) | [Proxy →](4-Proxy-EN.md)
+***
+
+# SSL Verify
+
+## Summary
+Describes the SSL certificate verification behavior of a request.
+- Set `true` to disable certificate validation, (This is not safe, please set certificates! )
+- Set to `false` to enable SSL certificate verification and use the default CA bundle provided by operating system.
+
+## Default
+- `false` 
+
+## Setting
+### Setting on Request
+```go
+// Set request HTTPSInsecure(Only the request is effected.)
+request.SetHTTPSInsecure(true)                           // Set request HTTPSInsecure to true.
+isInsecure := request.GetHTTPSInsecure()                 // Get request HTTPSInsecure.
+```
+
+### Setting on Client
+> When the request is not set, the client settings are used.
+
+```go
+// Set client HTTPSInsecure(For all requests which is sent by the client.)
+client.SetHTTPSInsecure(true)                         // Set client HTTPSInsecure to true.
+isInsecure := client.GetHTTPSInsecure()               // Get client HTTPSInsecure.
+```
+
+***
+[← Client](2-Client-EN.md) | SSL Verify[(中文)](3-Verify-CN.md) | [Proxy →](4-Proxy-EN.md)

+ 31 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/4-Proxy-CN.md

@@ -0,0 +1,31 @@
+[← SSL 验证](3-Verify-CN.md) | 代理[(English)](4-Proxy-EN.md) | [超时 →](5-Timeout-CN.md)
+***
+
+# 代理
+
+## 描述
+当你需要使用代理来发送你的请求时,你可以通过设置环境变量或者通过客户端来设置代理。
+`HTTP_PROXY`: 仅对 http 请求有效。
+`HTTPS_PROXY`: 仅对 https 请求有效。
+`NO_PROXY`: NO_PROXY 中的 ip 或者域名不使用代理。
+
+## 设置
+
+### 通过环境变量设置
+你可以设置环境变量 `HTTP_PROXY`, `HTTPS_PROXY` 或者 `NO_PROXY` 。
+
+### 通过客户端设置
+```go
+// 客户端设置代理优先级比环境变量高
+client.SetHttpProxy("http://127.0.0.1:8080")   // 设置 Http 代理
+client.GetHttpProxy()                          // 获取 Http 代理.
+
+client.SetHttpsProxy("https://127.0.0.1:8080")   // 设置 Https 代理.
+client.GetHttpsProxy()                           // 获取 Https 代理.
+
+client.SetNoProxy("127.0.0.1,localhost")     // 设置代理白名单.
+client.GetNoProxy()                          // 获取代理白名单
+```
+
+***
+[← SSL 验证](3-Verify-CN.md) | 代理[(English)](4-Proxy-EN.md) | [超时 →](5-Timeout-CN.md)

+ 31 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/4-Proxy-EN.md

@@ -0,0 +1,31 @@
+[← SSL Verify](3-Verify-EN.md) | Proxy[(中文)](4-Proxy-CN.md) | [Timeout →](5-Timeout-EN.md)
+***
+
+# Proxy
+
+## Description
+When you need to use proxy to send your request, you can set environment variables or you can set them by client:
+`HTTP_PROXY`: Only the HTTP request to take effect.
+`HTTPS_PROXY`: Only the HTTPS request to take effect.
+`NO_PROXY`: The Ips or domains in it will not use proxy.
+
+## Setting
+
+### Setting by environment variables
+You can set environment variables `HTTP_PROXY`, `HTTPS_PROXY` or `NO_PROXY`
+
+### Setting by client
+```go
+// client proxy has a high priority than environment variables.
+client.SetHttpProxy("http://127.0.0.1:8080")   // Set Http Proxy.
+client.GetHttpProxy()                          // Get Http Proxy.
+
+client.SetHttpsProxy("https://127.0.0.1:8080")   // Set Https Proxy.
+client.GetHttpsProxy()                           // Get Https Proxy.
+
+client.SetNoProxy("127.0.0.1,localhost")     // Set No Proxy.
+client.GetNoProxy()                          // Get No Proxy.
+```
+
+***
+[← SSL Verify](3-Verify-EN.md) | Proxy[(中文)](4-Proxy-CN.md) | [Timeout →](5-Timeout-EN.md)

+ 35 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/5-Timeout-CN.md

@@ -0,0 +1,35 @@
+[← 代理](4-Proxy-CN.md) | 超时[(English)](5-Timeout-EN.md) | [调试 →](6-Debug-CN.md)
+***
+
+# 超时
+
+## 描述
+如果你想限制请求花费的时间,你可以通过请求或者客户端设置 `ConnectTimeout` 和 `ReadTimeout`。
+
+## 默认值
+- `defaultConnectTimeout`: 5 秒
+- `defaultReadTimeout`: 10 秒
+
+## 设置
+### 通过请求设置
+```go
+// 设置请求超时(仅对当前请求有效)
+request.SetReadTimeout(10 * time.Second)             // 设置请求读超时为10秒
+readTimeout := request.GetReadTimeout()              // 获取请求读超时
+request.SetConnectTimeout(5 * time.Second)           // 设置请求连接超时为5秒
+connectTimeout := request.GetConnectTimeout()        // 获取请求连接超时
+```
+
+### 通过客户端设置
+> 当请求未设置超时时,客户端设置的超时才会生效。
+
+```go
+// 设置客户端超时(对所有通过该客户端发送的请求生效)
+client.SetReadTimeout(10 * time.Second)             // 设置客户端读超时为10秒
+readTimeout := client.GetReadTimeout()              // 获取客户端读超时
+client.SetConnectTimeout(5 * time.Second)           // 设置客户端连接超时为5秒
+connectTimeout := client.GetConnectTimeout()        // 获取客户端连接超时
+```
+
+***
+[← 代理](4-Proxy-CN.md) | 超时[(English)](5-Timeout-EN.md) | [调试 →](6-Debug-CN.md)

+ 35 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/5-Timeout-EN.md

@@ -0,0 +1,35 @@
+[← Proxy](4-Proxy-EN.md) | Timeout[(中文)](5-Timeout-CN.md) | [Debug →](6-Debug-EN.md)
+***
+
+# Timeout
+
+## Description
+When you want to limit the time of request costing, you can set `ConnectTimeout` and `ReadTimeout` by request or client:
+
+## Default
+- `defaultConnectTimeout`: 5 * time.Second
+- `defaultReadTimeout`: 10 * time.Second
+
+## Setting
+### Setting on Request
+```go
+// Set request Timeout(Only the request is effected.)
+request.SetReadTimeout(10 * time.Second)             // Set request ReadTimeout to 10 second.
+readTimeout := request.GetReadTimeout()              // Get request ReadTimeout.
+request.SetConnectTimeout(5 * time.Second)           // Set request ConnectTimeout to 5 second.
+connectTimeout := request.GetConnectTimeout()        // Get request ConnectTimeout.
+```
+
+### Setting on Client
+> When the request is not set, the client settings are used.
+
+```go
+// Set client Timeout(For all requests which is sent by the client.)
+client.SetReadTimeout(10 * time.Second)              // Set client ReadTimeout to 10 second.
+readTimeout := client.GetReadTimeout()               // Get client ReadTimeout.
+client.SetConnectTimeout(5 * time.Second)            // Set client ConnectTimeout to 5 second.
+connectTimeout := client.GetConnectTimeout()         // Get client ConnectTimeout.
+```
+
+***
+[← Proxy](4-Proxy-EN.md) | Timeout[(中文)](5-Timeout-CN.md) | [Debug →](6-Debug-EN.md)

+ 8 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/6-Debug-CN.md

@@ -0,0 +1,8 @@
+[← 超时](5-Timeout-CN.md) | 调试[(English)](6-Debug-EN.md) | [日志 →](7-Logger-CN.md)
+***
+
+# 调试
+如果环境变量 `DEBUG=sdk` 存在, 所有的请求都将启用调试模式。
+
+***
+[← 超时](5-Timeout-CN.md) | 调试[(English)](6-Debug-EN.md) | [日志 →](7-Logger-CN.md)

+ 8 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/6-Debug-EN.md

@@ -0,0 +1,8 @@
+[← Timeout](5-Timeout-EN.md) | Debug[(中文)](6-Debug-CN.md) | [Logger →](7-Logger-EN.md)
+***
+
+# Debugging
+If there is an environment variable `DEBUG=sdk` , all requests will enable debug mode.
+
+***
+[← Timeout](5-Timeout-EN.md) | Debug[(中文)](6-Debug-CN.md) | [Logger →](7-Logger-EN.md)

+ 56 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/7-Logger-CN.md

@@ -0,0 +1,56 @@
+[← 调试](6-Debug-CN.md) | 日志[(English)](7-Logger-EN.md) | [并发 →](8-Concurrent-CN.md)
+***
+
+# 日志
+
+## 描述
+
+logger 主要用于提供支持审计的能力,用于记录每次的调用情况,类似服务端的 access log。
+
+## 使用
+
+### 初始化日志
+
+如果您想要使用日志功能,您需要先初始化一个日志对象,您可以在初始化日志对象的时候设置日志等级,日志模版, 日志的输出路径以及 channel。
+```go
+// level: 默认为 info
+// channel: 默认为 AlibabaCloud
+// file: 一个实现了 io.writer 接口的对象
+// templete: 日志的模板, 若不输入,则默认为 `{time} {channel}: "{method} {uri} HTTP/{version}" {code} {cost} {hostname}`
+client.SetLogger("level", "channel", file, templete)      // 设置客户端的日志, 当您调用该方法,默认为您开启日志功能
+```
+
+### 相关操作
+
+```go
+logger := client.GetLogger()    // 获取客户端的 logger 
+client.OpenLogger()            // 开启日志功能,若此时客户端的 logger 不存在, 则创建一个配置一个默认的 logger
+client.CloseLogger()           // 关闭日志功能
+client.GetLoggerMsg()          // 获取上一条日志信息,若此时客户端的 logger 不存在, 则创建一个配置一个默认的 logger 
+client.SetTemplate(templete)   // 设置日志模板,若此时客户端的 logger 不存在, 则创建一个配置一个默认的 logger
+client.GetTemplate()           // 获取当前的日志模板,若此时客户端的 logger 不存在, 则创建一个配置一个默认的 logger
+```
+
+### 变量
+
+|    变量    |   描述    |
+|----------|-------------|
+| {channel}     | 日志的对象 |
+| {host}     | 请求主机 |
+| {ts}     | GMT中的 ISO 8601日期 |
+| {method}     | 请求方法 |
+| {uri}     | 请求的URI |
+| {version}     | 协议版本 |
+| {target}     | 请求目标 (path + query) |
+| {hostname}     | 发送请求的计算机的主机名 |
+| {code}     | 响应的状态代码(如果可用) |
+| {error}     | 任何错误消息(如果有) |
+| {req_headers}     | 请求头 |
+| {res_headers}     | 响应头 |
+| {pid}     | PID |
+| {cost}     | 耗时 |
+| {start_time}  | 开始时间 |
+| {res_body}  | 响应主体 |
+
+***
+[← 调试](6-Debug-CN.md) | 日志[(English)](7-Logger-EN.md) | [并发 →](8-Concurrent-CN.md)

+ 57 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/7-Logger-EN.md

@@ -0,0 +1,57 @@
+[← Debug](6-Debug-EN.md) | Logger[(中文)](7-Logger-CN.md) | [Concurrent →](8-Concurrent-EN.md)
+***
+
+
+# Logger
+
+## Description
+
+The logger is mainly used to provide support for auditing, to record each call, similar to the server's access log.
+
+## Using
+
+### Init logger
+
+If you want to use the log function, you need to initialize a log object first. You can set the log level, log template, log output path and channel when initializing the log object.
+```go
+// level: default value is info
+// channel: default value is AlibabaCloud
+// file: should be an object that implements the io.writer interface
+// templete: logger template, If not entered, the default value is `{time} {channel}: "{method} {uri} HTTP/{version}" {code} {cost} {hostname}`
+client.SetLogger("level", "channel", file, templete)      // Set the client's log. When you call this method, the log function is enabled by default.
+```
+
+### Related operations
+
+```go
+logger := client.GetLogger()    // Get client logger 
+client.OpenLogger()            // Open logger, if clien logger is not exist, there will create a default logger for client
+client.CloseLogger()           // Close logger
+client.GetLoggerMsg()          // Get last logger message,if clien logger is not exist, there will create a default logger for client
+client.SetTemplate(templete)   // Set client logger template,if clien logger is not exist, there will create a default logger for client
+client.GetTemplate()           // Get client logger template,if clien logger is not exist, there will create a default logger for client
+```
+
+### Variables
+
+| Variables |  Description  |
+|----------|-------------|
+| {channel}     | name of the log |
+| {host}     | Host of the request |
+| {ts}     | GMT中的 ISO 8601日期 |
+| {method}     | Method of the request |
+| {uri}     | URI of the request |
+| {version}     | Protocol version |
+| {target}     | Request target of the request (path + query) |
+| {hostname}     | Hostname of the machine that sent the request |
+| {code}     | Status code of the response (if available) |
+| {error}     | Any error messages (if available) |
+| {req_headers}     | Request headers |
+| {res_headers}     | Response headers |
+| {pid}     | PID |
+| {cost}     | Cost Time |
+| {start_time}     | start Time |
+| {res_body}  | Response body |
+
+***
+[← Debug](6-Debug-EN.md) | Logger[(中文)](7-Logger-CN.md) | [Concurrent →](8-Concurrent-EN.md)

+ 29 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/8-Concurrent-CN.md

@@ -0,0 +1,29 @@
+[← 日志](7-Logger-CN.md) | 并发[(English)](8-Concurrent-EN.md) | [异步调用 →](9-Asynchronous-CN.md)
+***
+
+## 并发请求
+
+* 因 Go 语言的并发特性,我们建议您在应用层面控制 SDK 的并发请求。
+* 为了方便您的使用,我们也提供了可直接使用的并发调用方式,相关的并发控制由 SDK 内部实现。
+
+### 开启 SDK Client 的并发功能
+
+```go
+// 最大并发数
+poolSize := 2
+// 可缓存的最大请求数
+maxTaskQueueSize := 5
+
+// 在创建时开启异步功能
+config := sdk.NewConfig()
+            .WithEnableAsync(true)
+            .WithGoRoutinePoolSize(poolSize)            // 可选,默认5
+            .WithMaxTaskQueueSize(maxTaskQueueSize)     // 可选,默认1000
+ecsClient, err := ecs.NewClientWithOptions(config)
+
+// 也可以在client初始化后再开启
+client.EnableAsync(poolSize, maxTaskQueueSize)
+```
+
+***
+[← 日志](7-Logger-CN.md) | 并发[(English)](8-Concurrent-EN.md) | [异步调用 →](9-Asynchronous-CN.md)

+ 29 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/8-Concurrent-EN.md

@@ -0,0 +1,29 @@
+[← Logger](7-Logger-EN.md) | Concurrent[(中文)](8-Concurrent-CN.md) | [Asynchronous Call →](9-Asynchronous-EN.md)
+***
+
+## Concurrent Request
+
+* Due to the concurrency nature of the Go language, we recommend that you control the concurrent requests for the SDK at the application level.
+* In order to facilitate your use, we also provide a direct use of concurrent invocation mode, the relevant concurrency control by the SDK internal implementation.
+
+### Open SDK Client's concurrent function.
+
+```go
+// Maximum Running Vusers
+poolSize := 2
+// The maximum number of requests that can be cached
+maxTaskQueueSize := 5
+
+// Enable asynchronous functionality at creation time
+config := sdk.NewConfig()
+            .WithEnableAsync(true)
+            .WithGoRoutinePoolSize(poolSize)            // Optional,default:5
+            .WithMaxTaskQueueSize(maxTaskQueueSize)     // Optional,default:1000
+ecsClient, err := ecs.NewClientWithOptions(config)
+
+// It can also be opened after client is initialized
+client.EnableAsync(poolSize, maxTaskQueueSize)
+```
+
+***
+[← Logger](7-Logger-EN.md) | Concurrent[(中文)](8-Concurrent-CN.md) | [Asynchronous Call →](9-Asynchronous-EN.md)

+ 30 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/9-Asynchronous-CN.md

@@ -0,0 +1,30 @@
+[← 并发](8-Concurrent-CN.md) | 异步调用[(English)](9-Asynchronous-EN.md) | [包管理 →](10-Package-Management-CN.md)
+***
+## 异步调用
+
+### 发起异步调用
+Alibaba Cloud SDK for Go 支持两种方式的异步调用:
+
+1. 使用channel作为返回值
+    ```go
+    responseChannel, errChannel := client.FooWithChan(request)
+
+    // this will block
+    response := <-responseChannel
+    err = <-errChannel
+    ```
+
+2. 使用 callback 控制回调
+
+    ```go
+    blocker := client.FooWithCallback(request, func(response *FooResponse, err error) {
+        // handle the response and err
+    })
+
+    // blocker 为(chan int),用于控制同步,返回1为成功,0为失败
+    // 在<-blocker返回失败时,err依然会被传入的callback处理
+    result := <-blocker
+    ```
+
+***
+[← 并发](8-Concurrent-CN.md) | 异步调用[(English)](9-Asynchronous-EN.md) | [包管理 →](10-Package-Management-CN.md)

+ 30 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/docs/9-Asynchronous-EN.md

@@ -0,0 +1,30 @@
+[← Concurrent](8-Concurrent-EN.md) | Asynchronous Call[(中文)](9-Asynchronous-CN.md) | [Package Management →](10-Package-Management-EN.md)
+***
+## Asynchronous Call
+
+### Make an asynchronous call
+Alibaba Cloud Go SDK supports asynchronous calls in two ways:
+
+1. Using channel as return values
+    ```go
+    responseChannel, errChannel := client.FooWithChan(request)
+
+    // this will block
+    response := <-responseChannel
+    err = <-errChannel
+    ```
+
+2. Use callback to control the callback
+
+    ```go
+    blocker := client.FooWithCallback(request, func(response *FooResponse, err error) {
+        // handle the response and err
+    })
+
+    // blocker which is type of (chan int),is used to control synchronization,when returning 1 means success,and returning 0 means failure.
+    // When <-blocker returns failure,err also will be handled by afferent callback.
+    result := <-blocker
+    ```
+
+***
+[← Concurrent](8-Concurrent-EN.md) | Asynchronous Call[(中文)](9-Asynchronous-CN.md) | [Package Management →](10-Package-Management-EN.md)

+ 15 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/go.mod

@@ -0,0 +1,15 @@
+module github.com/aliyun/alibaba-cloud-sdk-go
+
+require (
+	github.com/davecgh/go-spew v1.1.1 // indirect
+	github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d
+	github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af
+	github.com/json-iterator/go v1.1.5
+	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
+	github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742
+	github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a // indirect
+	github.com/stretchr/testify v1.3.0
+	gopkg.in/ini.v1 v1.42.0
+)
+
+go 1.13

+ 33 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/go.sum

@@ -0,0 +1,33 @@
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d h1:lBXNCxVENCipq4D1Is42JVOP4eQjlB8TQ6H69Yx5J9Q=
+github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A=
+github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
+github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
+github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM=
+github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
+github.com/json-iterator/go v1.1.5 h1:gL2yXlmiIo4+t+y32d4WGwOjKGYcGOuyrg46vadswDE=
+github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
+github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
+github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
+github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
+github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
+github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
+github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
+github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
+github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a h1:pa8hGb/2YqsZKovtsgrwcDH1RZhVbTKCjLp47XpqCDs=
+github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
+github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+gopkg.in/ini.v1 v1.42.0 h1:7N3gPTt50s8GuLortA00n8AqRTk75qOP98+mTPpgzRk=
+gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=

+ 272 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/integration/api_test.go

@@ -0,0 +1,272 @@
+package integration
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/services/airec"
+	"github.com/aliyun/alibaba-cloud-sdk-go/services/bssopenapi"
+	"github.com/aliyun/alibaba-cloud-sdk-go/services/cdn"
+	"github.com/aliyun/alibaba-cloud-sdk-go/services/cs"
+	"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
+	"github.com/aliyun/alibaba-cloud-sdk-go/services/ram"
+	"github.com/aliyun/alibaba-cloud-sdk-go/services/rds"
+	"github.com/aliyun/alibaba-cloud-sdk-go/services/slb"
+	"github.com/aliyun/alibaba-cloud-sdk-go/services/vpc"
+	"github.com/stretchr/testify/assert"
+	"net/http"
+	"net/http/httptest"
+	"os"
+	"strings"
+	"testing"
+)
+
+var (
+	securityGroupId = ""
+	flag            = false
+)
+
+func Test_CreateDiversifyWithROArequestWithXMLWithGet(t *testing.T) {
+	client, err := airec.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := airec.CreateCreateDiversifyRequest()
+	request.SetDomain("airec.cn-hangzhou.aliyuncs.com")
+	request.SetContentType("XML")
+	request.SetScheme("HTTPS")
+	response, err := client.CreateDiversify(request)
+	assert.NotNil(t, err)
+	assert.Equal(t, 400, response.GetHttpStatus())
+	assert.Contains(t, err.Error(), "Request url is invalid")
+}
+
+func Test_ScaleClusterWithROArequestWithXMLWithPUT(t *testing.T) {
+	client, err := cs.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := cs.CreateScaleClusterRequest()
+	request.SetContentType("XML")
+	request.SetScheme("HTTPS")
+	response, err := client.ScaleCluster(request)
+	assert.NotNil(t, err)
+	assert.Equal(t, 400, response.GetHttpStatus())
+	assert.Contains(t, err.Error(), "Request url is invalid")
+}
+
+func Test_CreateClusterTokenWithROArequestWithXMLWithPOST(t *testing.T) {
+	client, err := cs.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := cs.CreateCreateClusterRequest()
+	request.SetContentType("XML")
+	request.SetScheme("HTTPS")
+	response, err := client.CreateCluster(request)
+	assert.NotNil(t, err)
+	assert.Equal(t, 400, response.GetHttpStatus())
+	assert.Contains(t, err.Error(), "Request body can't be empty")
+}
+
+func Test_DeleteClusterWithROArequestWithXMLWithDelete(t *testing.T) {
+	client, err := cs.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := cs.CreateDeleteClusterRequest()
+	request.SetContentType("XML")
+	request.SetScheme("HTTPS")
+	response, err := client.DeleteCluster(request)
+	assert.NotNil(t, err)
+	assert.Equal(t, 400, response.GetHttpStatus())
+	assert.Contains(t, err.Error(), "Request url is invalid")
+}
+
+func Test_DeleteClusterWithROArequestWithJSONWithDelete(t *testing.T) {
+	client, err := cs.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := cs.CreateDeleteClusterRequest()
+	request.SetContentType("JSON")
+	request.SetScheme("HTTPS")
+	response, err := client.DeleteCluster(request)
+	assert.NotNil(t, err)
+	assert.Equal(t, 400, response.GetHttpStatus())
+	assert.Contains(t, err.Error(), "Request url is invalid")
+}
+
+func Test_ScaleClusterWithROArequestWithJSONWithPUT(t *testing.T) {
+	client, err := cs.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := cs.CreateScaleClusterRequest()
+	request.SetContentType("JSON")
+	request.SetScheme("HTTPS")
+	response, err := client.ScaleCluster(request)
+	assert.NotNil(t, err)
+	assert.Equal(t, 400, response.GetHttpStatus())
+	assert.Contains(t, err.Error(), "Request url is invalid")
+}
+
+func Test_CreateSecurityGroupWithRPCrequestWithJSONWithNestingparametersWithPOST(t *testing.T) {
+	client, err := ecs.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := ecs.CreateCreateSecurityGroupRequest()
+	request.SetContentType("JSON")
+	tag := ecs.CreateSecurityGroupTag{
+		Key:   "test",
+		Value: "test",
+	}
+	request.Tag = &[]ecs.CreateSecurityGroupTag{tag}
+	response, err := client.CreateSecurityGroup(request)
+	assert.Nil(t, err)
+	assert.True(t, response.IsSuccess())
+	assert.Equal(t, 36, len(response.RequestId))
+	assert.True(t, len(response.SecurityGroupId) > 0)
+	securityGroupId = response.SecurityGroupId
+}
+
+func Test_ECS_DescribeSecurityGroupsWithRPCrequestWithJSONWithNestingparametersWithGET(t *testing.T) {
+	client, err := ecs.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := ecs.CreateDescribeSecurityGroupsRequest()
+	request.SetContentType("JSON")
+	request.Method = requests.GET
+	response, err := client.DescribeSecurityGroups(request)
+	assert.Nil(t, err)
+	assert.True(t, response.IsSuccess())
+	for _, securitygroup := range response.SecurityGroups.SecurityGroup {
+		if securitygroup.SecurityGroupId == securityGroupId {
+			flag = true
+			break
+		}
+	}
+	assert.Equal(t, 36, len(response.RequestId))
+	assert.True(t, flag)
+	flag = false
+
+}
+
+func Test_ECS_DeleteSecurityGroupWithRPCrequestWithJSONWithPOST(t *testing.T) {
+	client, err := ecs.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := ecs.CreateDeleteSecurityGroupRequest()
+	request.SetContentType("JSON")
+	request.SecurityGroupId = securityGroupId
+	response, err := client.DeleteSecurityGroup(request)
+	assert.Nil(t, err)
+	assert.True(t, response.IsSuccess())
+	assert.Equal(t, 36, len(response.RequestId))
+	securityGroupId = ""
+}
+
+func Test_RDS_DescribeDBInstancesWithRPCrequest(t *testing.T) {
+	client, err := rds.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	assert.NotNil(t, client)
+	request := rds.CreateDescribeDBInstancesRequest()
+	request.SetContentType("JSON")
+	response, err := client.DescribeDBInstances(request)
+	assert.Nil(t, err)
+	assert.NotNil(t, response)
+}
+
+func Test_CDN_DescribeCdnDomainDetailWithRPCrequest(t *testing.T) {
+	client, err := cdn.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	assert.NotNil(t, client)
+	request := cdn.CreateDescribeRefreshTasksRequest()
+	response, err := client.DescribeRefreshTasks(request)
+	assert.Nil(t, err)
+	assert.NotNil(t, response)
+	assert.Equal(t, 36, len(response.RequestId))
+}
+
+func Test_RAM_ListRolesWithRPCrequest(t *testing.T) {
+	client, err := ram.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := ram.CreateListRolesRequest()
+	request.Scheme = "HTTPS"
+	response, err := client.ListRoles(request)
+	assert.Nil(t, err)
+	assert.True(t, response.IsSuccess())
+	assert.Equal(t, 36, len(response.RequestId))
+}
+
+func Test_SLB_DescribeRegionsWithRPCrequest(t *testing.T) {
+	client, err := slb.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := slb.CreateDescribeRegionsRequest()
+	response, err := client.DescribeRegions(request)
+	assert.Nil(t, err)
+	assert.True(t, response.IsSuccess())
+	assert.Equal(t, 36, len(response.RequestId))
+	assert.True(t, len(response.Regions.Region) > 0)
+}
+
+func Test_VPC_DescribeRegionsWithRPCrequest(t *testing.T) {
+	client, err := vpc.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := vpc.CreateDescribeRegionsRequest()
+	response, err := client.DescribeRegions(request)
+	assert.Nil(t, err)
+	assert.True(t, response.IsSuccess())
+	assert.Equal(t, 36, len(response.RequestId))
+	assert.True(t, len(response.Regions.Region) > 0)
+}
+
+func mockServer(status int, json string) (server *httptest.Server) {
+	// Start a test server locally.
+	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+		w.WriteHeader(status)
+		w.Write([]byte(json))
+		return
+	}))
+	return ts
+}
+
+func Test_DescribeRegionsWithRPCrequestWithunicode(t *testing.T) {
+	client, err := ecs.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := ecs.CreateDescribeRegionsRequest()
+	request.Scheme = "HTTP"
+	ts := mockServer(400, `{"Code": "&&&&杭州&&&"}`)
+	defer ts.Close()
+	domain := strings.Replace(ts.URL, "http://", "", 1)
+	request.Domain = domain
+	response, err := client.DescribeRegions(request)
+	assert.NotNil(t, err)
+	assert.Equal(t, 400, response.GetHttpStatus())
+	assert.Equal(t, "{\"Code\": \"&&&&杭州&&&\"}", response.GetHttpContentString())
+}
+
+func Test_DescribeRegionsWithRPCrequestWithescape(t *testing.T) {
+	client, err := ecs.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := ecs.CreateDescribeRegionsRequest()
+	request.Scheme = "HTTP"
+	ts := mockServer(400, `{"Code": "\t"}`)
+	defer ts.Close()
+	domain := strings.Replace(ts.URL, "http://", "", 1)
+	request.Domain = domain
+	response, err := client.DescribeRegions(request)
+	assert.NotNil(t, err)
+	assert.Equal(t, 400, response.GetHttpStatus())
+	assert.Equal(t, "{\"Code\": \"\\t\"}", response.GetHttpContentString())
+}
+
+func Test_DescribeRegionsWithRPCrequestWith3XX(t *testing.T) {
+	client, err := ecs.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := ecs.CreateDescribeRegionsRequest()
+	request.Scheme = "HTTP"
+	ts := mockServer(307, `{"error"}`)
+	defer ts.Close()
+	domain := strings.Replace(ts.URL, "http://", "", 1)
+	request.Domain = domain
+	response, err := client.DescribeRegions(request)
+	assert.NotNil(t, err)
+	assert.Equal(t, 307, response.GetHttpStatus())
+	assert.Equal(t, "{\"error\"}", response.GetHttpContentString())
+}
+
+func Test_QueryAvaliableInstances(t *testing.T) {
+	client, err := bssopenapi.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := bssopenapi.CreateQueryAvailableInstancesRequest()
+	endpoints.AddEndpointMapping(os.Getenv("REGION_ID"), "BssOpenApi", "business.aliyuncs.com")
+	response, err := client.QueryAvailableInstances(request)
+	assert.Nil(t, err)
+	assert.True(t, response.IsSuccess())
+	assert.Equal(t, 36, len(response.RequestId))
+}

+ 206 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/integration/base.go

@@ -0,0 +1,206 @@
+package integration
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/services/ram"
+	"github.com/aliyun/alibaba-cloud-sdk-go/services/sts"
+
+	"fmt"
+	"os"
+	"strings"
+)
+
+var role_doc = `{
+		"Statement": [{
+		    "Action": "sts:AssumeRole",
+		    "Effect": "Allow",
+		    "Principal": {
+		     	"RAM": [
+				      "acs:ram::%s:root"
+		        ]
+            }
+	    }],
+	   "Version": "1"
+	}`
+
+var (
+	travisValue = strings.Split(os.Getenv("TRAVIS_JOB_NUMBER"), ".")
+	username    = "test-go-user" + travisValue[len(travisValue)-1]
+	rolename    = "test-go-role" + travisValue[len(travisValue)-1]
+	rolearn     = fmt.Sprintf("acs:ram::%s:role/%s", os.Getenv("USER_ID"), rolename)
+)
+
+func createRole(userid string) (string, string, error) {
+	listRequest := ram.CreateListRolesRequest()
+	listRequest.Scheme = "HTTPS"
+	client, err := ram.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	if err != nil {
+		return "", "", err
+	}
+	listResponse, err := client.ListRoles(listRequest)
+	if err != nil {
+		return "", "", err
+	}
+	for _, role := range listResponse.Roles.Role {
+		if strings.ToLower(role.RoleName) == rolename {
+			return role.RoleName, role.Arn, nil
+		}
+	}
+	createRequest := ram.CreateCreateRoleRequest()
+	createRequest.Scheme = "HTTPS"
+	createRequest.RoleName = rolename
+	createRequest.AssumeRolePolicyDocument = fmt.Sprintf(role_doc, userid)
+	res, err := client.CreateRole(createRequest)
+	if err != nil {
+		return "", "", err
+	}
+	return res.Role.RoleName, res.Role.Arn, nil
+}
+
+func createUser() error {
+	listRequest := ram.CreateListUsersRequest()
+	listRequest.Scheme = "HTTPS"
+	client, err := ram.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	if err != nil {
+		return err
+	}
+	listResponse, err := client.ListUsers(listRequest)
+	if err != nil {
+		return err
+	}
+	for _, user := range listResponse.Users.User {
+		if user.UserName == username {
+			return nil
+		}
+	}
+	createRequest := ram.CreateCreateUserRequest()
+	createRequest.Scheme = "HTTPS"
+	createRequest.UserName = username
+	_, err = client.CreateUser(createRequest)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func createAttachPolicyToUser() error {
+	listRequest := ram.CreateListPoliciesForUserRequest()
+	listRequest.UserName = username
+	listRequest.Scheme = "HTTPS"
+	client, err := ram.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	if err != nil {
+		return err
+	}
+	listResponse, err := client.ListPoliciesForUser(listRequest)
+	if err != nil {
+		return err
+	}
+	for _, policy := range listResponse.Policies.Policy {
+		if policy.PolicyName == "AliyunSTSAssumeRoleAccess" {
+			return nil
+		}
+	}
+	createRequest := ram.CreateAttachPolicyToUserRequest()
+	createRequest.Scheme = "HTTPS"
+	createRequest.PolicyName = "AliyunSTSAssumeRoleAccess"
+	createRequest.UserName = username
+	createRequest.PolicyType = "System"
+	_, err = client.AttachPolicyToUser(createRequest)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func createAttachPolicyToRole() error {
+	listRequest := ram.CreateListPoliciesForRoleRequest()
+	listRequest.RoleName = rolename
+	listRequest.Scheme = "HTTPS"
+	client, err := ram.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	if err != nil {
+		return err
+	}
+	listResponse, err := client.ListPoliciesForRole(listRequest)
+	if err != nil {
+		return err
+	}
+	for _, policy := range listResponse.Policies.Policy {
+		if policy.PolicyName == "AdministratorAccess" {
+			return nil
+		}
+	}
+	createRequest := ram.CreateAttachPolicyToRoleRequest()
+	createRequest.Scheme = "HTTPS"
+	createRequest.PolicyName = "AdministratorAccess"
+	createRequest.RoleName = rolename
+	createRequest.PolicyType = "System"
+	_, err = client.AttachPolicyToRole(createRequest)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func createAccessKey() (string, string, error) {
+	client, err := ram.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	if err != nil {
+		return "", "", err
+	}
+	listrequest := ram.CreateListAccessKeysRequest()
+	listrequest.UserName = username
+	listrequest.Scheme = "HTTPS"
+	listresponse, err := client.ListAccessKeys(listrequest)
+	if err != nil {
+		return "", "", err
+	}
+	if listresponse.AccessKeys.AccessKey != nil {
+		if len(listresponse.AccessKeys.AccessKey) >= 2 {
+			accesskey := listresponse.AccessKeys.AccessKey[0]
+			deleterequest := ram.CreateDeleteAccessKeyRequest()
+			deleterequest.UserAccessKeyId = accesskey.AccessKeyId
+			deleterequest.UserName = username
+			deleterequest.Scheme = "HTTPS"
+			_, err := client.DeleteAccessKey(deleterequest)
+			if err != nil {
+				return "", "", err
+			}
+		}
+	}
+	request := ram.CreateCreateAccessKeyRequest()
+	request.Scheme = "HTTPS"
+	request.UserName = username
+	response, err := client.CreateAccessKey(request)
+	if err != nil {
+		return "", "", err
+	}
+
+	return response.AccessKey.AccessKeyId, response.AccessKey.AccessKeySecret, nil
+}
+
+func createAssumeRole() (*sts.AssumeRoleResponse, error) {
+	err := createUser()
+	if err != nil {
+		return nil, err
+	}
+	_, _, err = createRole(os.Getenv("USER_ID"))
+	if err != nil {
+		return nil, err
+	}
+	err = createAttachPolicyToUser()
+	if err != nil {
+		return nil, err
+	}
+	subaccesskeyid, subaccesskeysecret, err := createAccessKey()
+	if err != nil {
+		return nil, err
+	}
+	request := sts.CreateAssumeRoleRequest()
+	request.RoleArn = rolearn
+	request.RoleSessionName = "alice_test"
+	request.Scheme = "HTTPS"
+	client, err := sts.NewClientWithAccessKey(os.Getenv("REGION_ID"), subaccesskeyid, subaccesskeysecret)
+	response, err := client.AssumeRole(request)
+	if err != nil {
+		return nil, err
+	}
+	return response, nil
+}

+ 347 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/integration/core_test.go

@@ -0,0 +1,347 @@
+package integration
+
+import (
+	"fmt"
+	"github.com/goji/httpauth"
+	"net/http"
+	"net/http/httptest"
+	"net/http/httputil"
+	"net/url"
+	"os"
+	"strings"
+	"testing"
+	"time"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+
+	"github.com/stretchr/testify/assert"
+)
+
+func Test_DescribeRegionsWithCommonRequestWithRPC(t *testing.T) {
+	request := requests.NewCommonRequest()
+	request.Version = "2014-05-26"
+	request.Product = "Ecs"
+	request.ApiName = "DescribeRegions"
+	request.SetDomain("ecs.aliyuncs.com")
+	request.TransToAcsRequest()
+	client, err := sdk.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	response, err := client.ProcessCommonRequest(request)
+	assert.Nil(t, err)
+	assert.True(t, response.IsSuccess())
+}
+
+func Test_DescribeRegionsWithCommonRequestWithSTStoken(t *testing.T) {
+	assumeresponse, err := createAssumeRole()
+	assert.Nil(t, err)
+	credential := assumeresponse.Credentials
+	request := requests.NewCommonRequest()
+	request.Version = "2014-05-26"
+	request.Product = "Ecs"
+	request.ApiName = "DescribeRegions"
+	request.SetDomain("ecs.aliyuncs.com")
+	request.TransToAcsRequest()
+	client, err := sdk.NewClientWithStsToken(os.Getenv("REGION_ID"), credential.AccessKeyId, credential.AccessKeySecret, credential.SecurityToken)
+	assert.Nil(t, err)
+	response, err := client.ProcessCommonRequest(request)
+	assert.Nil(t, err)
+	assert.True(t, response.IsSuccess())
+}
+
+func Test_DescribeRegionsWithCommonRequestWithHTTPS(t *testing.T) {
+	request := requests.NewCommonRequest()
+	request.Version = "2014-05-26"
+	request.Product = "Ecs"
+	request.ApiName = "DescribeRegions"
+	request.SetDomain("ecs.aliyuncs.com")
+	request.TransToAcsRequest()
+	request.SetScheme("HTTPS")
+	client, err := sdk.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	response, err := client.ProcessCommonRequest(request)
+	assert.Nil(t, err)
+	assert.True(t, response.IsSuccess())
+}
+
+func Test_DescribeRegionsWithCommonRequestWithUnicodeSpecificParams(t *testing.T) {
+	request := requests.NewCommonRequest()
+	request.Version = "2014-05-26"
+	request.Product = "Ecs"
+	request.ApiName = "DescribeRegions"
+	request.SetDomain("ecs.aliyuncs.com")
+	request.TransToAcsRequest()
+	request.SetContent([]byte("sdk&-杭&&&州-test"))
+	client, err := sdk.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	response, err := client.ProcessCommonRequest(request)
+	assert.Nil(t, err)
+	assert.True(t, response.IsSuccess())
+}
+
+func Test_DescribeRegionsWithCommonRequestWithError(t *testing.T) {
+	request := requests.NewCommonRequest()
+	request.Version = "2014-05-26"
+	request.Product = "Ecs"
+	request.ApiName = "Describe"
+	request.SetDomain("ecs.aliyuncs.com")
+	request.TransToAcsRequest()
+	client, err := sdk.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	_, err = client.ProcessCommonRequest(request)
+	realerr := err.(errors.Error)
+	assert.Equal(t, "InvalidParameter", realerr.ErrorCode())
+	assert.Equal(t, "The specified parameter \"Action or Version\" is not valid.", realerr.Message())
+}
+
+func Test_DescribeRegionsWithCommonRequestWithIncompleteSignature(t *testing.T) {
+	request := requests.NewCommonRequest()
+	request.Version = "2014-05-26"
+	request.AcceptFormat = "json"
+	request.SetScheme("https")
+	request.Method = "POST"
+	request.ApiName = "DescribeRegions"
+	request.SetDomain("ecs.aliyuncs.com")
+	request.TransToAcsRequest()
+	client, err := sdk.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), strings.ToUpper(os.Getenv("ACCESS_KEY_SECRET")))
+	assert.Nil(t, err)
+	_, err = client.ProcessCommonRequest(request)
+	realerr := err.(*errors.ServerError)
+	assert.Equal(t, "IncompleteSignature", realerr.ErrorCode())
+	assert.Equal(t, "InvalidAccessKeySecret: Please check you AccessKeySecret", realerr.Recommend())
+}
+
+func Test_DescribeClustersWithCommonRequestWithROA(t *testing.T) {
+	client, err := sdk.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := requests.NewCommonRequest()
+	request.Method = "GET"
+	request.Domain = "cs.aliyuncs.com"
+	request.Version = "2015-12-15"
+	request.PathPattern = "/clusters"
+	request.ApiName = "DescribeClusters"
+	request.QueryParams["RegionId"] = os.Getenv("REGION_ID")
+	request.TransToAcsRequest()
+	resp, err := client.ProcessCommonRequest(request)
+	assert.Nil(t, err)
+	assert.Equal(t, 200, resp.GetHttpStatus())
+
+}
+
+func Test_DescribeClustersWithCommonRequestWithSignatureDostNotMatch(t *testing.T) {
+	client, err := sdk.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), strings.ToUpper(os.Getenv("ACCESS_KEY_SECRET")))
+	assert.Nil(t, err)
+	request := requests.NewCommonRequest()
+	request.Method = "GET"
+	request.Domain = "cs.aliyuncs.com"
+	request.Version = "2015-12-15"
+	request.PathPattern = "/clusters/[ClusterId]"
+	request.QueryParams["RegionId"] = os.Getenv("REGION_ID")
+	request.TransToAcsRequest()
+	_, err = client.ProcessCommonRequest(request)
+	assert.NotNil(t, err)
+	real, _ := err.(*errors.ServerError)
+	assert.Contains(t, real.Recommend(), "InvalidAccessKeySecret: Please check you AccessKeySecret")
+	assert.Equal(t, real.ErrorCode(), "SignatureDoesNotMatch")
+}
+
+func Test_DescribeClustersWithCommonRequestWithROAWithSTStoken(t *testing.T) {
+	assumeresponse, err := createAssumeRole()
+	assert.Nil(t, err)
+	credential := assumeresponse.Credentials
+	client, err := sdk.NewClientWithStsToken(os.Getenv("REGION_ID"), credential.AccessKeyId, credential.AccessKeySecret, credential.SecurityToken)
+	assert.Nil(t, err)
+	request := requests.NewCommonRequest()
+	request.Method = "GET"
+	request.Domain = "cs.aliyuncs.com"
+	request.Version = "2015-12-15"
+	request.PathPattern = "/clusters/[ClusterId]"
+	request.QueryParams["RegionId"] = os.Getenv("REGION_ID")
+	request.TransToAcsRequest()
+	f1, err := os.Create("test.txt")
+	defer os.Remove("test.txt")
+	assert.Nil(t, err)
+	templete := `{version}, {host}`
+	client.SetLogger("error", "Alibaba", f1, templete)
+	_, err = client.ProcessCommonRequest(request)
+	assert.NotNil(t, err)
+	assert.Contains(t, client.GetLoggerMsg(), `1.1, cs.aliyuncs.com`)
+	assert.Contains(t, err.Error(), "Request url is invalid")
+}
+
+func Test_DescribeClusterDetailWithCommonRequestWithROAWithHTTPS(t *testing.T) {
+	client, err := sdk.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := requests.NewCommonRequest()
+	request.Method = "GET"
+	request.Domain = "cs.aliyuncs.com"
+	request.Version = "2015-12-15"
+	request.SetScheme("HTTPS")
+	request.PathPattern = "/clusters/[ClusterId]"
+	request.QueryParams["RegionId"] = os.Getenv("REGION_ID")
+	request.TransToAcsRequest()
+
+	_, err = client.ProcessCommonRequest(request)
+	assert.NotNil(t, err)
+	assert.Contains(t, err.Error(), "Request url is invalid")
+}
+
+func Test_DescribeClusterDetailWithCommonRequestWithTimeout(t *testing.T) {
+	client, err := sdk.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := requests.NewCommonRequest()
+	request.Domain = "cs.aliyuncs.com"
+	request.Version = "2015-12-15"
+	request.SetScheme("HTTPS")
+	request.PathPattern = "/clusters/[ClusterId]"
+	request.QueryParams["RegionId"] = os.Getenv("REGION_ID")
+	request.ReadTimeout = 1 * time.Millisecond
+	request.ConnectTimeout = 1 * time.Nanosecond
+	request.TransToAcsRequest()
+	_, err = client.ProcessCommonRequest(request)
+	assert.NotNil(t, err)
+
+	request.ConnectTimeout = 1 * time.Second
+	_, err = client.ProcessCommonRequest(request)
+	assert.NotNil(t, err)
+	assert.Contains(t, err.Error(), "Read timeout. Please set a valid ReadTimeout.")
+}
+
+func Test_CreateInstanceWithCommonRequestWithPolicy(t *testing.T) {
+	err := createAttachPolicyToRole()
+	assert.Nil(t, err)
+
+	subaccesskeyid, subaccesskeysecret, err := createAccessKey()
+	assert.Nil(t, err)
+	client, err := sdk.NewClientWithRamRoleArnAndPolicy(os.Getenv("REGION_ID"), subaccesskeyid, subaccesskeysecret, rolearn, "alice_test", "")
+	assert.Nil(t, err)
+	request := requests.NewCommonRequest()
+	request.Method = "POST"
+	request.Product = "Ecs"
+	request.Domain = "ecs.aliyuncs.com"
+	request.Version = "2014-05-26"
+	request.SetScheme("HTTPS")
+	request.ApiName = "CreateInstance"
+	request.QueryParams["ImageId"] = "win2008r2_64_ent_sp1_en-us_40G_alibase_20170915.vhd"
+	request.QueryParams["InstanceType"] = "ecs.g5.large"
+	request.TransToAcsRequest()
+	_, err = client.ProcessCommonRequest(request)
+	assert.NotNil(t, err)
+	assert.Contains(t, err.Error(), "user order resource type [classic] not exists in [random]")
+
+	policy := `{
+    "Version": "1",
+    "Statement": [
+        {
+            "Action": "rds:*",
+            "Resource": "*",
+            "Effect": "Allow"
+        },
+        {
+            "Action": "dms:LoginDatabase",
+            "Resource": "acs:rds:*:*:*",
+            "Effect": "Allow"
+        }
+    ]
+}`
+	client, err = sdk.NewClientWithRamRoleArnAndPolicy(os.Getenv("REGION_ID"), subaccesskeyid, subaccesskeysecret, rolearn, "alice_test", policy)
+	assert.Nil(t, err)
+	_, err = client.ProcessCommonRequest(request)
+	assert.NotNil(t, err)
+	assert.Contains(t, err.Error(), "User not authorized to operate on the specified resource, or this API doesn't support RAM.")
+}
+
+func handlerTrue(w http.ResponseWriter, r *http.Request) {
+	w.WriteHeader(200)
+	w.Write([]byte("test"))
+	return
+}
+
+func handlerFake(w http.ResponseWriter, r *http.Request) {
+	trueserver := handlerTrueServer()
+	url, err := url.Parse(trueserver.URL)
+	if err != nil {
+		return
+	}
+	proxy := httputil.NewSingleHostReverseProxy(url)
+	w.Write([]byte("sdk"))
+	proxy.ServeHTTP(w, r)
+
+	return
+}
+
+func handlerFakeServer() (server *httptest.Server) {
+	handleFunc := httpauth.SimpleBasicAuth("someuser", "somepassword")(http.HandlerFunc(handlerFake))
+	server = httptest.NewServer(handleFunc)
+
+	return server
+}
+
+func handlerTrueServer() (server *httptest.Server) {
+	server = httptest.NewServer(http.HandlerFunc(handlerTrue))
+
+	return server
+}
+
+func Test_HTTPProxy(t *testing.T) {
+
+	ts := handlerFakeServer()
+	ts1 := handlerTrueServer()
+	defer func() {
+		ts.Close()
+		ts1.Close()
+	}()
+	client, err := sdk.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := requests.NewCommonRequest()
+	domain := strings.Replace(ts1.URL, "http://", "", 1)
+	request.Domain = domain
+	request.Version = "2015-12-15"
+	request.TransToAcsRequest()
+	resp, err := client.ProcessCommonRequest(request)
+	assert.Nil(t, err)
+	assert.Equal(t, 200, resp.GetHttpStatus())
+	assert.Equal(t, "test", resp.GetHttpContentString())
+
+	originEnv := os.Getenv("HTTP_PROXY")
+	domain = strings.Replace(ts.URL, "http://", "", 1)
+	os.Setenv("HTTP_PROXY", fmt.Sprintf("http://someuser:somepassword@%s", domain))
+	resp, err = client.ProcessCommonRequest(request)
+	assert.Nil(t, err)
+	assert.Equal(t, 200, resp.GetHttpStatus())
+	assert.Equal(t, "sdktest", resp.GetHttpContentString())
+
+	os.Setenv("HTTP_PROXY", originEnv)
+}
+
+func Test_DdoscooWithServiceCode(t *testing.T) {
+	client, err := sdk.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := requests.NewCommonRequest()
+	request.Version = "2017-12-28"
+	request.Product = "ddoscoo"
+	request.ServiceCode = "ddoscoo"
+	request.ApiName = "DescribeInstanceSpecs"
+	request.RegionId = "cn-hangzhou"
+	_, err = client.ProcessCommonRequest(request)
+	assert.NotNil(t, err)
+	assert.Contains(t, err.Error(), "InstanceIds is mandatory for this action.")
+}
+
+func Test_RoaRequestWithEcsRole(t *testing.T) {
+	client, err := sdk.NewClientWithEcsRamRole("cn-shenzhen", "test-go-role")
+	assert.Nil(t, err)
+	request := requests.NewCommonRequest()
+	request.Method = "POST"
+	request.Scheme = "https" // https | http
+	request.Domain = "edas.cn-hangzhou.aliyuncs.com"
+	request.Version = "2017-08-01"
+	request.PathPattern = "/pop/v5/resource/region_list"
+
+	request.QueryParams["RegionId"] = "cn-shenzhen"
+	_, err = client.ProcessCommonRequest(request)
+	assert.NotNil(t, err)
+	assert.Contains(t, err.Error(), "refresh Ecs sts token err")
+}

+ 100 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/integration/cr_test.go

@@ -0,0 +1,100 @@
+package integration
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/services/cr"
+
+	"github.com/stretchr/testify/assert"
+
+	"fmt"
+	"os"
+	"testing"
+)
+
+var crTestKey = "crtestkey" + travisValue[len(travisValue)-1]
+
+func Test_CR_CreateNamespace(t *testing.T) {
+	client, err := cr.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+
+	request := cr.CreateCreateNamespaceRequest()
+	domain := fmt.Sprintf("cr." + os.Getenv("REGION_ID") + ".aliyuncs.com")
+	request.SetDomain(domain)
+	request.SetContentType("JSON")
+	content := fmt.Sprintf(
+		`{
+			"Namespace":{
+				"Namespace":"%s"
+			}
+		}`, crTestKey,
+	)
+	request.SetContent([]byte(content))
+
+	response, err := client.CreateNamespace(request)
+	assert.Nil(t, err)
+	assert.True(t, response.IsSuccess())
+}
+
+func Test_CR_UpdateNamespace(t *testing.T) {
+	client, err := cr.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+
+	request := cr.CreateUpdateNamespaceRequest()
+	domain := fmt.Sprintf("cr." + os.Getenv("REGION_ID") + ".aliyuncs.com")
+	request.SetDomain(domain)
+	request.Namespace = crTestKey
+	request.SetContentType("JSON")
+	content := fmt.Sprintf(
+		`{
+			"Namespace":{
+				"AutoCreate":%v,
+				"DefaultVisibility":"%s"
+			}
+		}`, false, "PUBLIC",
+	)
+	request.SetContent([]byte(content))
+
+	response, err := client.UpdateNamespace(request)
+	assert.Nil(t, err)
+	assert.True(t, response.IsSuccess())
+}
+
+func Test_CR_GetNamespace(t *testing.T) {
+	client, err := cr.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+
+	request := cr.CreateGetNamespaceRequest()
+	domain := fmt.Sprintf("cr." + os.Getenv("REGION_ID") + ".aliyuncs.com")
+	request.SetDomain(domain)
+	request.Namespace = crTestKey
+
+	response, err := client.GetNamespace(request)
+	assert.Nil(t, err)
+	assert.True(t, response.IsSuccess())
+}
+
+func Test_CR_GetNamespaceList(t *testing.T) {
+	client, err := cr.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+
+	request := cr.CreateGetNamespaceListRequest()
+	domain := fmt.Sprintf("cr." + os.Getenv("REGION_ID") + ".aliyuncs.com")
+	request.SetDomain(domain)
+
+	response, err := client.GetNamespaceList(request)
+	assert.Nil(t, err)
+	assert.True(t, response.IsSuccess())
+}
+
+func Test_CR_DeleteNamespace(t *testing.T) {
+	client, err := cr.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+
+	request := cr.CreateDeleteNamespaceRequest()
+	domain := fmt.Sprintf("cr." + os.Getenv("REGION_ID") + ".aliyuncs.com")
+	request.SetDomain(domain)
+	request.Namespace = crTestKey
+
+	response, err := client.DeleteNamespace(request)
+	assert.Nil(t, err)
+	assert.True(t, response.IsSuccess())
+}

+ 156 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/integration/credential_test.go

@@ -0,0 +1,156 @@
+package integration
+
+import (
+	"bufio"
+	"bytes"
+	"crypto/aes"
+	"crypto/cipher"
+	"strings"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/services/airec"
+	"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
+	"github.com/stretchr/testify/assert"
+
+	"os"
+	"testing"
+)
+
+func Test_DescribeRegionsWithRPCrequestWithAK(t *testing.T) {
+	client, err := ecs.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	assert.NotNil(t, client)
+	request := ecs.CreateDescribeRegionsRequest()
+	request.Scheme = "https"
+	response, err := client.DescribeRegions(request)
+	assert.Nil(t, err)
+	assert.NotNil(t, response)
+	assert.Equal(t, 36, len(response.RequestId))
+	assert.True(t, len(response.Regions.Region) > 0)
+}
+
+func Test_DescribeRegionsWithRPCrequestWithSTStoken(t *testing.T) {
+	assumeresponse, err := createAssumeRole()
+	assert.Nil(t, err)
+	credential := assumeresponse.Credentials
+	client, err := ecs.NewClientWithStsToken(os.Getenv("REGION_ID"), credential.AccessKeyId, credential.AccessKeySecret, credential.SecurityToken)
+	assert.Nil(t, err)
+	assert.NotNil(t, client)
+	request := ecs.CreateDescribeRegionsRequest()
+	request.Scheme = "https"
+	response, err := client.DescribeRegions(request)
+	assert.Nil(t, err)
+	assert.NotNil(t, response)
+	assert.Equal(t, 36, len(response.RequestId))
+	assert.True(t, len(response.Regions.Region) > 0)
+}
+
+func Test_CreateDiversifyWithROArequestWithAK(t *testing.T) {
+	client, err := airec.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	request := airec.CreateCreateDiversifyRequest()
+	request.SetDomain("airec.cn-hangzhou.aliyuncs.com")
+	request.QueryParams["RegionId"] = os.Getenv("REGION_ID")
+	request.Method = "GET"
+	response, err := client.CreateDiversify(request)
+	assert.NotNil(t, err)
+	assert.Equal(t, 400, response.GetHttpStatus())
+	assert.Contains(t, err.Error(), "Request url is invalid")
+}
+
+func Test_DescribeRegionsWithRPCrequestWithArn(t *testing.T) {
+	subaccesskeyid, subaccesskeysecret, err := createAccessKey()
+	assert.Nil(t, err)
+	client, err := ecs.NewClientWithRamRoleArn(os.Getenv("REGION_ID"), subaccesskeyid, subaccesskeysecret, rolearn, "alice_test")
+	assert.Nil(t, err)
+
+	request := ecs.CreateDescribeRegionsRequest()
+	request.Scheme = "https"
+	request.Domain = "ecs.aliyuncs.com"
+	response, err := client.DescribeRegions(request)
+	assert.Nil(t, err)
+	assert.Equal(t, 36, len(response.RequestId))
+}
+
+func TestDescribeRegionsWithProviderAndAk(t *testing.T) {
+	os.Setenv(provider.ENVAccessKeyID, os.Getenv("ACCESS_KEY_ID"))
+	os.Setenv(provider.ENVAccessKeySecret, os.Getenv("ACCESS_KEY_SECRET"))
+	request := requests.NewCommonRequest()
+	request.Version = "2014-05-26"
+	request.Product = "Ecs"
+	request.ApiName = "DescribeRegions"
+	request.SetDomain("ecs.aliyuncs.com")
+	request.TransToAcsRequest()
+	client, err := sdk.NewClientWithProvider(os.Getenv("REGION_ID"))
+	assert.Nil(t, err)
+	response, err := client.ProcessCommonRequest(request)
+	assert.Nil(t, err)
+	assert.True(t, response.IsSuccess())
+}
+
+func TestDescribeRegionsWithProviderAndRsaKeyPair(t *testing.T) {
+	request := requests.NewCommonRequest()
+	request.Version = "2014-05-26"
+	request.Product = "Ecs"
+	request.ApiName = "DescribeRegions"
+	request.SetDomain("ecs.ap-northeast-1.aliyuncs.com")
+	request.TransToAcsRequest()
+
+	key := os.Getenv("RSA_FILE_AES_KEY")
+
+	srcfile, err := os.Open("./encyptfile")
+	assert.Nil(t, err)
+	defer srcfile.Close()
+
+	buf := new(bytes.Buffer)
+	read := bufio.NewReader(srcfile)
+	read.WriteTo(buf)
+
+	block, err := aes.NewCipher([]byte(key))
+	assert.Nil(t, err)
+
+	origData := buf.Bytes()
+	blockdec := cipher.NewCBCDecrypter(block, []byte(key)[:block.BlockSize()])
+	orig := make([]byte, len(origData))
+	blockdec.CryptBlocks(orig, origData)
+	orig = PKCS7UnPadding(orig)
+
+	cyphbuf := bytes.NewBuffer(orig)
+	scan := bufio.NewScanner(cyphbuf)
+	var data string
+	for scan.Scan() {
+		if strings.HasPrefix(scan.Text(), "----") {
+			continue
+		}
+		data += scan.Text() + "\n"
+	}
+
+	client, err := sdk.NewClientWithRsaKeyPair("ap-northeast-1", os.Getenv("PUBLIC_KEY_ID"), data, 3600)
+	assert.Nil(t, err)
+
+	response, err := client.ProcessCommonRequest(request)
+	assert.Nil(t, err)
+	assert.True(t, response.IsSuccess())
+}
+
+func PKCS7UnPadding(origData []byte) []byte {
+	length := len(origData)
+	unpadding := int(origData[length-1])
+	return origData[:(length - unpadding)]
+}
+
+func TestDescribeRegionsWithBearToken(t *testing.T) {
+	request := requests.NewCommonRequest()
+	request.Version = "2017-07-05"
+	request.Product = "CCC"
+	request.ApiName = "ListRoles "
+	request.SetDomain("ccc.cn-shanghai.aliyuncs.com")
+	request.TransToAcsRequest()
+	client, err := sdk.NewClientWithBearerToken("cn-shanghai", "eyJhbGciOiJSUzI1NiIsImsyaWQiOiJlNE92NnVOUDhsMEY2RmVUMVhvek5wb1NBcVZLblNGRyIsImtpZCI6IkpDOXd4enJocUowZ3RhQ0V0MlFMVWZldkVVSXdsdEZodWk0TzFiaDY3dFUifQ.TjU2UldwZzFzRE1oVEN5UStjYlZLV1dzNW45cFBOSWdNRDhzQmVXYmVpLytWY012MEJqYjdTdnB3SE9LcHBiZkorUGdvclAxRy9GTjdHeldmaWZFVndoa05ueUNTem80dU0rUVFKdDFSY2V0bmFQcml5WFljTDhmNUZ2c1pFd3BhTDFOajVvRW9QVG83S1NVU3JpTFdKQmNnVHB1U094cUd4cGpCeFdXS0pDVnN0L3lzRkp4RTVlSFNzUm1Qa1FBVTVwS1lmaXE0QVFSd3lPQjdYSk1uUGFKU1BiSWhyWVFVS21WOVd5K2d3PT0.jxdCiNimyes3swDRBSxdsgaL4IlOD2Kz49Gf5w0VZ0Xap9ozUyxvSSywGzMrKvCTIoeh9QMCMjCpnt9A-nQxENj3YGAeBk8Wy19uHiT-4OVo-CiCKmKxILpzxcpOptNO-LER1swVLbt0NiTuTH4KB5CUaRwJKIFJuUwa57HcsWbvWQyZa1ms0NNOccNfGJl4177eY2LTUyyXWi4wYNA_L0YMTkZz4sOFM_Mdzks8bHXiSbGkkjfWQy0QblkLz6Bboh1OYlg3_RCLSWby_FMNoxU_eG2lGAsDnYxZDmCAq2jedY0x1RzZodo9HYRQN7DujlBhfzqm4hOBNvA3LiJfzw")
+	assert.Nil(t, err)
+	response, err := client.ProcessCommonRequest(request)
+	assert.True(t, strings.Contains(err.Error(), "Bearertoken has expired"))
+	assert.False(t, response.IsSuccess())
+}

BIN
common/src/github.com/aliyun/alibaba-cloud-sdk-go/integration/encyptfile


+ 93 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/integration/error_test.go

@@ -0,0 +1,93 @@
+package integration
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
+	"github.com/stretchr/testify/assert"
+
+	"os"
+	"strings"
+	"testing"
+)
+
+func Test_DescribeRegionsWithParameterError(t *testing.T) {
+	request := requests.NewCommonRequest()
+	request.Version = "2014-05-26"
+	request.Product = "Ecs"
+	request.ApiName = "Describe"
+	request.SetDomain("ecs.aliyuncs.com")
+	request.TransToAcsRequest()
+	client, err := sdk.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	_, err = client.ProcessCommonRequest(request)
+	realerr := err.(errors.Error)
+	assert.Equal(t, "InvalidParameter", realerr.ErrorCode())
+	assert.Equal(t, "The specified parameter \"Action or Version\" is not valid.", realerr.Message())
+}
+
+func Test_DescribeRegionsWithUnreachableError(t *testing.T) {
+	request := requests.NewCommonRequest()
+	request.Version = "2014-05-26"
+	request.Product = "Ecs"
+	request.ApiName = "DescribeRegions"
+	request.SetDomain("www.aliyun-hangzhou.com")
+	request.TransToAcsRequest()
+	client, err := sdk.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	response, err := client.ProcessCommonRequest(request)
+	assert.Equal(t, 0, response.GetHttpStatus())
+	realerr := err.(errors.Error)
+	assert.True(t, strings.Contains(realerr.OriginError().Error(), "www.aliyun-hangzhou.com"))
+}
+
+func Test_DescribeRegionsWithTimeout(t *testing.T) {
+	credentail := credentials.NewAccessKeyCredential(os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	config := &sdk.Config{
+		Timeout: 100,
+	}
+	request := ecs.CreateDescribeRegionsRequest()
+	request.Scheme = "https"
+	request.SetDomain("ecs.aliyuncs.com")
+	client, err := ecs.NewClientWithOptions(os.Getenv("REGION_ID"), config, credentail)
+	response, err := client.DescribeRegions(request)
+	assert.Equal(t, 0, response.GetHttpStatus())
+	assert.Contains(t, err.Error(), "https://ecs.aliyuncs.com")
+	assert.Contains(t, err.Error(), "Client.Timeout exceeded while awaiting headers")
+}
+
+func Test_DescribeRegionsWithNilbody(t *testing.T) {
+	request := requests.NewCommonRequest()
+	request.Version = "2014-05-26"
+	request.Product = "Ecs"
+	request.ApiName = "DescribeRegions"
+	ts := mockServer(400, ``)
+	defer ts.Close()
+	domain := strings.Replace(ts.URL, "http://", "", 1)
+	request.Domain = domain
+	request.TransToAcsRequest()
+	client, err := sdk.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	response, err := client.ProcessCommonRequest(request)
+	assert.Equal(t, 400, response.GetHttpStatus())
+	assert.NotNil(t, err)
+}
+
+func Test_DescribeRegionsWithFormatError(t *testing.T) {
+	request := requests.NewCommonRequest()
+	request.Version = "2014-05-26"
+	request.Product = "Ecs"
+	request.ApiName = "DescribeRegions"
+	ts := mockServer(400, `bad json`)
+	defer ts.Close()
+	domain := strings.Replace(ts.URL, "http://", "", 1)
+	request.Domain = domain
+	request.TransToAcsRequest()
+	client, err := sdk.NewClientWithAccessKey(os.Getenv("REGION_ID"), os.Getenv("ACCESS_KEY_ID"), os.Getenv("ACCESS_KEY_SECRET"))
+	assert.Nil(t, err)
+	response, err := client.ProcessCommonRequest(request)
+	assert.Equal(t, 400, response.GetHttpStatus())
+	assert.Contains(t, err.Error(), "bad json")
+}

+ 249 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/api_timeout.go

@@ -0,0 +1,249 @@
+package sdk
+
+import (
+	"encoding/json"
+	"strings"
+	"time"
+)
+
+var apiTimeouts = `{
+  "ecs": {
+      "ActivateRouterInterface": 10,
+      "AddTags": 61,
+      "AllocateDedicatedHosts": 10,
+      "AllocateEipAddress": 17,
+      "AllocatePublicIpAddress": 36,
+      "ApplyAutoSnapshotPolicy": 10,
+      "AssignIpv6Addresses": 10,
+      "AssignPrivateIpAddresses": 10,
+      "AssociateEipAddress": 17,
+      "AttachClassicLinkVpc": 14,
+      "AttachDisk": 36,
+      "AttachInstanceRamRole": 11,
+      "AttachKeyPair": 16,
+      "AttachNetworkInterface": 16,
+      "AuthorizeSecurityGroupEgress": 16,
+      "AuthorizeSecurityGroup": 16,
+      "CancelAutoSnapshotPolicy": 10,
+      "CancelCopyImage": 10,
+      "CancelPhysicalConnection": 10,
+      "CancelSimulatedSystemEvents": 10,
+      "CancelTask": 10,
+      "ConnectRouterInterface": 10,
+      "ConvertNatPublicIpToEip": 12,
+      "CopyImage": 10,
+      "CreateAutoSnapshotPolicy": 10,
+      "CreateCommand": 16,
+      "CreateDeploymentSet": 16,
+      "CreateDisk": 36,
+      "CreateHpcCluster": 10,
+      "CreateImage": 36,
+      "CreateInstance": 86,
+      "CreateKeyPair": 10,
+      "CreateLaunchTemplate": 10,
+      "CreateLaunchTemplateVersion": 10,
+      "CreateNatGateway": 36,
+      "CreateNetworkInterfacePermission": 13,
+      "CreateNetworkInterface": 16,
+      "CreatePhysicalConnection": 10,
+      "CreateRouteEntry": 17,
+      "CreateRouterInterface": 10,
+      "CreateSecurityGroup": 86,
+      "CreateSimulatedSystemEvents": 10,
+      "CreateSnapshot": 86,
+      "CreateVirtualBorderRouter": 10,
+      "CreateVpc": 16,
+      "CreateVSwitch": 17,
+      "DeactivateRouterInterface": 10,
+      "DeleteAutoSnapshotPolicy": 10,
+      "DeleteBandwidthPackage": 10,
+      "DeleteCommand": 16,
+      "DeleteDeploymentSet": 12,
+      "DeleteDisk": 16,
+      "DeleteHpcCluster": 10,
+      "DeleteImage": 36,
+      "DeleteInstance": 66,
+      "DeleteKeyPairs": 10,
+      "DeleteLaunchTemplate": 10,
+      "DeleteLaunchTemplateVersion": 10,
+      "DeleteNatGateway": 10,
+      "DeleteNetworkInterfacePermission": 10,
+      "DeleteNetworkInterface": 16,
+      "DeletePhysicalConnection": 10,
+      "DeleteRouteEntry": 16,
+      "DeleteRouterInterface": 10,
+      "DeleteSecurityGroup": 87,
+      "DeleteSnapshot": 17,
+      "DeleteVirtualBorderRouter": 10,
+      "DeleteVpc": 17,
+      "DeleteVSwitch": 17,
+      "DescribeAccessPoints": 10,
+      "DescribeAccountAttributes": 10,
+      "DescribeAutoSnapshotPolicyEx": 16,
+      "DescribeAvailableResource": 10,
+      "DescribeBandwidthLimitation": 16,
+      "DescribeBandwidthPackages": 10,
+      "DescribeClassicLinkInstances": 15,
+      "DescribeCloudAssistantStatus": 16,
+      "DescribeClusters": 10,
+      "DescribeCommands": 16,
+      "DescribeDedicatedHosts": 10,
+      "DescribeDedicatedHostTypes": 10,
+      "DescribeDeploymentSets": 26,
+      "DescribeDiskMonitorData": 16,
+      "DescribeDisksFullStatus": 14,
+      "DescribeDisks": 19,
+      "DescribeEipAddresses": 16,
+      "DescribeEipMonitorData": 16,
+      "DescribeEniMonitorData": 10,
+      "DescribeHaVips": 10,
+      "DescribeHpcClusters": 16,
+      "DescribeImageSharePermission": 10,
+      "DescribeImages": 38,
+      "DescribeImageSupportInstanceTypes": 16,
+      "DescribeInstanceAttribute": 36,
+      "DescribeInstanceAutoRenewAttribute": 17,
+      "DescribeInstanceHistoryEvents": 19,
+      "DescribeInstanceMonitorData": 19,
+      "DescribeInstancePhysicalAttribute": 10,
+      "DescribeInstanceRamRole": 11,
+      "DescribeInstancesFullStatus": 14,
+      "DescribeInstances": 10,
+      "DescribeInstanceStatus": 26,
+      "DescribeInstanceTopology": 12,
+      "DescribeInstanceTypeFamilies": 17,
+      "DescribeInstanceTypes": 17,
+      "DescribeInstanceVncPasswd": 10,
+      "DescribeInstanceVncUrl": 36,
+      "DescribeInvocationResults": 16,
+      "DescribeInvocations": 16,
+      "DescribeKeyPairs": 12,
+      "DescribeLaunchTemplates": 16,
+      "DescribeLaunchTemplateVersions": 16,
+      "DescribeLimitation": 36,
+      "DescribeNatGateways": 10,
+      "DescribeNetworkInterfacePermissions": 13,
+      "DescribeNetworkInterfaces": 16,
+      "DescribeNewProjectEipMonitorData": 16,
+      "DescribePhysicalConnections": 10,
+      "DescribePrice": 16,
+      "DescribeRecommendInstanceType": 10,
+      "DescribeRegions": 19,
+      "DescribeRenewalPrice": 16,
+      "DescribeResourceByTags": 10,
+      "DescribeResourcesModification": 17,
+      "DescribeRouterInterfaces": 10,
+      "DescribeRouteTables": 17,
+      "DescribeSecurityGroupAttribute": 133,
+      "DescribeSecurityGroupReferences": 16,
+      "DescribeSecurityGroups": 25,
+      "DescribeSnapshotLinks": 17,
+      "DescribeSnapshotMonitorData": 12,
+      "DescribeSnapshotPackage": 10,
+      "DescribeSnapshots": 26,
+      "DescribeSnapshotsUsage": 26,
+      "DescribeSpotPriceHistory": 22,
+      "DescribeTags": 17,
+      "DescribeTaskAttribute": 10,
+      "DescribeTasks": 11,
+      "DescribeUserBusinessBehavior": 13,
+      "DescribeUserData": 10,
+      "DescribeVirtualBorderRoutersForPhysicalConnection": 10,
+      "DescribeVirtualBorderRouters": 10,
+      "DescribeVpcs": 41,
+      "DescribeVRouters": 17,
+      "DescribeVSwitches": 17,
+      "DescribeZones": 103,
+      "DetachClassicLinkVpc": 14,
+      "DetachDisk": 17,
+      "DetachInstanceRamRole": 10,
+      "DetachKeyPair": 10,
+      "DetachNetworkInterface": 16,
+      "EipFillParams": 19,
+      "EipFillProduct": 13,
+      "EipNotifyPaid": 10,
+      "EnablePhysicalConnection": 10,
+      "ExportImage": 10,
+      "GetInstanceConsoleOutput": 14,
+      "GetInstanceScreenshot": 14,
+      "ImportImage": 29,
+      "ImportKeyPair": 10,
+      "InstallCloudAssistant": 10,
+      "InvokeCommand": 16,
+      "JoinResourceGroup": 10,
+      "JoinSecurityGroup": 66,
+      "LeaveSecurityGroup": 66,
+      "ModifyAutoSnapshotPolicyEx": 10,
+      "ModifyBandwidthPackageSpec": 11,
+      "ModifyCommand": 10,
+      "ModifyDeploymentSetAttribute": 10,
+      "ModifyDiskAttribute": 16,
+      "ModifyDiskChargeType": 13,
+      "ModifyEipAddressAttribute": 14,
+      "ModifyImageAttribute": 10,
+      "ModifyImageSharePermission": 16,
+      "ModifyInstanceAttribute": 22,
+      "ModifyInstanceAutoReleaseTime": 15,
+      "ModifyInstanceAutoRenewAttribute": 16,
+      "ModifyInstanceChargeType": 22,
+      "ModifyInstanceDeployment": 10,
+      "ModifyInstanceNetworkSpec": 36,
+      "ModifyInstanceSpec": 62,
+      "ModifyInstanceVncPasswd": 35,
+      "ModifyInstanceVpcAttribute": 15,
+      "ModifyLaunchTemplateDefaultVersion": 10,
+      "ModifyNetworkInterfaceAttribute": 10,
+      "ModifyPhysicalConnectionAttribute": 10,
+      "ModifyPrepayInstanceSpec": 13,
+      "ModifyRouterInterfaceAttribute": 10,
+      "ModifySecurityGroupAttribute": 10,
+      "ModifySecurityGroupEgressRule": 10,
+      "ModifySecurityGroupPolicy": 10,
+      "ModifySecurityGroupRule": 16,
+      "ModifySnapshotAttribute": 10,
+      "ModifyUserBusinessBehavior": 10,
+      "ModifyVirtualBorderRouterAttribute": 10,
+      "ModifyVpcAttribute": 10,
+      "ModifyVRouterAttribute": 10,
+      "ModifyVSwitchAttribute": 10,
+      "ReActivateInstances": 10,
+      "RebootInstance": 27,
+      "RedeployInstance": 14,
+      "ReInitDisk": 16,
+      "ReleaseDedicatedHost": 10,
+      "ReleaseEipAddress": 16,
+      "ReleasePublicIpAddress": 10,
+      "RemoveTags": 10,
+      "RenewInstance": 19,
+      "ReplaceSystemDisk": 36,
+      "ResetDisk": 36,
+      "ResizeDisk": 11,
+      "RevokeSecurityGroupEgress": 13,
+      "RevokeSecurityGroup": 16,
+      "RunInstances": 86,
+      "StartInstance": 46,
+      "StopInstance": 27,
+      "StopInvocation": 10,
+      "TerminatePhysicalConnection": 10,
+      "TerminateVirtualBorderRouter": 10,
+      "UnassignIpv6Addresses": 10,
+      "UnassignPrivateIpAddresses": 10,
+      "UnassociateEipAddress": 16 
+  }
+}
+`
+
+func getAPIMaxTimeout(product, actionName string) (time.Duration, bool) {
+	timeout := make(map[string]map[string]int)
+	err := json.Unmarshal([]byte(apiTimeouts), &timeout)
+	if err != nil {
+		return 0 * time.Millisecond, false
+	}
+
+	obj := timeout[strings.ToLower(product)]
+	if obj != nil && obj[actionName] != 0 {
+		return time.Duration(obj[actionName]) * time.Second, true
+	}
+
+	return 0 * time.Millisecond, false
+}

+ 22 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/api_timeout_test.go

@@ -0,0 +1,22 @@
+package sdk
+
+import (
+	"testing"
+	"time"
+
+	"github.com/stretchr/testify/assert"
+)
+
+func Test_getAPIMaxTimeout(t *testing.T) {
+	timeout, ok := getAPIMaxTimeout("ecs", "UnassociateEipAddress")
+	assert.True(t, ok)
+	assert.Equal(t, 16*time.Second, timeout)
+
+	timeout, ok = getAPIMaxTimeout("Ecs", "UnassociateEipAddress")
+	assert.True(t, ok)
+	assert.Equal(t, 16*time.Second, timeout)
+
+	timeout, ok = getAPIMaxTimeout("Acs", "UnassociateEipAddress")
+	assert.False(t, ok)
+	assert.Equal(t, 0*time.Second, timeout)
+}

+ 18 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credential.go

@@ -0,0 +1,18 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package auth
+
+type Credential interface {
+}

+ 1 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credential_test.go

@@ -0,0 +1 @@
+package auth

+ 34 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/access_key_credential.go

@@ -0,0 +1,34 @@
+package credentials
+
+// Deprecated: Use AccessKeyCredential in this package instead.
+type BaseCredential struct {
+	AccessKeyId     string
+	AccessKeySecret string
+}
+
+type AccessKeyCredential struct {
+	AccessKeyId     string
+	AccessKeySecret string
+}
+
+// Deprecated: Use NewAccessKeyCredential in this package instead.
+func NewBaseCredential(accessKeyId, accessKeySecret string) *BaseCredential {
+	return &BaseCredential{
+		AccessKeyId:     accessKeyId,
+		AccessKeySecret: accessKeySecret,
+	}
+}
+
+func (baseCred *BaseCredential) ToAccessKeyCredential() *AccessKeyCredential {
+	return &AccessKeyCredential{
+		AccessKeyId:     baseCred.AccessKeyId,
+		AccessKeySecret: baseCred.AccessKeySecret,
+	}
+}
+
+func NewAccessKeyCredential(accessKeyId, accessKeySecret string) *AccessKeyCredential {
+	return &AccessKeyCredential{
+		AccessKeyId:     accessKeyId,
+		AccessKeySecret: accessKeySecret,
+	}
+}

+ 19 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/access_key_credential_test.go

@@ -0,0 +1,19 @@
+package credentials
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+)
+
+func TestAccessKeyCredential(t *testing.T) {
+	c := NewAccessKeyCredential("accesskeyid", "accesskeysecret")
+	assert.Equal(t, "accesskeyid", c.AccessKeyId)
+	assert.Equal(t, "accesskeysecret", c.AccessKeySecret)
+	b:= NewBaseCredential("accesskeyid", "accesskeysecret")
+	assert.Equal(t, "accesskeyid", b.AccessKeyId)
+	assert.Equal(t, "accesskeysecret", b.AccessKeySecret)
+	a := b.ToAccessKeyCredential()
+	assert.Equal(t, "accesskeyid", a.AccessKeyId)
+	assert.Equal(t, "accesskeysecret", a.AccessKeySecret)
+}

+ 12 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/bearer_token_credential.go

@@ -0,0 +1,12 @@
+package credentials
+
+type BearerTokenCredential struct {
+	BearerToken string
+}
+
+// NewBearerTokenCredential return a BearerTokenCredential object
+func NewBearerTokenCredential(token string) *BearerTokenCredential {
+	return &BearerTokenCredential{
+		BearerToken: token,
+	}
+}

+ 12 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/bearer_token_credential_test.go

@@ -0,0 +1,12 @@
+package credentials
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+)
+
+func TestNewBearerTokenCredential(t *testing.T) {
+	bc := NewBearerTokenCredential("Bearer.Token")
+	assert.Equal(t, &BearerTokenCredential{"Bearer.Token"}, bc)
+}

+ 29 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/ecs_ram_role.go

@@ -0,0 +1,29 @@
+package credentials
+
+func (oldCred *StsRoleNameOnEcsCredential) ToEcsRamRoleCredential() *EcsRamRoleCredential {
+	return &EcsRamRoleCredential{
+		RoleName: oldCred.RoleName,
+	}
+}
+
+type EcsRamRoleCredential struct {
+	RoleName string
+}
+
+func NewEcsRamRoleCredential(roleName string) *EcsRamRoleCredential {
+	return &EcsRamRoleCredential{
+		RoleName: roleName,
+	}
+}
+
+// Deprecated: Use EcsRamRoleCredential in this package instead.
+type StsRoleNameOnEcsCredential struct {
+	RoleName string
+}
+
+// Deprecated: Use NewEcsRamRoleCredential in this package instead.
+func NewStsRoleNameOnEcsCredential(roleName string) *StsRoleNameOnEcsCredential {
+	return &StsRoleNameOnEcsCredential{
+		RoleName: roleName,
+	}
+}

+ 16 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/ecs_ram_role_test.go

@@ -0,0 +1,16 @@
+package credentials
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+)
+
+func TestECSRamRole(t *testing.T) {
+	c := NewEcsRamRoleCredential("rolename")
+	assert.Equal(t, "rolename", c.RoleName)
+	s := NewStsRoleNameOnEcsCredential("rolename")
+	assert.Equal(t, "rolename", s.RoleName)
+	r := s.ToEcsRamRoleCredential()
+	assert.Equal(t, "rolename", r.RoleName)
+}

+ 30 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/env.go

@@ -0,0 +1,30 @@
+package provider
+
+import (
+	"errors"
+	"os"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+)
+
+type EnvProvider struct{}
+
+var ProviderEnv = new(EnvProvider)
+
+func NewEnvProvider() Provider {
+	return &EnvProvider{}
+}
+
+func (p *EnvProvider) Resolve() (auth.Credential, error) {
+	accessKeyID, ok1 := os.LookupEnv(ENVAccessKeyID)
+	accessKeySecret, ok2 := os.LookupEnv(ENVAccessKeySecret)
+	if !ok1 || !ok2 {
+		return nil, nil
+	}
+	if accessKeyID == "" || accessKeySecret == "" {
+		return nil, errors.New("Environmental variable (ALIBABACLOUD_ACCESS_KEY_ID or ALIBABACLOUD_ACCESS_KEY_SECRET) is empty")
+	}
+	return credentials.NewAccessKeyCredential(accessKeyID, accessKeySecret), nil
+}

+ 30 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/env_test.go

@@ -0,0 +1,30 @@
+package provider_test
+
+import (
+	"os"
+	"testing"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+
+	"github.com/stretchr/testify/assert"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider"
+)
+
+func TestEnvResolve(t *testing.T) {
+	p := provider.NewEnvProvider()
+	assert.Equal(t, &provider.EnvProvider{}, p)
+	c, err := p.Resolve()
+	assert.Nil(t, c)
+	assert.Nil(t, err)
+	os.Setenv(provider.ENVAccessKeyID, "")
+	os.Setenv(provider.ENVAccessKeySecret, "")
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.EqualError(t, err, "Environmental variable (ALIBABACLOUD_ACCESS_KEY_ID or ALIBABACLOUD_ACCESS_KEY_SECRET) is empty")
+	os.Setenv(provider.ENVAccessKeyID, "AccessKeyId")
+	os.Setenv(provider.ENVAccessKeySecret, "AccessKeySecret")
+	c, err = p.Resolve()
+	assert.Nil(t, err)
+	assert.Equal(t, &credentials.AccessKeyCredential{"AccessKeyId", "AccessKeySecret"}, c)
+}

+ 92 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/instance_credentials.go

@@ -0,0 +1,92 @@
+package provider
+
+import (
+	"encoding/json"
+	"errors"
+	"fmt"
+	"io/ioutil"
+	"net/http"
+	"os"
+	"time"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+)
+
+var securityCredURL = "http://100.100.100.200/latest/meta-data/ram/security-credentials/"
+
+type InstanceCredentialsProvider struct{}
+
+var ProviderInstance = new(InstanceCredentialsProvider)
+
+var HookGet = func(fn func(string) (int, []byte, error)) func(string) (int, []byte, error) {
+	return fn
+}
+
+func NewInstanceCredentialsProvider() Provider {
+	return &InstanceCredentialsProvider{}
+}
+
+func (p *InstanceCredentialsProvider) Resolve() (auth.Credential, error) {
+	roleName, ok := os.LookupEnv(ENVEcsMetadata)
+	if !ok {
+		return nil, nil
+	}
+	if roleName == "" {
+		return nil, errors.New("Environmental variable 'ALIBABA_CLOUD_ECS_METADATA' are empty")
+	}
+	status, content, err := HookGet(get)(securityCredURL + roleName)
+	if err != nil {
+		return nil, err
+	}
+	if status != 200 {
+		if status == 404 {
+			return nil, fmt.Errorf("The role was not found in the instance")
+		}
+		return nil, fmt.Errorf("Received %d when getting security credentials for %s", status, roleName)
+	}
+	body := make(map[string]interface{})
+
+	if err := json.Unmarshal(content, &body); err != nil {
+		return nil, err
+	}
+
+	accessKeyID, err := extractString(body, "AccessKeyId")
+	if err != nil {
+		return nil, err
+	}
+	accessKeySecret, err := extractString(body, "AccessKeySecret")
+	if err != nil {
+		return nil, err
+	}
+	securityToken, err := extractString(body, "SecurityToken")
+	if err != nil {
+		return nil, err
+	}
+
+	return credentials.NewStsTokenCredential(accessKeyID, accessKeySecret, securityToken), nil
+}
+
+func get(url string) (status int, content []byte, err error) {
+	httpClient := http.DefaultClient
+	httpClient.Timeout = 1 * time.Second
+	resp, err := httpClient.Get(url)
+	if err != nil {
+		return
+	}
+	defer resp.Body.Close()
+	content, err = ioutil.ReadAll(resp.Body)
+	return resp.StatusCode, content, err
+}
+
+func extractString(m map[string]interface{}, key string) (string, error) {
+	raw, ok := m[key]
+	if !ok {
+		return "", fmt.Errorf("%s not in map", key)
+	}
+	str, ok := raw.(string)
+	if !ok {
+		return "", fmt.Errorf("%s is not a string in map", key)
+	}
+	return str, nil
+}

+ 136 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/instance_credentials_test.go

@@ -0,0 +1,136 @@
+package provider_test
+
+import (
+	"os"
+	"testing"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+
+	"github.com/stretchr/testify/assert"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider"
+)
+
+func TestInstanceCredentialsProvider(t *testing.T) {
+	//testcase 1
+	//return nil, nil
+	p := provider.NewInstanceCredentialsProvider()
+	c, err := p.Resolve()
+	assert.Nil(t, c)
+	assert.Nil(t, err)
+
+	//testcase 2
+	//return nil, errors.New("Environmental variable 'ALIBABA_CLOUD_ECS_METADATA' are empty")
+	os.Setenv(provider.ENVEcsMetadata, "")
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.EqualError(t, err, "Environmental variable 'ALIBABA_CLOUD_ECS_METADATA' are empty")
+
+	//testcase 3
+	//return nil, err
+	os.Setenv(provider.ENVEcsMetadata, "test")
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.NotNil(t, err)
+
+	//testcase 4
+	//return nil, fmt.Errorf("The role was not found in the instance")
+	provider.HookGet = func(fn func(string) (int, []byte, error)) func(string) (int, []byte, error) {
+		return func(string) (int, []byte, error) {
+			return 404, []byte(""), nil
+		}
+	}
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.EqualError(t, err, "The role was not found in the instance")
+
+	//testcase 5
+	//return nil, fmt.Errorf("Received %d when getting security credentials for %s", status, roleName)
+	provider.HookGet = func(fn func(string) (int, []byte, error)) func(string) (int, []byte, error) {
+		return func(string) (int, []byte, error) {
+			return 400, []byte(""), nil
+		}
+	}
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.EqualError(t, err, "Received 400 when getting security credentials for test")
+
+	//testcase 6
+	//json unmarshal error
+	provider.HookGet = func(fn func(string) (int, []byte, error)) func(string) (int, []byte, error) {
+		return func(string) (int, []byte, error) {
+			return 200, []byte(`{
+				AccessKSTS.*******
+			  }`), nil
+		}
+	}
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.NotNil(t, err)
+
+	//testcase 7, AccessKeyId does not receive
+	provider.HookGet = func(fn func(string) (int, []byte, error)) func(string) (int, []byte, error) {
+		return func(string) (int, []byte, error) {
+			return 200, []byte(`{
+				"AccessKeySecret" : "*******",
+				"Expiration" : "2019-01-28T15:15:56Z",
+				"SecurityToken" : "SecurityToken",
+				"LastUpdated" : "2019-01-28T09:15:55Z",
+				"Code" : "Success"
+			  }`), nil
+		}
+	}
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.EqualError(t, err, "AccessKeyId not in map")
+
+	//testcase 8,AccessKeySecret does not receive
+	provider.HookGet = func(fn func(string) (int, []byte, error)) func(string) (int, []byte, error) {
+		return func(string) (int, []byte, error) {
+			return 200, []byte(`{
+				"AccessKeyId" : "STS.*******",
+				"Expiration" : "2019-01-28T15:15:56Z",
+				"SecurityToken" : "SecurityToken",
+				"LastUpdated" : "2019-01-28T09:15:55Z",
+				"Code" : "Success"
+			  }`), nil
+		}
+	}
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.EqualError(t, err, "AccessKeySecret not in map")
+
+	//testcase 9, SecurityToken does not receive
+	provider.HookGet = func(fn func(string) (int, []byte, error)) func(string) (int, []byte, error) {
+		return func(string) (int, []byte, error) {
+			return 200, []byte(`{
+				"AccessKeyId" : "STS.*******",
+				"AccessKeySecret" : "*******",
+				"Expiration" : "2019-01-28T15:15:56Z",
+				"LastUpdated" : "2019-01-28T09:15:55Z",
+				"Code" : "Success"
+			  }`), nil
+		}
+	}
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.EqualError(t, err, "SecurityToken not in map")
+
+	//testcase, normal receive
+	provider.HookGet = func(fn func(string) (int, []byte, error)) func(string) (int, []byte, error) {
+		return func(string) (int, []byte, error) {
+			return 200, []byte(`{
+				"AccessKeyId" : "STS.*******",
+				"AccessKeySecret" : "*******",
+				"Expiration" : "2019-01-28T15:15:56Z",
+				"SecurityToken" : "SecurityToken",
+				"LastUpdated" : "2019-01-28T09:15:55Z",
+				"Code" : "Success"
+			  }`), nil
+		}
+	}
+	c, err = p.Resolve()
+	assert.Nil(t, err)
+	assert.Equal(t, credentials.NewStsTokenCredential("STS.*******", "*******", "SecurityToken"), c)
+
+}

+ 159 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/profile_credentials.go

@@ -0,0 +1,159 @@
+package provider
+
+import (
+	"bufio"
+	"errors"
+	"os"
+	"runtime"
+	"strings"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+
+	ini "gopkg.in/ini.v1"
+)
+
+type ProfileProvider struct {
+	Profile string
+}
+
+var ProviderProfile = NewProfileProvider()
+
+// NewProfileProvider receive zero or more parameters,
+// when length of name is 0, the value of field Profile will be "default",
+// and when there are multiple inputs, the function will take the
+// first one and  discard the other values.
+func NewProfileProvider(name ...string) Provider {
+	p := new(ProfileProvider)
+	if len(name) == 0 {
+		p.Profile = "default"
+	} else {
+		p.Profile = name[0]
+	}
+	return p
+}
+
+// Resolve implements the Provider interface
+// when credential type is rsa_key_pair, the content of private_key file
+// must be able to be parsed directly into the required string
+// that NewRsaKeyPairCredential function needed
+func (p *ProfileProvider) Resolve() (auth.Credential, error) {
+	path, ok := os.LookupEnv(ENVCredentialFile)
+	if !ok {
+		var err error
+		path, err = checkDefaultPath()
+		if err != nil {
+			return nil, err
+		}
+		if path == "" {
+			return nil, nil
+		}
+	} else if path == "" {
+		return nil, errors.New("Environment variable '" + ENVCredentialFile + "' cannot be empty")
+	}
+
+	ini, err := ini.Load(path)
+	if err != nil {
+		return nil, errors.New("ERROR: Can not open file" + err.Error())
+	}
+
+	section, err := ini.GetSection(p.Profile)
+	if err != nil {
+		return nil, errors.New("ERROR: Can not load section" + err.Error())
+	}
+
+	value, err := section.GetKey("type")
+	if err != nil {
+		return nil, errors.New("ERROR: Can not find credential type" + err.Error())
+	}
+
+	switch value.String() {
+	case "access_key":
+		value1, err1 := section.GetKey("access_key_id")
+		value2, err2 := section.GetKey("access_key_secret")
+		if err1 != nil || err2 != nil {
+			return nil, errors.New("ERROR: Failed to get value")
+		}
+		if value1.String() == "" || value2.String() == "" {
+			return nil, errors.New("ERROR: Value can't be empty")
+		}
+		return credentials.NewAccessKeyCredential(value1.String(), value2.String()), nil
+	case "ecs_ram_role":
+		value1, err1 := section.GetKey("role_name")
+		if err1 != nil {
+			return nil, errors.New("ERROR: Failed to get value")
+		}
+		if value1.String() == "" {
+			return nil, errors.New("ERROR: Value can't be empty")
+		}
+		return credentials.NewEcsRamRoleCredential(value1.String()), nil
+	case "ram_role_arn":
+		value1, err1 := section.GetKey("access_key_id")
+		value2, err2 := section.GetKey("access_key_secret")
+		value3, err3 := section.GetKey("role_arn")
+		value4, err4 := section.GetKey("role_session_name")
+		if err1 != nil || err2 != nil || err3 != nil || err4 != nil {
+			return nil, errors.New("ERROR: Failed to get value")
+		}
+		if value1.String() == "" || value2.String() == "" || value3.String() == "" || value4.String() == "" {
+			return nil, errors.New("ERROR: Value can't be empty")
+		}
+		return credentials.NewRamRoleArnCredential(value1.String(), value2.String(), value3.String(), value4.String(), 3600), nil
+	case "rsa_key_pair":
+		value1, err1 := section.GetKey("public_key_id")
+		value2, err2 := section.GetKey("private_key_file")
+		if err1 != nil || err2 != nil {
+			return nil, errors.New("ERROR: Failed to get value")
+		}
+		if value1.String() == "" || value2.String() == "" {
+			return nil, errors.New("ERROR: Value can't be empty")
+		}
+		file, err := os.Open(value2.String())
+		if err != nil {
+			return nil, errors.New("ERROR: Can not get private_key")
+		}
+		defer file.Close()
+		var privateKey string
+		scan := bufio.NewScanner(file)
+		var data string
+		for scan.Scan() {
+			if strings.HasPrefix(scan.Text(), "----") {
+				continue
+			}
+			data += scan.Text() + "\n"
+		}
+		return credentials.NewRsaKeyPairCredential(privateKey, value1.String(), 3600), nil
+	default:
+		return nil, errors.New("ERROR: Failed to get credential")
+	}
+}
+
+// GetHomePath return home directory according to the system.
+// if the environmental virables does not exist, will return empty
+func GetHomePath() string {
+	if runtime.GOOS == "windows" {
+		path, ok := os.LookupEnv("USERPROFILE")
+		if !ok {
+			return ""
+		}
+		return path
+	}
+	path, ok := os.LookupEnv("HOME")
+	if !ok {
+		return ""
+	}
+	return path
+}
+
+func checkDefaultPath() (path string, err error) {
+	path = GetHomePath()
+	if path == "" {
+		return "", errors.New("The default credential file path is invalid")
+	}
+	path = strings.Replace("~/.alibabacloud/credentials", "~", path, 1)
+	_, err = os.Stat(path)
+	if err != nil {
+		return "", nil
+	}
+	return path, nil
+}

+ 236 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/profile_credentials_test.go

@@ -0,0 +1,236 @@
+package provider_test
+
+import (
+	"os"
+	"runtime"
+	"strings"
+	"testing"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+
+	"github.com/stretchr/testify/assert"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider"
+)
+
+var inistr = `
+[default]              
+enable = true                    
+type = access_key                
+access_key_id = foo               
+access_key_secret = bar            
+				   
+[notype]              
+access_key_id = foo               
+access_key_secret = bar
+
+[noak]
+type = access_key                        
+access_key_secret = bar   
+
+[emptyak]
+type = access_key                
+access_key_id =                
+access_key_secret = bar     
+
+[ecs]                         
+type = ecs_ram_role                
+role_name = EcsRamRoleTest
+
+[noecs]
+type = ecs_ram_role                
+
+[emptyecs]                         
+type = ecs_ram_role                
+role_name = 
+
+[ram]                                         
+type = ram_role_arn                
+access_key_id = foo
+access_key_secret = bar
+role_arn = role_arn
+role_session_name = session_name  
+
+[noram]                                         
+type = ram_role_arn                
+access_key_secret = bar
+role_arn = role_arn
+role_session_name = session_name  
+
+[emptyram]                                         
+type = ram_role_arn                
+access_key_id = 
+access_key_secret = bar
+role_arn = role_arn
+role_session_name = session_name  
+
+[rsa]                          
+type = rsa_key_pair               
+public_key_id = publicKeyId       
+private_key_file = ./pk.pem
+
+[norsa]                          
+type = rsa_key_pair               
+public_key_id = publicKeyId       
+
+[emptyrsa]                          
+type = rsa_key_pair               
+public_key_id = publicKeyId       
+private_key_file = 
+
+[error_rsa]                          
+type = rsa_key_pair               
+public_key_id = publicKeyId       
+private_key_file = ./pk_error.pem
+
+[error_type]                          
+type = error_type               
+public_key_id = publicKeyId       
+private_key_file = ./pk_error.pem
+`
+var privatekey = `this is privatekey`
+
+func TestProfileProvider(t *testing.T) {
+	var HOME string
+	if runtime.GOOS == "windows" {
+		HOME = "USERPROFILE"
+	} else {
+		HOME = "HOME"
+	}
+	path, ok := os.LookupEnv(HOME)
+	assert.True(t, ok)
+	os.Unsetenv(HOME)
+
+	// testcase 1, no HOME or USERPROFILE environment variable set
+	p := provider.NewProfileProvider()
+	c, err := p.Resolve()
+	assert.Nil(t, c)
+	assert.EqualError(t, err, "The default credential file path is invalid")
+
+	// testcase 2, default profile object
+	os.Setenv(HOME, path)
+	p = provider.NewProfileProvider()
+	value, ok := p.(*provider.ProfileProvider)
+	assert.True(t, ok)
+	assert.Equal(t, value.Profile, "default")
+
+	// testcase 3, credential file does not exist in the default path
+	// and section name does not exist
+	p = provider.NewProfileProvider("first")
+	value, ok = p.(*provider.ProfileProvider)
+	assert.True(t, ok)
+	assert.Equal(t, value.Profile, "first")
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.Nil(t, err)
+
+	// testcase 4, credential file path is error
+	os.Setenv(provider.ENVCredentialFile, "../../credentials_error")
+	p = provider.NewProfileProvider()
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.True(t, strings.Contains(err.Error(), "ERROR: Can not open file"))
+
+	// create profile
+	os.Setenv(provider.ENVCredentialFile, "./credentials")
+
+	file, err := os.Create("./credentials")
+	assert.Nil(t, err)
+	file.WriteString(inistr)
+	file.Close()
+	defer os.Remove("./credentials")
+
+	// testcase 5, section does not exist
+	p = provider.NewProfileProvider("NonExist")
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.True(t, strings.Contains(err.Error(), "ERROR: Can not load section"))
+
+	// testcase 6, credential type does not set
+	p = provider.NewProfileProvider("notype")
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.True(t, strings.Contains(err.Error(), "ERROR: Can not find credential type"))
+
+	// testcase 7, normal AK
+	p = provider.NewProfileProvider()
+	c, err = p.Resolve()
+	assert.Equal(t, credentials.NewAccessKeyCredential("foo", "bar"), c)
+	assert.Nil(t, err)
+	// testcase 8, key does not exist
+	p = provider.NewProfileProvider("noak")
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.True(t, strings.Contains(err.Error(), "ERROR: Failed to get value"))
+	// testcase 9, value is empty
+	p = provider.NewProfileProvider("emptyak")
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.True(t, strings.Contains(err.Error(), "ERROR: Value can't be empty"))
+
+	//testcase 10, normal EcsRamRole
+	p = provider.NewProfileProvider("ecs")
+	c, err = p.Resolve()
+	assert.Equal(t, credentials.NewEcsRamRoleCredential("EcsRamRoleTest"), c)
+	assert.Nil(t, err)
+	//testcase 11, key does not exist
+	p = provider.NewProfileProvider("noecs")
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.True(t, strings.Contains(err.Error(), "ERROR: Failed to get value"))
+	//testcase 12, value is empty
+	p = provider.NewProfileProvider("emptyecs")
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.True(t, strings.Contains(err.Error(), "ERROR: Value can't be empty"))
+
+	//testcase 13, normal RamRoleArn
+	p = provider.NewProfileProvider("ram")
+	c, err = p.Resolve()
+	assert.Equal(t, credentials.NewRamRoleArnCredential("foo", "bar", "role_arn", "session_name", 3600), c)
+	assert.Nil(t, err)
+	//testcase 14, key does not exist
+	p = provider.NewProfileProvider("noram")
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.True(t, strings.Contains(err.Error(), "ERROR: Failed to get value"))
+	//testcase 15, value is empty
+	p = provider.NewProfileProvider("emptyram")
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.True(t, strings.Contains(err.Error(), "ERROR: Value can't be empty"))
+
+	//testase 16, normal RsaKeyPair
+	file, err = os.Create("./pk.pem")
+	assert.Nil(t, err)
+	file.WriteString(privatekey)
+	file.Close()
+
+	p = provider.NewProfileProvider("rsa")
+	c, err = p.Resolve()
+	assert.Equal(t, credentials.NewRsaKeyPairCredential("", "publicKeyId", 3600), c)
+	assert.Nil(t, err)
+	defer os.Remove(`./pk.pem`)
+	//testcase 17, key does not exist
+	p = provider.NewProfileProvider("norsa")
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.True(t, strings.Contains(err.Error(), "ERROR: Failed to get value"))
+	//testcase 18, value is empty
+	p = provider.NewProfileProvider("emptyrsa")
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.True(t, strings.Contains(err.Error(), "ERROR: Value can't be empty"))
+
+	//testcase 19, the value is error
+	p = provider.NewProfileProvider("error_rsa")
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.True(t, strings.Contains(err.Error(), "ERROR: Can not get private_key"))
+
+	//testcase 20, credential type is error
+	p = provider.NewProfileProvider("error_type")
+	c, err = p.Resolve()
+	assert.Nil(t, c)
+	assert.True(t, strings.Contains(err.Error(), "ERROR: Failed to get credential"))
+}

+ 19 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider.go

@@ -0,0 +1,19 @@
+package provider
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+)
+
+//Environmental virables that may be used by the provider
+const (
+	ENVAccessKeyID     = "ALIBABA_CLOUD_ACCESS_KEY_ID"
+	ENVAccessKeySecret = "ALIBABA_CLOUD_ACCESS_KEY_SECRET"
+	ENVCredentialFile  = "ALIBABA_CLOUD_CREDENTIALS_FILE"
+	ENVEcsMetadata     = "ALIBABA_CLOUD_ECS_METADATA"
+	PATHCredentialFile = "~/.alibabacloud/credentials"
+)
+
+// When you want to customize the provider, you only need to implement the method of the interface.
+type Provider interface {
+	Resolve() (auth.Credential, error)
+}

+ 34 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider_chain.go

@@ -0,0 +1,34 @@
+package provider
+
+import (
+	"errors"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+)
+
+type ProviderChain struct {
+	Providers []Provider
+}
+
+var defaultproviders = []Provider{ProviderEnv, ProviderProfile, ProviderInstance}
+var DefaultChain = NewProviderChain(defaultproviders)
+
+func NewProviderChain(providers []Provider) Provider {
+	return &ProviderChain{
+		Providers: providers,
+	}
+}
+
+func (p *ProviderChain) Resolve() (auth.Credential, error) {
+	for _, provider := range p.Providers {
+		creds, err := provider.Resolve()
+		if err != nil {
+			return nil, err
+		} else if err == nil && creds == nil {
+			continue
+		}
+		return creds, err
+	}
+	return nil, errors.New("No credential found")
+
+}

+ 37 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider_chain_test.go

@@ -0,0 +1,37 @@
+package provider_test
+
+import (
+	"os"
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider"
+)
+
+func TestProviderChain(t *testing.T) {
+	env := provider.NewEnvProvider()
+	pp := provider.NewProfileProvider()
+	instanceP := provider.NewInstanceCredentialsProvider()
+
+	pc := provider.NewProviderChain([]provider.Provider{env, pp, instanceP})
+
+	c, err := pc.Resolve()
+	assert.Equal(t, &credentials.AccessKeyCredential{AccessKeyId: "AccessKeyId", AccessKeySecret: "AccessKeySecret"}, c)
+	assert.Nil(t, err)
+
+	os.Setenv(provider.ENVAccessKeyID, "")
+	os.Setenv(provider.ENVAccessKeySecret, "")
+	c, err = pc.Resolve()
+	assert.Nil(t, c)
+	assert.EqualError(t, err, "Environmental variable (ALIBABACLOUD_ACCESS_KEY_ID or ALIBABACLOUD_ACCESS_KEY_SECRET) is empty")
+
+	os.Unsetenv(provider.ENVAccessKeyID)
+	os.Unsetenv(provider.ENVCredentialFile)
+	os.Unsetenv(provider.ENVEcsMetadata)
+
+	c, err = pc.Resolve()
+	assert.Nil(t, c)
+	assert.EqualError(t, err, "No credential found")
+}

+ 34 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/providers/chain.go

@@ -0,0 +1,34 @@
+package providers
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+)
+
+type Provider interface {
+	Retrieve() (auth.Credential, error)
+}
+
+// NewChainProvider will attempt to use its given providers in the order
+// in which they're provided. It will return credentials for the first
+// provider that doesn't return an error.
+func NewChainProvider(providers []Provider) Provider {
+	return &ChainProvider{
+		Providers: providers,
+	}
+}
+
+type ChainProvider struct {
+	Providers []Provider
+}
+
+func (p *ChainProvider) Retrieve() (auth.Credential, error) {
+	var lastErr error
+	for _, provider := range p.Providers {
+		creds, err := provider.Retrieve()
+		if err == nil {
+			return creds, nil
+		}
+		lastErr = err
+	}
+	return nil, lastErr
+}

+ 122 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/providers/chain_test.go

@@ -0,0 +1,122 @@
+package providers
+
+import (
+	"errors"
+	"testing"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+)
+
+func TestNewChainProvider_Retrieve_UseFirstCredential(t *testing.T) {
+
+	accessKeyCredProvider := &TestProvider{
+		Credential: &credentials.AccessKeyCredential{},
+		Err:        nil,
+	}
+
+	stsTokenCredProvider := &TestProvider{
+		Credential: &credentials.StsTokenCredential{},
+		Err:        nil,
+	}
+
+	roleCredential := &TestProvider{
+		Credential: &credentials.EcsRamRoleCredential{},
+		Err:        nil,
+	}
+
+	credential, err := NewChainProvider([]Provider{accessKeyCredProvider, stsTokenCredProvider, roleCredential}).Retrieve()
+	if err != nil {
+		t.Fatal(err)
+	}
+
+	if _, ok := credential.(*credentials.AccessKeyCredential); !ok {
+		t.Fatal("expected access key credential")
+	}
+}
+
+func TestNewChainProvider_Retrieve_UseSecondCredential(t *testing.T) {
+
+	accessKeyCredProvider := &TestProvider{
+		Credential: nil,
+		Err:        errors.New("I don't work"),
+	}
+
+	stsTokenCredProvider := &TestProvider{
+		Credential: &credentials.StsTokenCredential{},
+		Err:        nil,
+	}
+
+	roleCredential := &TestProvider{
+		Credential: &credentials.EcsRamRoleCredential{},
+		Err:        nil,
+	}
+
+	credential, err := NewChainProvider([]Provider{accessKeyCredProvider, stsTokenCredProvider, roleCredential}).Retrieve()
+	if err != nil {
+		t.Fatal(err)
+	}
+
+	if _, ok := credential.(*credentials.StsTokenCredential); !ok {
+		t.Fatal("expected sts token credential")
+	}
+}
+
+func TestNewChainProvider_Retrieve_UseThirdCredential(t *testing.T) {
+
+	accessKeyCredProvider := &TestProvider{
+		Credential: nil,
+		Err:        errors.New("I don't work"),
+	}
+
+	stsTokenCredProvider := &TestProvider{
+		Credential: nil,
+		Err:        errors.New("I don't work"),
+	}
+
+	roleCredential := &TestProvider{
+		Credential: &credentials.EcsRamRoleCredential{},
+		Err:        nil,
+	}
+
+	credential, err := NewChainProvider([]Provider{accessKeyCredProvider, stsTokenCredProvider, roleCredential}).Retrieve()
+	if err != nil {
+		t.Fatal(err)
+	}
+
+	if _, ok := credential.(*credentials.EcsRamRoleCredential); !ok {
+		t.Fatal("expected ecs ram role credential")
+	}
+}
+
+func TestNewChainProvider_Retrieve_NoneWork(t *testing.T) {
+
+	accessKeyCredProvider := &TestProvider{
+		Credential: nil,
+		Err:        errors.New("I don't work"),
+	}
+
+	stsTokenCredProvider := &TestProvider{
+		Credential: nil,
+		Err:        errors.New("I don't work"),
+	}
+
+	roleCredential := &TestProvider{
+		Credential: nil,
+		Err:        errors.New("I don't work"),
+	}
+
+	_, err := NewChainProvider([]Provider{accessKeyCredProvider, stsTokenCredProvider, roleCredential}).Retrieve()
+	if err == nil {
+		t.Fatal("expected error")
+	}
+}
+
+type TestProvider struct {
+	Credential auth.Credential
+	Err        error
+}
+
+func (p *TestProvider) Retrieve() (auth.Credential, error) {
+	return p.Credential, p.Err
+}

+ 62 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/providers/configuration.go

@@ -0,0 +1,62 @@
+package providers
+
+import (
+	"errors"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+)
+
+var (
+	ErrNoValidCredentialsFound = errors.New("no valid credentials were found")
+)
+
+type Configuration struct {
+	AccessKeyID           string
+	AccessKeySecret       string
+	AccessKeyStsToken     string
+	RoleArn               string
+	RoleSessionName       string
+	RoleSessionExpiration *int
+	PrivateKey            string
+	PublicKeyID           string
+	SessionExpiration     *int
+	RoleName              string
+}
+
+func NewConfigurationCredentialProvider(configuration *Configuration) Provider {
+	return &ConfigurationProvider{
+		Configuration: configuration,
+	}
+}
+
+type ConfigurationProvider struct {
+	Configuration *Configuration
+}
+
+// Retrieve walks through all currently supported credential types and attempts to build them
+// using the given configuration.
+func (p *ConfigurationProvider) Retrieve() (auth.Credential, error) {
+
+	if p.Configuration.AccessKeyID != "" && p.Configuration.AccessKeySecret != "" {
+
+		if p.Configuration.RoleArn != "" && p.Configuration.RoleSessionName != "" && p.Configuration.RoleSessionExpiration != nil {
+			return credentials.NewRamRoleArnCredential(p.Configuration.AccessKeyID, p.Configuration.AccessKeySecret, p.Configuration.RoleArn, p.Configuration.RoleSessionName, *p.Configuration.RoleSessionExpiration), nil
+		}
+
+		if p.Configuration.AccessKeyStsToken != "" {
+			return credentials.NewStsTokenCredential(p.Configuration.AccessKeyID, p.Configuration.AccessKeySecret, p.Configuration.AccessKeyStsToken), nil
+		}
+
+		return credentials.NewAccessKeyCredential(p.Configuration.AccessKeyID, p.Configuration.AccessKeySecret), nil
+	}
+
+	if p.Configuration.RoleName != "" {
+		return credentials.NewEcsRamRoleCredential(p.Configuration.RoleName), nil
+	}
+
+	if p.Configuration.PrivateKey != "" && p.Configuration.PublicKeyID != "" && p.Configuration.SessionExpiration != nil {
+		return credentials.NewRsaKeyPairCredential(p.Configuration.PrivateKey, p.Configuration.PublicKeyID, *p.Configuration.SessionExpiration), nil
+	}
+	return nil, ErrNoValidCredentialsFound
+}

+ 165 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/providers/configuration_test.go

@@ -0,0 +1,165 @@
+package providers
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+)
+
+func TestConfigurationProvider_Retrieve_NewRamRoleArnCredential(t *testing.T) {
+
+	expectedAccesKeyId := "access-key-id"
+	expectedAccessKeySecret := "access-key-secret"
+	expectedRoleArn := "role-arn"
+	expectedRoleSessionName := "role-session-name"
+	expectedRoleSessionExpiration := 1
+
+	configuration := &Configuration{
+		AccessKeyID:           expectedAccesKeyId,
+		AccessKeySecret:       expectedAccessKeySecret,
+		RoleArn:               expectedRoleArn,
+		RoleSessionName:       expectedRoleSessionName,
+		RoleSessionExpiration: &expectedRoleSessionExpiration,
+	}
+	credential, err := NewConfigurationCredentialProvider(configuration).Retrieve()
+	if err != nil {
+		t.Fatal(err)
+	}
+	ramRoleArnCredential, ok := credential.(*credentials.RamRoleArnCredential)
+	assert.True(t, ok, "expected AccessKeyCredential")
+	assert.Equal(t, expectedAccesKeyId, ramRoleArnCredential.AccessKeyId, "expected AccessKeyId %s but received %s", expectedAccesKeyId, ramRoleArnCredential.AccessKeyId)
+
+	if ramRoleArnCredential.AccessKeySecret != expectedAccessKeySecret {
+		t.Fatalf("expected AccessKeySecret %s but received %s", expectedAccessKeySecret, ramRoleArnCredential.AccessKeySecret)
+	}
+	if ramRoleArnCredential.RoleArn != expectedRoleArn {
+		t.Fatalf("expected RoleArn %s but received %s", expectedRoleArn, ramRoleArnCredential.RoleArn)
+	}
+	if ramRoleArnCredential.RoleSessionName != expectedRoleSessionName {
+		t.Fatalf("expected RoleSessionName %s but received %s", expectedRoleSessionName, ramRoleArnCredential.RoleSessionName)
+	}
+	if ramRoleArnCredential.RoleSessionExpiration != expectedRoleSessionExpiration {
+		t.Fatalf("expected expectedRoleSessionExpiration %d but received %d", expectedRoleSessionExpiration, ramRoleArnCredential.RoleSessionExpiration)
+	}
+}
+
+func TestConfigurationProvider_Retrieve_NewStsTokenCredential(t *testing.T) {
+
+	expectedAccesKeyId := "access-key-id"
+	expectedAccessKeySecret := "access-key-secret"
+	expectedAccessKeyStsToken := "access-key-sts-token"
+
+	configuration := &Configuration{
+		AccessKeyID:       expectedAccesKeyId,
+		AccessKeySecret:   expectedAccessKeySecret,
+		AccessKeyStsToken: expectedAccessKeyStsToken,
+	}
+	credential, err := NewConfigurationCredentialProvider(configuration).Retrieve()
+	if err != nil {
+		t.Fatal(err)
+	}
+	stsTokenCredential, ok := credential.(*credentials.StsTokenCredential)
+	if !ok {
+		t.Fatal("expected AccessKeyCredential")
+	}
+
+	if stsTokenCredential.AccessKeyId != expectedAccesKeyId {
+		t.Fatalf("expected AccessKeyId %s but received %s", expectedAccesKeyId, stsTokenCredential.AccessKeyId)
+	}
+	if stsTokenCredential.AccessKeySecret != expectedAccessKeySecret {
+		t.Fatalf("expected AccessKeySecret %s but received %s", expectedAccessKeySecret, stsTokenCredential.AccessKeySecret)
+	}
+	if stsTokenCredential.AccessKeyStsToken != expectedAccessKeyStsToken {
+		t.Fatalf("expected AccessKeyStsToken %s but received %s", expectedAccessKeyStsToken, stsTokenCredential.AccessKeyStsToken)
+	}
+}
+
+func TestConfigurationProvider_Retrieve_NewAccessKeyCredential(t *testing.T) {
+
+	expectedAccesKeyId := "access-key-id"
+	expectedAccessKeySecret := "access-key-secret"
+
+	configuration := &Configuration{
+		AccessKeyID:     expectedAccesKeyId,
+		AccessKeySecret: expectedAccessKeySecret,
+	}
+	credential, err := NewConfigurationCredentialProvider(configuration).Retrieve()
+	if err != nil {
+		t.Fatal(err)
+	}
+	accessKeyCredential, ok := credential.(*credentials.AccessKeyCredential)
+	if !ok {
+		t.Fatal("expected AccessKeyCredential")
+	}
+
+	if accessKeyCredential.AccessKeyId != expectedAccesKeyId {
+		t.Fatalf("expected AccessKeyId %s but received %s", expectedAccesKeyId, accessKeyCredential.AccessKeyId)
+	}
+	if accessKeyCredential.AccessKeySecret != expectedAccessKeySecret {
+		t.Fatalf("expected AccessKeySecret %s but received %s", expectedAccessKeySecret, accessKeyCredential.AccessKeySecret)
+	}
+}
+
+func TestConfigurationProvider_Retrieve_NewEcsRamRoleCredential(t *testing.T) {
+
+	expectedRoleName := "role-name"
+
+	configuration := &Configuration{
+		RoleName: expectedRoleName,
+	}
+	credential, err := NewConfigurationCredentialProvider(configuration).Retrieve()
+	if err != nil {
+		t.Fatal(err)
+	}
+	ecsRamRoleCredential, ok := credential.(*credentials.EcsRamRoleCredential)
+	if !ok {
+		t.Fatal("expected AccessKeyCredential")
+	}
+
+	if ecsRamRoleCredential.RoleName != expectedRoleName {
+		t.Fatalf("expected RoleName %s but received %s", expectedRoleName, ecsRamRoleCredential.RoleName)
+	}
+}
+
+func TestConfigurationProvider_Retrieve_NewRsaKeyPairCredential(t *testing.T) {
+
+	expectedPrivateKey := "private-key"
+	expectedPublicKeyId := "public-key-id"
+	expectedSessionExpiration := 1
+
+	configuration := &Configuration{
+		PrivateKey:        expectedPrivateKey,
+		PublicKeyID:       expectedPublicKeyId,
+		SessionExpiration: &expectedSessionExpiration,
+	}
+	credential, err := NewConfigurationCredentialProvider(configuration).Retrieve()
+	if err != nil {
+		t.Fatal(err)
+	}
+	rsaKeyPairCredential, ok := credential.(*credentials.RsaKeyPairCredential)
+	if !ok {
+		t.Fatal("expected AccessKeyCredential")
+	}
+
+	if rsaKeyPairCredential.PrivateKey != expectedPrivateKey {
+		t.Fatalf("expected PrivateKey %s but received %s", expectedPrivateKey, rsaKeyPairCredential.PrivateKey)
+	}
+	if rsaKeyPairCredential.PublicKeyId != expectedPublicKeyId {
+		t.Fatalf("expected PublicKeyId %s but received %s", expectedPublicKeyId, rsaKeyPairCredential.PublicKeyId)
+	}
+	if rsaKeyPairCredential.SessionExpiration != expectedSessionExpiration {
+		t.Fatalf("expected SessionExpiration %d but received %d", expectedSessionExpiration, rsaKeyPairCredential.SessionExpiration)
+	}
+}
+
+func TestConfigurationProvider_Retrieve_ErrNoValidCredentialsFound(t *testing.T) {
+	_, err := NewConfigurationCredentialProvider(&Configuration{}).Retrieve()
+	if err == nil {
+		t.Fatal("expected ErrNoValidCredentialsFound for empty configuration")
+	}
+	if err != ErrNoValidCredentialsFound {
+		t.Fatal("expected ErrNoValidCredentialsFound for empty configuration")
+	}
+}

+ 2 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/providers/doc.go

@@ -0,0 +1,2 @@
+//Package providers Deprecated
+package providers

+ 65 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/providers/env.go

@@ -0,0 +1,65 @@
+package providers
+
+import (
+	"fmt"
+	"os"
+	"strconv"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+)
+
+const (
+	EnvVarAccessKeyID           = "ALICLOUD_ACCESS_KEY"
+	EnvVarAccessKeySecret       = "ALICLOUD_SECRET_KEY"
+	EnvVarAccessKeyStsToken     = "ALICLOUD_ACCESS_KEY_STS_TOKEN"
+	EnvVarRoleArn               = "ALICLOUD_ROLE_ARN"
+	EnvVarRoleSessionName       = "ALICLOUD_ROLE_SESSION_NAME"
+	EnvVarRoleSessionExpiration = "ALICLOUD_ROLE_SESSION_EXPIRATION"
+	EnvVarPrivateKey            = "ALICLOUD_PRIVATE_KEY"
+	EnvVarPublicKeyID           = "ALICLOUD_PUBLIC_KEY_ID"
+	EnvVarSessionExpiration     = "ALICLOUD_SESSION_EXPIRATION"
+	EnvVarRoleName              = "ALICLOUD_ROLE_NAME"
+)
+
+func NewEnvCredentialProvider() Provider {
+	return &EnvProvider{}
+}
+
+type EnvProvider struct{}
+
+func (p *EnvProvider) Retrieve() (auth.Credential, error) {
+	roleSessionExpiration, err := envVarToInt(EnvVarRoleSessionExpiration)
+	if err != nil {
+		return nil, err
+	}
+	sessionExpiration, err := envVarToInt(EnvVarSessionExpiration)
+	if err != nil {
+		return nil, err
+	}
+	c := &Configuration{
+		AccessKeyID:           os.Getenv(EnvVarAccessKeyID),
+		AccessKeySecret:       os.Getenv(EnvVarAccessKeySecret),
+		AccessKeyStsToken:     os.Getenv(EnvVarAccessKeyStsToken),
+		RoleArn:               os.Getenv(EnvVarRoleArn),
+		RoleSessionName:       os.Getenv(EnvVarRoleSessionName),
+		RoleSessionExpiration: &roleSessionExpiration,
+		PrivateKey:            os.Getenv(EnvVarPrivateKey),
+		PublicKeyID:           os.Getenv(EnvVarPublicKeyID),
+		SessionExpiration:     &sessionExpiration,
+		RoleName:              os.Getenv(EnvVarRoleName),
+	}
+	return NewConfigurationCredentialProvider(c).Retrieve()
+}
+
+func envVarToInt(envVar string) (int, error) {
+	asInt := 0
+	asStr := os.Getenv(envVar)
+	if asStr != "" {
+		if i, err := strconv.Atoi(asStr); err != nil {
+			return 0, fmt.Errorf("error parsing %s: %s", envVar, err)
+		} else {
+			asInt = i
+		}
+	}
+	return asInt, nil
+}

+ 215 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/providers/env_test.go

@@ -0,0 +1,215 @@
+package providers
+
+import (
+	"os"
+	"strconv"
+	"testing"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+)
+
+func TestEnvProvider_Retrieve_NewRamRoleArnCredential(t *testing.T) {
+
+	expectedAccesKeyId := "access-key-id"
+	expectedAccessKeySecret := "access-key-secret"
+	expectedRoleArn := "role-arn"
+	expectedRoleSessionName := "role-session-name"
+	expectedRoleSessionExpiration := 1
+
+	if err := os.Setenv(EnvVarAccessKeyID, expectedAccesKeyId); err != nil {
+		t.Fatal(err)
+	}
+	defer os.Unsetenv(EnvVarAccessKeyID)
+
+	if err := os.Setenv(EnvVarAccessKeySecret, expectedAccessKeySecret); err != nil {
+		t.Fatal(err)
+	}
+	defer os.Unsetenv(EnvVarAccessKeySecret)
+
+	if err := os.Setenv(EnvVarRoleArn, expectedRoleArn); err != nil {
+		t.Fatal(err)
+	}
+	defer os.Unsetenv(EnvVarRoleArn)
+
+	if err := os.Setenv(EnvVarRoleSessionName, expectedRoleSessionName); err != nil {
+		t.Fatal(err)
+	}
+	defer os.Unsetenv(EnvVarRoleSessionName)
+
+	if err := os.Setenv(EnvVarRoleSessionExpiration, strconv.Itoa(expectedRoleSessionExpiration)); err != nil {
+		t.Fatal(err)
+	}
+	defer os.Unsetenv(EnvVarRoleSessionExpiration)
+
+	credential, err := NewEnvCredentialProvider().Retrieve()
+	if err != nil {
+		t.Fatal(err)
+	}
+	ramRoleArnCredential, ok := credential.(*credentials.RamRoleArnCredential)
+	if !ok {
+		t.Fatal("expected AccessKeyCredential")
+	}
+
+	if ramRoleArnCredential.AccessKeyId != expectedAccesKeyId {
+		t.Fatalf("expected AccessKeyId %s but received %s", expectedAccesKeyId, ramRoleArnCredential.AccessKeyId)
+	}
+	if ramRoleArnCredential.AccessKeySecret != expectedAccessKeySecret {
+		t.Fatalf("expected AccessKeySecret %s but received %s", expectedAccessKeySecret, ramRoleArnCredential.AccessKeySecret)
+	}
+	if ramRoleArnCredential.RoleArn != expectedRoleArn {
+		t.Fatalf("expected RoleArn %s but received %s", expectedRoleArn, ramRoleArnCredential.RoleArn)
+	}
+	if ramRoleArnCredential.RoleSessionName != expectedRoleSessionName {
+		t.Fatalf("expected RoleSessionName %s but received %s", expectedRoleSessionName, ramRoleArnCredential.RoleSessionName)
+	}
+	if ramRoleArnCredential.RoleSessionExpiration != expectedRoleSessionExpiration {
+		t.Fatalf("expected RoleSessionExpiration %d but received %d", expectedRoleSessionExpiration, ramRoleArnCredential.RoleSessionExpiration)
+	}
+}
+
+func TestEnvProvider_Retrieve_NewStsTokenCredential(t *testing.T) {
+
+	expectedAccesKeyId := "access-key-id"
+	expectedAccessKeySecret := "access-key-secret"
+	expectedAccessKeyStsToken := "access-key-sts-token"
+
+	if err := os.Setenv(EnvVarAccessKeyID, expectedAccesKeyId); err != nil {
+		t.Fatal(err)
+	}
+	defer os.Unsetenv(EnvVarAccessKeyID)
+
+	if err := os.Setenv(EnvVarAccessKeySecret, expectedAccessKeySecret); err != nil {
+		t.Fatal(err)
+	}
+	defer os.Unsetenv(EnvVarAccessKeySecret)
+
+	if err := os.Setenv(EnvVarAccessKeyStsToken, expectedAccessKeyStsToken); err != nil {
+		t.Fatal(err)
+	}
+	defer os.Unsetenv(EnvVarAccessKeyStsToken)
+
+	credential, err := NewEnvCredentialProvider().Retrieve()
+	if err != nil {
+		t.Fatal(err)
+	}
+	stsTokenCredential, ok := credential.(*credentials.StsTokenCredential)
+	if !ok {
+		t.Fatal("expected AccessKeyCredential")
+	}
+
+	if stsTokenCredential.AccessKeyId != expectedAccesKeyId {
+		t.Fatalf("expected AccessKeyId %s but received %s", expectedAccesKeyId, stsTokenCredential.AccessKeyId)
+	}
+	if stsTokenCredential.AccessKeySecret != expectedAccessKeySecret {
+		t.Fatalf("expected AccessKeySecret %s but received %s", expectedAccessKeySecret, stsTokenCredential.AccessKeySecret)
+	}
+	if stsTokenCredential.AccessKeyStsToken != expectedAccessKeyStsToken {
+		t.Fatalf("expected AccessKeyStsToken %s but received %s", expectedAccessKeyStsToken, stsTokenCredential.AccessKeyStsToken)
+	}
+}
+
+func TestEnvProvider_Retrieve_NewAccessKeyCredential(t *testing.T) {
+
+	expectedAccesKeyId := "access-key-id"
+	expectedAccessKeySecret := "access-key-secret"
+
+	if err := os.Setenv(EnvVarAccessKeyID, expectedAccesKeyId); err != nil {
+		t.Fatal(err)
+	}
+	defer os.Unsetenv(EnvVarAccessKeyID)
+
+	if err := os.Setenv(EnvVarAccessKeySecret, expectedAccessKeySecret); err != nil {
+		t.Fatal(err)
+	}
+	defer os.Unsetenv(EnvVarAccessKeySecret)
+
+	credential, err := NewEnvCredentialProvider().Retrieve()
+	if err != nil {
+		t.Fatal(err)
+	}
+	accessKeyCredential, ok := credential.(*credentials.AccessKeyCredential)
+	if !ok {
+		t.Fatal("expected AccessKeyCredential")
+	}
+
+	if accessKeyCredential.AccessKeyId != expectedAccesKeyId {
+		t.Fatalf("expected AccessKeyId %s but received %s", expectedAccesKeyId, accessKeyCredential.AccessKeyId)
+	}
+	if accessKeyCredential.AccessKeySecret != expectedAccessKeySecret {
+		t.Fatalf("expected AccessKeySecret %s but received %s", expectedAccessKeySecret, accessKeyCredential.AccessKeySecret)
+	}
+}
+
+func TestEnvProvider_Retrieve_NewEcsRamRoleCredential(t *testing.T) {
+
+	expectedRoleName := "role-name"
+
+	if err := os.Setenv(EnvVarRoleName, expectedRoleName); err != nil {
+		t.Fatal(err)
+	}
+	defer os.Unsetenv(EnvVarRoleName)
+
+	credential, err := NewEnvCredentialProvider().Retrieve()
+	if err != nil {
+		t.Fatal(err)
+	}
+	ecsRamRoleCredential, ok := credential.(*credentials.EcsRamRoleCredential)
+	if !ok {
+		t.Fatal("expected AccessKeyCredential")
+	}
+
+	if ecsRamRoleCredential.RoleName != expectedRoleName {
+		t.Fatalf("expected RoleName %s but received %s", expectedRoleName, ecsRamRoleCredential.RoleName)
+	}
+}
+
+func TestEnvProvider_Retrieve_NewRsaKeyPairCredential(t *testing.T) {
+
+	expectedPrivateKey := "private-key"
+	expectedPublicKeyId := "public-key-id"
+	expectedSessionExpiration := 1
+
+	if err := os.Setenv(EnvVarPrivateKey, expectedPrivateKey); err != nil {
+		t.Fatal(err)
+	}
+	defer os.Unsetenv(EnvVarPrivateKey)
+
+	if err := os.Setenv(EnvVarPublicKeyID, expectedPublicKeyId); err != nil {
+		t.Fatal(err)
+	}
+	defer os.Unsetenv(EnvVarPublicKeyID)
+
+	if err := os.Setenv(EnvVarSessionExpiration, strconv.Itoa(expectedSessionExpiration)); err != nil {
+		t.Fatal(err)
+	}
+	defer os.Unsetenv(EnvVarSessionExpiration)
+
+	credential, err := NewEnvCredentialProvider().Retrieve()
+	if err != nil {
+		t.Fatal(err)
+	}
+	rsaKeyPairCredential, ok := credential.(*credentials.RsaKeyPairCredential)
+	if !ok {
+		t.Fatal("expected AccessKeyCredential")
+	}
+
+	if rsaKeyPairCredential.PrivateKey != expectedPrivateKey {
+		t.Fatalf("expected PrivateKey %s but received %s", expectedPrivateKey, rsaKeyPairCredential.PrivateKey)
+	}
+	if rsaKeyPairCredential.PublicKeyId != expectedPublicKeyId {
+		t.Fatalf("expected PublicKeyId %s but received %s", expectedPublicKeyId, rsaKeyPairCredential.PublicKeyId)
+	}
+	if rsaKeyPairCredential.SessionExpiration != expectedSessionExpiration {
+		t.Fatalf("expected SessionExpiration %d but received %d", expectedSessionExpiration, rsaKeyPairCredential.SessionExpiration)
+	}
+}
+
+func TestEnvProvider_Retrieve_ErrNoValidCredentialsFound(t *testing.T) {
+	_, err := NewEnvCredentialProvider().Retrieve()
+	if err == nil {
+		t.Fatal("expected ErrNoValidCredentialsFound for empty configuration")
+	}
+	if err != ErrNoValidCredentialsFound {
+		t.Fatal("expected ErrNoValidCredentialsFound for empty configuration")
+	}
+}

+ 106 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/providers/instance_metadata.go

@@ -0,0 +1,106 @@
+package providers
+
+import (
+	"encoding/json"
+	"errors"
+	"fmt"
+	"io/ioutil"
+	"net/http"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+)
+
+var securityCredURL = "http://100.100.100.200/latest/meta-data/ram/security-credentials/"
+
+func NewInstanceMetadataProvider() Provider {
+	return &InstanceMetadataProvider{}
+}
+
+type InstanceMetadataProvider struct {
+	RoleName string
+}
+
+func get(url string) (status int, content string, err error) {
+	resp, err := http.Get(url)
+	if err != nil {
+		return
+	}
+	defer resp.Body.Close()
+
+	bodyBytes, err := ioutil.ReadAll(resp.Body)
+	return resp.StatusCode, string(bodyBytes), err
+}
+
+func (p *InstanceMetadataProvider) GetRoleName() (roleName string, err error) {
+	// Instances can have only one role name that never changes,
+	// so attempt to populate it.
+	// If this call is executed in an environment that doesn't support instance metadata,
+	// it will time out after 30 seconds and return an err.
+	status, roleName, err := get(securityCredURL)
+
+	if err != nil {
+		return
+	}
+
+	if status != 200 {
+		err = fmt.Errorf("received %d getting role name: %s", status, roleName)
+		return
+	}
+
+	if roleName == "" {
+		err = errors.New("unable to retrieve role name, it may be unset")
+	}
+
+	return
+}
+
+func (p *InstanceMetadataProvider) Retrieve() (auth.Credential, error) {
+	if p.RoleName == "" {
+		roleName, err := p.GetRoleName()
+		if err != nil {
+			return nil, err
+		}
+		p.RoleName = roleName
+	}
+
+	status, content, err := get(securityCredURL + p.RoleName)
+	if err != nil {
+		return nil, err
+	}
+	if status != 200 {
+		return nil, fmt.Errorf("received %d getting security credentials for %s", status, p.RoleName)
+	}
+
+	body := make(map[string]interface{})
+
+	if err := json.Unmarshal([]byte(content), &body); err != nil {
+		return nil, err
+	}
+
+	accessKeyID, err := extractString(body, "AccessKeyId")
+	if err != nil {
+		return nil, err
+	}
+	accessKeySecret, err := extractString(body, "AccessKeySecret")
+	if err != nil {
+		return nil, err
+	}
+	securityToken, err := extractString(body, "SecurityToken")
+	if err != nil {
+		return nil, err
+	}
+	return credentials.NewStsTokenCredential(accessKeyID, accessKeySecret, securityToken), nil
+}
+
+func extractString(m map[string]interface{}, key string) (string, error) {
+	raw, ok := m[key]
+	if !ok {
+		return "", fmt.Errorf("%s not in map", key)
+	}
+	str, ok := raw.(string)
+	if !ok {
+		return "", fmt.Errorf("%s is not a string in map", key)
+	}
+	return str, nil
+}

+ 245 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/providers/instance_metadata_test.go

@@ -0,0 +1,245 @@
+package providers
+
+import (
+	"net/http"
+	"net/http/httptest"
+	"strings"
+	"testing"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+	"github.com/stretchr/testify/assert"
+)
+
+func TestInstanceMetadataProvider_Retrieve_Success(t *testing.T) {
+
+	// Start a test server locally.
+	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+
+		body := "unsupported path: " + r.URL.Path
+		status := 500
+
+		switch r.URL.Path {
+		case "/latest/meta-data/ram/security-credentials/":
+			body = "ELK"
+			status = 200
+		case "/latest/meta-data/ram/security-credentials/ELK":
+			body = ` {
+			  "AccessKeyId" : "STS.L4aBSCSJVMuKg5U1vFDw",
+			  "AccessKeySecret" : "wyLTSmsyPGP1ohvvw8xYgB29dlGI8KMiH2pKCNZ9",
+			  "Expiration" : "2018-08-20T22:30:02Z",
+			  "SecurityToken" : "CAESrAIIARKAAShQquMnLIlbvEcIxO6wCoqJufs8sWwieUxu45hS9AvKNEte8KRUWiJWJ6Y+YHAPgNwi7yfRecMFydL2uPOgBI7LDio0RkbYLmJfIxHM2nGBPdml7kYEOXmJp2aDhbvvwVYIyt/8iES/R6N208wQh0Pk2bu+/9dvalp6wOHF4gkFGhhTVFMuTDRhQlNDU0pWTXVLZzVVMXZGRHciBTQzMjc0KgVhbGljZTCpnJjwySk6BlJzYU1ENUJuCgExGmkKBUFsbG93Eh8KDEFjdGlvbkVxdWFscxIGQWN0aW9uGgcKBW9zczoqEj8KDlJlc291cmNlRXF1YWxzEghSZXNvdXJjZRojCiFhY3M6b3NzOio6NDMyNzQ6c2FtcGxlYm94L2FsaWNlLyo=",
+			  "LastUpdated" : "2018-08-20T16:30:01Z",
+			  "Code" : "Success"
+			}`
+			status = 200
+		}
+		w.WriteHeader(status)
+		w.Write([]byte(body))
+	}))
+	defer ts.Close()
+
+	// Update our securityCredURL to point at our local test server.
+	originalSecurityCredURL := securityCredURL
+	securityCredURL = strings.Replace(securityCredURL, "http://100.100.100.200", ts.URL, -1)
+	defer func() {
+		securityCredURL = originalSecurityCredURL
+	}()
+
+	credential, err := NewInstanceMetadataProvider().Retrieve()
+	assert.Nil(t, err)
+
+	stsTokenCredential, ok := credential.(*credentials.StsTokenCredential)
+	assert.True(t, ok)
+
+	assert.Equal(t, "STS.L4aBSCSJVMuKg5U1vFDw", stsTokenCredential.AccessKeyId)
+	assert.Equal(t, "wyLTSmsyPGP1ohvvw8xYgB29dlGI8KMiH2pKCNZ9", stsTokenCredential.AccessKeySecret)
+	assert.True(t, strings.HasPrefix(stsTokenCredential.AccessKeyStsToken, "CAESrAIIARKAA"))
+}
+
+func TestInstanceMetadataProvider_Retrieve_Fail1(t *testing.T) {
+	// Update our securityCredURL to point at our local test server.
+	originalSecurityCredURL := securityCredURL
+	securityCredURL = strings.Replace(securityCredURL, "http://100.100.100.200", "http://invalid-domain-xxx", -1)
+	defer func() {
+		securityCredURL = originalSecurityCredURL
+	}()
+
+	_, err := NewInstanceMetadataProvider().Retrieve()
+	assert.NotNil(t, err)
+	message := err.Error()
+	assert.True(t, strings.HasSuffix(message, "no such host"))
+}
+
+func TestInstanceMetadataProvider_Retrieve_Fail2(t *testing.T) {
+	// Start a test server locally.
+	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+
+		var body string
+		var status int
+
+		switch r.URL.Path {
+		case "/latest/meta-data/ram/security-credentials/":
+			body = "ELK"
+			status = 400
+		}
+		w.WriteHeader(status)
+		w.Write([]byte(body))
+	}))
+	defer ts.Close()
+
+	// Update our securityCredURL to point at our local test server.
+	originalSecurityCredURL := securityCredURL
+	securityCredURL = strings.Replace(securityCredURL, "http://100.100.100.200", ts.URL, -1)
+	defer func() {
+		securityCredURL = originalSecurityCredURL
+	}()
+
+	_, err := NewInstanceMetadataProvider().Retrieve()
+	assert.NotNil(t, err)
+	assert.Equal(t, "received 400 getting role name: ELK", err.Error())
+}
+
+func TestInstanceMetadataProvider_Retrieve_Fail3(t *testing.T) {
+	// Start a test server locally.
+	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+
+		var body string
+		var status int
+
+		switch r.URL.Path {
+		case "/latest/meta-data/ram/security-credentials/":
+			body = ""
+			status = 200
+		}
+		w.WriteHeader(status)
+		w.Write([]byte(body))
+	}))
+	defer ts.Close()
+
+	// Update our securityCredURL to point at our local test server.
+	originalSecurityCredURL := securityCredURL
+	securityCredURL = strings.Replace(securityCredURL, "http://100.100.100.200", ts.URL, -1)
+	defer func() {
+		securityCredURL = originalSecurityCredURL
+	}()
+
+	_, err := NewInstanceMetadataProvider().Retrieve()
+	assert.NotNil(t, err)
+	assert.Equal(t, "unable to retrieve role name, it may be unset", err.Error())
+}
+
+func TestInstanceMetadataProvider_Retrieve_Fail4(t *testing.T) {
+	// Start a test server locally.
+	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+
+		var body string
+		var status int
+
+		switch r.URL.Path {
+		case "/latest/meta-data/ram/security-credentials/":
+			body = "ELK"
+			status = 200
+		case "/latest/meta-data/ram/security-credentials/ELK":
+			body = ``
+			status = 404
+		}
+		w.WriteHeader(status)
+		w.Write([]byte(body))
+	}))
+	defer ts.Close()
+
+	// Update our securityCredURL to point at our local test server.
+	originalSecurityCredURL := securityCredURL
+	securityCredURL = strings.Replace(securityCredURL, "http://100.100.100.200", ts.URL, -1)
+	defer func() {
+		securityCredURL = originalSecurityCredURL
+	}()
+
+	_, err := NewInstanceMetadataProvider().Retrieve()
+	assert.NotNil(t, err)
+	assert.Equal(t, "received 404 getting security credentials for ELK", err.Error())
+}
+
+func TestInstanceMetadataProvider_Retrieve_Fail5(t *testing.T) {
+	// Start a test server locally.
+	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+
+		var body string
+		var status int
+
+		switch r.URL.Path {
+		case "/latest/meta-data/ram/security-credentials/":
+			body = "ELK"
+			status = 200
+		case "/latest/meta-data/ram/security-credentials/ELK":
+			body = `invalid json`
+			status = 200
+		}
+		w.WriteHeader(status)
+		w.Write([]byte(body))
+	}))
+	defer ts.Close()
+
+	// Update our securityCredURL to point at our local test server.
+	originalSecurityCredURL := securityCredURL
+	securityCredURL = strings.Replace(securityCredURL, "http://100.100.100.200", ts.URL, -1)
+	defer func() {
+		securityCredURL = originalSecurityCredURL
+	}()
+
+	_, err := NewInstanceMetadataProvider().Retrieve()
+	assert.NotNil(t, err)
+	assert.Equal(t, "invalid character 'i' looking for beginning of value", err.Error())
+}
+
+func mockServer(json string) (server *httptest.Server) {
+	// Start a test server locally.
+	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+
+		var body string
+		var status int
+
+		switch r.URL.Path {
+		case "/latest/meta-data/ram/security-credentials/":
+			body = "ELK"
+			status = 200
+		case "/latest/meta-data/ram/security-credentials/ELK":
+			body = json
+			status = 200
+		}
+		w.WriteHeader(status)
+		w.Write([]byte(body))
+	}))
+	return ts
+}
+
+func test(t *testing.T, input, expected string) {
+	// Start a test server locally.
+	ts := mockServer(input)
+	defer ts.Close()
+
+	// Update our securityCredURL to point at our local test server.
+	originalSecurityCredURL := securityCredURL
+	securityCredURL = strings.Replace(securityCredURL, "http://100.100.100.200", ts.URL, -1)
+	defer func() {
+		securityCredURL = originalSecurityCredURL
+	}()
+
+	_, err := NewInstanceMetadataProvider().Retrieve()
+	assert.NotNil(t, err)
+	assert.Equal(t, expected, err.Error())
+}
+
+func TestInstanceMetadataProvider_Retrieve_Fail6(t *testing.T) {
+	test(t, `{}`, "AccessKeyId not in map")
+	test(t, `{"AccessKeyId":true}`,
+		"AccessKeyId is not a string in map")
+	test(t, `{"AccessKeyId":"access key id"}`,
+		"AccessKeySecret not in map")
+	test(t, `{"AccessKeyId":"access key id", "AccessKeySecret":true}`,
+		"AccessKeySecret is not a string in map")
+	test(t, `{"AccessKeyId":"access key id", "AccessKeySecret":"secret"}`,
+		"SecurityToken not in map")
+	test(t, `{"AccessKeyId":"access key id", "AccessKeySecret":"secret","SecurityToken":true}`,
+		"SecurityToken is not a string in map")
+}

+ 15 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/rsa_key_pair_credential.go

@@ -0,0 +1,15 @@
+package credentials
+
+type RsaKeyPairCredential struct {
+	PrivateKey        string
+	PublicKeyId       string
+	SessionExpiration int
+}
+
+func NewRsaKeyPairCredential(privateKey, publicKeyId string, sessionExpiration int) *RsaKeyPairCredential {
+	return &RsaKeyPairCredential{
+		PrivateKey:        privateKey,
+		PublicKeyId:       publicKeyId,
+		SessionExpiration: sessionExpiration,
+	}
+}

+ 14 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/rsa_key_pair_credential_test.go

@@ -0,0 +1,14 @@
+package credentials
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+)
+
+func TestRSAKeyPairCredential(t *testing.T) {
+	c := NewRsaKeyPairCredential("privateKey", "publicKey", 3600)
+	assert.Equal(t, "privateKey", c.PrivateKey)
+	assert.Equal(t, "publicKey", c.PublicKeyId)
+	assert.Equal(t, 3600, c.SessionExpiration)
+}

+ 15 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_credential.go

@@ -0,0 +1,15 @@
+package credentials
+
+type StsTokenCredential struct {
+	AccessKeyId       string
+	AccessKeySecret   string
+	AccessKeyStsToken string
+}
+
+func NewStsTokenCredential(accessKeyId, accessKeySecret, accessKeyStsToken string) *StsTokenCredential {
+	return &StsTokenCredential{
+		AccessKeyId:       accessKeyId,
+		AccessKeySecret:   accessKeySecret,
+		AccessKeyStsToken: accessKeyStsToken,
+	}
+}

+ 14 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_credential_test.go

@@ -0,0 +1,14 @@
+package credentials
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+)
+
+func TestSTSCredential(t *testing.T) {
+	c := NewStsTokenCredential("accessKeyId", "accessKeySecret", "token")
+	assert.Equal(t, "accessKeyId", c.AccessKeyId)
+	assert.Equal(t, "accessKeySecret", c.AccessKeySecret)
+	assert.Equal(t, "token", c.AccessKeyStsToken)
+}

+ 61 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_role_arn_credential.go

@@ -0,0 +1,61 @@
+package credentials
+
+// Deprecated: Use RamRoleArnCredential in this package instead.
+type StsRoleArnCredential struct {
+	AccessKeyId           string
+	AccessKeySecret       string
+	RoleArn               string
+	RoleSessionName       string
+	RoleSessionExpiration int
+}
+
+type RamRoleArnCredential struct {
+	AccessKeyId           string
+	AccessKeySecret       string
+	RoleArn               string
+	RoleSessionName       string
+	RoleSessionExpiration int
+	Policy                string
+}
+
+// Deprecated: Use RamRoleArnCredential in this package instead.
+func NewStsRoleArnCredential(accessKeyId, accessKeySecret, roleArn, roleSessionName string, roleSessionExpiration int) *StsRoleArnCredential {
+	return &StsRoleArnCredential{
+		AccessKeyId:           accessKeyId,
+		AccessKeySecret:       accessKeySecret,
+		RoleArn:               roleArn,
+		RoleSessionName:       roleSessionName,
+		RoleSessionExpiration: roleSessionExpiration,
+	}
+}
+
+func (oldCred *StsRoleArnCredential) ToRamRoleArnCredential() *RamRoleArnCredential {
+	return &RamRoleArnCredential{
+		AccessKeyId:           oldCred.AccessKeyId,
+		AccessKeySecret:       oldCred.AccessKeySecret,
+		RoleArn:               oldCred.RoleArn,
+		RoleSessionName:       oldCred.RoleSessionName,
+		RoleSessionExpiration: oldCred.RoleSessionExpiration,
+	}
+}
+
+func NewRamRoleArnCredential(accessKeyId, accessKeySecret, roleArn, roleSessionName string, roleSessionExpiration int) *RamRoleArnCredential {
+	return &RamRoleArnCredential{
+		AccessKeyId:           accessKeyId,
+		AccessKeySecret:       accessKeySecret,
+		RoleArn:               roleArn,
+		RoleSessionName:       roleSessionName,
+		RoleSessionExpiration: roleSessionExpiration,
+	}
+}
+
+func NewRamRoleArnWithPolicyCredential(accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string, roleSessionExpiration int) *RamRoleArnCredential {
+	return &RamRoleArnCredential{
+		AccessKeyId:           accessKeyId,
+		AccessKeySecret:       accessKeySecret,
+		RoleArn:               roleArn,
+		RoleSessionName:       roleSessionName,
+		RoleSessionExpiration: roleSessionExpiration,
+		Policy:                policy,
+	}
+}

+ 35 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_role_arn_credential_test.go

@@ -0,0 +1,35 @@
+package credentials
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+)
+
+func TestRoleArnCredential(t *testing.T) {
+	c := NewRamRoleArnCredential("accessKeyId", "accessKeySecret", "roleArn", "roleSessionName", 3600)
+	assert.Equal(t, "accessKeyId", c.AccessKeyId)
+	assert.Equal(t, "accessKeySecret", c.AccessKeySecret)
+	assert.Equal(t, "roleArn", c.RoleArn)
+	assert.Equal(t, "roleSessionName", c.RoleSessionName)
+	assert.Equal(t, 3600, c.RoleSessionExpiration)
+	s := NewStsRoleArnCredential("accessKeyId", "accessKeySecret", "roleArn", "roleSessionName", 3600)
+	assert.Equal(t, "accessKeyId", s.AccessKeyId)
+	assert.Equal(t, "accessKeySecret", s.AccessKeySecret)
+	assert.Equal(t, "roleArn", s.RoleArn)
+	assert.Equal(t, "roleSessionName", s.RoleSessionName)
+	assert.Equal(t, 3600, s.RoleSessionExpiration)
+	r := s.ToRamRoleArnCredential()
+	assert.Equal(t, "accessKeyId", r.AccessKeyId)
+	assert.Equal(t, "accessKeySecret", r.AccessKeySecret)
+	assert.Equal(t, "roleArn", r.RoleArn)
+	assert.Equal(t, "roleSessionName", r.RoleSessionName)
+	assert.Equal(t, 3600, r.RoleSessionExpiration)
+	p := NewRamRoleArnWithPolicyCredential("accessKeyId", "accessKeySecret", "roleArn", "roleSessionName", "test", 3600)
+	assert.Equal(t, "accessKeyId", p.AccessKeyId)
+	assert.Equal(t, "accessKeySecret", p.AccessKeySecret)
+	assert.Equal(t, "roleArn", p.RoleArn)
+	assert.Equal(t, "test", p.Policy)
+	assert.Equal(t, "roleSessionName", p.RoleSessionName)
+	assert.Equal(t, 3600, p.RoleSessionExpiration)
+}

+ 138 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/roa_signature_composer.go

@@ -0,0 +1,138 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package auth
+
+import (
+	"bytes"
+	"sort"
+	"strings"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
+)
+
+var debug utils.Debug
+
+var hookGetDate = func(fn func() string) string {
+	return fn()
+}
+
+func init() {
+	debug = utils.Init("sdk")
+}
+
+func signRoaRequest(request requests.AcsRequest, signer Signer, regionId string) (err error) {
+	completeROASignParams(request, signer, regionId)
+	stringToSign := buildRoaStringToSign(request)
+	request.SetStringToSign(stringToSign)
+	accessKeyId, err := signer.GetAccessKeyId()
+	if err != nil {
+		return err
+	}
+
+	signature := signer.Sign(stringToSign, "")
+	request.GetHeaders()["Authorization"] = "acs " + accessKeyId + ":" + signature
+
+	return
+}
+
+func completeROASignParams(request requests.AcsRequest, signer Signer, regionId string) {
+	headerParams := request.GetHeaders()
+
+	// complete query params
+	queryParams := request.GetQueryParams()
+	//if _, ok := queryParams["RegionId"]; !ok {
+	//	queryParams["RegionId"] = regionId
+	//}
+	if extraParam := signer.GetExtraParam(); extraParam != nil {
+		for key, value := range extraParam {
+			if key == "SecurityToken" {
+				headerParams["x-acs-security-token"] = value
+				continue
+			}
+			if key == "BearerToken" {
+				headerParams["x-acs-bearer-token"] = value
+				continue
+			}
+			queryParams[key] = value
+		}
+	}
+
+	// complete header params
+	headerParams["Date"] = hookGetDate(utils.GetTimeInFormatRFC2616)
+	headerParams["x-acs-signature-method"] = signer.GetName()
+	headerParams["x-acs-signature-version"] = signer.GetVersion()
+	if request.GetFormParams() != nil && len(request.GetFormParams()) > 0 {
+		formString := utils.GetUrlFormedMap(request.GetFormParams())
+		request.SetContent([]byte(formString))
+		if headerParams["Content-Type"] == "" {
+			headerParams["Content-Type"] = requests.Form
+		}
+	}
+	contentMD5 := utils.GetMD5Base64(request.GetContent())
+	headerParams["Content-MD5"] = contentMD5
+	if _, contains := headerParams["Content-Type"]; !contains {
+		headerParams["Content-Type"] = requests.Raw
+	}
+	switch format := request.GetAcceptFormat(); format {
+	case "JSON":
+		headerParams["Accept"] = requests.Json
+	case "XML":
+		headerParams["Accept"] = requests.Xml
+	default:
+		headerParams["Accept"] = requests.Raw
+	}
+}
+
+func buildRoaStringToSign(request requests.AcsRequest) (stringToSign string) {
+
+	headers := request.GetHeaders()
+
+	stringToSignBuilder := bytes.Buffer{}
+	stringToSignBuilder.WriteString(request.GetMethod())
+	stringToSignBuilder.WriteString(requests.HeaderSeparator)
+
+	// append header keys for sign
+	appendIfContain(headers, &stringToSignBuilder, "Accept", requests.HeaderSeparator)
+	appendIfContain(headers, &stringToSignBuilder, "Content-MD5", requests.HeaderSeparator)
+	appendIfContain(headers, &stringToSignBuilder, "Content-Type", requests.HeaderSeparator)
+	appendIfContain(headers, &stringToSignBuilder, "Date", requests.HeaderSeparator)
+
+	// sort and append headers witch starts with 'x-acs-'
+	var acsHeaders []string
+	for key := range headers {
+		if strings.HasPrefix(key, "x-acs-") {
+			acsHeaders = append(acsHeaders, key)
+		}
+	}
+	sort.Strings(acsHeaders)
+	for _, key := range acsHeaders {
+		stringToSignBuilder.WriteString(key + ":" + headers[key])
+		stringToSignBuilder.WriteString(requests.HeaderSeparator)
+	}
+
+	// append query params
+	stringToSignBuilder.WriteString(request.BuildQueries())
+	stringToSign = stringToSignBuilder.String()
+	debug("stringToSign: %s", stringToSign)
+	return
+}
+
+func appendIfContain(sourceMap map[string]string, target *bytes.Buffer, key, separator string) {
+	if value, contain := sourceMap[key]; contain && len(value) > 0 {
+		target.WriteString(sourceMap[key])
+		target.WriteString(separator)
+	}
+}

+ 94 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/roa_signature_composer_test.go

@@ -0,0 +1,94 @@
+package auth
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+)
+
+func mockDate(fn func() string) string {
+	return "mock date"
+}
+
+func TestRoaSignatureComposer_buildRoaStringToSign(t *testing.T) {
+	request := requests.NewCommonRequest()
+	request.PathPattern = "/users/:user"
+	request.TransToAcsRequest()
+	stringToSign := buildRoaStringToSign(request)
+	assert.Equal(t, "GET\nx-acs-version:\n/users/:user", stringToSign)
+
+	request.Headers["Accept"] = "application/json;charset=utf8"
+	stringToSign = buildRoaStringToSign(request)
+	assert.Equal(t, "GET\napplication/json;charset=utf8\nx-acs-version:\n/users/:user", stringToSign)
+	request.SetContentType("application/json")
+	request.Headers["x-acs-custom-header"] = "value"
+	stringToSign = buildRoaStringToSign(request)
+	assert.Equal(t, "GET\napplication/json;charset=utf8\napplication/json\nx-acs-custom-header:value\nx-acs-version:\n/users/:user", stringToSign)
+	request.QueryParams["q"] = "value"
+	stringToSign = buildRoaStringToSign(request)
+	assert.Equal(t, "GET\napplication/json;charset=utf8\napplication/json\nx-acs-custom-header:value\nx-acs-version:\n/users/:user?q=value", stringToSign)
+	request.QueryParams["q"] = "http://domain/?q=value&q2=value2"
+	stringToSign = buildRoaStringToSign(request)
+	assert.Equal(t, "GET\napplication/json;charset=utf8\napplication/json\nx-acs-custom-header:value\nx-acs-version:\n/users/:user?q=http://domain/?q=value&q2=value2", stringToSign)
+}
+
+func TestRoaSignatureComposer(t *testing.T) {
+	request := requests.NewCommonRequest()
+	request.PathPattern = "/users/:user"
+	request.TransToAcsRequest()
+	c := credentials.NewAccessKeyCredential("accessKeyId", "accessKeySecret")
+	signer := signers.NewAccessKeySigner(c)
+
+	origTestHookGetDate := hookGetDate
+	defer func() { hookGetDate = origTestHookGetDate }()
+	hookGetDate = mockDate
+	signRoaRequest(request, signer, "regionId")
+	assert.Equal(t, "mock date", request.GetHeaders()["Date"])
+	assert.Equal(t, "acs accessKeyId:degLHXLEN6rMojj+bOlK74U9iic=", request.GetHeaders()["Authorization"])
+}
+
+func TestRoaSignatureComposer2(t *testing.T) {
+	request := requests.NewCommonRequest()
+	request.PathPattern = "/users/:user"
+	request.FormParams["key"] = "value"
+	request.AcceptFormat = "XML"
+	request.TransToAcsRequest()
+	c := credentials.NewAccessKeyCredential("accessKeyId", "accessKeySecret")
+	signer := signers.NewAccessKeySigner(c)
+
+	origTestHookLookupIP := hookGetDate
+	defer func() { hookGetDate = origTestHookLookupIP }()
+	hookGetDate = mockDate
+	signRoaRequest(request, signer, "regionId")
+	assert.Equal(t, "application/x-www-form-urlencoded", request.GetHeaders()["Content-Type"])
+	assert.Equal(t, "mock date", request.GetHeaders()["Date"])
+	assert.Equal(t, "application/xml", request.GetHeaders()["Accept"])
+	assert.Equal(t, "acs accessKeyId:U9uA3ftRZKixHPB08Z7Z4GOlpTY=", request.GetHeaders()["Authorization"])
+}
+
+func TestRoaSignatureComposer3(t *testing.T) {
+	request := requests.NewCommonRequest()
+	request.PathPattern = "/users/:user"
+	request.AcceptFormat = "RAW"
+	request.TransToAcsRequest()
+	c := credentials.NewAccessKeyCredential("accessKeyId", "accessKeySecret")
+	signer := signers.NewAccessKeySigner(c)
+
+	origTestHookGetDate := hookGetDate
+	defer func() { hookGetDate = origTestHookGetDate }()
+	hookGetDate = mockDate
+	signRoaRequest(request, signer, "regionId")
+	assert.Equal(t, "mock date", request.GetHeaders()["Date"])
+}
+func TestCompleteROASignParams(t *testing.T) {
+	req := requests.NewCommonRequest()
+	req.TransToAcsRequest()
+	sign := signers.NewBearerTokenSigner(credentials.NewBearerTokenCredential("Bearer.Token"))
+	completeROASignParams(req, sign, "cn-hangzhou")
+	head := req.GetHeaders()
+	assert.Equal(t, "Bearer.Token", head["x-acs-bearer-token"])
+}

+ 94 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/rpc_signature_composer.go

@@ -0,0 +1,94 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package auth
+
+import (
+	"net/url"
+	"strings"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
+)
+
+var hookGetNonce = func(fn func() string) string {
+	return fn()
+}
+
+func signRpcRequest(request requests.AcsRequest, signer Signer, regionId string) (err error) {
+	err = completeRpcSignParams(request, signer, regionId)
+	if err != nil {
+		return
+	}
+	// remove while retry
+	if _, containsSign := request.GetQueryParams()["Signature"]; containsSign {
+		delete(request.GetQueryParams(), "Signature")
+	}
+	stringToSign := buildRpcStringToSign(request)
+	request.SetStringToSign(stringToSign)
+	signature := signer.Sign(stringToSign, "&")
+	request.GetQueryParams()["Signature"] = signature
+
+	return
+}
+
+func completeRpcSignParams(request requests.AcsRequest, signer Signer, regionId string) (err error) {
+	queryParams := request.GetQueryParams()
+	queryParams["Version"] = request.GetVersion()
+	queryParams["Action"] = request.GetActionName()
+	queryParams["Format"] = request.GetAcceptFormat()
+	queryParams["Timestamp"] = hookGetDate(utils.GetTimeInFormatISO8601)
+	queryParams["SignatureMethod"] = signer.GetName()
+	queryParams["SignatureType"] = signer.GetType()
+	queryParams["SignatureVersion"] = signer.GetVersion()
+	queryParams["SignatureNonce"] = hookGetNonce(utils.GetUUID)
+	queryParams["AccessKeyId"], err = signer.GetAccessKeyId()
+
+	if err != nil {
+		return
+	}
+
+	if _, contains := queryParams["RegionId"]; !contains {
+		queryParams["RegionId"] = regionId
+	}
+	if extraParam := signer.GetExtraParam(); extraParam != nil {
+		for key, value := range extraParam {
+			queryParams[key] = value
+		}
+	}
+
+	request.GetHeaders()["Content-Type"] = requests.Form
+	formString := utils.GetUrlFormedMap(request.GetFormParams())
+	request.SetContent([]byte(formString))
+
+	return
+}
+
+func buildRpcStringToSign(request requests.AcsRequest) (stringToSign string) {
+	signParams := make(map[string]string)
+	for key, value := range request.GetQueryParams() {
+		signParams[key] = value
+	}
+	for key, value := range request.GetFormParams() {
+		signParams[key] = value
+	}
+
+	stringToSign = utils.GetUrlFormedMap(signParams)
+	stringToSign = strings.Replace(stringToSign, "+", "%20", -1)
+	stringToSign = strings.Replace(stringToSign, "*", "%2A", -1)
+	stringToSign = strings.Replace(stringToSign, "%7E", "~", -1)
+	stringToSign = url.QueryEscape(stringToSign)
+	stringToSign = request.GetMethod() + "&%2F&" + stringToSign
+	return
+}

+ 76 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/rpc_signature_composer_test.go

@@ -0,0 +1,76 @@
+package auth
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+)
+
+func mockRpcDate(fn func() string) string {
+	return "mock date"
+}
+
+func mockRpcGetNonce(fn func() string) string {
+	return "MOCK_UUID"
+}
+
+func TestRpcSignatureComposer_buildRpcStringToSign(t *testing.T) {
+	request := requests.NewCommonRequest()
+	request.TransToAcsRequest()
+	stringToSign := buildRpcStringToSign(request)
+	assert.Equal(t, "GET&%2F&", stringToSign)
+	request.FormParams["key"] = "value"
+	stringToSign = buildRpcStringToSign(request)
+	assert.Equal(t, "GET&%2F&key%3Dvalue", stringToSign)
+	request.QueryParams["q"] = "value"
+	stringToSign = buildRpcStringToSign(request)
+	assert.Equal(t, "GET&%2F&key%3Dvalue%26q%3Dvalue", stringToSign)
+	request.QueryParams["q"] = "http://domain/?q=value&q2=value2"
+	stringToSign = buildRpcStringToSign(request)
+	assert.Equal(t, "GET&%2F&key%3Dvalue%26q%3Dhttp%253A%252F%252Fdomain%252F%253Fq%253Dvalue%2526q2%253Dvalue2", stringToSign)
+}
+
+func TestRpcSignatureComposer(t *testing.T) {
+	request := requests.NewCommonRequest()
+	request.TransToAcsRequest()
+	c := credentials.NewAccessKeyCredential("accessKeyId", "accessKeySecret")
+	signer := signers.NewAccessKeySigner(c)
+
+	origTestHookGetDate := hookGetDate
+	defer func() { hookGetDate = origTestHookGetDate }()
+	hookGetDate = mockRpcDate
+	origTestHookGetNonce := hookGetNonce
+	defer func() { hookGetNonce = origTestHookGetNonce }()
+	hookGetNonce = mockRpcGetNonce
+	signRpcRequest(request, signer, "regionId")
+	assert.Equal(t, "mock date", request.GetQueryParams()["Timestamp"])
+	assert.Equal(t, "MOCK_UUID", request.GetQueryParams()["SignatureNonce"])
+	assert.Equal(t, "7loPmFjvDnzOVnQeQNj85S6nFGY=", request.GetQueryParams()["Signature"])
+	signRpcRequest(request, signer, "regionId")
+	assert.Equal(t, "mock date", request.GetQueryParams()["Timestamp"])
+	assert.Equal(t, "MOCK_UUID", request.GetQueryParams()["SignatureNonce"])
+	assert.Equal(t, "7loPmFjvDnzOVnQeQNj85S6nFGY=", request.GetQueryParams()["Signature"])
+}
+
+// func TestRpcSignatureComposer2(t *testing.T) {
+// 	request := requests.NewCommonRequest()
+// 	request.PathPattern = "/users/:user"
+// 	request.FormParams["key"] = "value"
+// 	request.AcceptFormat = "XML"
+// 	request.TransToAcsRequest()
+// 	c := credentials.NewAccessKeyCredential("accessKeyId", "accessKeySecret")
+// 	signer := signers.NewAccessKeySigner(c)
+
+// 	origTestHookLookupIP := hookGetDate
+// 	defer func() { hookGetDate = origTestHookLookupIP }()
+// 	hookGetDate = mockDate
+// 	signRpcRequest(request, signer, "regionId")
+// 	assert.Equal(t, "application/x-www-form-urlencoded", request.GetHeaders()["Content-Type"])
+// 	assert.Equal(t, "mock date", request.GetHeaders()["Date"])
+// 	assert.Equal(t, "application/xml", request.GetHeaders()["Accept"])
+// 	assert.Equal(t, "acs accessKeyId:U9uA3ftRZKixHPB08Z7Z4GOlpTY=", request.GetQueryParams()["Signature"])
+// }

+ 98 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signer.go

@@ -0,0 +1,98 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package auth
+
+import (
+	"fmt"
+	"reflect"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+type Signer interface {
+	GetName() string
+	GetType() string
+	GetVersion() string
+	GetAccessKeyId() (string, error)
+	GetExtraParam() map[string]string
+	Sign(stringToSign, secretSuffix string) string
+}
+
+func NewSignerWithCredential(credential Credential, commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error)) (signer Signer, err error) {
+	switch instance := credential.(type) {
+	case *credentials.AccessKeyCredential:
+		{
+			signer = signers.NewAccessKeySigner(instance)
+		}
+	case *credentials.StsTokenCredential:
+		{
+			signer = signers.NewStsTokenSigner(instance)
+		}
+	case *credentials.BearerTokenCredential:
+		{
+			signer = signers.NewBearerTokenSigner(instance)
+		}
+	case *credentials.RamRoleArnCredential:
+		{
+			signer, err = signers.NewRamRoleArnSigner(instance, commonApi)
+		}
+	case *credentials.RsaKeyPairCredential:
+		{
+			signer, err = signers.NewSignerKeyPair(instance, commonApi)
+		}
+	case *credentials.EcsRamRoleCredential:
+		{
+			signer = signers.NewEcsRamRoleSigner(instance, commonApi)
+		}
+	case *credentials.BaseCredential: // deprecated user interface
+		{
+			signer = signers.NewAccessKeySigner(instance.ToAccessKeyCredential())
+		}
+	case *credentials.StsRoleArnCredential: // deprecated user interface
+		{
+			signer, err = signers.NewRamRoleArnSigner(instance.ToRamRoleArnCredential(), commonApi)
+		}
+	case *credentials.StsRoleNameOnEcsCredential: // deprecated user interface
+		{
+			signer = signers.NewEcsRamRoleSigner(instance.ToEcsRamRoleCredential(), commonApi)
+		}
+	default:
+		message := fmt.Sprintf(errors.UnsupportedCredentialErrorMessage, reflect.TypeOf(credential))
+		err = errors.NewClientError(errors.UnsupportedCredentialErrorCode, message, nil)
+	}
+	return
+}
+
+func Sign(request requests.AcsRequest, signer Signer, regionId string) (err error) {
+	switch request.GetStyle() {
+	case requests.ROA:
+		{
+			err = signRoaRequest(request, signer, regionId)
+		}
+	case requests.RPC:
+		{
+			err = signRpcRequest(request, signer, regionId)
+		}
+	default:
+		message := fmt.Sprintf(errors.UnknownRequestTypeErrorMessage, reflect.TypeOf(request))
+		err = errors.NewClientError(errors.UnknownRequestTypeErrorCode, message, nil)
+	}
+
+	return
+}

+ 113 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signer_test.go

@@ -0,0 +1,113 @@
+package auth
+
+import (
+	"testing"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/stretchr/testify/assert"
+)
+
+func TestSigner_AccessKeySigner(t *testing.T) {
+	c := credentials.NewAccessKeyCredential("accessKeyId", "accessKeySecret")
+	signer, err := NewSignerWithCredential(c, nil)
+	assert.Nil(t, err)
+	_, ok := signer.(*signers.AccessKeySigner)
+	assert.True(t, ok)
+}
+
+func TestSigner_BaseSigner(t *testing.T) {
+	c := credentials.NewBaseCredential("accessKeyId", "accessKeySecret")
+	signer, err := NewSignerWithCredential(c, nil)
+	assert.Nil(t, err)
+	_, ok := signer.(*signers.AccessKeySigner)
+	assert.True(t, ok)
+}
+
+func TestSigner_StsRoleArnSigner(t *testing.T) {
+	c := credentials.NewStsRoleArnCredential("accessKeyId", "accessKeySecret", "roleArn", "roleSessionName", 3600)
+	signer, err := NewSignerWithCredential(c, nil)
+	assert.Nil(t, err)
+	_, ok := signer.(*signers.RamRoleArnSigner)
+	assert.True(t, ok)
+}
+
+func TestSigner_StsRoleNameOnEcsSigner(t *testing.T) {
+	c := credentials.NewStsRoleNameOnEcsCredential("roleName")
+	signer, err := NewSignerWithCredential(c, nil)
+	assert.Nil(t, err)
+	_, ok := signer.(*signers.EcsRamRoleSigner)
+	assert.True(t, ok)
+}
+
+func TestSigner_StsTokenSigner(t *testing.T) {
+	c := credentials.NewStsTokenCredential("accessKeyId", "accessKeySecret", "token")
+	signer, err := NewSignerWithCredential(c, nil)
+	assert.Nil(t, err)
+	_, ok := signer.(*signers.StsTokenSigner)
+	assert.True(t, ok)
+}
+
+func TestSigner_RamRoleArnSigner(t *testing.T) {
+	c := credentials.NewRamRoleArnCredential("accessKeyId", "accessKeySecret", "roleArn", "roleSessionName", 3600)
+	signer, err := NewSignerWithCredential(c, nil)
+	assert.Nil(t, err)
+	_, ok := signer.(*signers.RamRoleArnSigner)
+	assert.True(t, ok)
+}
+
+func TestSigner_NewSignerKeyPair(t *testing.T) {
+	c := credentials.NewRsaKeyPairCredential("publicKeyId", "privateKeyId", 3600)
+	signer, err := NewSignerWithCredential(c, nil)
+	assert.Nil(t, err)
+	_, ok := signer.(*signers.SignerKeyPair)
+	assert.True(t, ok)
+}
+
+func TestSigner_EcsRamRoleSigner(t *testing.T) {
+	c := credentials.NewEcsRamRoleCredential("roleName")
+	signer, err := NewSignerWithCredential(c, nil)
+	assert.Nil(t, err)
+	_, ok := signer.(*signers.EcsRamRoleSigner)
+	assert.True(t, ok)
+}
+
+func TestSigner_BearerTokenSigner(t *testing.T) {
+	c := credentials.NewBearerTokenCredential("Bearer.Token")
+	signer, err := NewSignerWithCredential(c, nil)
+	assert.Nil(t, err)
+	_, ok := signer.(*signers.BearerTokenSigner)
+	assert.True(t, ok)
+}
+
+type OtherCredential struct {
+}
+
+func TestSigner_OtherSigner(t *testing.T) {
+	c := &OtherCredential{}
+	_, err := NewSignerWithCredential(c, nil)
+	assert.NotNil(t, err)
+	assert.Equal(t, "[SDK.UnsupportedCredential] Specified credential (type = *auth.OtherCredential) is not supported, please check", err.Error())
+}
+
+func Test_Sign_ROA(t *testing.T) {
+	request := requests.NewCommonRequest()
+	request.PathPattern = "/users/:user"
+	request.TransToAcsRequest()
+	c := credentials.NewAccessKeyCredential("accessKeyId", "accessKeySecret")
+	signer := signers.NewAccessKeySigner(c)
+
+	err := Sign(request, signer, "regionId")
+	assert.Nil(t, err)
+}
+
+func Test_Sign_RPC(t *testing.T) {
+	request := requests.NewCommonRequest()
+	request.TransToAcsRequest()
+	c := credentials.NewAccessKeyCredential("accessKeyId", "accessKeySecret")
+	signer := signers.NewAccessKeySigner(c)
+
+	err := Sign(request, signer, "regionId")
+	assert.Nil(t, err)
+}

+ 57 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/algorithms.go

@@ -0,0 +1,57 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package signers
+
+import (
+	"crypto"
+	"crypto/hmac"
+	"crypto/rand"
+	"crypto/rsa"
+	"crypto/sha1"
+	"crypto/x509"
+	"encoding/base64"
+)
+
+func ShaHmac1(source, secret string) string {
+	key := []byte(secret)
+	hmac := hmac.New(sha1.New, key)
+	hmac.Write([]byte(source))
+	signedBytes := hmac.Sum(nil)
+	signedString := base64.StdEncoding.EncodeToString(signedBytes)
+	return signedString
+}
+
+func Sha256WithRsa(source, secret string) string {
+	// block, _ := pem.Decode([]byte(secret))
+	decodeString, err := base64.StdEncoding.DecodeString(secret)
+	if err != nil {
+		panic(err)
+	}
+	private, err := x509.ParsePKCS8PrivateKey(decodeString)
+	if err != nil {
+		panic(err)
+	}
+
+	h := crypto.Hash.New(crypto.SHA256)
+	h.Write([]byte(source))
+	hashed := h.Sum(nil)
+	signature, err := rsa.SignPKCS1v15(rand.Reader, private.(*rsa.PrivateKey),
+		crypto.SHA256, hashed)
+	if err != nil {
+		panic(err)
+	}
+
+	return base64.StdEncoding.EncodeToString(signature)
+}

+ 56 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/algorithms_test.go

@@ -0,0 +1,56 @@
+package signers
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+)
+
+func TestShaHmac1(t *testing.T) {
+	result := ShaHmac1("source", "secret")
+	assert.Equal(t, "Jv4yi8SobFhg5t1C7nWLbhBSFZQ=", result)
+
+	assert.Equal(t, "CqCYIa39h9SSWuXnTz8F5hh9UPA=", ShaHmac1("中文", "secret"))
+}
+
+func TestSha256WithRsa(t *testing.T) {
+	secret := `
+MIICeQIBADANBgkqhkiG9w0BAQEFAASCAmMwggJfAgEAAoGBAOJC+2WXtkXZ+6sa
+3+qJp4mDOsiZb3BghHT9nVbjTeaw4hsZWHYxQ6l6XDmTg4twPB59LOGAlAjYrT31
+3pdwEawnmdf6zyF93Zvxxpy7lO2HoxYKSjbtXO4I0pcq3WTnw2xlbhqHvrcuWwt+
+FqH9akzcnwHjc03siZBzt/dwDL3vAgMBAAECgYEAzwgZPqFuUEYgaTVDFDl2ynYA
+kNMMzBgUu3Pgx0Nf4amSitdLQYLcdbQXtTtMT4eYCxHgwkpDqkCRbLOQRKNwFo0I
+oaCuhjZlxWcKil4z4Zb/zB7gkeuXPOVUjFSS3FogsRWMtnNAMgR/yJRlbcg/Puqk
+Magt/yDk+7cJCe6H96ECQQDxMT4S+tVP9nOw//QT39Dk+kWe/YVEhnWnCMZmGlEq
+1gnN6qpUi68ts6b3BVgrDPrPN6wm/Z9vpcKNeWpIvxXRAkEA8CcT2UEUwDGRKAUu
+WVPJqdAJjpjc072eRF5g792NyO+TAF6thBlDKNslRvFQDB6ymLsjfy8JYCnGbbSb
+WqbHvwJBAIs7KeI6+jiWxGJA3t06LpSABQCqyOut0u0Bm8YFGyXnOPGtrXXwzMdN
+Fe0zIJp5e69zK+W2Mvt4bL7OgBROeoECQQDsE+4uLw0gFln0tosmovhmp60NcfX7
+bLbtzL2MbwbXlbOztF7ssgzUWAHgKI6hK3g0LhsqBuo3jzmSVO43giZvAkEA08Nm
+2TI9EvX6DfCVfPOiKZM+Pijh0xLN4Dn8qUgt3Tcew/vfj4WA2ZV6qiJqL01vMsHc
+vftlY0Hs1vNXcaBgEA==`
+	result := Sha256WithRsa("source", secret)
+	assert.Equal(t, "UNyJPD27jjSNl70b02E/DUtgtNESdtAuxbNBZTlksk1t/GYjiQNRlFIubp/EGKcWsqs7p5SFKnNiSRqWG3A51VmJFBXXtyW1nwLC9xY/MbUj6JVWNYCuLkPWM942O+GAk7N+G8ZQZt7ib2MhruDAUmv1lLN26lDaCPBX2MJQJCo=", result)
+
+	assert.Equal(t, "CKE0osxUnFFH+oYP3Q427saucBuignE+Mrni63G9w46yZFtVoXFOu5lNiNCnUtaPNpGmBf9X5oGCY+otqPf7bP93nB59rfdteQs0sS65PWH9yjH8RwYCWGCbuyRul/0qIv/nYYGzkLON1C1Vx9Z4Yep6llYuJang5RIXrAkQLmQ=", Sha256WithRsa("中文", secret))
+}
+
+func TestSha256WithRsa_DecodeString_Error(t *testing.T) {
+	defer func() { // 进行异常捕捉
+		err := recover()
+		assert.NotNil(t, err)
+		assert.Equal(t, "illegal base64 data at input byte 0", err.(error).Error())
+	}()
+	secret := `==`
+	Sha256WithRsa("source", secret)
+}
+
+func TestSha256WithRsa_ParsePKCS8PrivateKey_Error(t *testing.T) {
+	defer func() { // 进行异常捕捉
+		err := recover()
+		assert.NotNil(t, err)
+		assert.Equal(t, "asn1: structure error: length too large", err.(error).Error())
+	}()
+	secret := `Jv4yi8SobFhg5t1C7nWLbhBSFZQ=`
+	Sha256WithRsa("source", secret)
+}

+ 54 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/credential_updater.go

@@ -0,0 +1,54 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package signers
+
+import (
+	"time"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+const defaultInAdvanceScale = 0.95
+
+type credentialUpdater struct {
+	credentialExpiration int
+	lastUpdateTimestamp  int64
+	inAdvanceScale       float64
+	buildRequestMethod   func() (*requests.CommonRequest, error)
+	responseCallBack     func(response *responses.CommonResponse) error
+	refreshApi           func(request *requests.CommonRequest) (response *responses.CommonResponse, err error)
+}
+
+func (updater *credentialUpdater) needUpdateCredential() (result bool) {
+	if updater.inAdvanceScale == 0 {
+		updater.inAdvanceScale = defaultInAdvanceScale
+	}
+	return time.Now().Unix()-updater.lastUpdateTimestamp >= int64(float64(updater.credentialExpiration)*updater.inAdvanceScale)
+}
+
+func (updater *credentialUpdater) updateCredential() (err error) {
+	request, err := updater.buildRequestMethod()
+	if err != nil {
+		return
+	}
+	response, err := updater.refreshApi(request)
+	if err != nil {
+		return
+	}
+	updater.lastUpdateTimestamp = time.Now().Unix()
+	err = updater.responseCallBack(response)
+	return
+}

+ 80 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/credential_updater_test.go

@@ -0,0 +1,80 @@
+package signers
+
+import (
+	"fmt"
+	"testing"
+	"time"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+	"github.com/stretchr/testify/assert"
+)
+
+func TestCredentialUpdater_NeedUpdateCredential(t *testing.T) {
+	// default
+	updater := &credentialUpdater{}
+	assert.NotNil(t, updater)
+	assert.True(t, updater.needUpdateCredential())
+
+	// no need update
+	updater = &credentialUpdater{
+		inAdvanceScale:       1.0,
+		lastUpdateTimestamp:  time.Now().Unix() - 4000,
+		credentialExpiration: 5000,
+	}
+	assert.NotNil(t, updater)
+	assert.False(t, updater.needUpdateCredential())
+
+	// need update
+	updater = &credentialUpdater{
+		inAdvanceScale:       1.0,
+		lastUpdateTimestamp:  time.Now().Unix() - 10000,
+		credentialExpiration: 5000,
+	}
+	assert.NotNil(t, updater)
+	assert.True(t, updater.needUpdateCredential())
+}
+
+func TestCredentialUpdater_UpdateCredential(t *testing.T) {
+	updater := &credentialUpdater{}
+	assert.NotNil(t, updater)
+	updater.buildRequestMethod = func() (*requests.CommonRequest, error) {
+		return nil, fmt.Errorf("build request method failed")
+	}
+
+	err := updater.updateCredential()
+	assert.NotNil(t, err)
+	assert.Equal(t, "build request method failed", err.Error())
+
+	updater.buildRequestMethod = func() (*requests.CommonRequest, error) {
+		return requests.NewCommonRequest(), nil
+	}
+	updater.refreshApi = func(request *requests.CommonRequest) (response *responses.CommonResponse, err error) {
+		return nil, fmt.Errorf("refresh api executed fail")
+	}
+
+	err = updater.updateCredential()
+	assert.NotNil(t, err)
+	assert.Equal(t, "refresh api executed fail", err.Error())
+
+	updater.refreshApi = func(request *requests.CommonRequest) (response *responses.CommonResponse, err error) {
+		return responses.NewCommonResponse(), nil
+	}
+
+	updater.responseCallBack = func(response *responses.CommonResponse) error {
+		return fmt.Errorf("response callback fail")
+	}
+
+	err = updater.updateCredential()
+	assert.NotNil(t, err)
+	// update timestamp
+	assert.True(t, time.Now().Unix()-updater.lastUpdateTimestamp < 10)
+	assert.Equal(t, "response callback fail", err.Error())
+
+	updater.responseCallBack = func(response *responses.CommonResponse) error {
+		return nil
+	}
+
+	err = updater.updateCredential()
+	assert.Nil(t, err)
+}

+ 7 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/session_credential.go

@@ -0,0 +1,7 @@
+package signers
+
+type SessionCredential struct {
+	AccessKeyId     string
+	AccessKeySecret string
+	StsToken        string
+}

+ 54 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_access_key.go

@@ -0,0 +1,54 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package signers
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+)
+
+type AccessKeySigner struct {
+	credential *credentials.AccessKeyCredential
+}
+
+func (signer *AccessKeySigner) GetExtraParam() map[string]string {
+	return nil
+}
+
+func NewAccessKeySigner(credential *credentials.AccessKeyCredential) *AccessKeySigner {
+	return &AccessKeySigner{
+		credential: credential,
+	}
+}
+
+func (*AccessKeySigner) GetName() string {
+	return "HMAC-SHA1"
+}
+
+func (*AccessKeySigner) GetType() string {
+	return ""
+}
+
+func (*AccessKeySigner) GetVersion() string {
+	return "1.0"
+}
+
+func (signer *AccessKeySigner) GetAccessKeyId() (accessKeyId string, err error) {
+	return signer.credential.AccessKeyId, nil
+}
+
+func (signer *AccessKeySigner) Sign(stringToSign, secretSuffix string) string {
+	secret := signer.credential.AccessKeySecret + secretSuffix
+	return ShaHmac1(stringToSign, secret)
+}

+ 22 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_access_key_test.go

@@ -0,0 +1,22 @@
+package signers
+
+import (
+	"testing"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+	"github.com/stretchr/testify/assert"
+)
+
+func TestSignerAccessKey(t *testing.T) {
+	c := credentials.NewAccessKeyCredential("accessKeyId", "accessKeySecret")
+	assert.NotNil(t, c)
+	s := NewAccessKeySigner(c)
+	assert.Nil(t, s.GetExtraParam())
+	assert.Equal(t, "HMAC-SHA1", s.GetName())
+	assert.Equal(t, "", s.GetType())
+	assert.Equal(t, "1.0", s.GetVersion())
+	accessKeyId, err := s.GetAccessKeyId()
+	assert.Nil(t, err)
+	assert.Equal(t, "accessKeyId", accessKeyId)
+	assert.Equal(t, "Dqy7QZhP4TyQUDa3SBSFXopJaIo=", s.Sign("string to sign", "suffix"))
+}

+ 35 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_bearer_token.go

@@ -0,0 +1,35 @@
+package signers
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+)
+
+type BearerTokenSigner struct {
+	credential *credentials.BearerTokenCredential
+}
+
+func NewBearerTokenSigner(credential *credentials.BearerTokenCredential) *BearerTokenSigner {
+	return &BearerTokenSigner{
+		credential: credential,
+	}
+}
+
+func (signer *BearerTokenSigner) GetExtraParam() map[string]string {
+	return map[string]string{"BearerToken": signer.credential.BearerToken}
+}
+
+func (*BearerTokenSigner) GetName() string {
+	return ""
+}
+func (*BearerTokenSigner) GetType() string {
+	return "BEARERTOKEN"
+}
+func (*BearerTokenSigner) GetVersion() string {
+	return "1.0"
+}
+func (signer *BearerTokenSigner) GetAccessKeyId() (accessKeyId string, err error) {
+	return "", nil
+}
+func (signer *BearerTokenSigner) Sign(stringToSign, secretSuffix string) string {
+	return ""
+}

+ 31 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_bearer_token_test.go

@@ -0,0 +1,31 @@
+package signers_test
+
+import (
+	"reflect"
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers"
+)
+
+func TestBearerTokenSigner(t *testing.T) {
+	c := credentials.NewBearerTokenCredential("Bearer.Token")
+	sign := signers.NewBearerTokenSigner(c)
+	assert.NotNil(t, sign)
+	exparam := sign.GetExtraParam()
+	assert.True(t, reflect.DeepEqual(exparam, map[string]string{"BearerToken": "Bearer.Token"}))
+
+	assert.Empty(t, sign.GetName())
+
+	assert.Equal(t, "BEARERTOKEN", sign.GetType())
+
+	assert.Equal(t, "1.0", sign.GetVersion())
+
+	accessKeyID, err := sign.GetAccessKeyId()
+	assert.Empty(t, accessKeyID)
+	assert.Nil(t, err)
+
+	assert.Empty(t, sign.Sign("stringToSign", "&"))
+}

+ 167 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ecs_ram_role.go

@@ -0,0 +1,167 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package signers
+
+import (
+	"encoding/json"
+	"fmt"
+	"net/http"
+	"strings"
+	"time"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+	jmespath "github.com/jmespath/go-jmespath"
+)
+
+var securityCredURL = "http://100.100.100.200/latest/meta-data/ram/security-credentials/"
+
+type EcsRamRoleSigner struct {
+	*credentialUpdater
+	sessionCredential *SessionCredential
+	credential        *credentials.EcsRamRoleCredential
+	commonApi         func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error)
+}
+
+func NewEcsRamRoleSigner(credential *credentials.EcsRamRoleCredential, commonApi func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error)) (signer *EcsRamRoleSigner) {
+	signer = &EcsRamRoleSigner{
+		credential: credential,
+		commonApi:  commonApi,
+	}
+
+	signer.credentialUpdater = &credentialUpdater{
+		credentialExpiration: defaultDurationSeconds / 60,
+		buildRequestMethod:   signer.buildCommonRequest,
+		responseCallBack:     signer.refreshCredential,
+		refreshApi:           signer.refreshApi,
+	}
+
+	return signer
+}
+
+func (*EcsRamRoleSigner) GetName() string {
+	return "HMAC-SHA1"
+}
+
+func (*EcsRamRoleSigner) GetType() string {
+	return ""
+}
+
+func (*EcsRamRoleSigner) GetVersion() string {
+	return "1.0"
+}
+
+func (signer *EcsRamRoleSigner) GetAccessKeyId() (accessKeyId string, err error) {
+	if signer.sessionCredential == nil || signer.needUpdateCredential() {
+		err = signer.updateCredential()
+		if err != nil {
+			return
+		}
+	}
+	if signer.sessionCredential == nil || len(signer.sessionCredential.AccessKeyId) <= 0 {
+		return "", nil
+	}
+	return signer.sessionCredential.AccessKeyId, nil
+}
+
+func (signer *EcsRamRoleSigner) GetExtraParam() map[string]string {
+	if signer.sessionCredential == nil {
+		return make(map[string]string)
+	}
+	if len(signer.sessionCredential.StsToken) <= 0 {
+		return make(map[string]string)
+	}
+	return map[string]string{"SecurityToken": signer.sessionCredential.StsToken}
+}
+
+func (signer *EcsRamRoleSigner) Sign(stringToSign, secretSuffix string) string {
+	secret := signer.sessionCredential.AccessKeySecret + secretSuffix
+	return ShaHmac1(stringToSign, secret)
+}
+
+func (signer *EcsRamRoleSigner) buildCommonRequest() (request *requests.CommonRequest, err error) {
+	return
+}
+
+func (signer *EcsRamRoleSigner) refreshApi(request *requests.CommonRequest) (response *responses.CommonResponse, err error) {
+	requestUrl := securityCredURL + signer.credential.RoleName
+	httpRequest, err := http.NewRequest(requests.GET, requestUrl, strings.NewReader(""))
+	if err != nil {
+		err = fmt.Errorf("refresh Ecs sts token err: %s", err.Error())
+		return
+	}
+	httpClient := &http.Client{}
+	httpResponse, err := httpClient.Do(httpRequest)
+	if err != nil {
+		err = fmt.Errorf("refresh Ecs sts token err: %s", err.Error())
+		return
+	}
+
+	response = responses.NewCommonResponse()
+	err = responses.Unmarshal(response, httpResponse, "")
+	return
+}
+
+func (signer *EcsRamRoleSigner) refreshCredential(response *responses.CommonResponse) (err error) {
+	if response.GetHttpStatus() != http.StatusOK {
+		return fmt.Errorf("refresh Ecs sts token err, httpStatus: %d, message = %s", response.GetHttpStatus(), response.GetHttpContentString())
+	}
+	var data interface{}
+	err = json.Unmarshal(response.GetHttpContentBytes(), &data)
+	if err != nil {
+		return fmt.Errorf("refresh Ecs sts token err, json.Unmarshal fail: %s", err.Error())
+	}
+	code, err := jmespath.Search("Code", data)
+	if err != nil {
+		return fmt.Errorf("refresh Ecs sts token err, fail to get Code: %s", err.Error())
+	}
+	if code.(string) != "Success" {
+		return fmt.Errorf("refresh Ecs sts token err, Code is not Success")
+	}
+	accessKeyId, err := jmespath.Search("AccessKeyId", data)
+	if err != nil {
+		return fmt.Errorf("refresh Ecs sts token err, fail to get AccessKeyId: %s", err.Error())
+	}
+	accessKeySecret, err := jmespath.Search("AccessKeySecret", data)
+	if err != nil {
+		return fmt.Errorf("refresh Ecs sts token err, fail to get AccessKeySecret: %s", err.Error())
+	}
+	securityToken, err := jmespath.Search("SecurityToken", data)
+	if err != nil {
+		return fmt.Errorf("refresh Ecs sts token err, fail to get SecurityToken: %s", err.Error())
+	}
+	expiration, err := jmespath.Search("Expiration", data)
+	if err != nil {
+		return fmt.Errorf("refresh Ecs sts token err, fail to get Expiration: %s", err.Error())
+	}
+	if accessKeyId == nil || accessKeySecret == nil || securityToken == nil || expiration == nil {
+		return
+	}
+
+	expirationTime, err := time.Parse("2006-01-02T15:04:05Z", expiration.(string))
+	signer.credentialExpiration = int(expirationTime.Unix() - time.Now().Unix())
+	signer.sessionCredential = &SessionCredential{
+		AccessKeyId:     accessKeyId.(string),
+		AccessKeySecret: accessKeySecret.(string),
+		StsToken:        securityToken.(string),
+	}
+
+	return
+}
+
+func (signer *EcsRamRoleSigner) GetSessionCredential() *SessionCredential {
+	return signer.sessionCredential
+}

+ 183 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ecs_ram_role_test.go

@@ -0,0 +1,183 @@
+package signers
+
+import (
+	"fmt"
+	"net/http"
+	"net/http/httptest"
+	"strings"
+	"testing"
+	"time"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+	"github.com/stretchr/testify/assert"
+)
+
+func Test_ECSRamRole(t *testing.T) {
+	c := credentials.NewEcsRamRoleCredential("roleName")
+	singer := NewEcsRamRoleSigner(c, nil)
+	assert.NotNil(t, singer)
+	assert.Equal(t, "HMAC-SHA1", singer.GetName())
+	assert.Equal(t, "", singer.GetType())
+	assert.Equal(t, "1.0", singer.GetVersion())
+}
+
+func Test_EcsRamRoleSigner_buildCommonRequest(t *testing.T) {
+	c := credentials.NewEcsRamRoleCredential("roleName")
+	s := NewEcsRamRoleSigner(c, nil)
+	request, err := s.buildCommonRequest()
+	assert.Nil(t, err)
+	assert.Nil(t, request)
+}
+
+func Test_EcsRamRoleSigner_GetAccessKeyId(t *testing.T) {
+	c := credentials.NewEcsRamRoleCredential("roleName")
+	s := NewEcsRamRoleSigner(c, nil)
+	assert.NotNil(t, s)
+	// Update our securityCredURL to point at our local test server.
+	originalSecurityCredURL := securityCredURL
+	securityCredURL = strings.Replace(securityCredURL, "http://100.100.100.200", "http://invalid-domain-xxx", -1)
+	defer func() {
+		securityCredURL = originalSecurityCredURL
+	}()
+
+	accessKeyId, err := s.GetAccessKeyId()
+	assert.True(t, strings.HasSuffix(err.Error(), "no such host"))
+	assert.Equal(t, "", accessKeyId)
+}
+
+func mockServer(status int, json string) (server *httptest.Server) {
+	// Start a test server locally.
+	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+		switch r.URL.Path {
+		case "/latest/meta-data/ram/security-credentials/roleName":
+			w.WriteHeader(status)
+			w.Write([]byte(json))
+		}
+	}))
+	return ts
+}
+
+func Test_EcsRamRoleSigner_GetAccessKeyId2(t *testing.T) {
+	c := credentials.NewEcsRamRoleCredential("roleName")
+	s := NewEcsRamRoleSigner(c, nil)
+	assert.NotNil(t, s)
+	// Start a test server locally.
+	ts := mockServer(400, "{}")
+	defer ts.Close()
+	originalSecurityCredURL := securityCredURL
+	securityCredURL = strings.Replace(securityCredURL, "http://100.100.100.200", ts.URL, -1)
+	defer func() {
+		securityCredURL = originalSecurityCredURL
+	}()
+	accessKeyId, err := s.GetAccessKeyId()
+	assert.Equal(t, "SDK.ServerError\nErrorCode: \nRecommend: \nRequestId: \nMessage: {}", err.Error())
+	assert.Equal(t, "", accessKeyId)
+}
+
+func Test_EcsRamRoleSigner_GetAccessKeyId3(t *testing.T) {
+	c := credentials.NewEcsRamRoleCredential("roleName")
+	s := NewEcsRamRoleSigner(c, nil)
+	assert.NotNil(t, s)
+	// Start a test server locally.
+	ts := mockServer(200, "invalid json")
+	defer ts.Close()
+	originalSecurityCredURL := securityCredURL
+	securityCredURL = strings.Replace(securityCredURL, "http://100.100.100.200", ts.URL, -1)
+	defer func() {
+		securityCredURL = originalSecurityCredURL
+	}()
+	accessKeyId, err := s.GetAccessKeyId()
+	assert.Equal(t, "refresh Ecs sts token err, json.Unmarshal fail: invalid character 'i' looking for beginning of value", err.Error())
+	assert.Equal(t, "", accessKeyId)
+}
+
+func Test_EcsRamRoleSigner_GetAccessKeyId4(t *testing.T) {
+	c := credentials.NewEcsRamRoleCredential("roleName")
+	s := NewEcsRamRoleSigner(c, nil)
+	assert.NotNil(t, s)
+	// Start a test server locally.
+	ts := mockServer(200, `{"Code":"Fails"}`)
+	defer ts.Close()
+	originalSecurityCredURL := securityCredURL
+	securityCredURL = strings.Replace(securityCredURL, "http://100.100.100.200", ts.URL, -1)
+	defer func() {
+		securityCredURL = originalSecurityCredURL
+	}()
+	accessKeyId, err := s.GetAccessKeyId()
+	assert.Equal(t, "refresh Ecs sts token err, Code is not Success", err.Error())
+	assert.Equal(t, "", accessKeyId)
+}
+
+func Test_EcsRamRoleSigner_GetAccessKeyId5(t *testing.T) {
+	c := credentials.NewEcsRamRoleCredential("roleName")
+	s := NewEcsRamRoleSigner(c, nil)
+	assert.NotNil(t, s)
+	// Start a test server locally.
+	ts := mockServer(200, `{"Code":"Success"}`)
+	defer ts.Close()
+	originalSecurityCredURL := securityCredURL
+	securityCredURL = strings.Replace(securityCredURL, "http://100.100.100.200", ts.URL, -1)
+	defer func() {
+		securityCredURL = originalSecurityCredURL
+	}()
+	accessKeyId, err := s.GetAccessKeyId()
+	assert.Nil(t, err)
+	assert.Equal(t, "", accessKeyId)
+}
+
+func Test_EcsRamRoleSigner_GetAccessKeyId6(t *testing.T) {
+	c := credentials.NewEcsRamRoleCredential("roleName")
+	s := NewEcsRamRoleSigner(c, nil)
+	assert.NotNil(t, s)
+	// Start a test server locally.
+	ts := mockServer(201, `{"Code":"Success"}`)
+	defer ts.Close()
+	originalSecurityCredURL := securityCredURL
+	securityCredURL = strings.Replace(securityCredURL, "http://100.100.100.200", ts.URL, -1)
+	defer func() {
+		securityCredURL = originalSecurityCredURL
+	}()
+	accessKeyId, err := s.GetAccessKeyId()
+	assert.Equal(t, "refresh Ecs sts token err, httpStatus: 201, message = {\"Code\":\"Success\"}", err.Error())
+	assert.Equal(t, "", accessKeyId)
+}
+
+func Test_EcsRamRoleSigner_GetAccessKeyId_Success(t *testing.T) {
+	c := credentials.NewEcsRamRoleCredential("roleName")
+	s := NewEcsRamRoleSigner(c, nil)
+	assert.NotNil(t, s)
+	// Start a test server locally.
+	nextDay := time.Now().AddDate(0, 0, 1)
+	ts := mockServer(200, fmt.Sprintf(`{
+		"Code": "Success",
+		"AccessKeyId":"access key id",
+		"AccessKeySecret":"access key secret",
+		"SecurityToken":"security token",
+		"Expiration": "%s"
+	}`, nextDay.Format("2006-01-02T15:04:05Z")))
+	defer ts.Close()
+	originalSecurityCredURL := securityCredURL
+	securityCredURL = strings.Replace(securityCredURL, "http://100.100.100.200", ts.URL, -1)
+	defer func() {
+		securityCredURL = originalSecurityCredURL
+	}()
+	// sessionCredential should be nil
+	assert.Len(t, s.GetExtraParam(), 0)
+	assert.Nil(t, s.GetSessionCredential())
+	accessKeyId, err := s.GetAccessKeyId()
+	assert.Nil(t, err)
+	assert.Equal(t, "access key id", accessKeyId)
+	expiration := s.credentialExpiration
+	accessKeyId, err = s.GetAccessKeyId()
+	assert.NotNil(t, s.GetSessionCredential())
+	assert.Nil(t, err)
+	assert.Equal(t, "access key id", accessKeyId)
+	assert.Len(t, s.GetExtraParam(), 1)
+	assert.Equal(t, "security token", s.GetExtraParam()["SecurityToken"])
+	// the expiration should not changed. hit cache
+	assert.Equal(t, expiration, s.credentialExpiration)
+
+	assert.Equal(t, "dcM4bWGEoD5QUp9xhLW3SfcWfgs=", s.Sign("string to sign", "/"))
+	s.sessionCredential.StsToken = ""
+	assert.Len(t, s.GetExtraParam(), 0)
+}

+ 148 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_key_pair.go

@@ -0,0 +1,148 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package signers
+
+import (
+	"encoding/json"
+	"fmt"
+	"net/http"
+	"strconv"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+	jmespath "github.com/jmespath/go-jmespath"
+)
+
+type SignerKeyPair struct {
+	*credentialUpdater
+	sessionCredential *SessionCredential
+	credential        *credentials.RsaKeyPairCredential
+	commonApi         func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error)
+}
+
+func NewSignerKeyPair(credential *credentials.RsaKeyPairCredential, commonApi func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error)) (signer *SignerKeyPair, err error) {
+	signer = &SignerKeyPair{
+		credential: credential,
+		commonApi:  commonApi,
+	}
+
+	signer.credentialUpdater = &credentialUpdater{
+		credentialExpiration: credential.SessionExpiration,
+		buildRequestMethod:   signer.buildCommonRequest,
+		responseCallBack:     signer.refreshCredential,
+		refreshApi:           signer.refreshApi,
+	}
+
+	if credential.SessionExpiration > 0 {
+		if credential.SessionExpiration >= 900 && credential.SessionExpiration <= 3600 {
+			signer.credentialExpiration = credential.SessionExpiration
+		} else {
+			err = errors.NewClientError(errors.InvalidParamErrorCode, "Key Pair session duration should be in the range of 15min - 1Hr", nil)
+		}
+	} else {
+		signer.credentialExpiration = defaultDurationSeconds
+	}
+	return
+}
+
+func (*SignerKeyPair) GetName() string {
+	return "HMAC-SHA1"
+}
+
+func (*SignerKeyPair) GetType() string {
+	return ""
+}
+
+func (*SignerKeyPair) GetVersion() string {
+	return "1.0"
+}
+
+func (signer *SignerKeyPair) ensureCredential() error {
+	if signer.sessionCredential == nil || signer.needUpdateCredential() {
+		return signer.updateCredential()
+	}
+	return nil
+}
+
+func (signer *SignerKeyPair) GetAccessKeyId() (accessKeyId string, err error) {
+	err = signer.ensureCredential()
+	if err != nil {
+		return
+	}
+	if signer.sessionCredential == nil || len(signer.sessionCredential.AccessKeyId) <= 0 {
+		accessKeyId = ""
+		return
+	}
+
+	accessKeyId = signer.sessionCredential.AccessKeyId
+	return
+}
+
+func (signer *SignerKeyPair) GetExtraParam() map[string]string {
+	return make(map[string]string)
+}
+
+func (signer *SignerKeyPair) Sign(stringToSign, secretSuffix string) string {
+	secret := signer.sessionCredential.AccessKeySecret + secretSuffix
+	return ShaHmac1(stringToSign, secret)
+}
+
+func (signer *SignerKeyPair) buildCommonRequest() (request *requests.CommonRequest, err error) {
+	request = requests.NewCommonRequest()
+	request.Product = "Sts"
+	request.Version = "2015-04-01"
+	request.ApiName = "GenerateSessionAccessKey"
+	request.Scheme = requests.HTTPS
+	request.SetDomain("sts.ap-northeast-1.aliyuncs.com")
+	request.QueryParams["PublicKeyId"] = signer.credential.PublicKeyId
+	request.QueryParams["DurationSeconds"] = strconv.Itoa(signer.credentialExpiration)
+	return
+}
+
+func (signer *SignerKeyPair) refreshApi(request *requests.CommonRequest) (response *responses.CommonResponse, err error) {
+	signerV2 := NewSignerV2(signer.credential)
+	return signer.commonApi(request, signerV2)
+}
+
+func (signer *SignerKeyPair) refreshCredential(response *responses.CommonResponse) (err error) {
+	if response.GetHttpStatus() != http.StatusOK {
+		message := "refresh session AccessKey failed"
+		err = errors.NewServerError(response.GetHttpStatus(), response.GetHttpContentString(), message)
+		return
+	}
+	var data interface{}
+	err = json.Unmarshal(response.GetHttpContentBytes(), &data)
+	if err != nil {
+		return fmt.Errorf("refresh KeyPair err, json.Unmarshal fail: %s", err.Error())
+	}
+	accessKeyId, err := jmespath.Search("SessionAccessKey.SessionAccessKeyId", data)
+	if err != nil {
+		return fmt.Errorf("refresh KeyPair err, fail to get SessionAccessKeyId: %s", err.Error())
+	}
+	accessKeySecret, err := jmespath.Search("SessionAccessKey.SessionAccessKeySecret", data)
+	if err != nil {
+		return fmt.Errorf("refresh KeyPair err, fail to get SessionAccessKeySecret: %s", err.Error())
+	}
+	if accessKeyId == nil || accessKeySecret == nil {
+		return
+	}
+	signer.sessionCredential = &SessionCredential{
+		AccessKeyId:     accessKeyId.(string),
+		AccessKeySecret: accessKeySecret.(string),
+	}
+	return
+}

+ 174 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_key_pair_test.go

@@ -0,0 +1,174 @@
+package signers
+
+import (
+	"bytes"
+	"fmt"
+	"io/ioutil"
+	"net/http"
+	"strconv"
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+func TestKeyPairError(t *testing.T) {
+	c := credentials.NewRsaKeyPairCredential("privateKey", "publicKey", 1)
+	_, err := NewSignerKeyPair(c, nil)
+	assert.NotNil(t, err)
+	assert.Equal(t, "[SDK.InvalidParam] Key Pair session duration should be in the range of 15min - 1Hr", err.Error())
+}
+
+func TestKeyPairOk(t *testing.T) {
+	c := credentials.NewRsaKeyPairCredential("privateKey", "publicKey", 0)
+	s, err := NewSignerKeyPair(c, nil)
+	assert.Nil(t, err)
+	assert.NotNil(t, s)
+	assert.Equal(t, 3600, s.credentialExpiration)
+	c = credentials.NewRsaKeyPairCredential("privateKey", "publicKey", 3500)
+	s, err = NewSignerKeyPair(c, nil)
+	assert.Nil(t, err)
+	assert.NotNil(t, s)
+	assert.Equal(t, 3500, s.credentialExpiration)
+	assert.Equal(t, "HMAC-SHA1", s.GetName())
+	assert.Equal(t, "1.0", s.GetVersion())
+	assert.Equal(t, "", s.GetType())
+	assert.Len(t, s.GetExtraParam(), 0)
+}
+
+func Test_buildCommonRequest(t *testing.T) {
+	c := credentials.NewRsaKeyPairCredential("privateKey", "publicKey", 0)
+	s, err := NewSignerKeyPair(c, func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error) {
+		return nil, fmt.Errorf("common api fails")
+	})
+	assert.Nil(t, err)
+	request, err := s.buildCommonRequest()
+	assert.Nil(t, err)
+	assert.NotNil(t, request)
+	assert.Equal(t, "Sts", request.Product)
+	assert.Equal(t, "2015-04-01", request.Version)
+	assert.Equal(t, "GenerateSessionAccessKey", request.ApiName)
+	assert.Equal(t, "HTTPS", request.Scheme)
+	assert.Equal(t, "publicKey", request.QueryParams["PublicKeyId"])
+	assert.Equal(t, "3600", request.QueryParams["DurationSeconds"])
+}
+
+func TestGetAccessKeyId(t *testing.T) {
+	c := credentials.NewRsaKeyPairCredential("privateKey", "publicKey", 0)
+	s, err := NewSignerKeyPair(c, func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error) {
+		return nil, fmt.Errorf("common api fails")
+	})
+	assert.Nil(t, err)
+	assert.NotNil(t, s)
+	accessKeyId, err := s.GetAccessKeyId()
+	assert.Equal(t, "common api fails", err.Error())
+	assert.Equal(t, "", accessKeyId)
+}
+
+func TestGetAccessKeyId2(t *testing.T) {
+	// default response is not OK
+	c := credentials.NewRsaKeyPairCredential("privateKey", "publicKey", 0)
+	s, err := NewSignerKeyPair(c, func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error) {
+		return responses.NewCommonResponse(), nil
+	})
+	assert.Nil(t, err)
+	assert.NotNil(t, s)
+	// s.lastUpdateTimestamp = time.Now().Unix() - 1000
+	accessKeyId, err := s.GetAccessKeyId()
+	assert.Equal(t, "SDK.ServerError\nErrorCode: \nRecommend: refresh session AccessKey failed\nRequestId: \nMessage: ", err.Error())
+	assert.Equal(t, "", accessKeyId)
+}
+
+func TestGetAccessKeyId3(t *testing.T) {
+	c := credentials.NewRsaKeyPairCredential("privateKey", "publicKey", 0)
+	// Mock the 200 response and invalid json
+	s, err := NewSignerKeyPair(c, func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error) {
+		res := responses.NewCommonResponse()
+		statusCode := 200
+		header := make(http.Header)
+		status := strconv.Itoa(statusCode)
+		httpresp := &http.Response{
+			Proto:      "HTTP/1.1",
+			ProtoMajor: 1,
+			Header:     header,
+			StatusCode: statusCode,
+			Status:     status + " " + http.StatusText(statusCode),
+		}
+		httpresp.Header = make(http.Header)
+		httpresp.Body = ioutil.NopCloser(bytes.NewReader([]byte("invalid json")))
+		responses.Unmarshal(res, httpresp, "JSON")
+		return res, nil
+	})
+	assert.Nil(t, err)
+	assert.NotNil(t, s)
+	// s.lastUpdateTimestamp = time.Now().Unix() - 1000
+	accessKeyId, err := s.GetAccessKeyId()
+	assert.NotNil(t, err)
+	assert.Equal(t, "refresh KeyPair err, json.Unmarshal fail: invalid character 'i' looking for beginning of value", err.Error())
+	assert.Equal(t, "", accessKeyId)
+}
+
+func TestGetAccessKeyId4(t *testing.T) {
+	c := credentials.NewRsaKeyPairCredential("privateKey", "publicKey", 0)
+	// mock 200 response and valid json, but no data
+	s, err := NewSignerKeyPair(c, func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error) {
+		res := responses.NewCommonResponse()
+		statusCode := 200
+		header := make(http.Header)
+		status := strconv.Itoa(statusCode)
+		httpresp := &http.Response{
+			Proto:      "HTTP/1.1",
+			ProtoMajor: 1,
+			Header:     header,
+			StatusCode: statusCode,
+			Status:     status + " " + http.StatusText(statusCode),
+		}
+		httpresp.Header = make(http.Header)
+		httpresp.Body = ioutil.NopCloser(bytes.NewReader([]byte("{}")))
+		responses.Unmarshal(res, httpresp, "JSON")
+		return res, nil
+	})
+	assert.Nil(t, err)
+	assert.NotNil(t, s)
+	// s.lastUpdateTimestamp = time.Now().Unix() - 1000
+	accessKeyId, err := s.GetAccessKeyId()
+	assert.Nil(t, err)
+	assert.Equal(t, "", accessKeyId)
+}
+
+func TestGetAccessKeyIdAndSign(t *testing.T) {
+	c := credentials.NewRsaKeyPairCredential("privateKey", "publicKey", 0)
+	// mock 200 response and valid json and valid result
+	s, err := NewSignerKeyPair(c, func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error) {
+		res := responses.NewCommonResponse()
+		statusCode := 200
+		header := make(http.Header)
+		status := strconv.Itoa(statusCode)
+		httpresp := &http.Response{
+			Proto:      "HTTP/1.1",
+			ProtoMajor: 1,
+			Header:     header,
+			StatusCode: statusCode,
+			Status:     status + " " + http.StatusText(statusCode),
+		}
+		httpresp.Header = make(http.Header)
+		json := `{"SessionAccessKey":{"SessionAccessKeyId":"session access key id","SessionAccessKeySecret": "session access key secret"}}`
+		httpresp.Body = ioutil.NopCloser(bytes.NewReader([]byte(json)))
+		responses.Unmarshal(res, httpresp, "JSON")
+		return res, nil
+	})
+	assert.Nil(t, err)
+	assert.NotNil(t, s)
+	// s.lastUpdateTimestamp = time.Now().Unix() - 1000
+	accessKeyId, err := s.GetAccessKeyId()
+	assert.Nil(t, err)
+	assert.Equal(t, "session access key id", accessKeyId)
+	// no need update
+	err = s.ensureCredential()
+	assert.Nil(t, err)
+	signature := s.Sign("string to sign", "/")
+	assert.Equal(t, "cgoenM6nl61t2wFdlaHVySuGAgY=", signature)
+}

+ 175 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ram_role_arn.go

@@ -0,0 +1,175 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package signers
+
+import (
+	"encoding/json"
+	"fmt"
+	"net/http"
+	"strconv"
+	"time"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+	jmespath "github.com/jmespath/go-jmespath"
+)
+
+const (
+	defaultDurationSeconds = 3600
+)
+
+type RamRoleArnSigner struct {
+	*credentialUpdater
+	roleSessionName   string
+	sessionCredential *SessionCredential
+	credential        *credentials.RamRoleArnCredential
+	commonApi         func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error)
+}
+
+func NewRamRoleArnSigner(credential *credentials.RamRoleArnCredential, commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error)) (signer *RamRoleArnSigner, err error) {
+	signer = &RamRoleArnSigner{
+		credential: credential,
+		commonApi:  commonApi,
+	}
+
+	signer.credentialUpdater = &credentialUpdater{
+		credentialExpiration: credential.RoleSessionExpiration,
+		buildRequestMethod:   signer.buildCommonRequest,
+		responseCallBack:     signer.refreshCredential,
+		refreshApi:           signer.refreshApi,
+	}
+
+	if len(credential.RoleSessionName) > 0 {
+		signer.roleSessionName = credential.RoleSessionName
+	} else {
+		signer.roleSessionName = "aliyun-go-sdk-" + strconv.FormatInt(time.Now().UnixNano()/1000, 10)
+	}
+	if credential.RoleSessionExpiration > 0 {
+		if credential.RoleSessionExpiration >= 900 && credential.RoleSessionExpiration <= 3600 {
+			signer.credentialExpiration = credential.RoleSessionExpiration
+		} else {
+			err = errors.NewClientError(errors.InvalidParamErrorCode, "Assume Role session duration should be in the range of 15min - 1Hr", nil)
+		}
+	} else {
+		signer.credentialExpiration = defaultDurationSeconds
+	}
+	return
+}
+
+func (*RamRoleArnSigner) GetName() string {
+	return "HMAC-SHA1"
+}
+
+func (*RamRoleArnSigner) GetType() string {
+	return ""
+}
+
+func (*RamRoleArnSigner) GetVersion() string {
+	return "1.0"
+}
+
+func (signer *RamRoleArnSigner) GetAccessKeyId() (accessKeyId string, err error) {
+	if signer.sessionCredential == nil || signer.needUpdateCredential() {
+		err = signer.updateCredential()
+		if err != nil {
+			return
+		}
+	}
+
+	if signer.sessionCredential == nil || len(signer.sessionCredential.AccessKeyId) <= 0 {
+		return "", err
+	}
+
+	return signer.sessionCredential.AccessKeyId, nil
+}
+
+func (signer *RamRoleArnSigner) GetExtraParam() map[string]string {
+	if signer.sessionCredential == nil || signer.needUpdateCredential() {
+		signer.updateCredential()
+	}
+	if signer.sessionCredential == nil || len(signer.sessionCredential.StsToken) <= 0 {
+		return make(map[string]string)
+	}
+	return map[string]string{"SecurityToken": signer.sessionCredential.StsToken}
+}
+
+func (signer *RamRoleArnSigner) Sign(stringToSign, secretSuffix string) string {
+	secret := signer.sessionCredential.AccessKeySecret + secretSuffix
+	return ShaHmac1(stringToSign, secret)
+}
+
+func (signer *RamRoleArnSigner) buildCommonRequest() (request *requests.CommonRequest, err error) {
+	request = requests.NewCommonRequest()
+	request.Product = "Sts"
+	request.Version = "2015-04-01"
+	request.ApiName = "AssumeRole"
+	request.Scheme = requests.HTTPS
+	request.QueryParams["RoleArn"] = signer.credential.RoleArn
+	if signer.credential.Policy != "" {
+		request.QueryParams["Policy"] = signer.credential.Policy
+	}
+	request.QueryParams["RoleSessionName"] = signer.credential.RoleSessionName
+	request.QueryParams["DurationSeconds"] = strconv.Itoa(signer.credentialExpiration)
+	return
+}
+
+func (signer *RamRoleArnSigner) refreshApi(request *requests.CommonRequest) (response *responses.CommonResponse, err error) {
+	credential := &credentials.AccessKeyCredential{
+		AccessKeyId:     signer.credential.AccessKeyId,
+		AccessKeySecret: signer.credential.AccessKeySecret,
+	}
+	signerV1 := NewAccessKeySigner(credential)
+	return signer.commonApi(request, signerV1)
+}
+
+func (signer *RamRoleArnSigner) refreshCredential(response *responses.CommonResponse) (err error) {
+	if response.GetHttpStatus() != http.StatusOK {
+		message := "refresh session token failed"
+		err = errors.NewServerError(response.GetHttpStatus(), response.GetHttpContentString(), message)
+		return
+	}
+	var data interface{}
+	err = json.Unmarshal(response.GetHttpContentBytes(), &data)
+	if err != nil {
+		return fmt.Errorf("refresh RoleArn sts token err, json.Unmarshal fail: %s", err.Error())
+	}
+	accessKeyId, err := jmespath.Search("Credentials.AccessKeyId", data)
+	if err != nil {
+		return fmt.Errorf("refresh RoleArn sts token err, fail to get AccessKeyId: %s", err.Error())
+	}
+	accessKeySecret, err := jmespath.Search("Credentials.AccessKeySecret", data)
+	if err != nil {
+		return fmt.Errorf("refresh RoleArn sts token err, fail to get AccessKeySecret: %s", err.Error())
+	}
+	securityToken, err := jmespath.Search("Credentials.SecurityToken", data)
+	if err != nil {
+		return fmt.Errorf("refresh RoleArn sts token err, fail to get SecurityToken: %s", err.Error())
+	}
+	if accessKeyId == nil || accessKeySecret == nil || securityToken == nil {
+		return
+	}
+	signer.sessionCredential = &SessionCredential{
+		AccessKeyId:     accessKeyId.(string),
+		AccessKeySecret: accessKeySecret.(string),
+		StsToken:        securityToken.(string),
+	}
+	return
+}
+
+func (signer *RamRoleArnSigner) GetSessionCredential() *SessionCredential {
+	return signer.sessionCredential
+}

+ 204 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ram_role_arn_test.go

@@ -0,0 +1,204 @@
+package signers
+
+import (
+	"bytes"
+	"fmt"
+	"io/ioutil"
+	"net/http"
+	"strconv"
+	"strings"
+	"testing"
+
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+	"github.com/stretchr/testify/assert"
+)
+
+func Test_NewRamRoleArnSigner(t *testing.T) {
+	c := credentials.NewRamRoleArnCredential("accessKeyId", "accessKeySecret", "roleArn", "roleSessionName", 3500)
+	signer, err := NewRamRoleArnSigner(c, nil)
+	assert.Nil(t, err)
+	assert.Equal(t, "roleSessionName", signer.roleSessionName)
+	assert.Equal(t, 3500, signer.credentialExpiration)
+
+	assert.Equal(t, "HMAC-SHA1", signer.GetName())
+	assert.Equal(t, "", signer.GetType())
+	assert.Equal(t, "1.0", signer.GetVersion())
+
+	c = credentials.NewRamRoleArnCredential("accessKeyId", "accessKeySecret", "roleArn", "", 0)
+	signer, err = NewRamRoleArnSigner(c, nil)
+	assert.Nil(t, err)
+	assert.True(t, strings.HasPrefix(signer.roleSessionName, "aliyun-go-sdk-"))
+	assert.Equal(t, 3600, signer.credentialExpiration)
+
+	c = credentials.NewRamRoleArnCredential("accessKeyId", "accessKeySecret", "roleArn", "", 100)
+	signer, err = NewRamRoleArnSigner(c, nil)
+	assert.NotNil(t, err)
+	assert.Equal(t, "[SDK.InvalidParam] Assume Role session duration should be in the range of 15min - 1Hr", err.Error())
+}
+
+func Test_RamRoleArn_buildCommonRequest(t *testing.T) {
+	c := credentials.NewRamRoleArnCredential("accessKeyId", "accessKeySecret", "roleArn", "roleSessionName", 3600)
+	s, err := NewRamRoleArnSigner(c, func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error) {
+		return nil, fmt.Errorf("common api fails")
+	})
+	assert.Nil(t, err)
+	request, err := s.buildCommonRequest()
+	assert.Nil(t, err)
+	assert.NotNil(t, request)
+	assert.Equal(t, "Sts", request.Product)
+	assert.Equal(t, "2015-04-01", request.Version)
+	assert.Equal(t, "AssumeRole", request.ApiName)
+	assert.Equal(t, "HTTPS", request.Scheme)
+	assert.Equal(t, "roleArn", request.QueryParams["RoleArn"])
+	assert.Equal(t, "roleSessionName", request.QueryParams["RoleSessionName"])
+	assert.Equal(t, "3600", request.QueryParams["DurationSeconds"])
+	assert.Nil(t, s.GetSessionCredential())
+}
+
+func Test_RamRoleArn_GetAccessKeyId(t *testing.T) {
+	c := credentials.NewRamRoleArnCredential("accessKeyId", "accessKeySecret", "roleArn", "roleSessionName", 3600)
+	s, err := NewRamRoleArnSigner(c, func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error) {
+		return nil, fmt.Errorf("common api fails")
+	})
+	assert.Nil(t, err)
+	assert.NotNil(t, s)
+	accessKeyId, err := s.GetAccessKeyId()
+	assert.Equal(t, "common api fails", err.Error())
+	assert.Equal(t, "", accessKeyId)
+}
+
+func Test_RamRoleArn_GetAccessKeyId2(t *testing.T) {
+	// default response is not OK
+	c := credentials.NewRamRoleArnCredential("accessKeyId", "accessKeySecret", "roleArn", "roleSessionName", 3600)
+	s, err := NewRamRoleArnSigner(c, func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error) {
+		return responses.NewCommonResponse(), nil
+	})
+	assert.Nil(t, err)
+	assert.NotNil(t, s)
+	// s.lastUpdateTimestamp = time.Now().Unix() - 1000
+	accessKeyId, err := s.GetAccessKeyId()
+	assert.Equal(t, "SDK.ServerError\nErrorCode: \nRecommend: refresh session token failed\nRequestId: \nMessage: ", err.Error())
+	assert.Equal(t, "", accessKeyId)
+}
+
+func Test_RamRoleArn_GetAccessKeyId3(t *testing.T) {
+	c := credentials.NewRamRoleArnCredential("accessKeyId", "accessKeySecret", "roleArn", "roleSessionName", 3600)
+	// Mock the 200 response and invalid json
+	s, err := NewRamRoleArnSigner(c, func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error) {
+		res := responses.NewCommonResponse()
+		statusCode := 200
+		status := strconv.Itoa(statusCode)
+		httpresp := &http.Response{
+			Proto:      "HTTP/1.1",
+			ProtoMajor: 1,
+			Header:     make(http.Header),
+			StatusCode: statusCode,
+			Status:     status + " " + http.StatusText(statusCode),
+		}
+		httpresp.Body = ioutil.NopCloser(bytes.NewReader([]byte("invalid json")))
+		responses.Unmarshal(res, httpresp, "JSON")
+		return res, nil
+	})
+	assert.Nil(t, err)
+	assert.NotNil(t, s)
+	// s.lastUpdateTimestamp = time.Now().Unix() - 1000
+	accessKeyId, err := s.GetAccessKeyId()
+	assert.NotNil(t, err)
+	assert.Equal(t, "refresh RoleArn sts token err, json.Unmarshal fail: invalid character 'i' looking for beginning of value", err.Error())
+	assert.Equal(t, "", accessKeyId)
+}
+
+func Test_RamRoleArn_GetAccessKeyId4(t *testing.T) {
+	c := credentials.NewRamRoleArnCredential("accessKeyId", "accessKeySecret", "roleArn", "roleSessionName", 3600)
+	// Mock the 200 response and invalid json
+	s, err := NewRamRoleArnSigner(c, func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error) {
+		res := responses.NewCommonResponse()
+		statusCode := 200
+		header := make(http.Header)
+		status := strconv.Itoa(statusCode)
+		httpresp := &http.Response{
+			Proto:      "HTTP/1.1",
+			ProtoMajor: 1,
+			Header:     header,
+			StatusCode: statusCode,
+			Status:     status + " " + http.StatusText(statusCode),
+		}
+		httpresp.Header = make(http.Header)
+		httpresp.Body = ioutil.NopCloser(bytes.NewReader([]byte("{}")))
+		responses.Unmarshal(res, httpresp, "JSON")
+		return res, nil
+	})
+	assert.Nil(t, err)
+	assert.NotNil(t, s)
+	// s.lastUpdateTimestamp = time.Now().Unix() - 1000
+	accessKeyId, err := s.GetAccessKeyId()
+	assert.Nil(t, err)
+	assert.Equal(t, "", accessKeyId)
+}
+
+func Test_RamRoleArn_GetAccessKeyIdAndSign(t *testing.T) {
+	c := credentials.NewRamRoleArnCredential("accessKeyId", "accessKeySecret", "roleArn", "roleSessionName", 3600)
+	// mock 200 response and valid json and valid result
+	s, err := NewRamRoleArnSigner(c, func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error) {
+		res := responses.NewCommonResponse()
+		statusCode := 200
+		header := make(http.Header)
+		status := strconv.Itoa(statusCode)
+		httpresp := &http.Response{
+			Proto:      "HTTP/1.1",
+			ProtoMajor: 1,
+			Header:     header,
+			StatusCode: statusCode,
+			Status:     status + " " + http.StatusText(statusCode),
+		}
+
+		json := `{"Credentials":{"AccessKeyId":"access key id","AccessKeySecret": "access key secret","SecurityToken":"security token"}}`
+		httpresp.Body = ioutil.NopCloser(bytes.NewReader([]byte(json)))
+		responses.Unmarshal(res, httpresp, "JSON")
+		return res, nil
+	})
+	assert.Nil(t, err)
+	assert.NotNil(t, s)
+	// s.lastUpdateTimestamp = time.Now().Unix() - 1000
+	accessKeyId, err := s.GetAccessKeyId()
+	assert.Nil(t, err)
+	assert.Equal(t, "access key id", accessKeyId)
+
+	params := s.GetExtraParam()
+	assert.NotNil(t, params)
+	assert.Len(t, params, 1)
+	assert.Equal(t, "security token", params["SecurityToken"])
+	// assert.Nil(t, err)
+	signature := s.Sign("string to sign", "/")
+	assert.Equal(t, "dcM4bWGEoD5QUp9xhLW3SfcWfgs=", signature)
+}
+
+func Test_RamRoleArn_GetExtraParam_Fail(t *testing.T) {
+	c := credentials.NewRamRoleArnWithPolicyCredential("accessKeyId", "accessKeySecret", "roleArn", "roleSessionName", "policy", 3600)
+	// mock 200 response and valid json and valid result
+	s, err := NewRamRoleArnSigner(c, func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error) {
+		res := responses.NewCommonResponse()
+		statusCode := 200
+		header := make(http.Header)
+		status := strconv.Itoa(statusCode)
+		httpresp := &http.Response{
+			Proto:      "HTTP/1.1",
+			ProtoMajor: 1,
+			Header:     header,
+			StatusCode: statusCode,
+			Status:     status + " " + http.StatusText(statusCode),
+		}
+
+		json := `{"Credentials":{"AccessKeyId":"access key id","AccessKeySecret": "access key secret","SecurityToken":""}}`
+		httpresp.Body = ioutil.NopCloser(bytes.NewReader([]byte(json)))
+		responses.Unmarshal(res, httpresp, "JSON")
+		return res, nil
+	})
+	assert.Nil(t, err)
+	assert.NotNil(t, s)
+
+	params := s.GetExtraParam()
+	assert.Len(t, params, 0)
+}

+ 54 - 0
common/src/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_sts_token.go

@@ -0,0 +1,54 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package signers
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+)
+
+type StsTokenSigner struct {
+	credential *credentials.StsTokenCredential
+}
+
+func NewStsTokenSigner(credential *credentials.StsTokenCredential) *StsTokenSigner {
+	return &StsTokenSigner{
+		credential: credential,
+	}
+}
+
+func (*StsTokenSigner) GetName() string {
+	return "HMAC-SHA1"
+}
+
+func (*StsTokenSigner) GetType() string {
+	return ""
+}
+
+func (*StsTokenSigner) GetVersion() string {
+	return "1.0"
+}
+
+func (signer *StsTokenSigner) GetAccessKeyId() (accessKeyId string, err error) {
+	return signer.credential.AccessKeyId, nil
+}
+
+func (signer *StsTokenSigner) GetExtraParam() map[string]string {
+	return map[string]string{"SecurityToken": signer.credential.AccessKeyStsToken}
+}
+
+func (signer *StsTokenSigner) Sign(stringToSign, secretSuffix string) string {
+	secret := signer.credential.AccessKeySecret + secretSuffix
+	return ShaHmac1(stringToSign, secret)
+}

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.