samples

command
v1.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

README

apigeecli Client Sample

apigeecli can be used as a golang based client library. Here is a sample to get a list of orgs.


package main

import (
	"fmt"

	"github.com/srinandan/apigeecli/apiclient"
	"github.com/srinandan/apigeecli/client/orgs"
)

func main() {

	//set client options
	apiclient.NewApigeeClient(apiclient.ApigeeClientOptions{
		Org:            "apigee-org-name",
		ServiceAccount: "path-to-service-account.json",
		SkipLogInfo:    true,                             //skip printing client logs
	})

	//invoke list of orgs
	respBody, err := orgs.List()
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(respBody))
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL