/nifcloud-sdk-go-v2

DEPRECATED: This repository is DEPRECATED. Switch to official SDK (https://github.com/nifcloud/nifcloud-sdk-go)

Primary LanguageGoApache License 2.0Apache-2.0

DEPRECATED: This repository is DEPRECATED. Switch to official SDK https://github.com/nifcloud/nifcloud-sdk-go

nifcloud-sdk-go-v2

nifcloud-sdk-go-v2 is the Developer Preview for the v2 of the NIFCLOUD SDK for the Go programming language.

Getting started

Installing

go get -u github.com/aokumasan/nifcloud-sdk-go-v2

Hello NIFCLOUD

package main

import (
        "fmt"
        "context"

        "github.com/aokumasan/nifcloud-sdk-go-v2/nifcloud"
        "github.com/aokumasan/nifcloud-sdk-go-v2/nifcloud/endpoints"
        "github.com/aokumasan/nifcloud-sdk-go-v2/service/computing"
)

func main() {
        // Create config with credentials and region.
        cfg := nifcloud.NewConfig(
                "YOUR_ACCESS_KEY_ID",
                "YOUR_SECRET_ACCESS_KEY",
                endpoints.JpEast1RegionID,
        )

        // Create the Computing client with Config value.
        svc := computing.New(cfg)
        req := svc.DescribeInstancesRequest(nil)

        // Send the request
        resp, err := req.Send(context.TODO())
        if err != nil {
                panic(err)
        }
        fmt.Println(resp)
}