Brak opisu

haowei.yao 27c21f853d CAS SDK Auto Released By lihai.zhang,Version:1.50.8 6 lat temu
integration 6897f62c34 perfect the integration(4) 6 lat temu
sdk 709a0dadd6 repair the debug method 7 lat temu
services 27c21f853d CAS SDK Auto Released By lihai.zhang,Version:1.50.8 6 lat temu
vendor d35e7375af remove useless log 7 lat temu
.gitignore 1e688463b8 Add debug method for display debug info controled under env DEBUG variable 7 lat temu
.travis.yml b36f16f178 only run intergration test in master 7 lat temu
ChangeLog.txt 27c21f853d CAS SDK Auto Released By lihai.zhang,Version:1.50.8 6 lat temu
Gopkg.lock d35e7375af remove useless log 7 lat temu
Gopkg.toml d35e7375af remove useless log 7 lat temu
LICENSE e2e8a5b9ca Initial commit 8 lat temu
Makefile 2bfaebf0dd add test cases for signer_ram_role_arn.go 7 lat temu
README.md 98ffbbdc92 增加 API Explorer 链接,帮助用户快速调试和体验API、生成SDK Demo示例 7 lat temu
README_zh.md 96ad168e83 增加 API Explorer 链接,帮助用户快速调试和体验API、生成SDK Demo示例 7 lat temu

README.md

Alibaba Cloud Go Software Development Kit

Build Status Go Report Card codecov FOSSA Status

See 中文文档

The Alibaba Cloud Go Software Development Kit (SDK) 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 Go SDK.

If you have any problem while using Go SDK, please submit an issue.

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. It is highly recommended.

Prerequisites

  • To use Alibaba Cloud Go SDK, you must have an Alibaba Cloud account as well as an AccessKey.

    The AccessKey is required when initializing AcsClient. You can create an AccessKey in the Alibaba Cloud console. For more information, see Create an AccessKey.

    Note: To increase the security of your account, we recommend that you use the AccessKey of the RAM user to access Alibaba Cloud services.

  • To use Alibaba Cloud Go SDK to access the APIs of a product, you must first activate the product on the Alibaba Cloud console if required.

Installation

Run the following commands to install Alibaba Cloud Go SDK:

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

Using

The following code example shows the three main steps to use Alibaba Cloud Go SDK:

  1. Create the client.
  2. Create an API request and set parameters.
  3. Initiate the request and handle exceptions.
package main

import (
    "fmt"

    "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
    "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
)

func main() {
    // Create an ECS client
    ecsClient, err := ecs.NewClientWithAccessKey(
        "<your-region-id>",         // Your Region ID
        "<your-access-key-id>",     // Your AccessKey ID
        "<your-access-key-secret>") // Your AccessKey Secret
    if err != nil {
        // Handle exceptions
        panic(err)
    }
    // Create an API request and set parameters
    request := ecs.CreateDescribeInstancesRequest()
    // Set the request.PageSize to "10"
    request.PageSize = requests.NewInteger(10)
    // Initiate the request and handle exceptions
    response, err := ecsClient.DescribeInstances(request)
    if err != nil {
        // Handle exceptions
        panic(err)
    }
    fmt.Println(response)
}

License

FOSSA Status