Documentation
¶
Index ¶
- func IsQueryMethod(method string) bool
- type Client
- func (c *Client) CreateVirtualMachine(details *CreateVirtualMachine) (*VirtualMachine, error)
- func (c *Client) DeleteVirtualMachine(uuid string) error
- func (c *Client) DoRequest(method string, endpoint string, params interface{}, result interface{}) (*http.Response, error)
- func (c *Client) GetPackage(uuid string) (*Package, error)
- func (c *Client) GetTemplate(uuid string) (*Template, error)
- func (c *Client) GetVirtualMachine(uuid string) (*VirtualMachine, error)
- func (c *Client) GetZone(uuid string) (*Zone, error)
- func (c *Client) ListPackages() ([]Package, error)
- func (c *Client) ListTemplates() ([]Template, error)
- func (c *Client) ListVirtualMachines() ([]VirtualMachine, error)
- func (c *Client) ListZones() ([]Zone, error)
- func (c *Client) NewRequest(method string, endpoint string, params interface{}) (*http.Request, error)
- func (c *Client) PowerOffVirtualMachine(uuid string) error
- func (c *Client) SayHello() (*string, error)
- func (c *Client) ShutDownVirtualMachine(uuid string) error
- func (c *Client) StartVirtualMachine(uuid string) error
- func (c *Client) SuspendVirtualMachine(uuid string) error
- func (c *Client) UpdateVirtualMachine(uuid string, details *UpdateVirtualMachine) (*VirtualMachine, error)
- type CreateVirtualMachine
- type Package
- type Template
- type UpdateVirtualMachine
- type VirtualMachine
- type Zone
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsQueryMethod ¶
Types ¶
type Client ¶
type Client struct {
// Access Token
Token string
// URL to the base API to use
URL string
// HttpClient is the client to use. A client with
// default values will be used if not provided.
HTTP *http.Client
}
Client provides a client to the Contegix Cloud Classic API https://docs.contegix.com/display/CLOUDCLASSIC/
func NewCustomClient ¶
NewCustomClient returns a new Contigix client with a custom base URL. It requires an authorization token.
func (*Client) CreateVirtualMachine ¶
func (c *Client) CreateVirtualMachine(details *CreateVirtualMachine) (*VirtualMachine, error)
CreateVirtualMachine will attempt to create a new VM with the specified details. The name must be unique within your account.
func (*Client) DeleteVirtualMachine ¶
DeleteVirtualMachine will destroy the VM immediately and permanently.
func (*Client) GetPackage ¶
GetPackage returns the details for the specified VM Package
func (*Client) GetTemplate ¶
GetTemplate returns the details for the specified VM Template
func (*Client) GetVirtualMachine ¶
func (c *Client) GetVirtualMachine(uuid string) (*VirtualMachine, error)
GetVirtualMachine returns the details for the specified VM
func (*Client) ListPackages ¶
ListPackages returns an array of the available VM Packages.
func (*Client) ListTemplates ¶
ListTemplates returns an array of the available VM templates.
func (*Client) ListVirtualMachines ¶
func (c *Client) ListVirtualMachines() ([]VirtualMachine, error)
ListVirtualMachines retrieves all the VMs for the current account.
func (*Client) NewRequest ¶
func (c *Client) NewRequest(method string, endpoint string, params interface{}) (*http.Request, error)
Creates a new request with the params
func (*Client) PowerOffVirtualMachine ¶
PowerOffVirtualMachine will shut a VM down indefinitely.
func (*Client) ShutDownVirtualMachine ¶
ShutDownVirtualMachine will shut down the VM immediately.
func (*Client) StartVirtualMachine ¶
StartVirtualMachine will start (or restart) the VM.
func (*Client) SuspendVirtualMachine ¶
SuspendVirtualMachine will pause the VM for later use.
func (*Client) UpdateVirtualMachine ¶
func (c *Client) UpdateVirtualMachine(uuid string, details *UpdateVirtualMachine) (*VirtualMachine, error)
UpdateVirtualMachine allows changing the package of a VM, which adjusts the capacity and cost.
type CreateVirtualMachine ¶
type UpdateVirtualMachine ¶
type UpdateVirtualMachine struct {
PackageUUID string `form:"virtual_machine[package_uuid]"`
}
type VirtualMachine ¶
type VirtualMachine struct {
Name string `json:"name"`
UUID string `json:"uuid"`
State string `json:"state"`
IPAddresses []string `json:"ip_addresses"`
TemplateName string `json:"template_name"`
TemplateUUID string `json:"template_uuid"`
PackageName string `json:"package_name"`
PackageUUID string `json:"package_uuid"`
ZoneName string `json:"zone_name"`
ZoneUUID string `json:"zone_uuid"`
VMToolsStatus *string `json:"vm_tools_status"`
}
VirtualMachine represents the details of a Contegix VM Instance.