https://github.com/baidu/baiducloud-sdk-go
Go SDK for Baidu Cloud
https://github.com/baidu/baiducloud-sdk-go
Last synced: 5 months ago
JSON representation
Go SDK for Baidu Cloud
- Host: GitHub
- URL: https://github.com/baidu/baiducloud-sdk-go
- Owner: baidu
- License: apache-2.0
- Created: 2018-11-09T04:59:58.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-22T08:39:03.000Z (almost 6 years ago)
- Last Synced: 2024-06-19T06:56:32.732Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 125 KB
- Stars: 23
- Watchers: 11
- Forks: 8
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BaiduCloud SDK for Go
[](https://godoc.org/github.com/baidu/baiducloud-sdk-go)
[](https://travis-ci.org/baidu/baiducloud-sdk-go)
[](https://goreportcard.com/report/github.com/baidu/baiducloud-sdk-go)> 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)](https://cloud.baidu.com/doc/BCC/ProductDescription.html), [Baidu Load Balancer (BLB)](https://cloud.baidu.com/doc/BLB/ProductDescription.html), [Baidu Object Storage (BOS)](https://cloud.baidu.com/doc/BOS/ProductDescription.html), [Cloud Disk Service (CDS)](https://cloud.baidu.com/doc/CDS/ProductDescription.html), [Elastic IP (EIP)](https://cloud.baidu.com/doc/EIP/ProductDescription.html), [Virtual Private Cloud (VPC)](https://cloud.baidu.com/doc/VPC/ProductDescription.html), etc.
## Installing
Go >= 1.8 is required.
```bash
go get -u github.com/baidu/baiducloud-sdk-go/...
```## Usage
This example shows a complete example to list all eips in some region.
```golang
package mainimport (
"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
}
```## Contributors
- Guoyao Wu @guoyao
- Guoyan Chen @drinktee
- Yuxiao Song
- Hongbin Mao @hello2mao
- Yang Meng @m3ngyang
- Weidong Cai @cwdsuzhou## License
This SDK is distributed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).