Documentation
¶
Index ¶
- type CloneVirtualMachineRequest
- type CreateTagRequest
- type CreateVirtualMachineRequest
- type CreateVirtualMachineRequestDisk
- type CreateVirtualMachineTemplateRequest
- type Datastore
- type DatastoreNotFoundError
- type DatastoreStatus
- type ECloudService
- type Firewall
- type FirewallConfig
- type FirewallNotFoundError
- type FirewallRole
- type GetDatastoreResponseBody
- type GetDatastoresResponseBody
- type GetFirewallConfigResponseBody
- type GetFirewallResponseBody
- type GetFirewallsResponseBody
- type GetHostResponseBody
- type GetHostsResponseBody
- type GetNetworkResponseBody
- type GetNetworksResponseBody
- type GetPodResponseBody
- type GetPodsResponseBody
- type GetSiteResponseBody
- type GetSitesResponseBody
- type GetSolutionResponseBody
- type GetSolutionsResponseBody
- type GetTagResponseBody
- type GetTagsResponseBody
- type GetTemplateResponseBody
- type GetTemplatesResponseBody
- type GetVirtualMachineResponseBody
- type GetVirtualMachinesResponseBody
- type Host
- type HostCPU
- type HostNotFoundError
- type HostRAM
- type Network
- type PatchSolutionRequest
- type PatchTagRequest
- type PatchVirtualMachineRequest
- type PatchVirtualMachineRequestDisk
- type PatchVirtualMachineRequestDiskState
- type Pod
- type PodNotFoundError
- type RenameTemplateRequest
- type Service
- func (s *Service) CloneVirtualMachine(vmID int, req CloneVirtualMachineRequest) (int, error)
- func (s *Service) CreateSolutionTag(solutionID int, req CreateTagRequest) error
- func (s *Service) CreateVirtualMachine(req CreateVirtualMachineRequest) (int, error)
- func (s *Service) CreateVirtualMachineTag(vmID int, req CreateTagRequest) error
- func (s *Service) CreateVirtualMachineTemplate(vmID int, req CreateVirtualMachineTemplateRequest) error
- func (s *Service) DeleteSolutionTag(solutionID int, tagKey string) error
- func (s *Service) DeleteSolutionTemplate(solutionID int, templateName string) error
- func (s *Service) DeleteVirtualMachine(vmID int) error
- func (s *Service) DeleteVirtualMachineTag(vmID int, tagKey string) error
- func (s *Service) GetDatastore(datastoreID int) (Datastore, error)
- func (s *Service) GetDatastores(parameters connection.APIRequestParameters) ([]Datastore, error)
- func (s *Service) GetDatastoresPaginated(parameters connection.APIRequestParameters) ([]Datastore, error)
- func (s *Service) GetFirewall(firewallID int) (Firewall, error)
- func (s *Service) GetFirewallConfig(firewallID int) (FirewallConfig, error)
- func (s *Service) GetFirewalls(parameters connection.APIRequestParameters) ([]Firewall, error)
- func (s *Service) GetFirewallsPaginated(parameters connection.APIRequestParameters) ([]Firewall, error)
- func (s *Service) GetHost(hostID int) (Host, error)
- func (s *Service) GetHosts(parameters connection.APIRequestParameters) ([]Host, error)
- func (s *Service) GetHostsPaginated(parameters connection.APIRequestParameters) ([]Host, error)
- func (s *Service) GetPod(podID int) (Pod, error)
- func (s *Service) GetPodTemplates(podID int, parameters connection.APIRequestParameters) ([]Template, error)
- func (s *Service) GetPodTemplatesPaginated(podID int, parameters connection.APIRequestParameters) ([]Template, error)
- func (s *Service) GetPods(parameters connection.APIRequestParameters) ([]Pod, error)
- func (s *Service) GetPodsPaginated(parameters connection.APIRequestParameters) ([]Pod, error)
- func (s *Service) GetSite(siteID int) (Site, error)
- func (s *Service) GetSites(parameters connection.APIRequestParameters) ([]Site, error)
- func (s *Service) GetSitesPaginated(parameters connection.APIRequestParameters) ([]Site, error)
- func (s *Service) GetSolution(solutionID int) (Solution, error)
- func (s *Service) GetSolutionDatastores(solutionID int, parameters connection.APIRequestParameters) ([]Datastore, error)
- func (s *Service) GetSolutionDatastoresPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Datastore, error)
- func (s *Service) GetSolutionFirewalls(solutionID int, parameters connection.APIRequestParameters) ([]Firewall, error)
- func (s *Service) GetSolutionFirewallsPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Firewall, error)
- func (s *Service) GetSolutionHosts(solutionID int, parameters connection.APIRequestParameters) ([]Host, error)
- func (s *Service) GetSolutionHostsPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Host, error)
- func (s *Service) GetSolutionNetworks(solutionID int, parameters connection.APIRequestParameters) ([]Network, error)
- func (s *Service) GetSolutionNetworksPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Network, error)
- func (s *Service) GetSolutionSites(solutionID int, parameters connection.APIRequestParameters) ([]Site, error)
- func (s *Service) GetSolutionSitesPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Site, error)
- func (s *Service) GetSolutionTag(solutionID int, tagKey string) (Tag, error)
- func (s *Service) GetSolutionTags(solutionID int, parameters connection.APIRequestParameters) ([]Tag, error)
- func (s *Service) GetSolutionTagsPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Tag, error)
- func (s *Service) GetSolutionTemplate(solutionID int, templateName string) (Template, error)
- func (s *Service) GetSolutionTemplates(solutionID int, parameters connection.APIRequestParameters) ([]Template, error)
- func (s *Service) GetSolutionTemplatesPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Template, error)
- func (s *Service) GetSolutionVirtualMachines(solutionID int, parameters connection.APIRequestParameters) ([]VirtualMachine, error)
- func (s *Service) GetSolutionVirtualMachinesPaginated(solutionID int, parameters connection.APIRequestParameters) ([]VirtualMachine, error)
- func (s *Service) GetSolutions(parameters connection.APIRequestParameters) ([]Solution, error)
- func (s *Service) GetSolutionsPaginated(parameters connection.APIRequestParameters) ([]Solution, error)
- func (s *Service) GetVirtualMachine(vmID int) (VirtualMachine, error)
- func (s *Service) GetVirtualMachineTag(vmID int, tagKey string) (Tag, error)
- func (s *Service) GetVirtualMachineTags(vmID int, parameters connection.APIRequestParameters) ([]Tag, error)
- func (s *Service) GetVirtualMachineTagsPaginated(vmID int, parameters connection.APIRequestParameters) ([]Tag, error)
- func (s *Service) GetVirtualMachines(parameters connection.APIRequestParameters) ([]VirtualMachine, error)
- func (s *Service) GetVirtualMachinesPaginated(parameters connection.APIRequestParameters) ([]VirtualMachine, error)
- func (s *Service) PatchSolution(solutionID int, patch PatchSolutionRequest) (int, error)
- func (s *Service) PatchSolutionTag(solutionID int, tagKey string, patch PatchTagRequest) error
- func (s *Service) PatchVirtualMachine(vmID int, patch PatchVirtualMachineRequest) error
- func (s *Service) PatchVirtualMachineTag(vmID int, tagKey string, patch PatchTagRequest) error
- func (s *Service) PowerOffVirtualMachine(vmID int) error
- func (s *Service) PowerOnVirtualMachine(vmID int) error
- func (s *Service) PowerResetVirtualMachine(vmID int) error
- func (s *Service) PowerRestartVirtualMachine(vmID int) error
- func (s *Service) PowerShutdownVirtualMachine(vmID int) error
- func (s *Service) RenameSolutionTemplate(solutionID int, templateName string, req RenameTemplateRequest) error
- type Site
- type SiteNotFoundError
- type Solution
- type SolutionEnvironment
- type SolutionNotFoundError
- type Tag
- type TagNotFoundError
- type Template
- type TemplateNotFoundError
- type VirtualMachine
- type VirtualMachineDisk
- type VirtualMachineNotFoundError
- type VirtualMachinePowerStatus
- type VirtualMachineStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloneVirtualMachineRequest ¶
type CloneVirtualMachineRequest struct { connection.APIRequestBodyDefaultValidator Name string `json:"name" validate:"required"` }
CloneVirtualMachineRequest represents a request to clone an eCloud virtual machine
func (*CloneVirtualMachineRequest) Validate ¶
func (c *CloneVirtualMachineRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type CreateTagRequest ¶
type CreateTagRequest struct { connection.APIRequestBodyDefaultValidator Key string `json:"key" validate:"required"` Value string `json:"value" validate:"required"` }
CreateTagRequest represents a request to create an eCloud tag
func (*CreateTagRequest) Validate ¶
func (c *CreateTagRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type CreateVirtualMachineRequest ¶
type CreateVirtualMachineRequest struct { connection.APIRequestBodyDefaultValidator Environment string `json:"environment" validate:"required"` Template string `json:"template" validate:"required"` TemplatePassword string `json:"template_password,omitempty"` // Count in Cores CPU int `json:"cpu" validate:"required"` // Size in GB RAM int `json:"ram" validate:"required"` // Size in GB HDD int `json:"hdd,omitempty"` Disks []CreateVirtualMachineRequestDisk `json:"hdd_disks,omitempty"` Name string `json:"name,omitempty"` ComputerName string `json:"computername,omitempty"` Tags []CreateTagRequest `json:"tags,omitempty"` Backup bool `json:"backup"` Support bool `json:"support"` Monitoring bool `json:"monitoring"` MonitoringContacts []int `json:"monitoring_contacts"` SolutionID int `json:"solution_id,omitempty"` DatastoreID int `json:"datastore_id,omitempty"` SiteID int `json:"site_id,omitempty"` NetworkID int `json:"network_id,omitempty"` ExternalIPRequired bool `json:"external_ip_required"` SSHKeys []string `json:"ssh_keys,omitempty"` }
CreateVirtualMachineRequest represents a request to create an eCloud virtual machine
func (*CreateVirtualMachineRequest) Validate ¶
func (c *CreateVirtualMachineRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type CreateVirtualMachineRequestDisk ¶
type CreateVirtualMachineRequestDisk struct { Name string `json:"name,omitempty"` // Size in GB Capacity int `json:"capacity" validate:"required"` }
CreateVirtualMachineRequestDisk represents a request to create an eCloud virtual machine disk
type CreateVirtualMachineTemplateRequest ¶ added in v1.0.7
type CreateVirtualMachineTemplateRequest struct { connection.APIRequestBodyDefaultValidator TemplateName string `json:"template_name" validate:"required"` TemplateType string `json:"template_type"` }
CreateVirtualMachineTemplateRequest represents a request to clone an eCloud virtual machine template
func (*CreateVirtualMachineTemplateRequest) Validate ¶ added in v1.0.7
func (c *CreateVirtualMachineTemplateRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type Datastore ¶
type Datastore struct { ID int `json:"id"` SolutionID int `json:"solution_id"` SiteID int `json:"site_id"` Name string `json:"name"` Status DatastoreStatus `json:"status"` // Size in GB Capacity int `json:"capacity"` // Size in GB Allocated int `json:"allocated"` // Size in GB Available int `json:"available"` }
Datastore represents an eCloud datastore
type DatastoreNotFoundError ¶
type DatastoreNotFoundError struct {
ID int
}
DatastoreNotFoundError indicates a datastore was not found within eCloud
func (*DatastoreNotFoundError) Error ¶
func (e *DatastoreNotFoundError) Error() string
type DatastoreStatus ¶
type DatastoreStatus string
const ( DatastoreStatusCompleted DatastoreStatus = "Completed" DatastoreStatusFailed DatastoreStatus = "Failed" DatastoreStatusExpanding DatastoreStatus = "Expanding" DatastoreStatusQueued DatastoreStatus = "Queued" )
func (DatastoreStatus) String ¶
func (s DatastoreStatus) String() string
type ECloudService ¶
type ECloudService interface { // Virtual Machine GetVirtualMachines(parameters connection.APIRequestParameters) ([]VirtualMachine, error) GetVirtualMachinesPaginated(parameters connection.APIRequestParameters) ([]VirtualMachine, error) GetVirtualMachine(vmID int) (VirtualMachine, error) CreateVirtualMachine(req CreateVirtualMachineRequest) (int, error) PatchVirtualMachine(vmID int, patch PatchVirtualMachineRequest) error CloneVirtualMachine(vmID int, req CloneVirtualMachineRequest) (int, error) DeleteVirtualMachine(vmID int) error PowerOnVirtualMachine(vmID int) error PowerOffVirtualMachine(vmID int) error PowerResetVirtualMachine(vmID int) error PowerShutdownVirtualMachine(vmID int) error PowerRestartVirtualMachine(vmID int) error CreateVirtualMachineTemplate(vmID int, req CreateVirtualMachineTemplateRequest) error GetVirtualMachineTags(vmID int, parameters connection.APIRequestParameters) ([]Tag, error) GetVirtualMachineTagsPaginated(vmID int, parameters connection.APIRequestParameters) ([]Tag, error) GetVirtualMachineTag(vmID int, tagKey string) (Tag, error) CreateVirtualMachineTag(vmID int, req CreateTagRequest) error PatchVirtualMachineTag(vmID int, tagKey string, patch PatchTagRequest) error DeleteVirtualMachineTag(vmID int, tagKey string) error // Solution GetSolutions(parameters connection.APIRequestParameters) ([]Solution, error) GetSolutionsPaginated(parameters connection.APIRequestParameters) ([]Solution, error) GetSolution(solutionID int) (Solution, error) PatchSolution(solutionID int, patch PatchSolutionRequest) (int, error) GetSolutionVirtualMachines(solutionID int, parameters connection.APIRequestParameters) ([]VirtualMachine, error) GetSolutionVirtualMachinesPaginated(solutionID int, parameters connection.APIRequestParameters) ([]VirtualMachine, error) GetSolutionSites(solutionID int, parameters connection.APIRequestParameters) ([]Site, error) GetSolutionSitesPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Site, error) GetSolutionDatastores(solutionID int, parameters connection.APIRequestParameters) ([]Datastore, error) GetSolutionDatastoresPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Datastore, error) GetSolutionHosts(solutionID int, parameters connection.APIRequestParameters) ([]Host, error) GetSolutionHostsPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Host, error) GetSolutionNetworks(solutionID int, parameters connection.APIRequestParameters) ([]Network, error) GetSolutionNetworksPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Network, error) GetSolutionFirewalls(solutionID int, parameters connection.APIRequestParameters) ([]Firewall, error) GetSolutionFirewallsPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Firewall, error) GetSolutionTemplates(solutionID int, parameters connection.APIRequestParameters) ([]Template, error) GetSolutionTemplatesPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Template, error) GetSolutionTemplate(solutionID int, templateName string) (Template, error) DeleteSolutionTemplate(solutionID int, templateName string) error RenameSolutionTemplate(solutionID int, templateName string, req RenameTemplateRequest) error GetSolutionTags(solutionID int, parameters connection.APIRequestParameters) ([]Tag, error) GetSolutionTagsPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Tag, error) GetSolutionTag(solutionID int, tagKey string) (Tag, error) CreateSolutionTag(solutionID int, req CreateTagRequest) error PatchSolutionTag(solutionID int, tagKey string, patch PatchTagRequest) error DeleteSolutionTag(solutionID int, tagKey string) error // Site GetSites(parameters connection.APIRequestParameters) ([]Site, error) GetSitesPaginated(parameters connection.APIRequestParameters) ([]Site, error) GetSite(siteID int) (Site, error) // Host GetHosts(parameters connection.APIRequestParameters) ([]Host, error) GetHostsPaginated(parameters connection.APIRequestParameters) ([]Host, error) GetHost(hostID int) (Host, error) // Datastore GetDatastores(parameters connection.APIRequestParameters) ([]Datastore, error) GetDatastoresPaginated(parameters connection.APIRequestParameters) ([]Datastore, error) GetDatastore(datastoreID int) (Datastore, error) // Firewall GetFirewalls(parameters connection.APIRequestParameters) ([]Firewall, error) GetFirewallsPaginated(parameters connection.APIRequestParameters) ([]Firewall, error) GetFirewall(firewallID int) (Firewall, error) GetFirewallConfig(firewallID int) (FirewallConfig, error) // Pod GetPods(parameters connection.APIRequestParameters) ([]Pod, error) GetPodsPaginated(parameters connection.APIRequestParameters) ([]Pod, error) GetPod(podID int) (Pod, error) GetPodTemplates(podID int, parameters connection.APIRequestParameters) ([]Template, error) GetPodTemplatesPaginated(podID int, parameters connection.APIRequestParameters) ([]Template, error) }
ECloudService is an interface for managing eCloud
type Firewall ¶
type Firewall struct { ID int `json:"id"` Name string `json:"name"` Hostname string `json:"hostname"` IP connection.IPAddress `json:"ip"` Role FirewallRole `json:"role"` }
Firewall represents an eCloud firewall
type FirewallConfig ¶
type FirewallConfig struct {
Config string `json:"config"`
}
FirewallConfig represents an eCloud firewall config
type FirewallNotFoundError ¶
type FirewallNotFoundError struct {
ID int
}
FirewallNotFoundError indicates a firewall was not found within eCloud
func (*FirewallNotFoundError) Error ¶
func (e *FirewallNotFoundError) Error() string
type FirewallRole ¶
type FirewallRole string
const ( FirewallRoleNA FirewallRole = "N/A" FirewallRoleMaster FirewallRole = "Master" FirewallRoleSlave FirewallRole = "Slave" )
func (FirewallRole) String ¶
func (r FirewallRole) String() string
type GetDatastoreResponseBody ¶
type GetDatastoreResponseBody struct { connection.APIResponseBody Data Datastore `json:"data"` }
GetDatastoreResponseBody represents the API response body from the GetDatastore resource
type GetDatastoresResponseBody ¶
type GetDatastoresResponseBody struct { connection.APIResponseBody Data []Datastore `json:"data"` }
GetDatastoresResponseBody represents the API response body from the GetDatastores resource
type GetFirewallConfigResponseBody ¶
type GetFirewallConfigResponseBody struct { connection.APIResponseBody Data FirewallConfig `json:"data"` }
GetFirewallConfigResponseBody represents the API response body from the GetFirewallConfig resource
type GetFirewallResponseBody ¶
type GetFirewallResponseBody struct { connection.APIResponseBody Data Firewall `json:"data"` }
GetFirewallResponseBody represents the API response body from the GetFirewall resource
type GetFirewallsResponseBody ¶
type GetFirewallsResponseBody struct { connection.APIResponseBody Data []Firewall `json:"data"` }
GetFirewallsResponseBody represents the API response body from the GetFirewalls resource
type GetHostResponseBody ¶
type GetHostResponseBody struct { connection.APIResponseBody Data Host `json:"data"` }
GetHostResponseBody represents the API response body from the GetHost resource
type GetHostsResponseBody ¶
type GetHostsResponseBody struct { connection.APIResponseBody Data []Host `json:"data"` }
GetHostsResponseBody represents the API response body from the GetHosts resource
type GetNetworkResponseBody ¶
type GetNetworkResponseBody struct { connection.APIResponseBody Data Network `json:"data"` }
GetNetworkResponseBody represents the API response body from the GetNetwork resource
type GetNetworksResponseBody ¶
type GetNetworksResponseBody struct { connection.APIResponseBody Data []Network `json:"data"` }
GetNetworksResponseBody represents the API response body from the GetNetworks resource
type GetPodResponseBody ¶
type GetPodResponseBody struct { connection.APIResponseBody Data Pod `json:"data"` }
GetPodResponseBody represents the API response body from the GetPod resource
type GetPodsResponseBody ¶
type GetPodsResponseBody struct { connection.APIResponseBody Data []Pod `json:"data"` }
GetPodsResponseBody represents the API response body from the GetPods resource
type GetSiteResponseBody ¶
type GetSiteResponseBody struct { connection.APIResponseBody Data Site `json:"data"` }
GetSiteResponseBody represents the API response body from the GetSite resource
type GetSitesResponseBody ¶
type GetSitesResponseBody struct { connection.APIResponseBody Data []Site `json:"data"` }
GetSitesResponseBody represents the API response body from the GetSites resource
type GetSolutionResponseBody ¶
type GetSolutionResponseBody struct { connection.APIResponseBody Data Solution `json:"data"` }
GetSolutionResponseBody represents the API response body from the GetSolution resource
type GetSolutionsResponseBody ¶
type GetSolutionsResponseBody struct { connection.APIResponseBody Data []Solution `json:"data"` }
GetSolutionsResponseBody represents the API response body from the GetSolutions resource
type GetTagResponseBody ¶
type GetTagResponseBody struct { connection.APIResponseBody Data Tag `json:"data"` }
GetTagResponseBody represents the API response body from the GetTag resource
type GetTagsResponseBody ¶
type GetTagsResponseBody struct { connection.APIResponseBody Data []Tag `json:"data"` }
GetTagsResponseBody represents the API response body from the GetTags resource
type GetTemplateResponseBody ¶
type GetTemplateResponseBody struct { connection.APIResponseBody Data Template `json:"data"` }
GetTemplateResponseBody represents the API response body from the GetTemplate resource
type GetTemplatesResponseBody ¶
type GetTemplatesResponseBody struct { connection.APIResponseBody Data []Template `json:"data"` }
GetTemplatesResponseBody represents the API response body from the GetTemplates resource
type GetVirtualMachineResponseBody ¶
type GetVirtualMachineResponseBody struct { connection.APIResponseBody Data VirtualMachine `json:"data"` }
GetVirtualMachineResponseBody represents the API response body from the GetVirtualMachine resource
type GetVirtualMachinesResponseBody ¶
type GetVirtualMachinesResponseBody struct { connection.APIResponseBody Data []VirtualMachine `json:"data"` }
GetVirtualMachinesResponseBody represents the API response body from the GetVirtualMachines resource
type Host ¶
type Host struct { ID int `json:"id"` SolutionID int `json:"solution_id"` PodID int `json:"pod_id"` Name string `json:"name"` CPU HostCPU `json:"cpu"` RAM HostRAM `json:"ram"` }
Host represents an eCloud host
type HostCPU ¶
type HostCPU struct { Quantity int `json:"qty"` Cores int `json:"cores"` Speed string `json:"speed"` }
HostCPU represents an eCloud host's CPU resources
type HostNotFoundError ¶
type HostNotFoundError struct {
ID int
}
HostNotFoundError indicates a host was not found within eCloud
func (*HostNotFoundError) Error ¶
func (e *HostNotFoundError) Error() string
type HostRAM ¶
type HostRAM struct { // Size in GB Capacity int `json:"capacity"` // Size in GB Reserved int `json:"reserved"` // Size in GB Allocated int `json:"allocated"` // Size in GB Available int `json:"available"` }
HostRAM represents an eCloud host's RAM resources
type PatchSolutionRequest ¶
type PatchSolutionRequest struct {
Name *string `json:"name,omitempty"`
}
PatchSolutionRequest represents an eCloud solution patch request
func (*PatchSolutionRequest) Validate ¶
func (c *PatchSolutionRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type PatchTagRequest ¶
type PatchTagRequest struct {
Value string `json:"value,omitempty"`
}
PatchTagRequest represents an eCloud tag patch request
func (*PatchTagRequest) Validate ¶
func (c *PatchTagRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type PatchVirtualMachineRequest ¶
type PatchVirtualMachineRequest struct { Name *string `json:"name,omitempty"` // Count in Cores CPU int `json:"cpu,omitempty"` // Size in GB RAM int `json:"ram,omitempty"` // KV map of hard disks, key being hard disk name, value being size in GB Disks []PatchVirtualMachineRequestDisk `json:"hdd_disks,omitempty"` }
PatchVirtualMachineRequest represents an eCloud virtual machine patch request
func (*PatchVirtualMachineRequest) Validate ¶
func (c *PatchVirtualMachineRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type PatchVirtualMachineRequestDisk ¶
type PatchVirtualMachineRequestDisk struct { UUID string `json:"uuid" validate:"required"` // Size in GB Capacity int `json:"capacity,omitempty"` State PatchVirtualMachineRequestDiskState `json:"state,omitempty"` }
PatchVirtualMachineRequestDisk represents an eCloud virtual machine patch request disk
type PatchVirtualMachineRequestDiskState ¶
type PatchVirtualMachineRequestDiskState string
const ( PatchVirtualMachineRequestDiskStatePresent PatchVirtualMachineRequestDiskState = "present" PatchVirtualMachineRequestDiskStateAbsent PatchVirtualMachineRequestDiskState = "absent" )
func (PatchVirtualMachineRequestDiskState) String ¶
func (s PatchVirtualMachineRequestDiskState) String() string
type PodNotFoundError ¶
type PodNotFoundError struct {
ID int
}
PodNotFoundError indicates a pod was not found within eCloud
func (*PodNotFoundError) Error ¶
func (e *PodNotFoundError) Error() string
type RenameTemplateRequest ¶
type RenameTemplateRequest struct { connection.APIRequestBodyDefaultValidator Destination string `json:"destination" validate:"required"` }
RenameTemplateRequest represents an eCloud template rename request
func (*RenameTemplateRequest) Validate ¶
func (c *RenameTemplateRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements ECloudService for managing eCloud via the UKFast API
func NewService ¶
func NewService(connection connection.Connection) *Service
NewService returns a new instance of eCloud Service
func (*Service) CloneVirtualMachine ¶
func (s *Service) CloneVirtualMachine(vmID int, req CloneVirtualMachineRequest) (int, error)
CloneVirtualMachine clones a virtual machine
func (*Service) CreateSolutionTag ¶
func (s *Service) CreateSolutionTag(solutionID int, req CreateTagRequest) error
CreateSolutionTag creates a new solution tag
func (*Service) CreateVirtualMachine ¶
func (s *Service) CreateVirtualMachine(req CreateVirtualMachineRequest) (int, error)
CreateVirtualMachine creates a new virtual machine
func (*Service) CreateVirtualMachineTag ¶
func (s *Service) CreateVirtualMachineTag(vmID int, req CreateTagRequest) error
CreateVirtualMachineTag creates a new virtual machine tag
func (*Service) CreateVirtualMachineTemplate ¶ added in v1.0.7
func (s *Service) CreateVirtualMachineTemplate(vmID int, req CreateVirtualMachineTemplateRequest) error
CreateVirtualMachineTemplate creates a virtual machine template
func (*Service) DeleteSolutionTag ¶
DeleteSolutionTag removes a solution tag
func (*Service) DeleteSolutionTemplate ¶ added in v1.0.7
DeleteSolutionTemplate removes a solution template
func (*Service) DeleteVirtualMachine ¶
DeleteVirtualMachine removes a virtual machine
func (*Service) DeleteVirtualMachineTag ¶
DeleteVirtualMachineTag removes a virtual machine tag
func (*Service) GetDatastore ¶
GetDatastore retrieves a single datastore by ID
func (*Service) GetDatastores ¶
func (s *Service) GetDatastores(parameters connection.APIRequestParameters) ([]Datastore, error)
GetDatastores retrieves a list of datastores
func (*Service) GetDatastoresPaginated ¶
func (s *Service) GetDatastoresPaginated(parameters connection.APIRequestParameters) ([]Datastore, error)
GetDatastoresPaginated retrieves a paginated list of datastores
func (*Service) GetFirewall ¶
GetFirewall retrieves a single firewall by ID
func (*Service) GetFirewallConfig ¶
func (s *Service) GetFirewallConfig(firewallID int) (FirewallConfig, error)
GetFirewallConfig retrieves a single firewall config by ID
func (*Service) GetFirewalls ¶
func (s *Service) GetFirewalls(parameters connection.APIRequestParameters) ([]Firewall, error)
GetFirewalls retrieves a list of firewalls
func (*Service) GetFirewallsPaginated ¶
func (s *Service) GetFirewallsPaginated(parameters connection.APIRequestParameters) ([]Firewall, error)
GetFirewallsPaginated retrieves a paginated list of firewalls
func (*Service) GetHosts ¶
func (s *Service) GetHosts(parameters connection.APIRequestParameters) ([]Host, error)
GetHosts retrieves a list of hosts
func (*Service) GetHostsPaginated ¶
func (s *Service) GetHostsPaginated(parameters connection.APIRequestParameters) ([]Host, error)
GetHostsPaginated retrieves a paginated list of hosts
func (*Service) GetPodTemplates ¶
func (s *Service) GetPodTemplates(podID int, parameters connection.APIRequestParameters) ([]Template, error)
GetPodTemplates retrieves a list of pod templates
func (*Service) GetPodTemplatesPaginated ¶
func (s *Service) GetPodTemplatesPaginated(podID int, parameters connection.APIRequestParameters) ([]Template, error)
GetPodTemplatesPaginated retrieves a paginated list of pod templates
func (*Service) GetPods ¶
func (s *Service) GetPods(parameters connection.APIRequestParameters) ([]Pod, error)
GetPods retrieves a list of pods
func (*Service) GetPodsPaginated ¶
func (s *Service) GetPodsPaginated(parameters connection.APIRequestParameters) ([]Pod, error)
GetPodsPaginated retrieves a paginated list of pods
func (*Service) GetSites ¶
func (s *Service) GetSites(parameters connection.APIRequestParameters) ([]Site, error)
GetSites retrieves a list of sites
func (*Service) GetSitesPaginated ¶
func (s *Service) GetSitesPaginated(parameters connection.APIRequestParameters) ([]Site, error)
GetSitesPaginated retrieves a paginated list of sites
func (*Service) GetSolution ¶
GetSolution retrieves a single Solution by ID
func (*Service) GetSolutionDatastores ¶
func (s *Service) GetSolutionDatastores(solutionID int, parameters connection.APIRequestParameters) ([]Datastore, error)
GetSolutionDatastores retrieves a list of datastores within a solution
func (*Service) GetSolutionDatastoresPaginated ¶
func (s *Service) GetSolutionDatastoresPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Datastore, error)
GetSolutionDatastoresPaginated retrieves a paginated list of datastores within a solution
func (*Service) GetSolutionFirewalls ¶
func (s *Service) GetSolutionFirewalls(solutionID int, parameters connection.APIRequestParameters) ([]Firewall, error)
GetSolutionFirewalls retrieves a list of firewalls within a solution
func (*Service) GetSolutionFirewallsPaginated ¶
func (s *Service) GetSolutionFirewallsPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Firewall, error)
GetSolutionFirewallsPaginated retrieves a paginated list of firewalls within a solution
func (*Service) GetSolutionHosts ¶
func (s *Service) GetSolutionHosts(solutionID int, parameters connection.APIRequestParameters) ([]Host, error)
GetSolutionHosts retrieves a list of hosts within a solution
func (*Service) GetSolutionHostsPaginated ¶
func (s *Service) GetSolutionHostsPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Host, error)
GetSolutionHostsPaginated retrieves a paginated list of hosts within a solution
func (*Service) GetSolutionNetworks ¶
func (s *Service) GetSolutionNetworks(solutionID int, parameters connection.APIRequestParameters) ([]Network, error)
GetSolutionNetworks retrieves a list of networks within a solution
func (*Service) GetSolutionNetworksPaginated ¶
func (s *Service) GetSolutionNetworksPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Network, error)
GetSolutionNetworksPaginated retrieves a paginated list of networks within a solution
func (*Service) GetSolutionSites ¶
func (s *Service) GetSolutionSites(solutionID int, parameters connection.APIRequestParameters) ([]Site, error)
GetSolutionSites retrieves a list of virtual machines within a solution
func (*Service) GetSolutionSitesPaginated ¶
func (s *Service) GetSolutionSitesPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Site, error)
GetSolutionSitesPaginated retrieves a paginated list of sites within a solution
func (*Service) GetSolutionTag ¶
GetSolutionTag retrieves a single solution tag by key
func (*Service) GetSolutionTags ¶
func (s *Service) GetSolutionTags(solutionID int, parameters connection.APIRequestParameters) ([]Tag, error)
GetSolutionTags retrieves a list of tags for a solution
func (*Service) GetSolutionTagsPaginated ¶
func (s *Service) GetSolutionTagsPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Tag, error)
GetSolutionTagsPaginated retrieves a paginated list of tags for a solution
func (*Service) GetSolutionTemplate ¶ added in v1.0.7
GetSolutionTemplate retrieves a single solution template by name
func (*Service) GetSolutionTemplates ¶
func (s *Service) GetSolutionTemplates(solutionID int, parameters connection.APIRequestParameters) ([]Template, error)
GetSolutionTemplates retrieves a list of virtual machines within a solution
func (*Service) GetSolutionTemplatesPaginated ¶
func (s *Service) GetSolutionTemplatesPaginated(solutionID int, parameters connection.APIRequestParameters) ([]Template, error)
GetSolutionTemplatesPaginated retrieves a paginated list of templates within a solution
func (*Service) GetSolutionVirtualMachines ¶
func (s *Service) GetSolutionVirtualMachines(solutionID int, parameters connection.APIRequestParameters) ([]VirtualMachine, error)
GetSolutionVirtualMachines retrieves a list of virtual machines within a solution
func (*Service) GetSolutionVirtualMachinesPaginated ¶
func (s *Service) GetSolutionVirtualMachinesPaginated(solutionID int, parameters connection.APIRequestParameters) ([]VirtualMachine, error)
GetSolutionVirtualMachinesPaginated retrieves a paginated list of virtual machines within a solution
func (*Service) GetSolutions ¶
func (s *Service) GetSolutions(parameters connection.APIRequestParameters) ([]Solution, error)
GetSolutions retrieves a list of solutions
func (*Service) GetSolutionsPaginated ¶
func (s *Service) GetSolutionsPaginated(parameters connection.APIRequestParameters) ([]Solution, error)
GetSolutionsPaginated retrieves a paginated list of solutions
func (*Service) GetVirtualMachine ¶
func (s *Service) GetVirtualMachine(vmID int) (VirtualMachine, error)
GetVirtualMachine retrieves a single virtual machine by ID
func (*Service) GetVirtualMachineTag ¶
GetVirtualMachineTag retrieves a single virtual machine tag by key
func (*Service) GetVirtualMachineTags ¶
func (s *Service) GetVirtualMachineTags(vmID int, parameters connection.APIRequestParameters) ([]Tag, error)
GetVirtualMachineTags retrieves a list of tags for a virtual machine
func (*Service) GetVirtualMachineTagsPaginated ¶
func (s *Service) GetVirtualMachineTagsPaginated(vmID int, parameters connection.APIRequestParameters) ([]Tag, error)
GetVirtualMachineTagsPaginated retrieves a paginated list of tags for a virtual machine
func (*Service) GetVirtualMachines ¶
func (s *Service) GetVirtualMachines(parameters connection.APIRequestParameters) ([]VirtualMachine, error)
GetVirtualMachines retrieves a list of virtual machines
func (*Service) GetVirtualMachinesPaginated ¶
func (s *Service) GetVirtualMachinesPaginated(parameters connection.APIRequestParameters) ([]VirtualMachine, error)
GetVirtualMachinesPaginated retrieves a paginated list of virtual machines
func (*Service) PatchSolution ¶
func (s *Service) PatchSolution(solutionID int, patch PatchSolutionRequest) (int, error)
PatchSolution patches an eCloud solution
func (*Service) PatchSolutionTag ¶
func (s *Service) PatchSolutionTag(solutionID int, tagKey string, patch PatchTagRequest) error
PatchSolutionTag patches an eCloud solution tag
func (*Service) PatchVirtualMachine ¶
func (s *Service) PatchVirtualMachine(vmID int, patch PatchVirtualMachineRequest) error
PatchVirtualMachine patches an eCloud virtual machine
func (*Service) PatchVirtualMachineTag ¶
func (s *Service) PatchVirtualMachineTag(vmID int, tagKey string, patch PatchTagRequest) error
PatchVirtualMachineTag patches an eCloud virtual machine tag
func (*Service) PowerOffVirtualMachine ¶
PowerOffVirtualMachine powers off a virtual machine
func (*Service) PowerOnVirtualMachine ¶
PowerOnVirtualMachine powers on a virtual machine
func (*Service) PowerResetVirtualMachine ¶
PowerResetVirtualMachine resets a virtual machine (hard power off)
func (*Service) PowerRestartVirtualMachine ¶
PowerRestartVirtualMachine resets a virtual machine (graceful power off)
func (*Service) PowerShutdownVirtualMachine ¶
PowerShutdownVirtualMachine shuts down a virtual machine
func (*Service) RenameSolutionTemplate ¶ added in v1.0.7
func (s *Service) RenameSolutionTemplate(solutionID int, templateName string, req RenameTemplateRequest) error
RenameSolutionTemplate renames a solution template
type Site ¶
type Site struct { ID int `json:"id"` State string `json:"state"` SolutionID int `json:"solution_id"` PodID int `json:"pod_id"` }
Site represents an eCloud site
type SiteNotFoundError ¶
type SiteNotFoundError struct {
ID int
}
SiteNotFoundError indicates a site was not found within eCloud
func (*SiteNotFoundError) Error ¶
func (e *SiteNotFoundError) Error() string
type Solution ¶
type Solution struct { ID int `json:"id"` Name string `json:"name"` Environment SolutionEnvironment `json:"environment"` PodID int `json:"pod_id"` }
Solution represents an eCloud solution
type SolutionEnvironment ¶
type SolutionEnvironment string
const ( SolutionEnvironmentHybrid SolutionEnvironment = "Hybrid" SolutionEnvironmentPrivate SolutionEnvironment = "Private" )
func (SolutionEnvironment) String ¶
func (s SolutionEnvironment) String() string
type SolutionNotFoundError ¶
type SolutionNotFoundError struct {
ID int
}
SolutionNotFoundError indicates a solution was not found within eCloud
func (*SolutionNotFoundError) Error ¶
func (e *SolutionNotFoundError) Error() string
type Tag ¶
type Tag struct { Key string `json:"key"` Value string `json:"value"` CreatedAt connection.DateTime `json:"created_at"` }
Tag represents an eCloud tag
type TagNotFoundError ¶
type TagNotFoundError struct {
Key string
}
TagNotFoundError indicates a tag was not found within eCloud
func (*TagNotFoundError) Error ¶
func (e *TagNotFoundError) Error() string
type Template ¶
type Template struct { Name string `json:"name"` // Count in Cores CPU int `json:"cpu"` // Size in GB RAM int `json:"ram"` // Size in GB HDD int `json:"hdd"` Disks []VirtualMachineDisk `json:"hdd_disks"` Platform string `json:"platform"` OperatingSystem string `json:"operating_system"` SolutionID int `json:"solution_id"` }
Template represents an eCloud template
type TemplateNotFoundError ¶
type TemplateNotFoundError struct {
Name string
}
TemplateNotFoundError indicates a template was not found within eCloud
func (*TemplateNotFoundError) Error ¶
func (e *TemplateNotFoundError) Error() string
type VirtualMachine ¶
type VirtualMachine struct { ID int `json:"id"` Name string `json:"name"` Hostname string `json:"hostname"` ComputerName string `json:"computername"` // Count in Cores CPU int `json:"cpu"` // Size in GB RAM int `json:"ram"` // Size in GB HDD int `json:"hdd"` IPInternal connection.IPAddress `json:"ip_internal"` IPExternal connection.IPAddress `json:"ip_external"` Platform string `json:"platform"` Template string `json:"template"` Backup bool `json:"backup"` Support bool `json:"support"` Environment string `json:"environment"` SolutionID int `json:"solution_id"` Status VirtualMachineStatus `json:"status"` PowerStatus string `json:"power_status"` ToolsStatus string `json:"tools_status"` Disks []VirtualMachineDisk `json:"hdd_disks"` }
VirtualMachine represents an eCloud Virtual Machine
type VirtualMachineDisk ¶
type VirtualMachineDisk struct { UUID string `json:"uuid"` Name string `json:"name"` // Size in GB Capacity int `json:"capacity"` }
VirtualMachineDisk represents an eCloud Virtual Machine disk
type VirtualMachineNotFoundError ¶
type VirtualMachineNotFoundError struct {
ID int
}
VirtualMachineNotFoundError indicates a virtual machine was not found within eCloud
func (*VirtualMachineNotFoundError) Error ¶
func (e *VirtualMachineNotFoundError) Error() string
type VirtualMachinePowerStatus ¶
type VirtualMachinePowerStatus string
const ( VirtualMachinePowerStatusOnline VirtualMachinePowerStatus = "Online" VirtualMachinePowerStatusOffline VirtualMachinePowerStatus = "Offline" )
func ParseVirtualMachinePowerStatus ¶
func ParseVirtualMachinePowerStatus(s string) (VirtualMachinePowerStatus, error)
ParseVirtualMachinePowerStatus attempts to parse a VirtualMachinePowerStatus from string
func (VirtualMachinePowerStatus) String ¶
func (s VirtualMachinePowerStatus) String() string
type VirtualMachineStatus ¶
type VirtualMachineStatus string
const ( VirtualMachineStatusComplete VirtualMachineStatus = "Complete" VirtualMachineStatusFailed VirtualMachineStatus = "Failed" VirtualMachineStatusBeingBuilt VirtualMachineStatus = "Being Built" )
func (VirtualMachineStatus) String ¶
func (s VirtualMachineStatus) String() string