Няма описание

wenzuochao 4ea1124597 Merge pull request #242 from wenzuochao/dev_3.26 преди 6 години
.github 639e410763 add issue template преди 7 години
docs d79ec311a5 modify readme to meet standard преди 6 години
integration ae22c4bc89 fix integration test преди 6 години
sdk 69d623c6d2 update endpoint config and add tools package преди 6 години
services 14d7e3f223 Generate NAS go SDK by JacksonTian преди 6 години
tools 69d623c6d2 update endpoint config and add tools package преди 6 години
vendor ddc730b9ea add Authorization to httpproxy преди 6 години
.appveyor.yml dc8a60b54c fixed CI error преди 6 години
.gitignore 1e688463b8 Add debug method for display debug info controled under env DEBUG variable преди 7 години
.travis.yml 4ce9f58813 add go 1.12.x into travis.yml and appveyor.yml преди 6 години
CONTRIBUTING.md d79ec311a5 modify readme to meet standard преди 6 години
ChangeLog.txt e14bf12251 KMS SDK Auto Released By shenshi,Version:1.53.74 преди 6 години
Gopkg.lock 7e390b4180 Update dependency package and CI config преди 6 години
Gopkg.toml 6e81423f22 update dependency (#197) преди 6 години
LICENSE e2e8a5b9ca Initial commit преди 8 години
Makefile 2bfaebf0dd add test cases for signer_ram_role_arn.go преди 7 години
README.md d79ec311a5 modify readme to meet standard преди 6 години
README_zh.md d79ec311a5 modify readme to meet standard преди 6 години

README.md

English | 简体中文

Alibaba Cloud Client for Go

Latest Stable Version License
codecov Travis Build Status Appveyor Build Status Codacy Badge Go Report Card

Alibaba Cloud Client for Go is a client tool that helps Go developers manage credentials and send requests, Alibaba Cloud SDK for Go dependency on this tool.

Online Demo

API Explorer 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:

$ 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 Go SDK:

$ 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.

Create Client

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

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

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

Issues

Opening an Issue, Issues not conforming to the guidelines may be closed immediately.

Contribution

Please make sure to read the Contributing Guide before making a pull request.

References

License

FOSSA Status