Skip to content

iij/doapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang binding for DO API

DO is IIJ DNS outsource service.

Install

  • go get -u github.com/iij/doapi

Usage for Golang users

package main

// Usage:
//   export IIJAPI_ACCESS_KEY=<YOUR ACCESSS KEY>
//   export IIJAPI_SECRET_KEY=<YOUR SECRET KEY>
//   export DOSERVICECODE=<YOUR DO CODE>

import (
	"log"
	"os"

	"github.com/iij/doapi"
	"github.com/iij/doapi/protocol"
)

func main() {
	api := doapi.NewAPI(os.Getenv("IIJAPI_ACCESS_KEY"), os.Getenv("IIJAPI_SECRET_KEY"))

    // List zones
	request := protocol.ZoneListGet{ DoServiceCode: os.Getenv("DOSERVICECODE"), }
	response := protocol.ZoneListGetResponse{}
	if err := doapi.Call(*api, request, &response); err == nil {
		for _, zone := range response.ZoneList { 
			log.Println("zone", zone)
		}
	}
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages