MyGit
🚩收到GitHub仓库的更新通知

aliyun/alibaba-cloud-sdk-go

Fork: 266 Star: 1146 (更新于 2024-05-13 02:57:39)

license: Apache-2.0

Language: Go .

Alibaba Cloud SDK for Go

最后发布版本: v1.62.734 ( 2024-05-11 11:05:53)

GitHub网址

✨免费申请网站SSL证书,支持多域名和泛域名,点击查看

English | 简体中文

Alibaba Cloud SDK for Go

Go codecov FOSSA Status

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.

Troubleshoot

Troubleshoot Provide OpenAPI diagnosis service to help developers locate quickly and provide solutions for developers through RequestID or error 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 the Requirements, such as installing a Go environment which is new than 1.13.x.

Installation

Use go 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 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 aCertification     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

最近版本更新:(数据更新于 2024-05-13 02:57:24)

2024-05-11 11:05:53 v1.62.734

2024-05-08 16:07:33 v1.62.733

2024-05-08 11:52:02 v1.62.732

2024-05-06 16:43:41 v1.62.731

2024-04-30 23:15:53 v1.62.730

2024-04-30 15:05:53 v1.62.729

2024-04-29 16:00:06 v1.62.728

2024-04-28 16:45:56 v1.62.727

2024-04-26 17:49:02 v1.62.726

2024-04-26 16:39:58 v1.62.725

主题(topics):

alibaba, alibaba-cloud, aliyun, dns, ecs, go, rds, sdk, slb

aliyun/alibaba-cloud-sdk-go同语言 Go最近更新仓库

2024-05-18 17:58:05 SagerNet/sing-box

2024-05-18 06:38:00 dolthub/dolt

2024-05-18 04:35:49 containerd/containerd

2024-05-18 02:28:56 aws/aws-sdk-go

2024-05-18 00:27:14 aurora-develop/aurora

2024-05-17 16:35:04 bnb-chain/bsc