Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The Alibaba Cloud V1.0 Go SDK has entered End-of-Support (March 1, 2025) and is no longer recommended for use.

License

NotificationsYou must be signed in to change notification settings

aliyun/alibaba-cloud-sdk-go

Repository files navigation

English |简体中文 |日本語

Alibaba Cloud SDK for Go

GocodecovFOSSA Status

The Alibaba Cloud V1.0 Go SDK has entered End-of-Support (March 1, 2025) and is no longer recommended for use. New users should directly use the V2.0 Go SDK; users who have already integrated the V1.0 Go SDK are also advised to migrate to the V2.0 Go SDK.

Troubleshoot

Troubleshoot Provide OpenAPI diagnosis service to help developers locate quickly and provide solutions for developers throughRequestID orerror message.

Online Demo

Alibaba Cloud OpenAPI Developer Portal 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 theRequirements, such as installing a Go environment which is new than 1.13.x.

Installation

Usego get to install SDK:

go get -u github.com/aliyun/alibaba-cloud-sdk-go/sdk

Quick Examples

Before you begin, you need to sign up for an Alibaba Cloud account and retrieve yourCredentials.

Create Client

package mainimport"github.com/aliyun/alibaba-cloud-sdk-go/sdk"funcmain() {client,err:=sdk.NewClientWithAccessKey("REGION_ID","ACCESS_KEY_ID","ACCESS_KEY_SECRET")iferr!=nil {// Handle exceptionspanic(err)  }}

ROA Request

package mainimport"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"funcmain() {request:=requests.NewCommonRequest()// Make a common requestrequest.Method="GET"// Set request methodrequest.Product="CS"// Specify productrequest.Domain="cs.aliyuncs.com"// Location Service will not be enabled if the host is specified. For example, service with aCertification     type-Bearer Token should be specifiedrequest.Version="2015-12-15"// Specify product versionrequest.PathPattern="/clusters/[ClusterId]"// Specify path rule with ROA-stylerequest.Scheme="https"// Set request scheme. Default: httprequest.ApiName="DescribeCluster"// Specify product interfacerequest.QueryParams["ClusterId"]="123456"// Assign values to parameters in the pathrequest.QueryParams["RegionId"]="region_id"// Specify the requested regionId, if not specified, use the client regionId, then default regionIdrequest.TransToAcsRequest()// Trans commonrequest to acsRequest, which is used by client.}

RPC Request

package mainimport"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"funcmain() {request:=requests.NewCommonRequest()// Make a common requestrequest.Method="POST"// Set request methodrequest.Product="Ecs"// Specify productrequest.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 specifiedrequest.Version="2014-05-26"// Specify product versionrequest.Scheme="https"// Set request scheme. Default: httprequest.ApiName="CreateInstance"// Specify product interfacerequest.QueryParams["InstanceType"]="ecs.g5.large"// Assign values to parameters in the pathrequest.QueryParams["RegionId"]="region_id"// Specify the requested regionId, if not specified, use the client regionId, then default regionIdrequest.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 theContributing Guide before making a pull request.

References

License

FOSSA Status

About

The Alibaba Cloud V1.0 Go SDK has entered End-of-Support (March 1, 2025) and is no longer recommended for use.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors39

Languages


[8]ページ先頭

©2009-2025 Movatter.jp