clientcloudavenue

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MPL-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBearerToken added in v0.3.0

func GetBearerToken() string

GetBearerToken - Returns the bearer token

func Init

func Init(opts Opts) (err error)

Init - Initializes the client

func ToError

func ToError(e *APIErrorResponse) error

ToError - Converts an APIErrorResponse to an error

Types

type APIErrorResponse

type APIErrorResponse struct {
	Code    string `json:"code"`
	Reason  string `json:"reason"`
	Message string `json:"message"`
}

func (*APIErrorResponse) FormatError

func (e *APIErrorResponse) FormatError() string

FormatError - Formats the error

type Client

type Client struct {
	*resty.Client
}

func New

func New() (*Client, error)

New creates a new cloudavenue client.

type Opts

type Opts struct {
	Endpoint   string `env:"ENDPOINT,default=https://console1.cloudavenue.orange-business.com"`
	Username   string `env:"USERNAME"`
	Password   string `env:"PASSWORD"`
	Org        string `env:"ORG"`
	VDC        string `env:"VDC"`
	Debug      bool   `env:"DEBUG,default=false"`
	VCDVersion string `env:"VCD_VERSION,default=37.2"`
}

Opts - Is a struct that contains the options for the vmware client

Jump to

Keyboard shortcuts

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