client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package client is the main client for the CloudAvenue provider.

Package client is the main client for the CloudAvenue provider.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAuthFailed is returned when the authentication failed.
	ErrAuthFailed = errors.New("authentication error")
	// ErrTokenEmpty is returned when the token is empty.
	ErrTokenEmpty = errors.New("token is empty")
	// ErrConfigureVmware is returned when the configuration of vmware failed.
	ErrConfigureVmware = errors.New("error configuring vmware")
	ErrVCDVersionEmpty = errors.New("empty vcd version")
)
View Source
var (
	ErrEmptyOrgNameProvided = errors.New("empty Org name provided")
	ErrEmptyVDCNameProvided = errors.New("empty VDC name provided")
	ErrRetrievingOrg        = errors.New("error retrieving Org")
	ErrRetrievingOrgAdmin   = errors.New("error retrieving Org admin")
	ErrEmptyOrgFound        = errors.New("empty Org found")
	ErrRetrievingVDC        = errors.New("error retrieving VDC")
	ErrRetrievingVDCGroup   = errors.New("error retrieving VDC Group")
	ErrEmptyVDCFound        = errors.New("empty VDC found")
)

Functions

This section is empty.

Types

type AdminOrg

type AdminOrg struct {
	*govcd.AdminOrg
}

func (*AdminOrg) ListCatalogs

func (ao *AdminOrg) ListCatalogs() *govcdtypes.CatalogsList

ListCatalogs

Get the catalogs list from the admin org.

type CloudAvenue

type CloudAvenue struct {
	Org                string
	VDC                string
	User               string
	Password           string
	URL                string
	TerraformVersion   string
	CloudAvenueVersion string

	// API CLOUDAVENUE
	APIClient *apiclient.APIClient
	Auth      context.Context

	// API VMWARE
	Vmware *govcd.VCDClient

	VCDVersion string
	// contains filtered or unexported fields
}

CloudAvenue is the main struct for the CloudAvenue client.

func (*CloudAvenue) DefaultVDCExist

func (c *CloudAvenue) DefaultVDCExist() bool

DefaultVDCExist returns true if the default VDC exists.

func (*CloudAvenue) GetAdminOrg

func (c *CloudAvenue) GetAdminOrg() (*AdminOrg, error)

GetAdminOrg return the admin org using the name provided in the provider.

func (*CloudAvenue) GetDefaultVDC

func (c *CloudAvenue) GetDefaultVDC() string

GetDefaultVDC returns the default VDC.

func (*CloudAvenue) GetOrg

func (c *CloudAvenue) GetOrg() (*Org, error)

GetOrg return the org using the name provided in the provider.

func (*CloudAvenue) GetOrgAndVDC

func (c *CloudAvenue) GetOrgAndVDC(orgName, vdcName string) (org *govcd.Org, vdcOrVDCGroup VDCOrVDCGroupHandler, err error)

! Deprecated

GetOrgAndVDC

finds a pair of org and vdc using the names provided in the args. If the names are empty, it will use the default org and vdc names from the provider.

DEPRECATED: use GetOrg, GetVDC, GetVDCGroup or GetVDCOrVDCGroup instead.

func (*CloudAvenue) GetOrgName

func (c *CloudAvenue) GetOrgName() string

GetOrgName() returns the name of the organization. Deprecated: use GetOrg instead.

func (*CloudAvenue) GetURL

func (c *CloudAvenue) GetURL() string

GetURL returns the base path of the API.

func (*CloudAvenue) GetVDC

func (c *CloudAvenue) GetVDC(opts ...GetVDCOpts) (*VDC, error)

GetVDC return the vdc using the name provided in the argument. If the name is empty, it will try to use the default vdc provided in the provider.

func (*CloudAvenue) GetVDCGroup

func (c *CloudAvenue) GetVDCGroup(vdcGroupName string) (*VDCGroup, error)

GetVDCGroup return the vdc group using the name provided in the argument.

func (*CloudAvenue) GetVDCOrVDCGroup

func (c *CloudAvenue) GetVDCOrVDCGroup(vdcOrVDCGroupName string) (VDCOrVDCGroupHandler, error)

GetVDCOrVDCGroup return the vdc or vdc group using the name provided in the argument.

func (*CloudAvenue) New

func (c *CloudAvenue) New() (*CloudAvenue, error)

New creates a new CloudAvenue client.

type GetVDCOpts

type GetVDCOpts func(*VDC)

func WithVDCName

func WithVDCName(name string) GetVDCOpts

type Org

type Org struct {
	*govcd.Org
}

func (*Org) GetID

func (o *Org) GetID() string

Returns the ID of the organization.

func (*Org) GetName

func (o *Org) GetName() string

Returns the name of the organization.

type VAPP

type VAPP struct {
	*govcd.VApp
}

func (VAPP) GetDescription

func (v VAPP) GetDescription() string

GetDescription give you the status code of the vApp.

func (VAPP) GetHREF

func (v VAPP) GetHREF() string

GetHREF give you the HREF of the vApp.

func (VAPP) GetID

func (v VAPP) GetID() string

GetID give you the ID of the vApp.

func (VAPP) GetName

func (v VAPP) GetName() string

GetName give you the name of the vApp.

func (VAPP) GetStatusCode

func (v VAPP) GetStatusCode() int

GetStatusCode give you the status code of the vApp.

type VDC

type VDC struct {
	*govcd.Vdc
	// contains filtered or unexported fields
}

func (VDC) GetID

func (v VDC) GetID() string

GetID give you the ID of the vDC.

func (VDC) GetName

func (v VDC) GetName() string

GetName give you the name of the vDC.

func (VDC) GetVAPP

func (v VDC) GetVAPP(nameOrID string, refresh bool) (*VAPP, error)

GetVAPP give you the vApp using the name provided in the argument.

type VDCGroup

type VDCGroup struct {
	*govcd.VdcGroup
}

func (VDCGroup) GetID

func (g VDCGroup) GetID() string

GetID give you the ID of the vDC Group.

func (VDCGroup) GetName

func (g VDCGroup) GetName() string

GetName give you the name of the vDC Group.

type VDCOrVDCGroupHandler

type VDCOrVDCGroupHandler interface {
	GetOpenApiOrgVdcNetworkByName(string) (*govcd.OpenApiOrgVdcNetwork, error)
	GetName() string
	GetID() string
}

VDCOrVDCGroupHandler is an interface to access some common methods on VDC or VDC Group without explicitly handling exact types.

Jump to

Keyboard shortcuts

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