govcloudair

package
v0.1.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2015 License: Apache-2.0, MPL-2.0, Apache-2.0 Imports: 12 Imported by: 0

README

govcloudair

This package provides the govcloudair package which offers an interface to the vCloud Air 5.6 API.

It serves as a foundation for a project currently in development, there are plans to make it a general purpose API in the future.

The API is currently under heavy development, its coverage is extremely limited at the moment.

Documentation

Overview

Package govcloudair provides a simple binding for vCloud Air REST APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

type Catalog struct {
	Catalog *types.Catalog
	// contains filtered or unexported fields
}

func NewCatalog

func NewCatalog(c *Client) *Catalog

func (*Catalog) FindCatalogItem

func (c *Catalog) FindCatalogItem(catalogitem string) (CatalogItem, error)

type CatalogItem

type CatalogItem struct {
	CatalogItem *types.CatalogItem
	// contains filtered or unexported fields
}

func NewCatalogItem

func NewCatalogItem(c *Client) *CatalogItem

func (*CatalogItem) GetVAppTemplate

func (ci *CatalogItem) GetVAppTemplate() (VAppTemplate, error)

type Client

type Client struct {
	VAToken       string      // vCloud Air authorization token
	VAEndpoint    url.URL     // vCloud Air API endpoint
	Region        string      // Region where the compute resource lives.
	VCDToken      string      // Access Token (authorization header)
	VCDAuthHeader string      // Authorization header
	VCDVDCHREF    url.URL     // HREF of the backend VDC you're using
	Http          http.Client // HttpClient is the client to use. Default will be used if not provided.
}

Client provides a client to vCloud Air, values can be populated automatically using the Authenticate method.

func NewClient

func NewClient() (*Client, error)

NewClient returns a new empty client to authenticate against the vCloud Air service, the vCloud Air endpoint can be overridden by setting the VCLOUDAIR_ENDPOINT environment variable.

func (*Client) Authenticate

func (c *Client) Authenticate(username, password, computeid, vdcid string) (Vdc, error)

Authenticate is an helper function that performs a complete login in vCloud Air and in the backend vCloud Director instance.

func (*Client) Disconnect

func (c *Client) Disconnect() error

Disconnect performs a disconnection from the vCloud Air API endpoint.

func (*Client) NewRequest

func (c *Client) NewRequest(params map[string]string, method string, u url.URL, body io.Reader) *http.Request

NewRequest creates a new HTTP request and applies necessary auth headers if set.

type EdgeGateway

type EdgeGateway struct {
	EdgeGateway *types.EdgeGateway
	// contains filtered or unexported fields
}

func NewEdgeGateway

func NewEdgeGateway(c *Client) *EdgeGateway

func (*EdgeGateway) Create1to1Mapping

func (e *EdgeGateway) Create1to1Mapping(internal, external, description string) (Task, error)

func (*EdgeGateway) Refresh

func (e *EdgeGateway) Refresh() error

func (*EdgeGateway) Remove1to1Mapping

func (e *EdgeGateway) Remove1to1Mapping(internal, external string) (Task, error)

type Org

type Org struct {
	Org *types.Org
	// contains filtered or unexported fields
}

func NewOrg

func NewOrg(c *Client) *Org

func (*Org) FindCatalog

func (o *Org) FindCatalog(catalog string) (Catalog, error)

type OrgVDCNetwork

type OrgVDCNetwork struct {
	OrgVDCNetwork *types.OrgVDCNetwork
	// contains filtered or unexported fields
}

func NewOrgVDCNetwork

func NewOrgVDCNetwork(c *Client) *OrgVDCNetwork

type Task

type Task struct {
	Task *types.Task
	// contains filtered or unexported fields
}

func NewTask

func NewTask(c *Client) *Task

func (*Task) Refresh

func (t *Task) Refresh() error

func (*Task) WaitTaskCompletion

func (t *Task) WaitTaskCompletion() error

type VApp

type VApp struct {
	VApp *types.VApp
	// contains filtered or unexported fields
}

func NewVApp

func NewVApp(c *Client) *VApp

func (*VApp) ChangeCPUcount

func (v *VApp) ChangeCPUcount(size int) (Task, error)

func (*VApp) ChangeMemorySize

func (v *VApp) ChangeMemorySize(size int) (Task, error)

func (*VApp) ComposeVApp

func (v *VApp) ComposeVApp(orgvdcnetwork OrgVDCNetwork, vapptemplate VAppTemplate, name string, description string) (Task, error)

func (*VApp) Delete

func (v *VApp) Delete() (Task, error)

func (*VApp) Deploy

func (v *VApp) Deploy() (Task, error)

func (*VApp) GetStatus

func (v *VApp) GetStatus() (string, error)

func (*VApp) PowerOff

func (v *VApp) PowerOff() (Task, error)

func (*VApp) PowerOn

func (v *VApp) PowerOn() (Task, error)

func (*VApp) Reboot

func (v *VApp) Reboot() (Task, error)

func (*VApp) Refresh

func (v *VApp) Refresh() error

func (*VApp) Reset

func (v *VApp) Reset() (Task, error)

func (*VApp) RunCustomizationScript

func (v *VApp) RunCustomizationScript(computername, script string) (Task, error)

func (*VApp) Shutdown

func (v *VApp) Shutdown() (Task, error)

func (*VApp) Suspend

func (v *VApp) Suspend() (Task, error)

func (*VApp) Undeploy

func (v *VApp) Undeploy() (Task, error)

type VAppTemplate

type VAppTemplate struct {
	VAppTemplate *types.VAppTemplate
	// contains filtered or unexported fields
}

func NewVAppTemplate

func NewVAppTemplate(c *Client) *VAppTemplate

type Vdc

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

func NewVdc

func NewVdc(c *Client) *Vdc

func (*Vdc) FindEdgeGateway

func (v *Vdc) FindEdgeGateway(edgegateway string) (EdgeGateway, error)

func (*Vdc) FindVAppByID

func (v *Vdc) FindVAppByID(vappid string) (VApp, error)

func (*Vdc) FindVAppByName

func (v *Vdc) FindVAppByName(vapp string) (VApp, error)

func (*Vdc) FindVDCNetwork

func (v *Vdc) FindVDCNetwork(network string) (OrgVDCNetwork, error)

func (*Vdc) GetVDCOrg

func (v *Vdc) GetVDCOrg() (Org, error)

func (*Vdc) Refresh

func (v *Vdc) Refresh() error

Directories

Path Synopsis
types
v56

Jump to

Keyboard shortcuts

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