nifcloud-sdk-go is data-driven SDK for the Go programming language. It works by feeding AWS-SDK-compatible model JSONs to github.com/aws/aws-sdk-go-v2.
- ✔️ Support for NIFCLOUD Computing / RDB / NAS / ESS / DNS / ObjectStorageService / ServiceActivity / DevOps with GitLab APIs
- ✔️ AWS-SDK-compatible data-driven architecture
- Go 1.17 or later.
go get -u github.com/nifcloud/nifcloud-sdk-go
This example shows DescribeInstances.
package main
import (
"fmt"
"context"
"github.com/nifcloud/nifcloud-sdk-go/nifcloud"
"github.com/nifcloud/nifcloud-sdk-go/service/computing"
)
func main() {
// Create config with credentials and region.
cfg := nifcloud.NewConfig(
"YOUR_ACCESS_KEY_ID",
"YOUR_SECRET_ACCESS_KEY",
"jp-east-1",
)
// Create the Computing client with Config value.
svc := computing.NewFromConfig(cfg)
// Send the request
resp, err := svc.DescribeInstances(context.TODO(), nil)
if err != nil {
panic(err)
}
fmt.Println("Instances:")
for _, reservationSet := range resp.ReservationSet {
for _, instancesSet := range reservationSet.InstancesSet {
fmt.Println(nifcloud.ToString(instancesSet.InstanceId))
}
}
}
See LICENSE.