| 1 | # AliyunGo: Go SDK for Aliyun Services |
| 2 | |
| 3 | [](https://travis-ci.org/denverdino/aliyungo) [](https://circleci.com/gh/denverdino/aliyungo) [](https://goreportcard.com/report/github.com/denverdino/aliyungo) |
| 4 | |
| 5 | This is an unofficial Go SDK for Aliyun services. You are welcome for contribution. |
| 6 | |
| 7 | The official SDK for Aliyun services is published. Please visit https://github.com/aliyun/alibaba-cloud-sdk-go for details |
| 8 | |
| 9 | ## Package Structure |
| 10 | |
| 11 | * cdn: [Content Delivery Network](https://help.aliyun.com/document_detail/27101.html) |
| 12 | * cms: [Cloud Monitor Service](https://help.aliyun.com/document_detail/28615.html) |
| 13 | * cs: [Container Service](https://help.aliyun.com/product/25972.html) |
| 14 | * dm: [Direct Mail](https://help.aliyun.com/document_detail/29414.html) |
| 15 | * dns: [DNS](https://help.aliyun.com/document_detail/dns/api-reference/summary.html) |
| 16 | * ecs: [Elastic Compute Service](https://help.aliyun.com/document_detail/ecs/open-api/summary.html) |
| 17 | * ess: [Auto Scaling](https://help.aliyun.com/document_detail/25857.html) |
| 18 | * mns: [Message Service](https://help.aliyun.com/document_detail/27414.html) |
| 19 | * mq: [Message Queue](https://help.aliyun.com/document_detail/29532.html) |
| 20 | * nas: [Network Attached Storage](https://help.aliyun.com/document_detail/27518.html) |
| 21 | * opensearch: [OpenSearch](https://help.aliyun.com/document_detail/29118.html) |
| 22 | * oss: [Open Storage Service](https://help.aliyun.com/document_detail/oss/api-reference/abstract.html) |
| 23 | * push: [Cloud Mobile Push](https://help.aliyun.com/document_detail/30049.html) |
| 24 | * rds: [Relational Database Service](https://help.aliyun.com/document_detail/26226.html) |
| 25 | * ram: [Resource Access Management](https://help.aliyun.com/document_detail/ram/ram-api-reference/intro/intro.html) |
| 26 | * slb: [Server Load Balancer](https://help.aliyun.com/document_detail/slb/api-reference/brief-introduction.html) |
| 27 | * sls: [Logging Service](https://help.aliyun.com/document_detail/sls/api/overview.html) |
| 28 | * sms: [Short Message Service](https://help.aliyun.com/product/44282.html) |
| 29 | * sts: [Security Token Service](https://help.aliyun.com/document_detail/28756.html) |
| 30 | * common: Common libary of Aliyun Go SDK |
| 31 | * util: Utility helpers |
| 32 | |
| 33 | ## Quick Start |
| 34 | |
| 35 | ```go |
| 36 | package main |
| 37 | |
| 38 | import ( |
| 39 | "fmt" |
| 40 | |
| 41 | "github.com/denverdino/aliyungo/ecs" |
| 42 | ) |
| 43 | |
| 44 | const ACCESS_KEY_ID = "<YOUR_ID>" |
| 45 | const ACCESS_KEY_SECRET = "<****>" |
| 46 | |
| 47 | func main() { |
| 48 | client := ecs.NewClient(ACCESS_KEY_ID, ACCESS_KEY_SECRET) |
| 49 | fmt.Print(client.DescribeRegions()) |
| 50 | } |
| 51 | |
| 52 | ``` |
| 53 | |
| 54 | ## Documentation |
| 55 | |
| 56 | * CDN: [https://godoc.org/github.com/denverdino/aliyungo/cdn](https://godoc.org/github.com/denverdino/aliyungo/cdn)[](https://godoc.org/github.com/denverdino/aliyungo/cdn) |
| 57 | * CMS: [https://godoc.org/github.com/denverdino/aliyungo/cms](https://godoc.org/github.com/denverdino/aliyungo/cms) [](https://godoc.org/github.com/denverdino/aliyungo/cms) |
| 58 | * CS: [https://godoc.org/github.com/denverdino/aliyungo/cs](https://godoc.org/github.com/denverdino/aliyungo/cs) [](https://godoc.org/github.com/denverdino/aliyungo/cs) |
| 59 | * DM: [https://godoc.org/github.com/denverdino/aliyungo/dm](https://godoc.org/github.com/denverdino/aliyungo/dm) [](https://godoc.org/github.com/denverdino/aliyungo/dm) |
| 60 | * DNS: [https://godoc.org/github.com/denverdino/aliyungo/dns](https://godoc.org/github.com/denverdino/aliyungo/dns) [](https://godoc.org/github.com/denverdino/aliyungo/dns) |
| 61 | * ECS: [https://godoc.org/github.com/denverdino/aliyungo/ecs](https://godoc.org/github.com/denverdino/aliyungo/ecs) [](https://godoc.org/github.com/denverdino/aliyungo/ecs) |
| 62 | * ESS: [https://godoc.org/github.com/denverdino/aliyungo/ess](https://godoc.org/github.com/denverdino/aliyungo/ess)[](https://godoc.org/github.com/denverdino/aliyungo/ess) |
| 63 | * MNS: [https://godoc.org/github.com/denverdino/aliyungo/mns](https://godoc.org/github.com/denverdino/aliyungo/mns)[](https://godoc.org/github.com/denverdino/aliyungo/mns) |
| 64 | * MQ: [https://godoc.org/github.com/denverdino/aliyungo/mq](https://godoc.org/github.com/denverdino/aliyungo/mq) [](https://godoc.org/github.com/denverdino/aliyungo/mq) |
| 65 | * NAS: [https://godoc.org/github.com/denverdino/aliyungo/nas](https://godoc.org/github.com/denverdino/aliyungo/nas) [](https://godoc.org/github.com/denverdino/aliyungo/nas) |
| 66 | * OPENSEARCH: [https://godoc.org/github.com/denverdino/aliyungo/opensearch](https://godoc.org/github.com/denverdino/aliyungo/opensearch) [](https://godoc.org/github.com/denverdino/aliyungo/opensearch) |
| 67 | * OSS: [https://godoc.org/github.com/denverdino/aliyungo/oss](https://godoc.org/github.com/denverdino/aliyungo/oss) [](https://godoc.org/github.com/denverdino/aliyungo/oss) |
| 68 | * PUSH: [https://godoc.org/github.com/denverdino/aliyungo/push](https://godoc.org/github.com/denverdino/aliyungo/push) [](https://godoc.org/github.com/denverdino/aliyungo/push) |
| 69 | * RAM: [https://godoc.org/github.com/denverdino/aliyungo/ram](https://godoc.org/github.com/denverdino/aliyungo/ram) [](https://godoc.org/github.com/denverdino/aliyungo/ram) |
| 70 | * RDS: [https://godoc.org/github.com/denverdino/aliyungo/rds](https://godoc.org/github.com/denverdino/aliyungo/rds) [](https://godoc.org/github.com/denverdino/aliyungo/rds) |
| 71 | * SLB: [https://godoc.org/github.com/denverdino/aliyungo/slb](https://godoc.org/github.com/denverdino/aliyungo/slb) [](https://godoc.org/github.com/denverdino/aliyungo/slb) |
| 72 | * SLS: [https://godoc.org/github.com/denverdino/aliyungo/sls](https://godoc.org/github.com/denverdino/aliyungo/sls) [](https://godoc.org/github.com/denverdino/aliyungo/sls) |
| 73 | * SMS: [https://godoc.org/github.com/denverdino/aliyungo/sms](https://godoc.org/github.com/denverdino/aliyungo/sms) [](https://godoc.org/github.com/denverdino/aliyungo/sms) |
| 74 | * STS: [https://godoc.org/github.com/denverdino/aliyungo/sts](https://godoc.org/github.com/denverdino/aliyungo/sts) [](https://godoc.org/github.com/denverdino/aliyungo/sts) |
| 75 | |
| 76 | ## Build and Install |
| 77 | |
| 78 | go get: |
| 79 | |
| 80 | ```sh |
| 81 | go get github.com/denverdino/aliyungo |
| 82 | ``` |
| 83 | |
| 84 | ## Test ECS |
| 85 | |
| 86 | Modify "ecs/config_test.go" |
| 87 | |
| 88 | ```sh |
| 89 | TestAccessKeyId = "MY_ACCESS_KEY_ID" |
| 90 | TestAccessKeySecret = "MY_ACCESS_KEY_ID" |
| 91 | TestInstanceId = "MY_INSTANCE_ID" |
| 92 | TestIAmRich = false |
| 93 | ``` |
| 94 | |
| 95 | * TestAccessKeyId: the Access Key Id |
| 96 | * TestAccessKeySecret: the Access Key Secret. |
| 97 | * TestInstanceId: the existing instance id for testing. It will be stopped and restarted during testing. |
| 98 | * TestIAmRich(Optional): If it is set to true, it will perform tests to create virtual machines and disks under your account. And you will pay the bill. :-) |
| 99 | |
| 100 | Under "ecs" and run |
| 101 | |
| 102 | ```sh |
| 103 | go test |
| 104 | ``` |
| 105 | |
| 106 | ## Test OSS |
| 107 | |
| 108 | Modify "oss/config_test.go" |
| 109 | |
| 110 | ```sh |
| 111 | TestAccessKeyId = "MY_ACCESS_KEY_ID" |
| 112 | TestAccessKeySecret = "MY_ACCESS_KEY_ID" |
| 113 | TestRegion = oss.Beijing |
| 114 | TestBucket = "denverdino" |
| 115 | ``` |
| 116 | |
| 117 | * TestAccessKeyId: the Access Key Id |
| 118 | * TestAccessKeySecret: the Access Key Secret. |
| 119 | * TestRegion: the region of OSS for testing |
| 120 | * TestBucket: the bucket name for testing |
| 121 | |
| 122 | Under "oss" and run |
| 123 | |
| 124 | ```sh |
| 125 | go test |
| 126 | ``` |
| 127 | |
| 128 | ## Contributors |
| 129 | |
| 130 | * Li Yi ([email protected]) |
| 131 | * Boshi Lian ([email protected]) |
| 132 | * Yu Zhou ([email protected]) |
| 133 | * Yufei Zhang |
| 134 | * linuxlikerqq |
| 135 | * Changhai Yan |
| 136 | * Jizhong Jiang ([email protected]) |
| 137 | * Kent Wang ([email protected]) |
| 138 | * ringtail |
| 139 | * aiden0z ([email protected]) |
| 140 | * jimmycmh |
| 141 | * menglingwei |
| 142 | * mingang.he ([email protected]) |
| 143 | * Young Chen ([email protected]) |
| 144 | * johnzeng |
| 145 | * spacexnice ([email protected]) |
| 146 | * xiaoheihero |
| 147 | * hmgle ([email protected]) |
| 148 | * jzwlqx ([email protected]) |
| 149 | * Linhua Tan ([email protected]) |
| 150 | * Plutonist ([email protected]) |
| 151 | * Bin Liu |
| 152 | * wangyue |
| 153 | * demonwy |
| 154 | * yarous224 |
| 155 | * yufeizyf ([email protected]) |
| 156 | * keontang ([email protected]) |
| 157 | * Cholerae Hu ([email protected]) |
| 158 | * Zach Bergh ([email protected]) |
| 159 | * Bingshen Wang |
| 160 | * xiaozhu36 |
| 161 | * Russell ([email protected]) |
| 162 | * zhuzhih2017 |
| 163 | * cheyang |
| 164 | * Hobo Chen |
| 165 | * Shuwei Yin |
| 166 | * Xujin Zheng ([email protected]) |
| 167 | * Dino Lai ([email protected]) |
| 168 | |
| 169 | ## License |
| 170 | |
| 171 | This project is licensed under the Apache License, Version 2.0. See [LICENSE](https://github.com/denverdino/aliyungo/blob/master/LICENSE.txt) for the full license text. |
| 172 | |
| 173 | ## Related projects |
| 174 | |
| 175 | * Aliyun ECS driver for Docker Machine: [Pull request](https://github.com/docker/machine/pull/1182) |
| 176 | |
| 177 | * Aliyun OSS driver for Docker Registry V2: [Pull request](https://github.com/docker/distribution/pull/514) |
| 178 | |
| 179 | ## References |
| 180 | |
| 181 | The GO API design of OSS refer the implementation from [https://github.com/AdRoll/goamz](https://github.com/AdRoll) |