clientcloudavenue

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MPL-2.0 Imports: 12 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
	Vmware *govcd.VCDClient
}

func New

func New() (*Client, error)

New creates a new cloudavenue client.

func (*Client) GetDebug added in v0.5.4

func (v *Client) GetDebug() bool

GetDebug - Returns the debug

func (*Client) GetEndpoint added in v0.6.0

func (v *Client) GetEndpoint() string

GetEndpoint - Returns the API endpoint

func (*Client) GetOrganization added in v0.5.4

func (v *Client) GetOrganization() string

GetOrganization - Returns the organization

func (*Client) GetOrganizationID added in v0.6.0

func (v *Client) GetOrganizationID() string

GetOrganizationID - Returns the organization ID

func (*Client) GetURL added in v0.8.0

func (v *Client) GetURL() string

GetURL - Returns the API endpoint

func (*Client) GetUsername added in v0.5.4

func (v *Client) GetUsername() string

GetUsername - Returns the username

type Opts

type Opts struct {
	Endpoint   string `env:"ENDPOINT,overwrite"` // Deprecated - use URL instead
	URL        string `env:"URL,overwrite"`      // Computed from Org if not provided
	Username   string `env:"USERNAME,overwrite"` // Required
	Password   string `env:"PASSWORD,overwrite"` // Required
	Org        string `env:"ORG,overwrite"`      // Required
	VDC        string `env:"VDC,overwrite"`
	Debug      bool   `env:"DEBUG,overwrite"`
	VCDVersion string `env:"VCD_VERSION,overwrite,default=37.2"`
}

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

func (*Opts) Validate added in v0.8.0

func (o *Opts) Validate() error

Jump to

Keyboard shortcuts

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