This sdk is still under development and may be changed frequently.
baiudcloud-sdk-go is the official BaiudCloud SDK for the Go programming language, supporting convenient access to cloud resources, including Baidu Cloud Compute (BCC), Baidu Load Balancer (BLB), Baidu Object Storage (BOS), Cloud Disk Service (CDS), Elastic IP (EIP), Virtual Private Cloud (VPC), etc.
Go >= 1.8 is required.
go get -u github.com/baidu/baiducloud-sdk-go/...
This example shows a complete example to list all eips in some region.
package main
import (
"fmt"
"time"
"github.com/baidu/baiducloud-sdk-go/bce"
"github.com/baidu/baiducloud-sdk-go/eip"
)
func main() {
cred, err := bce.NewCredentialsFromFile("example/main/aksk.json")
if err != nil {
panic(err)
}
bceConf := &bce.Config{
Credentials: cred,
Checksum: true,
Timeout: 5 * time.Second,
Region: "bj",
}
eipClient := eip.NewEIPClient(bceConf)
eipClient.SetDebug(true)
eips, err := eipClient.GetEips(nil, nil)
if err != nil {
panic(err)
}
for idx, ip := range eips {
fmt.Printf("%d, %s\n", idx, ip.Eip)
}
return
}
- Guoyao Wu @guoyao
- Guoyan Chen @drinktee
- Yuxiao Song
- Hongbin Mao @hello2mao
- Yang Meng @m3ngyang
- Weidong Cai @cwdsuzhou
This SDK is distributed under the Apache License, Version 2.0.