Skip to content
This repository has been archived by the owner on Oct 4, 2020. It is now read-only.

aokumasan/nifcloud-sdk-go-v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)
}