Documentation
¶
Overview ¶
Package egoscale is a mapping for with the CloudStack API (http://cloudstack.apache.org/api.html) from Go. It has been designed against the Exoscale (https://www.exoscale.com/) infrastructure but should fit other CloudStack services.
Requests and Responses ¶
To build a request, construct the adequate struct. This library expects a pointer for efficiency reasons only. The response is a struct corresponding to the request itself. E.g. DeployVirtualMachine gives DeployVirtualMachineResponse, as a pointer as well to avoid big copies.
Then everything within the struct is not a pointer.
Affinity and Anti-Affinity groups ¶
Affinity and Anti-Affinity groups provide a way to influence where VMs should run. See: http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/stable/virtual_machines.html#affinity-groups
APIs ¶
All the available APIs on the server and provided by the API Discovery plugin
cs := egoscale.NewClient("https://api.exoscale.ch/compute", "EXO...", "...")
resp, err := cs.Request(&egoscale.ListAPIs{})
if err != nil {
panic(err)
}
for _, api := range resp.(*egoscale.ListAPIsResponse).API {
fmt.Println("%s %s", api.Name, api.Description)
}
// Output:
// listNetworks Lists all available networks
// ...
Elastic IPs ¶
Networks ¶
NICs ¶
Security Groups ¶
Security Groups provide a way to isolate traffic to VMs.
resp, err := cs.Request(&egoscale.CreateSecurityGroup{
Name: "Load balancer",
Description: "Opens HTTP/HTTPS ports from the outside world",
})
securityGroup := resp.(*egoscale.CreateSecurityGroupResponse).SecurityGroup
// ...
err = client.BooleanRequest(&egoscale.DeleteSecurityGroup{
ID: securityGroup.ID,
})
// ...
Security Group also implement the generic Get and Delete interface (Gettable and Deletable).
sg := &egoscale.SecurityGroup{Name: "Load balancer"}
if err := cs.Get(sg); err != nil {
...
}
// The SecurityGroup has been loaded with the SecurityGroup informations
if err := cs.Delete(sg); err != nil {
...
}
// The SecurityGroup has been deleted
Service Offerings ¶
A service offering correspond to some hardware features (CPU, RAM).
SSH Key Pairs ¶
In addition to username and password (disabled on Exoscale), SSH keys are used to log into the infrastructure.
Virtual Machines ¶
The VM object is the big contenter, it implements the Get and Delete interface.
See: http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/stable/virtual_machines.html
Templates ¶
A Template corresponds to the kind of machines that can be deployed.
See: http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/latest/templates.html
Zones ¶
A Zone corresponds to a Data Center. You may list them. Zone implements the Listable interface, which let you perform a list in two different ways. The first exposes the underlying CloudStack request while the second one hide them and you only manipulate the structs of your interest.
// Using ListZones request
req := &egoscale.ListZones{}
resp, err := client.Request(req)
if err != nil {
panic(err)
}
for _, zone := range resp.(*egoscale.ListZonesResponse) {
...
}
// Using client.List
zone := &egoscale.Zone{}
zones, err := client.List(zone)
if err != nil {
panic(err)
}
for _, z := range zones {
zone := z.(egoscale.Zone)
...
}
Index ¶
- Constants
- func FibonacciRetryStrategy(iteration int64) time.Duration
- type API
- type APIParam
- type APIResponse
- type Account
- type AccountType
- type ActivateIP6
- type ActivateIP6Response
- type AddIPToNic
- type AddIPToNicResponse
- type AddNicToVirtualMachine
- type AddNicToVirtualMachineResponse
- type AffinityGroup
- type AffinityGroupType
- type AssociateIPAddress
- type AssociateIPAddressResponse
- type AsyncJobResult
- type AuthorizeSecurityGroupEgress
- type AuthorizeSecurityGroupEgressResponse
- type AuthorizeSecurityGroupIngress
- type AuthorizeSecurityGroupIngressResponse
- type ChangeServiceForVirtualMachine
- type ChangeServiceForVirtualMachineResponse
- type Client
- func (client *Client) AsyncList(g Listable) (<-chan interface{}, <-chan error)
- func (client *Client) AsyncListWithContext(ctx context.Context, g Listable) (<-chan interface{}, <-chan error)
- func (exo *Client) BooleanRequest(req Command) error
- func (exo *Client) BooleanRequestWithContext(ctx context.Context, req Command) error
- func (exo *Client) CreateDomain(name string) (*DNSDomain, error)
- func (exo *Client) CreateRecord(name string, rec DNSRecord) (*DNSRecord, error)
- func (client *Client) Delete(g Deletable) error
- func (exo *Client) DeleteDomain(name string) error
- func (exo *Client) DeleteRecord(name string, recordID int64) error
- func (client *Client) DeleteWithContext(ctx context.Context, g Deletable) error
- func (client *Client) Get(g Gettable) error
- func (exo *Client) GetDomain(name string) (*DNSDomain, error)
- func (exo *Client) GetRecord(domain string, recordID int64) (*DNSRecord, error)
- func (exo *Client) GetRecords(name string) ([]DNSRecord, error)
- func (client *Client) GetWithContext(ctx context.Context, g Gettable) error
- func (client *Client) List(g Listable) ([]interface{}, error)
- func (client *Client) ListWithContext(ctx context.Context, g Listable) ([]interface{}, error)
- func (exo *Client) Request(request Command) (interface{}, error)
- func (exo *Client) RequestWithContext(ctx context.Context, request Command) (interface{}, error)
- func (exo *Client) UpdateRecord(name string, rec DNSRecord) (*DNSRecord, error)
- type Command
- type CreateAffinityGroup
- type CreateAffinityGroupResponse
- type CreateInstanceGroup
- type CreateInstanceGroupResponse
- type CreateNetwork
- type CreateNetworkResponse
- type CreateSSHKeyPair
- type CreateSSHKeyPairResponse
- type CreateSecurityGroup
- type CreateSecurityGroupResponse
- type CreateSnapshot
- type CreateSnapshotResponse
- type CreateTags
- type DNSDomain
- type DNSDomainResponse
- type DNSError
- type DNSErrorResponse
- type DNSRecord
- type DNSRecordResponse
- type Deletable
- type DeleteAffinityGroup
- type DeleteInstanceGroup
- type DeleteNetwork
- type DeleteSSHKeyPair
- type DeleteSecurityGroup
- type DeleteSnapshot
- type DeleteTags
- type DeployVirtualMachine
- type DeployVirtualMachineResponse
- type DestroyVirtualMachine
- type DestroyVirtualMachineResponse
- type DisassociateIPAddress
- type EgressRule
- type ErrorCode
- type ErrorResponse
- type Event
- type EventType
- type ExpungeVirtualMachine
- type GetVMPassword
- type GetVMPasswordResponse
- type Gettable
- type IPAddress
- type IPToNetwork
- type IngressRule
- type InstanceGroup
- type InstanceGroupResponse
- type JobResultResponse
- type JobStatusType
- type ListAPIs
- type ListAPIsResponse
- type ListAccounts
- type ListAccountsResponse
- type ListAffinityGroupTypes
- type ListAffinityGroupTypesResponse
- type ListAffinityGroups
- type ListAffinityGroupsResponse
- type ListAsyncJobs
- type ListAsyncJobsResponse
- type ListEventTypes
- type ListEventTypesResponse
- type ListEvents
- type ListEventsResponse
- type ListInstanceGroups
- type ListInstanceGroupsResponse
- type ListNetworkOfferings
- type ListNetworkOfferingsResponse
- type ListNetworks
- type ListNetworksResponse
- type ListNics
- type ListNicsResponse
- type ListPublicIPAddresses
- type ListPublicIPAddressesResponse
- type ListResourceLimits
- type ListResourceLimitsResponse
- type ListSSHKeyPairs
- type ListSSHKeyPairsResponse
- type ListSecurityGroups
- type ListSecurityGroupsResponse
- type ListServiceOfferings
- type ListServiceOfferingsResponse
- type ListSnapshots
- type ListSnapshotsResponse
- type ListTags
- type ListTagsResponse
- type ListTemplates
- type ListTemplatesResponse
- type ListVirtualMachines
- type ListVirtualMachinesResponse
- type ListVolumes
- type ListVolumesResponse
- type ListZones
- type ListZonesResponse
- type Listable
- type Network
- type NetworkOffering
- type NetworkResponse
- type Nic
- type NicSecondaryIP
- type Password
- type QueryAsyncJobResult
- type QueryAsyncJobResultResponse
- type RebootVirtualMachine
- type RebootVirtualMachineResponse
- type RecoverVirtualMachine
- type RecoverVirtualMachineResponse
- type RegisterSSHKeyPair
- type RegisterSSHKeyPairResponse
- type RegisterUserKeys
- type RegisterUserKeysResponse
- type RemoveIPFromNic
- type RemoveNicFromVirtualMachine
- type RemoveNicFromVirtualMachineResponse
- type ResetPasswordForVirtualMachine
- type ResetPasswordForVirtualMachineResponse
- type ResetSSHKeyForVirtualMachine
- type ResetSSHKeyForVirtualMachineResponse
- type ResizeVolume
- type ResizeVolumeResponse
- type ResourceLimit
- type ResourceTag
- type ResourceType
- type ResourceTypeName
- type RestartNetwork
- type RestartNetworkResponse
- type RestoreVirtualMachine
- type RestoreVirtualMachineResponse
- type RetryStrategyFunc
- type RevertSnapshot
- type RevokeSecurityGroupEgress
- type RevokeSecurityGroupIngress
- type SSHKeyPair
- type ScaleVirtualMachine
- type SecurityGroup
- type SecurityGroupResponse
- type Service
- type ServiceCapability
- type ServiceOffering
- type ServiceProvider
- type Snapshot
- type StartVirtualMachine
- type StartVirtualMachineResponse
- type StopVirtualMachine
- type StopVirtualMachineResponse
- type Taggable
- type Template
- type UUIDItem
- type UpdateDefaultNicForVirtualMachine
- type UpdateDefaultNicForVirtualMachineResponse
- type UpdateIPAddress
- type UpdateIPAddressResponse
- type UpdateInstanceGroup
- type UpdateInstanceGroupResponse
- type UpdateNetwork
- type UpdateNetworkResponse
- type UpdateVMAffinityGroup
- type UpdateVMAffinityGroupResponse
- type UpdateVirtualMachine
- type UpdateVirtualMachineResponse
- type User
- type UserSecurityGroup
- type VirtualMachine
- func (vm *VirtualMachine) DefaultNic() *Nic
- func (vm *VirtualMachine) Delete(ctx context.Context, client *Client) error
- func (vm *VirtualMachine) Get(ctx context.Context, client *Client) error
- func (vm *VirtualMachine) NicByID(nicID string) *Nic
- func (vm *VirtualMachine) NicByNetworkID(networkID string) *Nic
- func (vm *VirtualMachine) NicsByType(nicType string) []Nic
- func (*VirtualMachine) ResourceType() string
- type VirtualMachineResponse
- type Volume
- type Zone
Constants ¶
const ( // UserAccount represents a User UserAccount = iota // AdminAccount represents an Admin AdminAccount // DomainAdminAccount represents a Domain Admin DomainAdminAccount )
const ( // VirtualMachineTypeName is the resource type name of a VM VirtualMachineTypeName ResourceTypeName = "user_vm" // IPAddressTypeName is the resource type name of an IP address IPAddressTypeName = "public_ip" // VolumeTypeName is the resource type name of a volume VolumeTypeName = "volume" // SnapshotTypeName is the resource type name of a snapshot SnapshotTypeName = "snapshot" // TemplateTypeName is the resource type name of a template TemplateTypeName = "template" // ProjectTypeName is the resource type name of a project ProjectTypeName = "project" // NetworkTypeName is the resource type name of a network NetworkTypeName = "network" // VPCTypeName is the resource type name of a VPC VPCTypeName = "vpc" // CPUTypeName is the resource type name of a CPU CPUTypeName = "cpu" // MemoryTypeName is the resource type name of Memory MemoryTypeName = "memory" // PrimaryStorageTypeName is the resource type name of primary storage PrimaryStorageTypeName = "primary_storage" // SecondaryStorageTypeName is the resource type name of secondary storage SecondaryStorageTypeName = "secondary_storage" )
const ( Unauthorized ErrorCode = 401 // MethodNotAllowed represents ... (TODO) MethodNotAllowed = 405 // UnsupportedActionError represents ... (TODO) UnsupportedActionError = 422 // APILimitExceeded represents ... (TODO) APILimitExceeded = 429 // MalformedParameterError represents ... (TODO) MalformedParameterError = 430 // ParamError represents ... (TODO) ParamError = 431 // InternalError represents a server error InternalError = 530 // AccountError represents ... (TODO) AccountError = 531 // AccountResourceLimitError represents ... (TODO) AccountResourceLimitError = 532 // InsufficientCapacityError represents ... (TODO) InsufficientCapacityError = 533 ResourceUnavailableError = 534 // ResourceAllocationError represents ... (TODO) ResourceAllocationError = 535 // ResourceInUseError represents ... (TODO) ResourceInUseError = 536 // NetworkRuleConflictError represents ... (TODO) NetworkRuleConflictError = 537 )
Variables ¶
This section is empty.
Functions ¶
func FibonacciRetryStrategy ¶ added in v0.9.11
FibonacciRetryStrategy waits for an increasing amount of time following the Fibonacci sequence
Types ¶
type API ¶ added in v0.9.0
type API struct {
Description string `json:"description"`
IsAsync bool `json:"isasync"`
Name string `json:"name"`
Related string `json:"related"` // comma separated
Since string `json:"since"`
Type string `json:"type"`
Params []APIParam `json:"params"`
Response []APIResponse `json:"responses"`
}
API represents an API service
type APIParam ¶ added in v0.9.0
type APIParam struct {
Description string `json:"description"`
Length int64 `json:"length"`
Name string `json:"name"`
Related string `json:"related"` // comma separated
Since string `json:"since"`
Type string `json:"type"`
}
APIParam represents an API parameter field
type APIResponse ¶ added in v0.9.0
type APIResponse struct {
Description string `json:"description"`
Name string `json:"name"`
Response []APIResponse `json:"response"`
Type string `json:"type"`
}
APIResponse represents an API response field
type Account ¶ added in v0.9.7
type Account struct {
ID string `json:"id"`
AccountType AccountType `json:"accounttype,omitempty"`
AccountDetails string `json:"accountdetails,omitempty"`
CPUAvailable string `json:"cpuavailable,omitempty"`
CPULimit string `json:"cpulimit,omitempty"`
CPUTotal int64 `json:"cputotal,omitempty"`
DefaultZoneID string `json:"defaultzoneid,omitempty"`
Domain string `json:"domain,omitempty"`
DomainID string `json:"domainid,omitempty"`
EIPLimit string `json:"eiplimit,omitempty"`
Groups []string `json:"groups,omitempty"`
IPAvailable string `json:"ipavailable,omitempty"`
IPLimit string `json:"iplimit,omitempty"`
IPTotal int64 `json:"iptotal,omitempty"`
IsDefault bool `json:"isdefault,omitempty"`
MemoryAvailable string `json:"memoryavailable,omitempty"`
MemoryLimit string `json:"memorylimit,omitempty"`
MemoryTotal int64 `json:"memorytotal,omitempty"`
Name string `json:"name,omitempty"`
NetworkAvailable string `json:"networkavailable,omitempty"`
NetworkDomain string `json:"networkdomain,omitempty"`
NetworkLimit string `json:"networklimit,omitempty"`
NetworkTotal int16 `json:"networktotal,omitempty"`
PrimaryStorageAvailable string `json:"primarystorageavailable,omitempty"`
PrimaryStorageLimit string `json:"primarystoragelimit,omitempty"`
PrimaryStorageTotal int64 `json:"primarystoragetotal,omitempty"`
ProjectAvailable string `json:"projectavailable,omitempty"`
ProjectLimit string `json:"projectlimit,omitempty"`
ProjectTotal int64 `json:"projecttotal,omitempty"`
SecondaryStorageAvailable string `json:"secondarystorageavailable,omitempty"`
SecondaryStorageLimit string `json:"secondarystoragelimit,omitempty"`
SecondaryStorageTotal int64 `json:"secondarystoragetotal,omitempty"`
SnapshotAvailable string `json:"snapshotavailable,omitempty"`
SnapshotLimit string `json:"snapshotlimit,omitempty"`
SnapshotTotal int64 `json:"snapshottotal,omitempty"`
State string `json:"state,omitempty"`
TemplateAvailable string `json:"templateavailable,omitempty"`
TemplateLimit string `json:"templatelimit,omitempty"`
TemplateTotal int64 `json:"templatetotal,omitempty"`
VMAvailable string `json:"vmavailable,omitempty"`
VMLimit string `json:"vmlimit,omitempty"`
VMTotal int64 `json:"vmtotal,omitempty"`
VolumeAvailable string `json:"volumeavailable,omitempty"`
VolumeLimit string `json:"volumelimit,omitempty"`
VolumeTotal int64 `json:"volumetotal,omitempty"`
VPCAvailable string `json:"vpcavailable,omitempty"`
VPCLimit string `json:"vpclimit,omitempty"`
VPCTotal int64 `json:"vpctotal,omitempty"`
User []User `json:"user,omitempty"`
}
Account provides the detailed account information
type AccountType ¶ added in v0.9.7
type AccountType int64
AccountType represents the type of an Account
type ActivateIP6 ¶ added in v0.9.13
type ActivateIP6 struct {
NicID string `json:"nicid"`
}
ActivateIP6 (Async) activates the IP6 on the given NIC
Exoscale specific API: https://community.exoscale.ch/api/compute/#activateip6_GET
func (*ActivateIP6) APIName ¶ added in v0.9.13
func (*ActivateIP6) APIName() string
APIName returns the CloudStack API command name: activateIp6
type ActivateIP6Response ¶ added in v0.9.13
type ActivateIP6Response struct {
Nic Nic `json:"nic"`
}
ActivateIP6Response represents the modified NIC
type AddIPToNic ¶ added in v0.9.0
AddIPToNic (Async) represents the assignation of a secondary IP
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/addIpToNic.html
func (*AddIPToNic) APIName ¶ added in v0.9.11
func (*AddIPToNic) APIName() string
APIName returns the CloudStack API command name: addIpToNic
type AddIPToNicResponse ¶ added in v0.9.0
type AddIPToNicResponse struct {
NicSecondaryIP NicSecondaryIP `json:"nicsecondaryip"`
}
AddIPToNicResponse represents the addition of an IP to a NIC
type AddNicToVirtualMachine ¶ added in v0.9.0
type AddNicToVirtualMachine struct {
NetworkID string `json:"networkid"`
VirtualMachineID string `json:"virtualmachineid"`
IPAddress net.IP `json:"ipaddress,omitempty"`
}
AddNicToVirtualMachine (Async) adds a NIC to a VM
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/addNicToVirtualMachine.html
func (*AddNicToVirtualMachine) APIName ¶ added in v0.9.11
func (*AddNicToVirtualMachine) APIName() string
APIName returns the CloudStack API command name
type AddNicToVirtualMachineResponse ¶ added in v0.9.0
type AddNicToVirtualMachineResponse VirtualMachineResponse
AddNicToVirtualMachineResponse represents the modified VM
type AffinityGroup ¶
type AffinityGroup struct {
ID string `json:"id,omitempty"`
Account string `json:"account,omitempty"`
Description string `json:"description,omitempty"`
Domain string `json:"domain,omitempty"`
DomainID string `json:"domainid,omitempty"`
Name string `json:"name,omitempty"`
Project string `json:"project,omitempty"`
ProjectID string `json:"projectid,omitempty"`
Type string `json:"type,omitempty"`
VirtualMachineIDs []string `json:"virtualmachineIds,omitempty"` // *I*ds is not a typo
}
AffinityGroup represents an (anti-)affinity group
type AffinityGroupType ¶ added in v0.9.0
type AffinityGroupType struct {
Type string `json:"type"`
}
AffinityGroupType represent an affinity group type
type AssociateIPAddress ¶ added in v0.9.0
type AssociateIPAddress struct {
Account string `json:"account,omitempty"`
DomainID string `json:"domainid,omitempty"`
ForDisplay *bool `json:"fordisplay,omitempty"`
IsPortable *bool `json:"isportable,omitempty"`
NetworkdID string `json:"networkid,omitempty"`
ProjectID string `json:"projectid,omitempty"`
RegionID string `json:"regionid,omitempty"`
VpcID string `json:"vpcid,omitempty"`
ZoneID string `json:"zoneid,omitempty"`
}
AssociateIPAddress (Async) represents the IP creation
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/associateIpAddress.html
func (*AssociateIPAddress) APIName ¶ added in v0.9.11
func (*AssociateIPAddress) APIName() string
APIName returns the CloudStack API command name
type AssociateIPAddressResponse ¶ added in v0.9.0
type AssociateIPAddressResponse struct {
IPAddress IPAddress `json:"ipaddress"`
}
AssociateIPAddressResponse represents the response to the creation of an IPAddress
type AsyncJobResult ¶ added in v0.9.0
type AsyncJobResult struct {
AccountID string `json:"accountid"`
Cmd string `json:"cmd"`
Created string `json:"created"`
JobInstanceID string `json:"jobinstanceid"`
JobInstanceType string `json:"jobinstancetype"`
JobProcStatus int `json:"jobprocstatus"`
JobResult *json.RawMessage `json:"jobresult"`
JobResultCode int `json:"jobresultcode"`
JobResultType string `json:"jobresulttype"`
JobStatus JobStatusType `json:"jobstatus"`
UserID string `json:"userid"`
JobID string `json:"jobid"`
}
AsyncJobResult represents an asynchronous job result
type AuthorizeSecurityGroupEgress ¶ added in v0.9.0
type AuthorizeSecurityGroupEgress AuthorizeSecurityGroupIngress
AuthorizeSecurityGroupEgress (Async) represents the egress rule creation
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/authorizeSecurityGroupEgress.html
func (*AuthorizeSecurityGroupEgress) APIName ¶ added in v0.9.11
func (*AuthorizeSecurityGroupEgress) APIName() string
APIName returns the CloudStack API command name
type AuthorizeSecurityGroupEgressResponse ¶
type AuthorizeSecurityGroupEgressResponse CreateSecurityGroupResponse
AuthorizeSecurityGroupEgressResponse represents the new egress rule /!\ the Cloud Stack API document is not fully accurate. /!\
type AuthorizeSecurityGroupIngress ¶ added in v0.9.0
type AuthorizeSecurityGroupIngress struct {
Account string `json:"account,omitempty"`
CidrList []string `json:"cidrlist,omitempty"`
Description string `json:"description,omitempty"`
DomainID string `json:"domainid,omitempty"`
IcmpType int `json:"icmptype,omitempty"`
IcmpCode int `json:"icmpcode,omitempty"`
StartPort int `json:"startport,omitempty"`
EndPort int `json:"endport,omitempty"`
ProjectID string `json:"projectid,omitempty"`
Protocol string `json:"protocol,omitempty"`
SecurityGroupID string `json:"securitygroupid,omitempty"`
SecurityGroupName string `json:"securitygroupname,omitempty"`
UserSecurityGroupList []UserSecurityGroup `json:"usersecuritygrouplist,omitempty"`
}
AuthorizeSecurityGroupIngress (Async) represents the ingress rule creation
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/authorizeSecurityGroupIngress.html
func (*AuthorizeSecurityGroupIngress) APIName ¶ added in v0.9.11
func (*AuthorizeSecurityGroupIngress) APIName() string
APIName returns the CloudStack API command name
type AuthorizeSecurityGroupIngressResponse ¶
type AuthorizeSecurityGroupIngressResponse SecurityGroupResponse
AuthorizeSecurityGroupIngressResponse represents the new egress rule /!\ the Cloud Stack API document is not fully accurate. /!\
type ChangeServiceForVirtualMachine ¶ added in v0.9.0
type ChangeServiceForVirtualMachine ScaleVirtualMachine
ChangeServiceForVirtualMachine represents the scaling of a VM
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/changeServiceForVirtualMachine.html
func (*ChangeServiceForVirtualMachine) APIName ¶ added in v0.9.11
func (*ChangeServiceForVirtualMachine) APIName() string
APIName returns the CloudStack API command name
type ChangeServiceForVirtualMachineResponse ¶ added in v0.9.0
type ChangeServiceForVirtualMachineResponse VirtualMachineResponse
ChangeServiceForVirtualMachineResponse represents an changed VM instance
type Client ¶
type Client struct {
// PageSize represents the default size for a paginated result
PageSize int
// Timeout represents the default timeout for the async requests
Timeout time.Duration
// RetryStrategy represents the waiting strategy for polling the async requests
RetryStrategy RetryStrategyFunc
// contains filtered or unexported fields
}
Client represents the CloudStack API client
func NewClientWithTimeout ¶ added in v0.9.11
NewClientWithTimeout creates a CloudStack API client
Timeout is set to booth the HTTP client and the client itself.
func (*Client) AsyncListWithContext ¶ added in v0.9.16
func (client *Client) AsyncListWithContext(ctx context.Context, g Listable) (<-chan interface{}, <-chan error)
AsyncListWithContext lists the given resources and paginates
func (*Client) BooleanRequest ¶ added in v0.9.0
BooleanRequest performs the given boolean command
func (*Client) BooleanRequestWithContext ¶ added in v0.9.12
BooleanRequestWithContext performs the given boolean command
func (*Client) CreateDomain ¶
CreateDomain creates a DNS domain
func (*Client) CreateRecord ¶
CreateRecord creates a DNS record
func (*Client) DeleteDomain ¶
DeleteDomain delets a DNS domain
func (*Client) DeleteRecord ¶
DeleteRecord deletes a record
func (*Client) DeleteWithContext ¶ added in v0.9.12
DeleteWithContext removes the given resource of fails
func (*Client) GetRecords ¶
GetRecords returns the DNS records
func (*Client) GetWithContext ¶ added in v0.9.12
GetWithContext populates the given resource or fails
func (*Client) ListWithContext ¶ added in v0.9.16
ListWithContext lists the given resources (and paginate till the end)
func (*Client) RequestWithContext ¶ added in v0.9.11
RequestWithContext preforms a request with a context
type Command ¶ added in v0.9.0
type Command interface {
// CloudStack API command name
APIName() string
}
Command represents a CloudStack request
type CreateAffinityGroup ¶ added in v0.9.0
type CreateAffinityGroup struct {
Name string `json:"name"`
Type string `json:"type"`
Account string `json:"account,omitempty"`
Description string `json:"description,omitempty"`
DomainID string `json:"domainid,omitempty"`
}
CreateAffinityGroup (Async) represents a new (anti-)affinity group
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/createAffinityGroup.html
func (*CreateAffinityGroup) APIName ¶ added in v0.9.11
func (*CreateAffinityGroup) APIName() string
APIName returns the CloudStack API command name
type CreateAffinityGroupResponse ¶
type CreateAffinityGroupResponse struct {
AffinityGroup AffinityGroup `json:"affinitygroup"`
}
CreateAffinityGroupResponse represents the response of the creation of an (anti-)affinity group
type CreateInstanceGroup ¶ added in v0.9.7
type CreateInstanceGroup struct {
Name string `json:"name"`
Account string `json:"account,omitempty"`
DomainID string `json:"domainid,omitempty"`
ProjectID string `json:"projectid,omitempty"`
}
CreateInstanceGroup creates a VM group
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/createInstanceGroup.html
func (*CreateInstanceGroup) APIName ¶ added in v0.9.11
func (*CreateInstanceGroup) APIName() string
APIName returns the CloudStack API command name
type CreateInstanceGroupResponse ¶ added in v0.9.7
type CreateInstanceGroupResponse InstanceGroupResponse
CreateInstanceGroupResponse represents a freshly created VM group
type CreateNetwork ¶ added in v0.9.0
type CreateNetwork struct {
DisplayText string `json:"displaytext,omitempty"`
Name string `json:"name,omitempty"`
NetworkOfferingID string `json:"networkofferingid"`
ZoneID string `json:"zoneid"`
Account string `json:"account,omitempty"`
ACLID string `json:"aclid,omitempty"`
ACLType string `json:"acltype,omitempty"` // Account or Domain
DisplayNetwork *bool `json:"displaynetwork,omitempty"` // root only
DomainID string `json:"domainid,omitempty"`
EndIP net.IP `json:"endip,omitempty"`
EndIpv6 net.IP `json:"endipv6,omitempty"`
Gateway net.IP `json:"gateway,omitempty"`
IP6Cidr string `json:"ip6cidr,omitempty"`
IP6Gateway net.IP `json:"ip6gateway,omitempty"`
IsolatedPVlan string `json:"isolatedpvlan,omitempty"`
Netmask net.IP `json:"netmask,omitempty"`
NetworkDomain string `json:"networkdomain,omitempty"`
PhysicalNetworkID string `json:"physicalnetworkid,omitempty"`
ProjectID string `json:"projectid,omitempty"`
StartIP net.IP `json:"startip,omitempty"`
StartIpv6 net.IP `json:"startipv6,omitempty"`
SubdomainAccess string `json:"subdomainaccess,omitempty"`
Vlan string `json:"vlan,omitempty"`
VpcID string `json:"vpcid,omitempty"`
}
CreateNetwork creates a network
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/createNetwork.html
func (*CreateNetwork) APIName ¶ added in v0.9.11
func (*CreateNetwork) APIName() string
APIName returns the CloudStack API command name
type CreateNetworkResponse ¶ added in v0.9.0
type CreateNetworkResponse NetworkResponse
CreateNetworkResponse represents a freshly created network
type CreateSSHKeyPair ¶ added in v0.9.0
type CreateSSHKeyPair struct {
Name string `json:"name"`
Account string `json:"account,omitempty"`
DomainID string `json:"domainid,omitempty"`
ProjectID string `json:"projectid,omitempty"`
}
CreateSSHKeyPair represents a new keypair to be created
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/createSSHKeyPair.html
func (*CreateSSHKeyPair) APIName ¶ added in v0.9.11
func (*CreateSSHKeyPair) APIName() string
APIName returns the CloudStack API command name
type CreateSSHKeyPairResponse ¶
type CreateSSHKeyPairResponse struct {
KeyPair SSHKeyPair `json:"keypair"`
}
CreateSSHKeyPairResponse represents the creation of an SSH Key Pair
type CreateSecurityGroup ¶ added in v0.9.0
type CreateSecurityGroup struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
}
CreateSecurityGroup represents a security group creation
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/createSecurityGroup.html
func (*CreateSecurityGroup) APIName ¶ added in v0.9.11
func (*CreateSecurityGroup) APIName() string
APIName returns the CloudStack API command name
type CreateSecurityGroupResponse ¶
type CreateSecurityGroupResponse SecurityGroupResponse
CreateSecurityGroupResponse represents a new security group
type CreateSnapshot ¶ added in v0.9.0
type CreateSnapshot struct {
VolumeID string `json:"volumeid"`
Account string `json:"account,omitempty"`
DomainID string `json:"domainid,omitempty"`
PolicyID string `json:"policyid,omitempty"`
QuiesceVM *bool `json:"quiescevm,omitempty"`
}
CreateSnapshot represents a request to create a volume snapshot
CloudStackAPI: http://cloudstack.apache.org/api/apidocs-4.10/apis/createSnapshot.html
func (*CreateSnapshot) APIName ¶ added in v0.9.11
func (*CreateSnapshot) APIName() string
APIName returns the CloudStack API command name
type CreateSnapshotResponse ¶ added in v0.9.0
type CreateSnapshotResponse struct {
Snapshot Snapshot `json:"snapshot"`
}
CreateSnapshotResponse represents a freshly created snapshot
type CreateTags ¶ added in v0.9.0
type CreateTags struct {
ResourceIDs []string `json:"resourceids"`
ResourceType string `json:"resourcetype"`
Tags []ResourceTag `json:"tags"`
Customer string `json:"customer,omitempty"`
}
CreateTags (Async) creates resource tag(s)
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/createTags.html
func (*CreateTags) APIName ¶ added in v0.9.11
func (*CreateTags) APIName() string
APIName returns the CloudStack API command name
type DNSDomain ¶
type DNSDomain struct {
ID int64 `json:"id"`
AccountID int64 `json:"account_id,omitempty"`
UserID int64 `json:"user_id,omitempty"`
RegistrantID int64 `json:"registrant_id,omitempty"`
Name string `json:"name"`
UnicodeName string `json:"unicode_name"`
Token string `json:"token"`
State string `json:"state"`
Language string `json:"language,omitempty"`
Lockable bool `json:"lockable"`
AutoRenew bool `json:"auto_renew"`
WhoisProtected bool `json:"whois_protected"`
RecordCount int64 `json:"record_count"`
ServiceCount int64 `json:"service_count"`
ExpiresOn string `json:"expires_on,omitempty"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
DNSDomain represents a domain
type DNSDomainResponse ¶ added in v0.9.0
type DNSDomainResponse struct {
Domain *DNSDomain `json:"domain"`
}
DNSDomainResponse represents a domain creation response
type DNSErrorResponse ¶ added in v0.9.0
type DNSErrorResponse struct {
Message string `json:"message,omitempty"`
Errors *DNSError `json:"errors"`
}
DNSErrorResponse represents an error in the API
func (*DNSErrorResponse) Error ¶ added in v0.9.0
func (req *DNSErrorResponse) Error() error
Error formats the DNSerror into a string
type DNSRecord ¶
type DNSRecord struct {
ID int64 `json:"id,omitempty"`
DomainID int64 `json:"domain_id,omitempty"`
Name string `json:"name"`
TTL int `json:"ttl,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
Content string `json:"content"`
RecordType string `json:"record_type"`
Prio int `json:"prio,omitempty"`
}
DNSRecord represents a DNS record
type DNSRecordResponse ¶
type DNSRecordResponse struct {
Record DNSRecord `json:"record"`
}
DNSRecordResponse represents the creation of a DNS record
type Deletable ¶ added in v0.9.12
type Deletable interface {
// Delete removes the given resource(s) or throws
Delete(context context.Context, client *Client) error
}
Deletable represents an Interface that can be "Delete" by the client
type DeleteAffinityGroup ¶ added in v0.9.0
type DeleteAffinityGroup struct {
Account string `json:"account,omitempty"` // must be specified with DomainID
DomainID string `json:"domainid,omitempty"`
ID string `json:"id,omitempty"` // mutually exclusive with Name
Name string `json:"name,omitempty"` // mutually exclusive with ID
ProjectID string `json:"projectid,omitempty"`
}
DeleteAffinityGroup (Async) represents an (anti-)affinity group to be deleted
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/deleteAffinityGroup.html
func (*DeleteAffinityGroup) APIName ¶ added in v0.9.11
func (*DeleteAffinityGroup) APIName() string
APIName returns the CloudStack API command name
type DeleteInstanceGroup ¶ added in v0.9.7
type DeleteInstanceGroup struct {
Name string `json:"name"`
Account string `json:"account,omitempty"`
DomainID string `json:"domainid,omitempty"`
ProjectID string `json:"projectid,omitempty"`
}
DeleteInstanceGroup creates a VM group
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/deleteInstanceGroup.html
func (*DeleteInstanceGroup) APIName ¶ added in v0.9.11
func (*DeleteInstanceGroup) APIName() string
APIName returns the CloudStack API command name
type DeleteNetwork ¶ added in v0.9.0
DeleteNetwork deletes a network
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/deleteNetwork.html
func (*DeleteNetwork) APIName ¶ added in v0.9.11
func (*DeleteNetwork) APIName() string
APIName returns the CloudStack API command name
type DeleteSSHKeyPair ¶ added in v0.9.0
type DeleteSSHKeyPair struct {
Name string `json:"name"`
Account string `json:"account,omitempty"`
DomainID string `json:"domainid,omitempty"`
ProjectID string `json:"projectid,omitempty"`
}
DeleteSSHKeyPair represents a new keypair to be created
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/deleteSSHKeyPair.html
func (*DeleteSSHKeyPair) APIName ¶ added in v0.9.11
func (*DeleteSSHKeyPair) APIName() string
APIName returns the CloudStack API command name
type DeleteSecurityGroup ¶ added in v0.9.0
type DeleteSecurityGroup struct {
Account string `json:"account,omitempty"` // Must be specified with Domain ID
DomainID string `json:"domainid,omitempty"` // Must be specified with Account
ID string `json:"id,omitempty"` // Mutually exclusive with name
Name string `json:"name,omitempty"` // Mutually exclusive with id
ProjectID string `json:"project,omitempty"`
}
DeleteSecurityGroup represents a security group deletion
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/deleteSecurityGroup.html
func (*DeleteSecurityGroup) APIName ¶ added in v0.9.11
func (*DeleteSecurityGroup) APIName() string
APIName returns the CloudStack API command name
type DeleteSnapshot ¶ added in v0.9.0
type DeleteSnapshot struct {
ID string `json:"id"`
}
DeleteSnapshot represents the deletion of a volume snapshot
CloudStackAPI: http://cloudstack.apache.org/api/apidocs-4.10/apis/deleteSnapshot.html
func (*DeleteSnapshot) APIName ¶ added in v0.9.11
func (*DeleteSnapshot) APIName() string
APIName returns the CloudStack API command name
type DeleteTags ¶ added in v0.9.0
type DeleteTags struct {
ResourceIDs []string `json:"resourceids"`
ResourceType string `json:"resourcetype"`
Tags []ResourceTag `json:"tags,omitempty"`
}
DeleteTags (Async) deletes the resource tag(s)
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/deleteTags.html
func (*DeleteTags) APIName ¶ added in v0.9.11
func (*DeleteTags) APIName() string
APIName returns the CloudStack API command name
type DeployVirtualMachine ¶ added in v0.9.0
type DeployVirtualMachine struct {
ServiceOfferingID string `json:"serviceofferingid"`
TemplateID string `json:"templateid"`
ZoneID string `json:"zoneid"`
Account string `json:"account,omitempty"`
AffinityGroupIDs []string `json:"affinitygroupids,omitempty"` // mutually exclusive with AffinityGroupNames
AffinityGroupNames []string `json:"affinitygroupnames,omitempty"` // mutually exclusive with AffinityGroupIDs
CustomID string `json:"customid,omitempty"` // root only
DeploymentPlanner string `json:"deploymentplanner,omitempty"` // root only
Details map[string]string `json:"details,omitempty"`
DiskOfferingID string `json:"diskofferingid,omitempty"`
DisplayName string `json:"displayname,omitempty"`
DisplayVM *bool `json:"displayvm,omitempty"`
DomainID string `json:"domainid,omitempty"`
Group string `json:"group,omitempty"`
HostID string `json:"hostid,omitempty"`
Hypervisor string `json:"hypervisor,omitempty"`
IP4 *bool `json:"ip4,omitempty"` // Exoscale specific
IP6 *bool `json:"ip6,omitempty"` // Exoscale specific
IPAddress net.IP `json:"ipaddress,omitempty"`
IP6Address net.IP `json:"ip6address,omitempty"`
IPToNetworkList []IPToNetwork `json:"iptonetworklist,omitempty"`
Keyboard string `json:"keyboard,omitempty"`
KeyPair string `json:"keypair,omitempty"`
Name string `json:"name,omitempty"`
NetworkIDs []string `json:"networkids,omitempty"` // mutually exclusive with IPToNetworkList
ProjectID string `json:"projectid,omitempty"`
RootDiskSize int64 `json:"rootdisksize,omitempty"` // in GiB
SecurityGroupIDs []string `json:"securitygroupids,omitempty"` // mutually exclusive with SecurityGroupNames
SecurityGroupNames []string `json:"securitygroupnames,omitempty"` // mutually exclusive with SecurityGroupIDs
Size string `json:"size,omitempty"` // mutually exclusive with DiskOfferingID
StartVM *bool `json:"startvm,omitempty"`
UserData string `json:"userdata,omitempty"` // the client is responsible to base64/gzip it
}
DeployVirtualMachine (Async) represents the machine creation
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/deployVirtualMachine.html
func (*DeployVirtualMachine) APIName ¶ added in v0.9.11
func (*DeployVirtualMachine) APIName() string
APIName returns the CloudStack API command name
type DeployVirtualMachineResponse ¶
type DeployVirtualMachineResponse VirtualMachineResponse
DeployVirtualMachineResponse represents a deployed VM instance
type DestroyVirtualMachine ¶ added in v0.9.0
type DestroyVirtualMachine struct {
ID string `json:"id"`
Expunge *bool `json:"expunge,omitempty"`
}
DestroyVirtualMachine (Async) represents the destruction of the virtual machine
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/destroyVirtualMachine.html
func (*DestroyVirtualMachine) APIName ¶ added in v0.9.11
func (*DestroyVirtualMachine) APIName() string
APIName returns the CloudStack API command name
type DestroyVirtualMachineResponse ¶
type DestroyVirtualMachineResponse VirtualMachineResponse
DestroyVirtualMachineResponse represents a destroyed VM instance
type DisassociateIPAddress ¶ added in v0.9.0
type DisassociateIPAddress struct {
ID string `json:"id"`
}
DisassociateIPAddress (Async) represents the IP deletion
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/disassociateIpAddress.html
func (*DisassociateIPAddress) APIName ¶ added in v0.9.11
func (*DisassociateIPAddress) APIName() string
APIName returns the CloudStack API command name
type EgressRule ¶ added in v0.9.0
type EgressRule IngressRule
EgressRule represents the ingress rule
type ErrorCode ¶ added in v0.9.2
type ErrorCode int
ErrorCode represents the CloudStack ApiErrorCode enum
See: https://github.com/apache/cloudstack/blob/master/api/src/org/apache/cloudstack/api/ApiErrorCode.java
type ErrorResponse ¶ added in v0.9.0
type ErrorResponse struct {
ErrorCode ErrorCode `json:"errorcode"`
CsErrorCode int `json:"cserrorcode"`
ErrorText string `json:"errortext"`
UUIDList []UUIDItem `json:"uuidList,omitempty"` // uuid*L*ist is not a typo
}
ErrorResponse represents the standard error response from CloudStack
func (*ErrorResponse) Error ¶ added in v0.9.0
func (e *ErrorResponse) Error() string
Error formats a CloudStack error into a standard error
type Event ¶ added in v0.9.0
type Event struct {
ID string `json:"id"`
Account string `json:"account"`
Created string `json:"created"`
Description string `json:"description,omitempty"`
Domain string `json:"domain,omitempty"`
DomainID string `json:"domainid,omitempty"`
Level string `json:"level"` // INFO, WARN, ERROR
ParentID string `json:"parentid,omitempty"`
Project string `json:"project,omitempty"`
ProjectID string `json:"projectid,omitempty"`
State string `json:"state,omitempty"`
Type string `json:"type"`
UserName string `json:"username,omitempty"`
}
Event represents an event in the system
type EventType ¶ added in v0.9.0
type EventType struct {
Name string `json:"name"`
}
EventType represent a type of event
type ExpungeVirtualMachine ¶ added in v0.9.0
type ExpungeVirtualMachine struct {
ID string `json:"id"`
}
ExpungeVirtualMachine represents the annihilation of a VM
func (*ExpungeVirtualMachine) APIName ¶ added in v0.9.11
func (*ExpungeVirtualMachine) APIName() string
APIName returns the CloudStack API command name
type GetVMPassword ¶ added in v0.9.0
type GetVMPassword struct {
ID string `json:"id"`
}
GetVMPassword asks for an encrypted password
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/getVMPassword.html
func (*GetVMPassword) APIName ¶ added in v0.9.11
func (*GetVMPassword) APIName() string
APIName returns the CloudStack API command name
type GetVMPasswordResponse ¶ added in v0.9.0
type GetVMPasswordResponse struct {
// Base64 encrypted password for the VM
Password Password `json:"password"`
}
GetVMPasswordResponse represents the encrypted password
type Gettable ¶ added in v0.9.12
type Gettable interface {
// Get populates the given resource or throws
Get(context context.Context, client *Client) error
}
Gettable represents an Interface that can be "Get" by the client
type IPAddress ¶ added in v0.9.0
type IPAddress struct {
ID string `json:"id"`
Account string `json:"account,omitempty"`
AllocatedAt string `json:"allocated,omitempty"`
AssociatedNetworkID string `json:"associatednetworkid,omitempty"`
AssociatedNetworkName string `json:"associatednetworkname,omitempty"`
DomainID string `json:"domainid,omitempty"`
DomainName string `json:"domainname,omitempty"`
ForDisplay bool `json:"fordisplay,omitempty"`
ForVirtualNetwork bool `json:"forvirtualnetwork,omitempty"`
IPAddress net.IP `json:"ipaddress"`
IsElastic bool `json:"iselastic,omitempty"`
IsPortable bool `json:"isportable,omitempty"`
IsSourceNat bool `json:"issourcenat,omitempty"`
IsSystem bool `json:"issystem,omitempty"`
NetworkID string `json:"networkid,omitempty"`
PhysicalNetworkID string `json:"physicalnetworkid,omitempty"`
Project string `json:"project,omitempty"`
ProjectID string `json:"projectid,omitempty"`
Purpose string `json:"purpose,omitempty"`
State string `json:"state,omitempty"`
VirtualMachineDisplayName string `json:"virtualmachinedisplayname,omitempty"`
VirtualMachineID string `json:"virtualmachineid,omitempty"`
VirtualMachineName string `json:"virtualmachineName,omitempty"`
VlanID string `json:"vlanid,omitempty"`
VlanName string `json:"vlanname,omitempty"`
VMIPAddress net.IP `json:"vmipaddress,omitempty"`
VpcID string `json:"vpcid,omitempty"`
ZoneID string `json:"zoneid,omitempty"`
ZoneName string `json:"zonename,omitempty"`
Tags []ResourceTag `json:"tags,omitempty"`
JobID string `json:"jobid,omitempty"`
JobStatus JobStatusType `json:"jobstatus,omitempty"`
}
IPAddress represents an IP Address
func (*IPAddress) ResourceType ¶ added in v0.9.7
ResourceType returns the type of the resource
type IPToNetwork ¶ added in v0.9.0
type IPToNetwork struct {
IP string `json:"ip,omitempty"`
IPV6 string `json:"ipv6,omitempty"`
NetworkID string `json:"networkid,omitempty"`
}
IPToNetwork represents a mapping between ip and networks
type IngressRule ¶ added in v0.9.0
type IngressRule struct {
RuleID string `json:"ruleid"`
Account string `json:"account,omitempty"`
Cidr string `json:"cidr,omitempty"`
Description string `json:"description,omitempty"`
IcmpType int `json:"icmptype,omitempty"`
IcmpCode int `json:"icmpcode,omitempty"`
StartPort int `json:"startport,omitempty"`
EndPort int `json:"endport,omitempty"`
Protocol string `json:"protocol,omitempty"`
Tags []ResourceTag `json:"tags,omitempty"`
SecurityGroupID string `json:"securitygroupid,omitempty"`
SecurityGroupName string `json:"securitygroupname,omitempty"`
UserSecurityGroupList []UserSecurityGroup `json:"usersecuritygrouplist,omitempty"`
JobID string `json:"jobid,omitempty"`
JobStatus JobStatusType `json:"jobstatus,omitempty"`
}
IngressRule represents the ingress rule
type InstanceGroup ¶ added in v0.9.7
type InstanceGroup struct {
ID string `json:"id"`
Account string `json:"account,omitempty"`
Created string `json:"created,omitempty"`
Domain string `json:"domain,omitempty"`
DomainID string `json:"domainid,omitempty"`
Name string `json:"name,omitempty"`
Project string `json:"project,omitempty"`
ProjectID string `json:"projectid,omitempty"`
}
InstanceGroup represents a group of VM
type InstanceGroupResponse ¶ added in v0.9.7
type InstanceGroupResponse struct {
InstanceGroup InstanceGroup `json:"instancegroup"`
}
InstanceGroupResponse represents a VM group
type JobResultResponse ¶ added in v0.9.0
type JobResultResponse struct {
AccountID string `json:"accountid,omitempty"`
Cmd string `json:"cmd"`
Created string `json:"created"`
JobID string `json:"jobid"`
JobProcStatus int `json:"jobprocstatus"`
JobResult *json.RawMessage `json:"jobresult"`
JobStatus JobStatusType `json:"jobstatus"`
JobResultType string `json:"jobresulttype"`
UserID string `json:"userid,omitempty"`
}
JobResultResponse represents a generic response to a job task
type JobStatusType ¶ added in v0.9.0
type JobStatusType int
JobStatusType represents the status of a Job
const ( // Pending represents a job in progress Pending JobStatusType = iota // Success represents a successfully completed job Success // Failure represents a job that has failed to complete Failure )
type ListAPIs ¶ added in v0.9.0
type ListAPIs struct {
Name string `json:"name,omitempty"`
}
ListAPIs represents a query to list the api
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/listApis.html
type ListAPIsResponse ¶ added in v0.9.0
ListAPIsResponse represents a list of API
type ListAccounts ¶ added in v0.9.7
type ListAccounts struct {
AccountType int64 `json:"accounttype,omitempty"`
DomainID string `json:"domainid,omitempty"`
ID string `json:"id,omitempty"`
IsCleanUpRequired *bool `json:"iscleanuprequired,omitempty"`
IsRecursive *bool `json:"isrecursive,omitempty"`
Keyword string `json:"keyword,omitempty"`
ListAll *bool `json:"listall,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
State string `json:"state,omitempty"`
}
ListAccounts represents a query to display the accounts
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/listAccounts.html
func (*ListAccounts) APIName ¶ added in v0.9.11
func (*ListAccounts) APIName() string
APIName returns the CloudStack API command name
type ListAccountsResponse ¶ added in v0.9.7
ListAccountsResponse represents a list of accounts
type ListAffinityGroupTypes ¶ added in v0.9.0
type ListAffinityGroupTypes struct {
Keyword string `json:"keyword,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
}
ListAffinityGroupTypes represents an (anti-)affinity groups search
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/listAffinityGroupTypes.html
func (*ListAffinityGroupTypes) APIName ¶ added in v0.9.11
func (*ListAffinityGroupTypes) APIName() string
APIName returns the CloudStack API command name
type ListAffinityGroupTypesResponse ¶ added in v0.9.0
type ListAffinityGroupTypesResponse struct {
Count int `json:"count"`
AffinityGroupType []AffinityGroupType `json:"affinitygrouptype"`
}
ListAffinityGroupTypesResponse represents a list of (anti-)affinity group types
type ListAffinityGroups ¶ added in v0.9.0
type ListAffinityGroups struct {
Account string `json:"account,omitempty"`
DomainID string `json:"domainid,omitempty"`
ID string `json:"id,omitempty"`
IsRecursive *bool `json:"isrecursive,omitempty"`
Keyword string `json:"keyword,omitempty"`
ListAll *bool `json:"listall,omitempty"`
Name string `json:"name,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
Type string `json:"type,omitempty"`
VirtualMachineID string `json:"virtualmachineid,omitempty"`
}
ListAffinityGroups represents an (anti-)affinity groups search
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/listAffinityGroups.html
func (*ListAffinityGroups) APIName ¶ added in v0.9.11
func (*ListAffinityGroups) APIName() string
APIName returns the CloudStack API command name
type ListAffinityGroupsResponse ¶
type ListAffinityGroupsResponse struct {
Count int `json:"count"`
AffinityGroup []AffinityGroup `json:"affinitygroup"`
}
ListAffinityGroupsResponse represents a list of (anti-)affinity groups
type ListAsyncJobs ¶ added in v0.9.0
type ListAsyncJobs struct {
Account string `json:"account,omitempty"`
DomainID string `json:"domainid,omitempty"`
IsRecursive *bool `json:"isrecursive,omitempty"`
Keyword string `json:"keyword,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
StartDate string `json:"startdate,omitempty"`
}
ListAsyncJobs list the asynchronous jobs
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/listAsyncJobs.html
func (*ListAsyncJobs) APIName ¶ added in v0.9.11
func (*ListAsyncJobs) APIName() string
APIName returns the CloudStack API command name
type ListAsyncJobsResponse ¶ added in v0.9.0
type ListAsyncJobsResponse struct {
Count int `json:"count"`
AsyncJobs []AsyncJobResult `json:"asyncjobs"`
}
ListAsyncJobsResponse represents a list of job results
type ListEventTypes ¶ added in v0.9.0
type ListEventTypes struct{}
ListEventTypes list the event types
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/listEventTypes.html
func (*ListEventTypes) APIName ¶ added in v0.9.11
func (*ListEventTypes) APIName() string
APIName returns the CloudStack API command name
type ListEventTypesResponse ¶ added in v0.9.0
type ListEventTypesResponse struct {
Count int `json:"count"`
EventType []EventType `json:"eventtype"`
}
ListEventTypesResponse represents a response of a list query
type ListEvents ¶ added in v0.9.0
type ListEvents struct {
Account string `json:"account,omitempty"`
DomainID string `json:"domainid,omitempty"`
Duration int `json:"duration,omitempty"`
EndDate string `json:"enddate,omitempty"`
EntryTime int `json:"entrytime,omitempty"`
ID string `json:"id,omitempty"`
IsRecursive *bool `json:"isrecursive,omitempty"`
Keyword string `json:"keyword,omitempty"`
Level string `json:"level,omitempty"` // INFO, WARN, ERROR
ListAll *bool `json:"listall,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
ProjectID string `json:"projectid,omitempty"`
StartDate string `json:"startdate,omitempty"`
Type string `json:"type,omitempty"`
}
ListEvents list the events
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/listEvents.html
func (*ListEvents) APIName ¶ added in v0.9.11
func (*ListEvents) APIName() string
APIName returns the CloudStack API command name
type ListEventsResponse ¶ added in v0.9.0
ListEventsResponse represents a response of a list query
type ListInstanceGroups ¶ added in v0.9.7
type ListInstanceGroups struct {
Account string `json:"account,omitempty"`
DomainID string `json:"domainid,omitempty"`
ID string `json:"id,omitempty"`
IsRecursive *bool `json:"isrecursive,omitempty"`
Keyword string `json:"keyword,omitempty"`
ListAll *bool `json:"listall,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
State string `json:"state,omitempty"`
ProjectID string `json:"projectid,omitempty"`
}
ListInstanceGroups lists VM groups
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/listInstanceGroups.html
func (*ListInstanceGroups) APIName ¶ added in v0.9.11
func (*ListInstanceGroups) APIName() string
APIName returns the CloudStack API command name
type ListInstanceGroupsResponse ¶ added in v0.9.7
type ListInstanceGroupsResponse struct {
Count int `json:"count"`
InstanceGroup []InstanceGroup `json:"instancegroup"`
}
ListInstanceGroupsResponse represents a list of instance groups
type ListNetworkOfferings ¶ added in v0.9.0
type ListNetworkOfferings struct {
Availability string `json:"availability,omitempty"`
DisplayText string `json:"displaytext,omitempty"`
ForVPC bool `json:"forvpc,omitempty"`
GuestIPType string `json:"guestiptype,omitempty"` // shared of isolated
ID string `json:"id,omitempty"`
IsDefault bool `json:"isdefault,omitempty"`
IsTagged bool `json:"istagged,omitempty"`
Keyword string `json:"keyword,omitempty"`
Name string `json:"name,omitempty"`
NetworkID string `json:"networkid,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
SourceNATSupported bool `json:"sourcenatsupported,omitempty"`
SpecifyIPRanges bool `json:"specifyipranges,omitempty"`
SpecifyVlan string `json:"specifyvlan,omitempty"`
State string `json:"state,omitempty"`
SupportedServices string `json:"supportedservices,omitempty"`
Tags []ResourceTag `json:"tags,omitempty"`
TrafficType string `json:"traffictype,omitempty"`
ZoneID string `json:"zoneid,omitempty"`
}
ListNetworkOfferings represents a query for network offerings
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/listNetworkOfferings.html
func (*ListNetworkOfferings) APIName ¶ added in v0.9.11
func (*ListNetworkOfferings) APIName() string
APIName returns the CloudStack API command name
type ListNetworkOfferingsResponse ¶ added in v0.9.0
type ListNetworkOfferingsResponse struct {
Count int `json:"count"`
NetworkOffering []NetworkOffering `json:"networkoffering"`
}
ListNetworkOfferingsResponse represents a list of service offerings
type ListNetworks ¶ added in v0.9.0
type ListNetworks struct {
Account string `json:"account,omitempty"`
ACLType string `json:"acltype,omitempty"` // Account or Domain
CanUseForDeploy *bool `json:"canusefordeploy,omitempty"`
DisplayNetwork *bool `json:"displaynetwork,omitempty"` // root only
DomainID string `json:"domainid,omitempty"`
ForVpc string `json:"forvpc,omitempty"`
ID string `json:"id,omitempty"`
IsRecursive *bool `json:"isrecursive,omitempty"`
IsSystem *bool `json:"issystem,omitempty"`
Keyword string `json:"keyword,omitempty"`
ListAll *bool `json:"listall,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
PhysicalNetworkID string `json:"physicalnetworkid,omitempty"`
ProjectID string `json:"projectid,omitempty"`
RestartRequired *bool `json:"restartrequired,omitempty"`
SpecifyRanges *bool `json:"specifyranges,omitempty"`
SupportedServices []Service `json:"supportedservices,omitempty"`
Tags []ResourceTag `json:"resourcetag,omitempty"`
TrafficType string `json:"traffictype,omitempty"`
Type string `json:"type,omitempty"`
VpcID string `json:"vpcid,omitempty"`
ZoneID string `json:"zoneid,omitempty"`
}
ListNetworks represents a query to a network
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/listNetworks.html
func (*ListNetworks) APIName ¶ added in v0.9.11
func (*ListNetworks) APIName() string
APIName returns the CloudStack API command name
type ListNetworksResponse ¶ added in v0.9.0
ListNetworksResponse represents the list of networks
type ListNics ¶ added in v0.9.0
type ListNics struct {
VirtualMachineID string `json:"virtualmachineid"`
ForDisplay bool `json:"fordisplay,omitempty"`
Keyword string `json:"keyword,omitempty"`
NetworkID string `json:"networkid,omitempty"`
NicID string `json:"nicid,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
}
ListNics represents the NIC search
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/listNics.html
type ListNicsResponse ¶ added in v0.9.0
ListNicsResponse represents a list of templates
type ListPublicIPAddresses ¶ added in v0.9.0
type ListPublicIPAddresses struct {
Account string `json:"account,omitempty"` // must be used with the DomainID
AllocatedOnly *bool `json:"allocatedonly,omitempty"`
AllocatedNetworkID string `json:"allocatednetworkid,omitempty"`
DomainID string `json:"domainid,omitempty"`
ForDisplay *bool `json:"fordisplay,omitempty"`
ForLoadBalancing *bool `json:"forloadbalancing,omitempty"`
ForVirtualNetwork string `json:"forvirtualnetwork,omitempty"`
ID string `json:"id,omitempty"`
IPAddress net.IP `json:"ipaddress,omitempty"`
IsElastic *bool `json:"iselastic,omitempty"`
IsRecursive *bool `json:"isrecursive,omitempty"`
IsSourceNat *bool `json:"issourcenat,omitempty"`
IsStaticNat *bool `json:"isstaticnat,omitempty"`
Keyword string `json:"keyword,omitempty"`
ListAll *bool `json:"listall,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
PhysicalNetworkID string `json:"physicalnetworkid,omitempty"`
ProjectID string `json:"projectid,omitempty"`
Tags []ResourceTag `json:"tags,omitempty"`
VlanID string `json:"vlanid,omitempty"`
VpcID string `json:"vpcid,omitempty"`
ZoneID string `json:"zoneid,omitempty"`
}
ListPublicIPAddresses represents a search for public IP addresses
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/listPublicIpAddresses.html
func (*ListPublicIPAddresses) APIName ¶ added in v0.9.11
func (*ListPublicIPAddresses) APIName() string
APIName returns the CloudStack API command name
type ListPublicIPAddressesResponse ¶ added in v0.9.0
type ListPublicIPAddressesResponse struct {
Count int `json:"count"`
PublicIPAddress []IPAddress `json:"publicipaddress"`
}
ListPublicIPAddressesResponse represents a list of public IP addresses
type ListResourceLimits ¶ added in v0.9.7
type ListResourceLimits struct {
Account string `json:"account,omittempty"`
DomainID string `json:"domainid,omitempty"`
ID string `json:"id,omitempty"`
IsRecursive *bool `json:"isrecursive,omitempty"`
Keyword string `json:"keyword,omitempty"`
ListAll *bool `json:"listall,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
ProjectID string `json:"projectid,omitempty"`
ResourceType ResourceType `json:"resourcetype,omitempty"`
ResourceTypeName ResourceTypeName `json:"resourcetypename,omitempty"`
}
ListResourceLimits lists the resource limits
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/listResourceLimits.html
func (*ListResourceLimits) APIName ¶ added in v0.9.11
func (*ListResourceLimits) APIName() string
APIName returns the CloudStack API command name
type ListResourceLimitsResponse ¶ added in v0.9.7
type ListResourceLimitsResponse struct {
Count int `json:"count"`
ResourceLimit []ResourceLimit `json:"resourcelimit"`
}
ListResourceLimitsResponse represents a list of resource limits
type ListSSHKeyPairs ¶ added in v0.9.0
type ListSSHKeyPairs struct {
Account string `json:"account,omitempty"`
DomainID string `json:"domainid,omitempty"`
Fingerprint string `json:"fingerprint,omitempty"`
IsRecursive *bool `json:"isrecursive,omitempty"`
Keyword string `json:"keyword,omitempty"`
ListAll *bool `json:"listall,omitempty"`
Name string `json:"name,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
ProjectID string `json:"projectid,omitempty"`
}
ListSSHKeyPairs represents a query for a list of SSH KeyPairs
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/listSSHKeyPairs.html
func (*ListSSHKeyPairs) APIName ¶ added in v0.9.11
func (*ListSSHKeyPairs) APIName() string
APIName returns the CloudStack API command name
type ListSSHKeyPairsResponse ¶
type ListSSHKeyPairsResponse struct {
Count int `json:"count"`
SSHKeyPair []SSHKeyPair `json:"sshkeypair"`
}
ListSSHKeyPairsResponse represents a list of SSH key pairs
type ListSecurityGroups ¶ added in v0.9.0
type ListSecurityGroups struct {
Account string `json:"account,omitempty"`
DomainID string `json:"domainid,omitempty"`
ID string `json:"id,omitempty"`
IsRecursive *bool `json:"isrecursive,omitempty"`
Keyword string `json:"keyword,omitempty"`
ListAll *bool `json:"listall,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
ProjectID string `json:"projectid,omitempty"`
Type string `json:"type,omitempty"`
SecurityGroupName string `json:"securitygroupname,omitempty"`
Tags []ResourceTag `json:"tags,omitempty"`
VirtualMachineID string `json:"virtualmachineid,omitempty"`
}
ListSecurityGroups represents a search for security groups
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/listSecurityGroups.html
func (*ListSecurityGroups) APIName ¶ added in v0.9.11
func (*ListSecurityGroups) APIName() string
APIName returns the CloudStack API command name
type ListSecurityGroupsResponse ¶
type ListSecurityGroupsResponse struct {
Count int `json:"count"`
SecurityGroup []SecurityGroup `json:"securitygroup"`
}
ListSecurityGroupsResponse represents a list of security groups
type ListServiceOfferings ¶ added in v0.9.0
type ListServiceOfferings struct {
DomainID string `json:"domainid,omitempty"`
ID string `json:"id,omitempty"`
IsRecursive *bool `json:"isrecursive,omitempty"`
IsSystem *bool `json:"issystem,omitempty"`
Keyword string `json:"keyword,omitempty"`
Name string `json:"name,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
SystemVMType string `json:"systemvmtype,omitempty"` // consoleproxy, secondarystoragevm, or domainrouter
VirtualMachineID string `json:"virtualmachineid,omitempty"`
}
ListServiceOfferings represents a query for service offerings
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/listServiceOfferings.html
func (*ListServiceOfferings) APIName ¶ added in v0.9.11
func (*ListServiceOfferings) APIName() string
APIName returns the CloudStack API command name
type ListServiceOfferingsResponse ¶
type ListServiceOfferingsResponse struct {
Count int `json:"count"`
ServiceOffering []ServiceOffering `json:"serviceoffering"`
}
ListServiceOfferingsResponse represents a list of service offerings
type ListSnapshots ¶ added in v0.9.0
type ListSnapshots struct {
Account string `json:"account,omitempty"`
DomainID string `json:"domainid,omitempty"`
ID string `json:"id,omitempty"`
IntervalType string `json:"intervaltype,omitempty"`
IsRecursive *bool `json:"isrecursive,omitempty"`
Keyword string `json:"keyword,omitempty"`
ListAll *bool `json:"listall,omitempty"`
Name string `json:"name,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
ProjectID string `json:"projectid,omitempty"`
SnapshotType string `json:"snapshottype,omitempty"`
Tags []ResourceTag `json:"tags,omitempty"`
VolumeID string `json:"volumeid,omitempty"`
ZoneID string `json:"zoneid,omitempty"`
}
ListSnapshots lists the volume snapshots
CloudStackAPI: http://cloudstack.apache.org/api/apidocs-4.10/apis/listSnapshots.html
func (*ListSnapshots) APIName ¶ added in v0.9.11
func (*ListSnapshots) APIName() string
APIName returns the CloudStack API command name
type ListSnapshotsResponse ¶ added in v0.9.0
type ListSnapshotsResponse struct {
Count int `json:"count"`
Snapshot []Snapshot `json:"snapshot"`
}
ListSnapshotsResponse represents a list of volume snapshots
type ListTags ¶ added in v0.9.0
type ListTags struct {
Account string `json:"account,omitempty"`
Customer string `json:"customer,omitempty"`
DomainID string `json:"domainid,omitempty"`
IsRecursive *bool `json:"isrecursive,omitempty"`
Key string `json:"key,omitempty"`
Keyword string `json:"keyword,omitempty"`
ListAll *bool `json:"listall,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
ProjectID string `json:"projectid,omitempty"`
ResourceID string `json:"resourceid,omitempty"`
ResourceType string `json:"resourcetype,omitempty"`
Value string `json:"value,omitempty"`
}
ListTags list resource tag(s)
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/listTags.html
type ListTagsResponse ¶ added in v0.9.0
type ListTagsResponse struct {
Count int `json:"count"`
Tag []ResourceTag `json:"tag"`
}
ListTagsResponse represents a list of resource tags
type ListTemplates ¶ added in v0.9.0
type ListTemplates struct {
TemplateFilter string `json:"templatefilter"` // featured, etc.
Account string `json:"account,omitempty"`
DomainID string `json:"domainid,omitempty"`
Hypervisor string `json:"hypervisor,omitempty"`
ID string `json:"id,omitempty"`
IsRecursive *bool `json:"isrecursive,omitempty"`
Keyword string `json:"keyword,omitempty"`
ListAll *bool `json:"listall,omitempty"`
Name string `json:"name,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
ProjectID string `json:"projectid,omitempty"`
ShowRemoved *bool `json:"showremoved,omitempty"`
Tags []ResourceTag `json:"tags,omitempty"`
ZoneID string `json:"zoneid,omitempty"`
}
ListTemplates represents a template query filter
func (*ListTemplates) APIName ¶ added in v0.9.11
func (*ListTemplates) APIName() string
APIName returns the CloudStack API command name
type ListTemplatesResponse ¶
type ListTemplatesResponse struct {
Count int `json:"count"`
Template []Template `json:"template"`
}
ListTemplatesResponse represents a list of templates
type ListVirtualMachines ¶ added in v0.9.0
type ListVirtualMachines struct {
Account string `json:"account,omitempty"`
AffinityGroupID string `json:"affinitygroupid,omitempty"`
Details map[string]string `json:"details,omitempty"`
DisplayVM *bool `json:"displayvm,omitempty"` // root only
DomainID string `json:"domainid,omitempty"`
ForVirtualNetwork *bool `json:"forvirtualnetwork,omitempty"`
GroupID string `json:"groupid,omitempty"`
HostID string `json:"hostid,omitempty"`
Hypervisor string `json:"hypervisor,omitempty"`
ID string `json:"id,omitempty"`
IDs []string `json:"ids,omitempty"` // mutually exclusive with id
IsoID string `json:"isoid,omitempty"`
IsRecursive *bool `json:"isrecursive,omitempty"`
KeyPair string `json:"keypair,omitempty"`
Keyword string `json:"keyword,omitempty"`
ListAll *bool `json:"listall,omitempty"`
Name string `json:"name,omitempty"`
NetworkID string `json:"networkid,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
PodID string `json:"podid,omitempty"`
ProjectID string `json:"projectid,omitempty"`
ServiceOfferindID string `json:"serviceofferingid,omitempty"`
State string `json:"state,omitempty"` // Running, Stopped, Present, ...
StorageID string `json:"storageid,omitempty"`
Tags []ResourceTag `json:"tags,omitempty"`
TemplateID string `json:"templateid,omitempty"`
UserID string `json:"userid,omitempty"`
VpcID string `json:"vpcid,omitempty"`
ZoneID string `json:"zoneid,omitempty"`
}
ListVirtualMachines represents a search for a VM
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/listVirtualMachine.html
func (*ListVirtualMachines) APIName ¶ added in v0.9.11
func (*ListVirtualMachines) APIName() string
APIName returns the CloudStack API command name
type ListVirtualMachinesResponse ¶
type ListVirtualMachinesResponse struct {
Count int `json:"count"`
VirtualMachine []VirtualMachine `json:"virtualmachine"`
}
ListVirtualMachinesResponse represents a list of virtual machines
type ListVolumes ¶ added in v0.9.0
type ListVolumes struct {
Account string `json:"account,omitempty"`
DiskOfferingID string `json:"diskoffering,omitempty"`
DisplayVolume string `json:"displayvolume,omitempty"` // root only
DomainID string `json:"domainid,omitempty"`
HostID string `json:"hostid,omitempty"`
ID string `json:"id,omitempty"`
IsRecursive *bool `json:"isrecursive,omitempty"`
Keyword string `json:"keyword,omitempty"`
ListAll *bool `json:"listall,omitempty"`
Name string `json:"name,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
PodID string `json:"podid,omitempty"`
ProjectID string `json:"projectid,omitempty"`
StorageID string `json:"storageid,omitempty"`
Tags []ResourceTag `json:"tags,omitempty"`
Type string `json:"type,omitempty"`
VirtualMachineID string `json:"virtualmachineid,omitempty"`
ZoneID string `json:"zoneid,omitempty"`
}
ListVolumes represents a query listing volumes
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/listVolumes.html
func (*ListVolumes) APIName ¶ added in v0.9.11
func (*ListVolumes) APIName() string
APIName returns the CloudStack API command name
type ListVolumesResponse ¶ added in v0.9.0
ListVolumesResponse represents a list of volumes
type ListZones ¶ added in v0.9.0
type ListZones struct {
Available *bool `json:"available,omitempty"`
DomainID string `json:"domainid,omitempty"`
ID string `json:"id,omitempty"`
Keyword string `json:"keyword,omitempty"`
Name string `json:"name,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
ShowCapacities *bool `json:"showcapacities,omitempty"`
Tags []ResourceTag `json:"tags,omitempty"`
}
ListZones represents a query for zones
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/listZones.html
type ListZonesResponse ¶
ListZonesResponse represents a list of zones
type Listable ¶ added in v0.9.16
type Listable interface {
// List search the given resources and paginates till the end of time
List(context context.Context, client *Client) (<-chan interface{}, <-chan error)
}
Listable represents an Interface that can be "List" by the client
type Network ¶ added in v0.9.0
type Network struct {
ID string `json:"id"`
Account string `json:"account"`
ACLID string `json:"aclid,omitempty"`
ACLType string `json:"acltype,omitempty"`
BroadcastDomainType string `json:"broadcastdomaintype,omitempty"`
BroadcastURI string `json:"broadcasturi,omitempty"`
CanUseForDeploy bool `json:"canusefordeploy,omitempty"`
Cidr string `json:"cidr,omitempty"`
DisplayNetwork bool `json:"diplaynetwork,omitempty"`
DisplayText string `json:"displaytext"`
DNS1 net.IP `json:"dns1,omitempty"`
DNS2 net.IP `json:"dns2,omitempty"`
Domain string `json:"domain,omitempty"`
DomainID string `json:"domainid,omitempty"`
Gateway net.IP `json:"gateway,omitempty"`
IP6Cidr string `json:"ip6cidr,omitempty"`
IP6Gateway net.IP `json:"ip6gateway,omitempty"`
IsDefault bool `json:"isdefault,omitempty"`
IsPersistent bool `json:"ispersistent,omitempty"`
Name string `json:"name"`
Netmask net.IP `json:"netmask,omitempty"`
NetworkCidr string `json:"networkcidr,omitempty"`
NetworkDomain string `json:"networkdomain,omitempty"`
NetworkOfferingAvailability string `json:"networkofferingavailability,omitempty"`
NetworkOfferingConserveMode bool `json:"networkofferingconservemode,omitempty"`
NetworkOfferingDisplayText string `json:"networkofferingdisplaytext,omitempty"`
NetworkOfferingID string `json:"networkofferingid,omitempty"`
NetworkOfferingName string `json:"networkofferingname,omitempty"`
PhysicalNetworkID string `json:"physicalnetworkid,omitempty"`
Project string `json:"project,omitempty"`
ProjectID string `json:"projectid,omitempty"`
Related string `json:"related,omitempty"`
ReserveIPRange string `json:"reserveiprange,omitempty"`
RestartRequired bool `json:"restartrequired,omitempty"`
SpecifyIPRanges bool `json:"specifyipranges,omitempty"`
State string `json:"state"`
StrechedL2Subnet bool `json:"strechedl2subnet,omitempty"`
SubdomainAccess bool `json:"subdomainaccess,omitempty"`
TrafficType string `json:"traffictype"`
Type string `json:"type"`
Vlan string `json:"vlan,omitemtpy"` // root only
VpcID string `json:"vpcid,omitempty"`
ZoneID string `json:"zoneid,omitempty"`
ZoneName string `json:"zonename,omitempty"`
ZonesNetworkSpans string `json:"zonesnetworkspans,omitempty"`
Service []Service `json:"service"`
Tags []ResourceTag `json:"tags"`
}
Network represents a network
func (*Network) ResourceType ¶ added in v0.9.7
ResourceType returns the type of the resource
type NetworkOffering ¶ added in v0.9.0
type NetworkOffering struct {
ID string `json:"id"`
Availability string `json:"availability,omitempty"`
ConserveMode bool `json:"conservemode,omitempty"`
Created string `json:"created"`
Details map[string]string `json:"details,omitempty"`
DisplayText string `json:"displaytext,omitempty"`
EgressDefaultPolicy bool `json:"egressdefaultpolicy,omitempty"`
ForVPC bool `json:"forvpc,omitempty"`
GuestIPType string `json:"guestiptype,omitempty"`
IsDefault bool `json:"isdefault,omitempty"`
IsPersistent bool `json:"ispersistent,omitempty"`
MaxConnections int `json:"maxconnections,omitempty"`
Name string `json:"name,omitempty"`
NetworkRate int `json:"networkrate,omitempty"`
ServiceOfferingID string `json:"serviceofferingid,omitempty"`
SpecifyIPRanges bool `json:"specifyipranges,omitempty"`
SpecifyVlan bool `json:"specifyvlan,omitempty"`
State string `json:"state"` // Disabled/Enabled/Inactive
SupportsPublicAccess bool `json:"supportspublicaccess,omitempty"`
SupportsStrechedL2Subnet bool `json:"supportsstrechedl2subnet,omitempty"`
Tags []ResourceTag `json:"tags,omitempty"`
TrafficType string `json:"traffictype,omitempty"` // Public, Management, Control, ...
Service []Service `json:"service,omitempty"`
}
NetworkOffering corresponds to the Compute Offerings
type NetworkResponse ¶ added in v0.9.0
type NetworkResponse struct {
Network Network `json:"network"`
}
NetworkResponse represents a network
type Nic ¶ added in v0.9.0
type Nic struct {
ID string `json:"id,omitempty"`
BroadcastURI string `json:"broadcasturi,omitempty"`
Gateway net.IP `json:"gateway,omitempty"`
IP6Address net.IP `json:"ip6address,omitempty"`
IP6Cidr string `json:"ip6cidr,omitempty"`
IP6Gateway net.IP `json:"ip6gateway,omitempty"`
IPAddress net.IP `json:"ipaddress,omitempty"`
IsDefault bool `json:"isdefault,omitempty"`
IsolationURI string `json:"isolationuri,omitempty"`
MacAddress string `json:"macaddress,omitempty"`
Netmask net.IP `json:"netmask,omitempty"`
NetworkID string `json:"networkid,omitempty"`
NetworkName string `json:"networkname,omitempty"`
SecondaryIP []NicSecondaryIP `json:"secondaryip,omitempty"`
TrafficType string `json:"traffictype,omitempty"`
Type string `json:"type,omitempty"`
VirtualMachineID string `json:"virtualmachineid,omitempty"`
}
Nic represents a Network Interface Controller (NIC)
type NicSecondaryIP ¶ added in v0.9.0
type NicSecondaryIP struct {
ID string `json:"id"`
IPAddress net.IP `json:"ipaddress"`
NetworkID string `json:"networkid"`
NicID string `json:"nicid"`
VirtualMachineID string `json:"virtualmachineid,omitempty"`
}
NicSecondaryIP represents a link between NicID and IPAddress
type Password ¶ added in v0.9.14
type Password struct {
EncryptedPassword string `json:"encryptedpassword"`
}
Password represents an encrypted password
TODO: method to decrypt it, https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=34014652
type QueryAsyncJobResult ¶ added in v0.9.0
type QueryAsyncJobResult struct {
JobID string `json:"jobid"`
}
QueryAsyncJobResult represents a query to fetch the status of async job
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/queryAsyncJobResult.html
func (*QueryAsyncJobResult) APIName ¶ added in v0.9.11
func (*QueryAsyncJobResult) APIName() string
APIName returns the CloudStack API command name
type QueryAsyncJobResultResponse ¶
type QueryAsyncJobResultResponse AsyncJobResult
QueryAsyncJobResultResponse represents the current status of an asynchronous job
type RebootVirtualMachine ¶ added in v0.9.0
type RebootVirtualMachine struct {
ID string `json:"id"`
}
RebootVirtualMachine (Async) represents the rebooting of the virtual machine
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/rebootVirtualMachine.html
func (*RebootVirtualMachine) APIName ¶ added in v0.9.11
func (*RebootVirtualMachine) APIName() string
APIName returns the CloudStack API command name
type RebootVirtualMachineResponse ¶
type RebootVirtualMachineResponse VirtualMachineResponse
RebootVirtualMachineResponse represents a rebooted VM instance
type RecoverVirtualMachine ¶ added in v0.9.0
type RecoverVirtualMachine struct {
ID string `json:"virtualmachineid"`
}
RecoverVirtualMachine represents the restoration of the virtual machine
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/recoverVirtualMachine.html
func (*RecoverVirtualMachine) APIName ¶ added in v0.9.11
func (*RecoverVirtualMachine) APIName() string
APIName returns the CloudStack API command name
type RecoverVirtualMachineResponse ¶ added in v0.9.0
type RecoverVirtualMachineResponse VirtualMachineResponse
RecoverVirtualMachineResponse represents a recovered VM instance
type RegisterSSHKeyPair ¶ added in v0.9.0
type RegisterSSHKeyPair struct {
Name string `json:"name"`
PublicKey string `json:"publickey"`
Account string `json:"account,omitempty"`
DomainID string `json:"domainid,omitempty"`
ProjectID string `json:"projectid,omitempty"`
}
RegisterSSHKeyPair represents a new registration of a public key in a keypair
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/registerSSHKeyPair.html
func (*RegisterSSHKeyPair) APIName ¶ added in v0.9.11
func (*RegisterSSHKeyPair) APIName() string
APIName returns the CloudStack API command name
type RegisterSSHKeyPairResponse ¶ added in v0.9.0
type RegisterSSHKeyPairResponse struct {
KeyPair SSHKeyPair `json:"keypair"`
}
RegisterSSHKeyPairResponse represents the creation of an SSH Key Pair
type RegisterUserKeys ¶ added in v0.9.7
type RegisterUserKeys struct {
ID string `json:"id"`
}
RegisterUserKeys registers a new set of key of the given user
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/registerUserKeys.html
func (*RegisterUserKeys) APIName ¶ added in v0.9.11
func (*RegisterUserKeys) APIName() string
APIName returns the CloudStack API command name
type RegisterUserKeysResponse ¶ added in v0.9.7
type RegisterUserKeysResponse struct {
UserKeys User `json:"userkeys"`
}
RegisterUserKeysResponse represents a new set of UserKeys
NB: only the APIKey and SecretKey will be filled
type RemoveIPFromNic ¶ added in v0.9.0
type RemoveIPFromNic struct {
ID string `json:"id"`
}
RemoveIPFromNic (Async) represents a deletion request
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/removeIpFromNic.html
func (*RemoveIPFromNic) APIName ¶ added in v0.9.11
func (*RemoveIPFromNic) APIName() string
APIName returns the CloudStack API command name: removeIpFromNic
type RemoveNicFromVirtualMachine ¶ added in v0.9.0
type RemoveNicFromVirtualMachine struct {
NicID string `json:"nicid"`
VirtualMachineID string `json:"virtualmachineid"`
}
RemoveNicFromVirtualMachine (Async) removes a NIC from a VM
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/removeNicFromVirtualMachine.html
func (*RemoveNicFromVirtualMachine) APIName ¶ added in v0.9.11
func (*RemoveNicFromVirtualMachine) APIName() string
APIName returns the CloudStack API command name
type RemoveNicFromVirtualMachineResponse ¶ added in v0.9.0
type RemoveNicFromVirtualMachineResponse VirtualMachineResponse
RemoveNicFromVirtualMachineResponse represents the modified VM
type ResetPasswordForVirtualMachine ¶ added in v0.9.0
type ResetPasswordForVirtualMachine ScaleVirtualMachine
ResetPasswordForVirtualMachine (Async) represents the scaling of a VM
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/resetPasswordForVirtualMachine.html
func (*ResetPasswordForVirtualMachine) APIName ¶ added in v0.9.11
func (*ResetPasswordForVirtualMachine) APIName() string
APIName returns the CloudStack API command name
type ResetPasswordForVirtualMachineResponse ¶ added in v0.9.0
type ResetPasswordForVirtualMachineResponse VirtualMachineResponse
ResetPasswordForVirtualMachineResponse represents the updated vm
type ResetSSHKeyForVirtualMachine ¶ added in v0.9.0
type ResetSSHKeyForVirtualMachine struct {
ID string `json:"id"`
KeyPair string `json:"keypair"`
Account string `json:"account,omitempty"`
DomainID string `json:"domainid,omitempty"`
ProjectID string `json:"projectid,omitempty"`
}
ResetSSHKeyForVirtualMachine (Async) represents a change for the key pairs
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/resetSSHKeyForVirtualMachine.html
func (*ResetSSHKeyForVirtualMachine) APIName ¶ added in v0.9.11
func (*ResetSSHKeyForVirtualMachine) APIName() string
APIName returns the CloudStack API command name
type ResetSSHKeyForVirtualMachineResponse ¶ added in v0.9.0
type ResetSSHKeyForVirtualMachineResponse VirtualMachineResponse
ResetSSHKeyForVirtualMachineResponse represents the modified VirtualMachine
type ResizeVolume ¶ added in v0.9.0
type ResizeVolume struct {
ID string `json:"id"`
DiskOfferingID string `json:"diskofferingid,omitempty"`
ShrinkOk *bool `json:"shrinkok,omitempty"`
Size int64 `json:"size,omitempty"` // in GiB
}
ResizeVolume (Async) resizes a volume
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/resizeVolume.html
func (*ResizeVolume) APIName ¶ added in v0.9.11
func (*ResizeVolume) APIName() string
APIName returns the CloudStack API command name
type ResizeVolumeResponse ¶ added in v0.9.0
type ResizeVolumeResponse struct {
Volume Volume `json:"volume"`
}
ResizeVolumeResponse represents the new Volume
type ResourceLimit ¶ added in v0.9.7
type ResourceLimit struct {
Account string `json:"account,omitempty"`
Domain string `json:"domain,omitempty"`
DomainID string `json:"domainid,omitempty"`
Max int64 `json:"max,omitempty"` // -1 means the sky is the limit
Project string `json:"project,omitempty"`
ProjectID string `json:"projectid,omitempty"`
ResourceType ResourceType `json:"resourcetype,omitempty"`
ResourceTypeName ResourceTypeName `json:"resourcetypename,omitempty"`
}
ResourceLimit represents the limit on a particular resource
type ResourceTag ¶ added in v0.9.0
type ResourceTag struct {
Account string `json:"account,omitempty"`
Customer string `json:"customer,omitempty"`
Domain string `json:"domain,omitempty"`
DomainID string `json:"domainid,omitempty"`
Key string `json:"key"`
Project string `json:"project,omitempty"`
ProjectID string `json:"projectid,omitempty"`
ResourceID string `json:"resourceid,omitempty"`
ResourceType string `json:"resourcetype,omitempty"`
Value string `json:"value"`
}
ResourceTag is a tag associated with a resource
http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/4.9/management.html
type ResourceType ¶ added in v0.9.7
type ResourceType int64
ResourceType represents the ID of a resource type (for limits)
const ( // VirtualMachineType is the resource type ID of a VM VirtualMachineType ResourceType = iota // IPAddressType is the resource type ID of an IP address IPAddressType // VolumeType is the resource type ID of a volume VolumeType // SnapshotType is the resource type ID of a snapshot SnapshotType // TemplateType is the resource type ID of a template TemplateType // ProjectType is the resource type ID of a project ProjectType // NetworkType is the resource type ID of a network NetworkType // VPCType is the resource type ID of a VPC VPCType // CPUType is the resource type ID of a CPU CPUType // MemoryType is the resource type ID of Memory MemoryType // PrimaryStorageType is the resource type ID of primary storage PrimaryStorageType // SecondaryStorageType is the resource type ID of secondary storage SecondaryStorageType )
type ResourceTypeName ¶ added in v0.9.7
type ResourceTypeName string
ResourceTypeName represents the name of a resource type (for limits)
type RestartNetwork ¶ added in v0.9.0
RestartNetwork updates a network
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/restartNetwork.html
func (*RestartNetwork) APIName ¶ added in v0.9.11
func (*RestartNetwork) APIName() string
APIName returns the CloudStack API command name
type RestartNetworkResponse ¶ added in v0.9.0
type RestartNetworkResponse NetworkResponse
RestartNetworkResponse represents a freshly created network
type RestoreVirtualMachine ¶ added in v0.9.0
type RestoreVirtualMachine struct {
VirtualMachineID string `json:"virtualmachineid"`
TemplateID string `json:"templateid,omitempty"`
RootDiskSize string `json:"rootdisksize,omitempty"` // in GiB, Exoscale specific
}
RestoreVirtualMachine (Async) represents the restoration of the virtual machine
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/restoreVirtualMachine.html
func (*RestoreVirtualMachine) APIName ¶ added in v0.9.11
func (*RestoreVirtualMachine) APIName() string
APIName returns the CloudStack API command name
type RestoreVirtualMachineResponse ¶ added in v0.9.0
type RestoreVirtualMachineResponse VirtualMachineResponse
RestoreVirtualMachineResponse represents a restored VM instance
type RetryStrategyFunc ¶ added in v0.9.11
RetryStrategyFunc represents a how much time to wait between two calls to CloudStack
type RevertSnapshot ¶ added in v0.9.0
type RevertSnapshot struct {
ID string `json:"id"`
}
RevertSnapshot revert a volume snapshot
CloudStackAPI: http://cloudstack.apache.org/api/apidocs-4.10/apis/revertSnapshot.html
func (*RevertSnapshot) APIName ¶ added in v0.9.11
func (*RevertSnapshot) APIName() string
APIName returns the CloudStack API command name
type RevokeSecurityGroupEgress ¶ added in v0.9.0
type RevokeSecurityGroupEgress struct {
ID string `json:"id"`
}
RevokeSecurityGroupEgress (Async) represents the ingress/egress rule deletion
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/revokeSecurityGroupEgress.html
func (*RevokeSecurityGroupEgress) APIName ¶ added in v0.9.11
func (*RevokeSecurityGroupEgress) APIName() string
APIName returns the CloudStack API command name
type RevokeSecurityGroupIngress ¶ added in v0.9.0
type RevokeSecurityGroupIngress struct {
ID string `json:"id"`
}
RevokeSecurityGroupIngress (Async) represents the ingress/egress rule deletion
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/revokeSecurityGroupIngress.html
func (*RevokeSecurityGroupIngress) APIName ¶ added in v0.9.11
func (*RevokeSecurityGroupIngress) APIName() string
APIName returns the CloudStack API command name
type SSHKeyPair ¶
type SSHKeyPair struct {
Account string `json:"account,omitempty"` // must be used with a Domain ID
DomainID string `json:"domainid,omitempty"`
ProjectID string `json:"projectid,omitempty"`
Fingerprint string `json:"fingerprint,omitempty"`
Name string `json:"name,omitempty"`
PrivateKey string `json:"privatekey,omitempty"`
}
SSHKeyPair represents an SSH key pair
type ScaleVirtualMachine ¶ added in v0.9.0
type ScaleVirtualMachine struct {
ID string `json:"id"`
ServiceOfferingID string `json:"serviceofferingid"`
Details map[string]string `json:"details,omitempty"`
}
ScaleVirtualMachine (Async) represents the scaling of a VM
ChangeServiceForVirtualMachine does the same thing but returns the new Virtual Machine which is more consistent with the rest of the API.
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/scaleVirtualMachine.html
func (*ScaleVirtualMachine) APIName ¶ added in v0.9.11
func (*ScaleVirtualMachine) APIName() string
APIName returns the CloudStack API command name
type SecurityGroup ¶
type SecurityGroup struct {
ID string `json:"id"`
Account string `json:"account,omitempty"`
Description string `json:"description,omitempty"`
Domain string `json:"domain,omitempty"`
DomainID string `json:"domainid,omitempty"`
Name string `json:"name"`
Project string `json:"project,omitempty"`
ProjectID string `json:"projectid,omitempty"`
VirtualMachineCount int `json:"virtualmachinecount,omitempty"` // CloudStack 4.6+
VirtualMachineIDs []string `json:"virtualmachineids,omitempty"` // CloudStack 4.6+
IngressRule []IngressRule `json:"ingressrule"`
EgressRule []EgressRule `json:"egressrule"`
Tags []ResourceTag `json:"tags,omitempty"`
JobID string `json:"jobid,omitempty"`
JobStatus JobStatusType `json:"jobstatus,omitempty"`
}
SecurityGroup represent a firewalling set of rules
func (*SecurityGroup) Delete ¶ added in v0.9.12
func (sg *SecurityGroup) Delete(ctx context.Context, client *Client) error
Delete deletes the given Security Group
func (*SecurityGroup) Get ¶ added in v0.9.12
func (sg *SecurityGroup) Get(ctx context.Context, client *Client) error
Get loads the given Security Group
func (*SecurityGroup) ResourceType ¶ added in v0.9.7
func (*SecurityGroup) ResourceType() string
ResourceType returns the type of the resource
type SecurityGroupResponse ¶ added in v0.9.0
type SecurityGroupResponse struct {
SecurityGroup SecurityGroup `json:"securitygroup"`
}
SecurityGroupResponse represents a generic security group response
type Service ¶ added in v0.9.0
type Service struct {
Name string `json:"name"`
Capability []ServiceCapability `json:"capability,omitempty"`
Provider []ServiceProvider `json:"provider,omitempty"`
}
Service is a feature of a network
type ServiceCapability ¶ added in v0.9.0
type ServiceCapability struct {
CanChooseServiceCapability bool `json:"canchooseservicecapability"`
Name string `json:"name"`
Value string `json:"value"`
}
ServiceCapability represents optional capability of a service
type ServiceOffering ¶
type ServiceOffering struct {
ID string `json:"id"`
CPUNumber int `json:"cpunumber"`
CPUSpeed int `json:"cpuspeed"`
Created string `json:"created"`
DefaultUse bool `json:"defaultuse,omitempty"`
DeploymentPlanner string `json:"deploymentplanner,omitempty"`
DiskBytesReadRate int64 `json:"diskBytesReadRate,omitempty"`
DiskBytesWriteRate int64 `json:"diskBytesWriteRate,omitempty"`
DiskIopsReadRate int64 `json:"diskIopsReadRate,omitempty"`
DiskIopsWriteRate int64 `json:"diskIopsWriteRate,omitempty"`
DisplayText string `json:"displaytext,omitempty"`
Domain string `json:"domain"`
DomainID string `json:"domainid"`
HostTags string `json:"hosttags,omitempty"`
HypervisorSnapshotReserve int `json:"hypervisorsnapshotreserve,omitempty"`
IsCustomized bool `json:"iscustomized,omitempty"`
IsCustomizedIops bool `json:"iscustomizediops,omitempty"`
IsSystem bool `json:"issystem,omitempty"`
IsVolatile bool `json:"isvolatile,omitempty"`
LimitCPUUse bool `json:"limitcpuuse,omitempty"`
MaxIops int64 `json:"maxiops,omitempty"`
Memory int `json:"memory,omitempty"`
MinIops int64 `json:"miniops,omitempty"`
Name string `json:"name,omitempty"`
NetworkRate int `json:"networkrate,omitempty"`
OfferHA bool `json:"offerha,omitempty"`
ServiceOfferingDetails map[string]string `json:"serviceofferingdetails,omitempty"`
StorageType string `json:"storagetype,omitempty"`
SystemVMType string `json:"systemvmtype,omitempty"`
Tags []ResourceTag `json:"tags,omitempty"`
}
ServiceOffering corresponds to the Compute Offerings
type ServiceProvider ¶ added in v0.9.0
type ServiceProvider struct {
ID string `json:"id"`
CanEnableIndividualService bool `json:"canenableindividualservice"`
DestinationPhysicalNetworkID string `json:"destinationphysicalnetworkid"`
Name string `json:"name"`
PhysicalNetworkID string `json:"physicalnetworkid"`
ServiceList []string `json:"servicelist,omitempty"`
}
ServiceProvider represents the provider of the service
type Snapshot ¶ added in v0.9.0
type Snapshot struct {
ID string `json:"id"`
Account string `json:"account"`
Created string `json:"created,omitempty"`
Domain string `json:"domain"`
DomainID string `json:"domainid"`
IntervalType string `json:"intervaltype,omitempty"` // hourly, daily, weekly, monthly, ..., none
Name string `json:"name,omitempty"`
PhysicalSize int64 `json:"physicalsize"`
Project string `json:"project"`
ProjectID string `json:"projectid"`
Revertable bool `json:"revertable,omitempty"`
Size int64 `json:"size,omitempty"`
SnapshotType string `json:"snapshottype,omitempty"`
State string `json:"state"` // BackedUp, Creating, BackingUp, ...
VolumeID string `json:"volumeid"`
VolumeName string `json:"volumename,omitempty"`
VolumeType string `json:"volumetype,omitempty"`
ZoneID string `json:"zoneid"`
Tags []ResourceTag `json:"tags"`
JobID string `json:"jobid,omitempty"`
JobStatus JobStatusType `json:"jobstatus,omitempty"`
}
Snapshot represents a volume snapshot
func (*Snapshot) ResourceType ¶ added in v0.9.7
ResourceType returns the type of the resource
type StartVirtualMachine ¶ added in v0.9.0
type StartVirtualMachine struct {
ID string `json:"id"`
DeploymentPlanner string `json:"deploymentplanner,omitempty"` // root only
HostID string `json:"hostid,omitempty"` // root only
}
StartVirtualMachine (Async) represents the creation of the virtual machine
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/startVirtualMachine.html
func (*StartVirtualMachine) APIName ¶ added in v0.9.11
func (*StartVirtualMachine) APIName() string
APIName returns the CloudStack API command name
type StartVirtualMachineResponse ¶
type StartVirtualMachineResponse VirtualMachineResponse
StartVirtualMachineResponse represents a started VM instance
type StopVirtualMachine ¶ added in v0.9.0
StopVirtualMachine (Async) represents the stopping of the virtual machine
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/stopVirtualMachine.html
func (*StopVirtualMachine) APIName ¶ added in v0.9.11
func (*StopVirtualMachine) APIName() string
APIName returns the CloudStack API command name
type StopVirtualMachineResponse ¶
type StopVirtualMachineResponse VirtualMachineResponse
StopVirtualMachineResponse represents a stopped VM instance
type Taggable ¶ added in v0.9.7
type Taggable interface {
// CloudStack resource type of the Taggable type
ResourceType() string
}
Taggable represents a resource which can have tags attached
This is a helper to fill the resourcetype of a CreateTags call
type Template ¶
type Template struct {
Account string `json:"account,omitempty"`
AccountID string `json:"accountid,omitempty"`
Bootable bool `json:"bootable,omitempty"`
Checksum string `json:"checksum,omitempty"`
Created string `json:"created,omitempty"`
CrossZones bool `json:"crossZones,omitempty"`
Details map[string]string `json:"details,omitempty"`
DisplayText string `json:"displaytext,omitempty"`
Domain string `json:"domain,omitempty"`
DomainID string `json:"domainid,omitempty"`
Format string `json:"format,omitempty"`
HostID string `json:"hostid,omitempty"`
HostName string `json:"hostname,omitempty"`
Hypervisor string `json:"hypervisor,omitempty"`
ID string `json:"id,omitempty"`
IsDynamicallyScalable bool `json:"isdynamicallyscalable,omitempty"`
IsExtractable bool `json:"isextractable,omitempty"`
IsFeatured bool `json:"isfeatured,omitempty"`
IsPublic bool `json:"ispublic,omitempty"`
IsReady bool `json:"isready,omitempty"`
Name string `json:"name,omitempty"`
OsTypeID string `json:"ostypeid,omitempty"`
OsTypeName string `json:"ostypename,omitempty"`
PasswordEnabled bool `json:"passwordenabled,omitempty"`
Project string `json:"project,omitempty"`
ProjectID string `json:"projectid,omitempty"`
Removed string `json:"removed,omitempty"`
Size int64 `json:"size,omitempty"`
SourceTemplateID string `json:"sourcetemplateid,omitempty"`
SSHKeyEnabled bool `json:"sshkeyenabled,omitempty"`
Status string `json:"status,omitempty"`
Zoneid string `json:"zoneid,omitempty"`
Zonename string `json:"zonename,omitempty"`
}
Template represents a machine to be deployed
func (*Template) ResourceType ¶ added in v0.9.7
ResourceType returns the type of the resource
type UUIDItem ¶ added in v0.9.9
type UUIDItem struct {
Description string `json:"description,omitempty"`
SerialVersionUID int64 `json:"serialVersionUID,omitempty"`
UUID string `json:"uuid"`
}
UUIDItem represents an item of the UUIDList part of an ErrorResponse
type UpdateDefaultNicForVirtualMachine ¶ added in v0.9.0
type UpdateDefaultNicForVirtualMachine struct {
NetworkID string `json:"networkid"`
VirtualMachineID string `json:"virtualmachineid"`
IPAddress net.IP `json:"ipaddress,omitempty"`
}
UpdateDefaultNicForVirtualMachine (Async) adds a NIC to a VM
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/updateDefaultNicForVirtualMachine.html
func (*UpdateDefaultNicForVirtualMachine) APIName ¶ added in v0.9.11
func (*UpdateDefaultNicForVirtualMachine) APIName() string
APIName returns the CloudStack API command name
type UpdateDefaultNicForVirtualMachineResponse ¶ added in v0.9.0
type UpdateDefaultNicForVirtualMachineResponse VirtualMachineResponse
UpdateDefaultNicForVirtualMachineResponse represents the modified VM
type UpdateIPAddress ¶ added in v0.9.0
type UpdateIPAddress struct {
ID string `json:"id"`
CustomID string `json:"customid,omitempty"` // root only
ForDisplay *bool `json:"fordisplay,omitempty"`
}
UpdateIPAddress (Async) represents the IP modification
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/updateIpAddress.html
func (*UpdateIPAddress) APIName ¶ added in v0.9.11
func (*UpdateIPAddress) APIName() string
APIName returns the CloudStack API command name
type UpdateIPAddressResponse ¶ added in v0.9.0
type UpdateIPAddressResponse AssociateIPAddressResponse
UpdateIPAddressResponse represents the modified IP Address
type UpdateInstanceGroup ¶ added in v0.9.7
UpdateInstanceGroup creates a VM group
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/updateInstanceGroup.html
func (*UpdateInstanceGroup) APIName ¶ added in v0.9.11
func (*UpdateInstanceGroup) APIName() string
APIName returns the CloudStack API command name
type UpdateInstanceGroupResponse ¶ added in v0.9.7
type UpdateInstanceGroupResponse InstanceGroupResponse
UpdateInstanceGroupResponse represents an updated VM group
type UpdateNetwork ¶ added in v0.9.0
type UpdateNetwork struct {
ID string `json:"id"`
ChangeCidr *bool `json:"changecidr,omitempty"`
CustomID string `json:"customid,omitempty"` // root only
DisplayNetwork string `json:"displaynetwork,omitempty"`
DisplayText string `json:"displaytext,omitempty"`
Forced *bool `json:"forced,omitempty"`
GuestVMCidr string `json:"guestvmcidr,omitempty"`
Name string `json:"name,omitempty"`
NetworkDomain string `json:"networkdomain,omitempty"`
NetworkOfferingID string `json:"networkofferingid,omitempty"`
UpdateInSequence *bool `json:"updateinsequence,omitempty"`
}
UpdateNetwork updates a network
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/updateNetwork.html
func (*UpdateNetwork) APIName ¶ added in v0.9.11
func (*UpdateNetwork) APIName() string
APIName returns the CloudStack API command name
type UpdateNetworkResponse ¶ added in v0.9.0
type UpdateNetworkResponse NetworkResponse
UpdateNetworkResponse represents a freshly created network
type UpdateVMAffinityGroup ¶ added in v0.9.0
type UpdateVMAffinityGroup struct {
ID string `json:"id"`
AffinityGroupIDs []string `json:"affinitygroupids,omitempty"` // mutually exclusive with names
AffinityGroupNames []string `json:"affinitygroupnames,omitempty"` // mutually exclusive with ids
}
UpdateVMAffinityGroup (Async) represents a modification of a (anti-)affinity group
CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/updateVMAffinityGroup.html
func (*UpdateVMAffinityGroup) APIName ¶ added in v0.9.11
func (*UpdateVMAffinityGroup) APIName() string
APIName returns the CloudStack API command name
type UpdateVMAffinityGroupResponse ¶ added in v0.9.0
type UpdateVMAffinityGroupResponse VirtualMachineResponse
UpdateVMAffinityGroupResponse represents the new VM
type UpdateVirtualMachine ¶ added in v0.9.0
type UpdateVirtualMachine struct {
ID string `json:"id"`
CustomID string `json:"customid,omitempty"` // root only
Details map[string]string `json:"details,omitempty"`
DisplayName string `json:"displayname,omitempty"`
DisplayVM *bool `json:"displayvm,omitempty"`
Group string `json:"group,omitempty"`
HAEnable *bool `json:"haenable,omitempty"`
IsDynamicallyScalable *bool `json:"isdynamicallyscalable,omitempty"`
Name string `json:"name,omitempty"` // must reboot
OSTypeID int64 `json:"ostypeid,omitempty"`
SecurityGroupIDs []string `json:"securitygroupids,omitempty"`
UserData string `json:"userdata,omitempty"`
}
UpdateVirtualMachine represents the update of the virtual machine
CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/updateVirtualMachine.html
func (*UpdateVirtualMachine) APIName ¶ added in v0.9.11
func (*UpdateVirtualMachine) APIName() string
APIName returns the CloudStack API command name
type UpdateVirtualMachineResponse ¶ added in v0.9.0
type UpdateVirtualMachineResponse VirtualMachineResponse
UpdateVirtualMachineResponse represents an updated VM instance
type User ¶ added in v0.9.7
type User struct {
Account string `json:"account,omitempty"`
AccountID string `json:"accountid,omitempty"`
AccountType string `json:"accounttype,omitempty"`
APIKey string `json:"apikey,omitempty"`
Created string `json:"created,omitempty"`
Domain string `json:"domain,omitempty"`
DomainID string `json:"domainid,omitempty"`
Email string `json:"email,omitempty"`
FirstName string `json:"firstname,omitempty"`
ID string `json:"id,omitempty"`
IsCallerChildDomain bool `json:"iscallerchilddomain,omitempty"`
IsDefault bool `json:"isdefault,omitempty"`
LastName string `json:"lastname,omitempty"`
SecretKey string `json:"secretkey,omitempty"`
State string `json:"state,omitempty"`
UserName string `json:"username,omitempty"`
}
User represents a User
type UserSecurityGroup ¶
type UserSecurityGroup struct {
Group string `json:"group,omitempty"`
Account string `json:"account,omitempty"`
}
UserSecurityGroup represents the traffic of another security group
type VirtualMachine ¶
type VirtualMachine struct {
ID string `json:"id,omitempty"`
Account string `json:"account,omitempty"`
ClusterID string `json:"clusterid,omitempty"`
ClusterName string `json:"clustername,omitempty"`
CPUNumber int64 `json:"cpunumber,omitempty"`
CPUSpeed int64 `json:"cpuspeed,omitempty"`
CPUUsed string `json:"cpuused,omitempty"`
Created string `json:"created,omitempty"`
Details map[string]string `json:"details,omitempty"`
DiskIoRead int64 `json:"diskioread,omitempty"`
DiskIoWrite int64 `json:"diskiowrite,omitempty"`
DiskKbsRead int64 `json:"diskkbsread,omitempty"`
DiskKbsWrite int64 `json:"diskkbswrite,omitempty"`
DiskOfferingID string `json:"diskofferingid,omitempty"`
DiskOfferingName string `json:"diskofferingname,omitempty"`
DisplayName string `json:"displayname,omitempty"`
DisplayVM bool `json:"displayvm,omitempty"`
Domain string `json:"domain,omitempty"`
DomainID string `json:"domainid,omitempty"`
ForVirtualNetwork bool `json:"forvirtualnetwork,omitempty"`
Group string `json:"group,omitempty"`
GroupID string `json:"groupid,omitempty"`
GuestOsID string `json:"guestosid,omitempty"`
HAEnable bool `json:"haenable,omitempty"`
HostID string `json:"hostid,omitempty"`
HostName string `json:"hostname,omitempty"`
Hypervisor string `json:"hypervisor,omitempty"`
InstanceName string `json:"instancename,omitempty"` // root only
IsDynamicallyScalable bool `json:"isdynamicallyscalable,omitempty"`
IsoDisplayText string `json:"isodisplaytext,omitempty"`
IsoID string `json:"isoid,omitempty"`
IsoName string `json:"isoname,omitempty"`
KeyPair string `json:"keypair,omitempty"`
Memory int64 `json:"memory,omitempty"`
MemoryIntFreeKbs int64 `json:"memoryintfreekbs,omitempty"`
MemoryKbs int64 `json:"memorykbs,omitempty"`
MemoryTargetKbs int64 `json:"memorytargetkbs,omitempty"`
Name string `json:"name,omitempty"`
NetworkKbsRead int64 `json:"networkkbsread,omitempty"`
NetworkKbsWrite int64 `json:"networkkbswrite,omitempty"`
OsCategoryID string `json:"oscategoryid,omitempty"`
OsTypeID int64 `json:"ostypeid,omitempty"`
Password string `json:"password,omitempty"`
PasswordEnabled bool `json:"passwordenabled,omitempty"`
PCIDevices string `json:"pcidevices,omitempty"` // not in the doc
PodID string `json:"podid,omitempty"`
PodName string `json:"podname,omitempty"`
Project string `json:"project,omitempty"`
ProjectID string `json:"projectid,omitempty"`
PublicIP string `json:"publicip,omitempty"`
PublicIPID string `json:"publicipid,omitempty"`
RootDeviceID int64 `json:"rootdeviceid,omitempty"`
RootDeviceType string `json:"rootdevicetype,omitempty"`
ServiceOfferingID string `json:"serviceofferingid,omitempty"`
ServiceOfferingName string `json:"serviceofferingname,omitempty"`
ServiceState string `json:"servicestate,omitempty"`
State string `json:"state,omitempty"`
TemplateDisplayText string `json:"templatedisplaytext,omitempty"`
TemplateID string `json:"templateid,omitempty"`
TemplateName string `json:"templatename,omitempty"`
UserID string `json:"userid,omitempty"` // not in the doc
UserName string `json:"username,omitempty"` // not in the doc
Vgpu string `json:"vgpu,omitempty"` // not in the doc
ZoneID string `json:"zoneid,omitempty"`
ZoneName string `json:"zonename,omitempty"`
AffinityGroup []AffinityGroup `json:"affinitygroup,omitempty"`
Nic []Nic `json:"nic,omitempty"`
SecurityGroup []SecurityGroup `json:"securitygroup,omitempty"`
Tags []ResourceTag `json:"tags,omitempty"`
JobID string `json:"jobid,omitempty"`
JobStatus JobStatusType `json:"jobstatus,omitempty"`
}
VirtualMachine reprents a virtual machine
func (*VirtualMachine) DefaultNic ¶ added in v0.9.10
func (vm *VirtualMachine) DefaultNic() *Nic
DefaultNic returns the default nic
func (*VirtualMachine) Delete ¶ added in v0.9.12
func (vm *VirtualMachine) Delete(ctx context.Context, client *Client) error
Delete destroys the VM
func (*VirtualMachine) Get ¶ added in v0.9.12
func (vm *VirtualMachine) Get(ctx context.Context, client *Client) error
Get fills the VM
func (*VirtualMachine) NicByID ¶ added in v0.9.2
func (vm *VirtualMachine) NicByID(nicID string) *Nic
NicByID returns the corresponding interface base on its ID
func (*VirtualMachine) NicByNetworkID ¶ added in v0.9.2
func (vm *VirtualMachine) NicByNetworkID(networkID string) *Nic
NicByNetworkID returns the corresponding interface based on the given NetworkID
A VM cannot be connected twice to a same network.
func (*VirtualMachine) NicsByType ¶ added in v0.9.2
func (vm *VirtualMachine) NicsByType(nicType string) []Nic
NicsByType returns the corresponding interfaces base on the given type
func (*VirtualMachine) ResourceType ¶ added in v0.9.7
func (*VirtualMachine) ResourceType() string
ResourceType returns the type of the resource
type VirtualMachineResponse ¶ added in v0.9.0
type VirtualMachineResponse struct {
VirtualMachine VirtualMachine `json:"virtualmachine"`
}
VirtualMachineResponse represents a generic Virtual Machine response
type Volume ¶ added in v0.9.0
type Volume struct {
ID string `json:"id"`
Account string `json:"account,omitempty"`
Attached string `json:"attached,omitempty"`
ChainInfo string `json:"chaininfo,omitempty"`
Created string `json:"created,omitempty"`
Destroyed bool `json:"destroyed,omitempty"`
DisplayVolume bool `json:"displayvolume,omitempty"`
Domain string `json:"domain,omitempty"`
DomainID string `json:"domainid,omitempty"`
Name string `json:"name,omitempty"`
QuiesceVM bool `json:"quiescevm,omitempty"`
ServiceOfferingDisplayText string `json:"serviceofferingdisplaytext,omitempty"`
ServiceOfferingID string `json:"serviceofferingid,omitempty"`
ServiceOfferingName string `json:"serviceofferingname,omitempty"`
Size uint64 `json:"size,omitempty"`
State string `json:"state,omitempty"`
Type string `json:"type,omitempty"`
VirtualMachineID string `json:"virtualmachineid,omitempty"`
VMName string `json:"vmname,omitempty"`
VMState string `json:"vmstate,omitempty"`
ZoneID string `json:"zoneid,omitempty"`
ZoneName string `json:"zonename,omitempty"`
Tags []ResourceTag `json:"tags,omitempty"`
JobID string `json:"jobid,omitempty"`
JobStatus JobStatusType `json:"jobstatus,omitempty"`
}
Volume represents a volume linked to a VM
func (*Volume) ResourceType ¶ added in v0.9.7
ResourceType returns the type of the resource
type Zone ¶
type Zone struct {
ID string `json:"id"`
AllocationState string `json:"allocationstate,omitempty"`
Capacity string `json:"capacity,omitempty"`
Description string `json:"description,omitempty"`
DhcpProvider string `json:"dhcpprovider,omitempty"`
DisplayText string `json:"displaytext,omitempty"`
DNS1 net.IP `json:"dns1,omitempty"`
DNS2 net.IP `json:"dns2,omitempty"`
Domain string `json:"domain,omitempty"`
DomainID string `json:"domainid,omitempty"`
DomainName string `json:"domainname,omitempty"`
GuestCidrAddress string `json:"guestcidraddress,omitempty"`
InternalDNS1 net.IP `json:"internaldns1,omitempty"`
InternalDNS2 net.IP `json:"internaldns2,omitempty"`
IP6DNS1 net.IP `json:"ip6dns1,omitempty"`
IP6DNS2 net.IP `json:"ip6dns2,omitempty"`
LocalStorageEnabled bool `json:"localstorageenabled,omitempty"`
Name string `json:"name,omitempty"`
NetworkType string `json:"networktype,omitempty"`
ResourceDetails map[string]string `json:"resourcedetails,omitempty"`
SecurityGroupsEnabled bool `json:"securitygroupsenabled,omitempty"`
Vlan string `json:"vlan,omitempty"`
ZoneToken string `json:"zonetoken,omitempty"`
Tags []ResourceTag `json:"tags,omitempty"`
}
Zone represents a data center
Source Files
¶
- accounts.go
- addresses.go
- addresses_type.go
- affinity_groups.go
- apis.go
- async_jobs.go
- client.go
- client_type.go
- dns.go
- doc.go
- events.go
- keypairs.go
- limits.go
- network_offerings.go
- networks.go
- nics.go
- request.go
- security_groups.go
- serialization.go
- service_offerings.go
- snapshots.go
- tags.go
- templates.go
- users.go
- virtual_machines.go
- vm_groups.go
- volumes.go
- zones.go
