egoscale

package module
v0.9.24 Latest Latest
Warning

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

Go to latest
Published: May 14, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

README

egoscale: Exoscale driver for Go

Build Status Maintainability Test Coverage GoDoc Go Report Card

An API wrapper for the CloudStack based Exoscale public cloud.

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

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. Find below some examples of how egoscale may be used to interact with a CloudStack endpoint, especially Exoscale itself. If anything feels odd or unclear, please let us know: https://github.com/exoscale/egoscale/issues

req := &egoscale.DeployVirtualMachine{
	Size:              10,
	ServiceOfferingID: "...",
	TemplateID:        "...",
	ZoneID:            "...",
}

fmt.Println("Deployment started")
resp, err := cs.Request(req)
if err != nil {
	panic(err)
}

vm := resp.(*egoscale.DeployVirtualMachineResponse).VirtualMachine
fmt.Printf("Virtual Machine ID: %s\n", vm.ID)

This exemple deploys a virtual machine while controlling the job status as it goes. It enables a finer control over errors, e.g. HTTP timeout, and eventually a way to kill it of (from the client side).

req := &egoscale.DeployVirtualMachine{
	Size:              10,
	ServiceOfferingID: "...",
	TemplateID:        "...",
	ZoneID:            "...",
}
resp := &egoscale.DeployVirtualMachineResponse{}

fmt.Println("Deployment started")
cs.AsyncRequest(req, func(jobResult *egoscale.AsyncJobResult, err error) bool {
	if err != nil {
		// any kind of error
		panic(err)
	}

	// Keep waiting
	if jobResult.JobStatus == egoscale.Pending {
		fmt.Println("wait...")
		return true
	}

	// Unmarshal the response into the response struct
	if err := jobResult.Response(resp); err != nil {
		// JSON unmarshaling error
		panic(err)
	}

	// Stop waiting
	return false
})

fmt.Printf("Virtual Machine ID: %s\n", resp.VirtualMachine.ID)

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.Printf("%s %s\n", api.Name, api.Description)
}
// Output:
// listNetworks Lists all available networks
// ...

Security Groups

Security Groups provide a way to isolate traffic to VMs. Rules are added via the two Authorization commands.

resp, err := cs.Request(&egoscale.CreateSecurityGroup{
	Name: "Load balancer",
	Description: "Opens HTTP/HTTPS ports from the outside world",
})
securityGroup := resp.(*egoscale.CreateSecurityGroupResponse).SecurityGroup

resp, err = cs.Request(&egoscale.AuthorizeSecurityGroupIngress{
	Description:     "SSH traffic",
	SecurityGroupID: securityGroup.ID,
	CidrList:        []string{"0.0.0.0/0"},
	Protocol:        "tcp",
	StartPort:       22,
	EndPort:         22,
})
// The modified SecurityGroup is returned
securityGroup := resp.(*egoscale.AuthorizeSecurityGroupResponse).SecurityGroup

// ...
err = client.BooleanRequest(&egoscale.DeleteSecurityGroup{
	ID: securityGroup.ID,
})
// ...

Security Group also implement the generic List, Get and Delete interfaces (Listable, Gettable and Deletable).

// List all Security Groups
sgs, err := cs.List(new(egoscale.SecurityGroup))
for _, s := range sgs {
	sg := s.(egoscale.SecurityGroup)
	// ...
}

// Get a Security Group
sg := &egoscale.SecurityGroup{Name: "Load balancer"}
if err := cs.Get(sg); err != nil {
	...
}
// The SecurityGroup struct has been loaded with the SecurityGroup informations

if err := cs.Delete(sg); err != nil {
	...
}
// The SecurityGroup has been deleted

See: http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/stable/networking_and_traffic.html#security-groups

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)
	...
}

Elastic IPs

An Elastic IP is a way to attach an IP address to many Virtual Machines. The API side of the story configures the external environment, like the routing. Some work is required within the machine to properly configure the interfaces.

See: http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/latest/networking_and_traffic.html#about-elastic-ips

Index

Constants

View Source
const Version = "0.9.24"

Version of the library

Variables

This section is empty.

Functions

func FibonacciRetryStrategy added in v0.9.11

func FibonacciRetryStrategy(iteration int64) time.Duration

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,omitempty" doc:"description of the api"`
	IsAsync     bool       `json:"isasync,omitempty" doc:"true if api is asynchronous"`
	Name        string     `json:"name,omitempty" doc:"the name of the api command"`
	Related     string     `json:"related,omitempty" doc:"comma separated related apis"`
	Since       string     `json:"since,omitempty" doc:"version of CloudStack the api was introduced in"`
	Type        string     `json:"type,omitempty" doc:"response field type"`
	Params      []APIParam `json:"params,omitempty" doc:"the list params the api accepts"`
	Response    []APIParam `json:"response,omitempty" doc:"api response fields"`
}

API represents an API service

type APILimit added in v0.9.24

type APILimit struct {
	Account     string `json:"account,omitempty" doc:"the account name of the api remaining count"`
	Accountid   string `json:"accountid,omitempty" doc:"the account uuid of the api remaining count"`
	APIAllowed  int    `json:"apiAllowed,omitempty" doc:"currently allowed number of apis"`
	APIIssued   int    `json:"apiIssued,omitempty" doc:"number of api already issued"`
	ExpireAfter int64  `json:"expireAfter,omitempty" doc:"seconds left to reset counters"`
}

APILimit represents the limit count

type APIParam added in v0.9.0

type APIParam struct {
	Description string `json:"description"`
	Length      int64  `json:"length"`
	Name        string `json:"name"`
	Required    bool   `json:"required"`
	Since       string `json:"since"`
	Type        string `json:"type"`
}

APIParam represents an API parameter field

type Account added in v0.9.7

type Account struct {
	AccountDetails            map[string]string `json:"accountdetails,omitempty" doc:"details for the account"`
	AccountType               AccountType       `json:"accounttype,omitempty" doc:"account type (admin, domain-admin, user)"`
	CPUAvailable              string            `json:"cpuavailable,omitempty" doc:"the total number of cpu cores available to be created for this account"`
	CPULimit                  string            `json:"cpulimit,omitempty" doc:"the total number of cpu cores the account can own"`
	CPUTotal                  int64             `json:"cputotal,omitempty" doc:"the total number of cpu cores owned by account"`
	DefaultZoneID             string            `json:"defaultzoneid,omitempty" doc:"the default zone of the account"`
	Domain                    string            `json:"domain,omitempty" doc:"name of the Domain the account belongs too"`
	DomainID                  string            `json:"domainid,omitempty" doc:"id of the Domain the account belongs too"`
	EipLimit                  string            `json:"eiplimit,omitempty" doc:"the total number of public elastic ip addresses this account can acquire"`
	Groups                    []string          `json:"groups,omitempty" doc:"the list of acl groups that account belongs to"`
	ID                        string            `json:"id,omitempty" doc:"the id of the account"`
	IPAvailable               string            `json:"ipavailable,omitempty" doc:"the total number of public ip addresses available for this account to acquire"`
	IPLimit                   string            `json:"iplimit,omitempty" doc:"the total number of public ip addresses this account can acquire"`
	IPTotal                   int64             `json:"iptotal,omitempty" doc:"the total number of public ip addresses allocated for this account"`
	IsCleanupRequired         bool              `json:"iscleanuprequired,omitempty" doc:"true if the account requires cleanup"`
	IsDefault                 bool              `json:"isdefault,omitempty" doc:"true if account is default, false otherwise"`
	MemoryAvailable           string            `json:"memoryavailable,omitempty" doc:"the total memory (in MB) available to be created for this account"`
	MemoryLimit               string            `json:"memorylimit,omitempty" doc:"the total memory (in MB) the account can own"`
	MemoryTotal               int64             `json:"memorytotal,omitempty" doc:"the total memory (in MB) owned by account"`
	Name                      string            `json:"name,omitempty" doc:"the name of the account"`
	NetworkAvailable          string            `json:"networkavailable,omitempty" doc:"the total number of networks available to be created for this account"`
	NetworkDomain             string            `json:"networkdomain,omitempty" doc:"the network domain"`
	NetworkLimit              string            `json:"networklimit,omitempty" doc:"the total number of networks the account can own"`
	NetworkTotal              int64             `json:"networktotal,omitempty" doc:"the total number of networks owned by account"`
	PrimaryStorageAvailable   string            `json:"primarystorageavailable,omitempty" doc:"the total primary storage space (in GiB) available to be used for this account"`
	PrimaryStorageLimit       string            `json:"primarystoragelimit,omitempty" doc:"the total primary storage space (in GiB) the account can own"`
	PrimaryStorageTotal       int64             `json:"primarystoragetotal,omitempty" doc:"the total primary storage space (in GiB) owned by account"`
	ProjectAvailable          string            `json:"projectavailable,omitempty" doc:"the total number of projects available for administration by this account"`
	ProjectLimit              string            `json:"projectlimit,omitempty" doc:"the total number of projects the account can own"`
	ProjectTotal              int64             `json:"projecttotal,omitempty" doc:"the total number of projects being administrated by this account"`
	SecondaryStorageAvailable string            `` /* 129-byte string literal not displayed */
	SecondaryStorageLimit     string            `json:"secondarystoragelimit,omitempty" doc:"the total secondary storage space (in GiB) the account can own"`
	SecondaryStorageTotal     int64             `json:"secondarystoragetotal,omitempty" doc:"the total secondary storage space (in GiB) owned by account"`
	SMTP                      bool              `json:"smtp,omitempty" doc:"if SMTP outbound is allowed"`
	SnapshotAvailable         string            `json:"snapshotavailable,omitempty" doc:"the total number of snapshots available for this account"`
	SnapshotLimit             string            `json:"snapshotlimit,omitempty" doc:"the total number of snapshots which can be stored by this account"`
	SnapshotTotal             int64             `json:"snapshottotal,omitempty" doc:"the total number of snapshots stored by this account"`
	State                     string            `json:"state,omitempty" doc:"the state of the account"`
	TemplateAvailable         string            `json:"templateavailable,omitempty" doc:"the total number of templates available to be created by this account"`
	TemplateLimit             string            `json:"templatelimit,omitempty" doc:"the total number of templates which can be created by this account"`
	TemplateTotal             int64             `json:"templatetotal,omitempty" doc:"the total number of templates which have been created by this account"`
	User                      []User            `json:"user,omitempty" doc:"the list of users associated with account"`
	VMAvailable               string            `json:"vmavailable,omitempty" doc:"the total number of virtual machines available for this account to acquire"`
	VMLimit                   string            `json:"vmlimit,omitempty" doc:"the total number of virtual machines that can be deployed by this account"`
	VMRunning                 int               `json:"vmrunning,omitempty" doc:"the total number of virtual machines running for this account"`
	VMStopped                 int               `json:"vmstopped,omitempty" doc:"the total number of virtual machines stopped for this account"`
	VMTotal                   int64             `json:"vmtotal,omitempty" doc:"the total number of virtual machines deployed by this account"`
	VolumeAvailable           string            `json:"volumeavailable,omitempty" doc:"the total volume available for this account"`
	VolumeLimit               string            `json:"volumelimit,omitempty" doc:"the total volume which can be used by this account"`
	VolumeTotal               int64             `json:"volumetotal,omitempty" doc:"the total volume being used by this account"`
}

Account provides the detailed account information

type AccountType added in v0.9.7

type AccountType int16

AccountType represents the type of an Account

http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/4.8/accounts.html#accounts-users-and-domains

const (
	// UserAccount represents a User
	UserAccount AccountType = iota
	// AdminAccount represents an Admin
	AdminAccount
	// DomainAdminAccount represents a Domain Admin
	DomainAdminAccount
)

func (AccountType) String added in v0.9.22

func (i AccountType) String() string

type ActivateIP6 added in v0.9.13

type ActivateIP6 struct {
	NicID string `json:"nicid" doc:"the ID of the nic to which you want to assign the IPv6"`
}

ActivateIP6 (Async) activates the IP6 on the given NIC

Exoscale specific API: https://community.exoscale.ch/api/compute/#activateip6_GET

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

type AddIPToNic struct {
	NicID     string `json:"nicid" doc:"the ID of the nic to which you want to assign private IP"`
	IPAddress net.IP `json:"ipaddress,omitempty" doc:"Secondary IP Address"`
}

AddIPToNic (Async) represents the assignation of a secondary IP

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/addIpToNic.html

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" doc:"Network ID"`
	VirtualMachineID string `json:"virtualmachineid" doc:"Virtual Machine ID"`
	IPAddress        net.IP `json:"ipaddress,omitempty" doc:"IP Address for the new network"`
}

AddNicToVirtualMachine (Async) adds a NIC to a VM

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/addNicToVirtualMachine.html

type AddNicToVirtualMachineResponse added in v0.9.0

type AddNicToVirtualMachineResponse VirtualMachineResponse

AddNicToVirtualMachineResponse represents the modified VM

type AffinityGroup

type AffinityGroup struct {
	Account           string   `json:"account,omitempty" doc:"the account owning the affinity group"`
	Description       string   `json:"description,omitempty" doc:"the description of the affinity group"`
	Domain            string   `json:"domain,omitempty" doc:"the domain name of the affinity group"`
	DomainID          string   `json:"domainid,omitempty" doc:"the domain ID of the affinity group"`
	ID                string   `json:"id,omitempty" doc:"the ID of the affinity group"`
	Name              string   `json:"name,omitempty" doc:"the name of the affinity group"`
	Type              string   `json:"type,omitempty" doc:"the type of the affinity group"`
	VirtualMachineIDs []string `json:"virtualmachineIds,omitempty" doc:"virtual machine Ids associated with this affinity group "`
}

AffinityGroup represents an (anti-)affinity group

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

func (*AffinityGroup) Delete added in v0.9.12

func (ag *AffinityGroup) Delete(ctx context.Context, client *Client) error

Delete removes the given Affinity Group

func (*AffinityGroup) Get added in v0.9.12

func (ag *AffinityGroup) Get(ctx context.Context, client *Client) error

Get loads the given Affinity Group

type AffinityGroupType added in v0.9.0

type AffinityGroupType struct {
	Type string `json:"type,omitempty" doc:"the type of the affinity group"`
}

AffinityGroupType represent an affinity group type

type AssociateIPAddress added in v0.9.0

type AssociateIPAddress struct {
	Account    string `json:"account,omitempty" doc:"the account to associate with this IP address"`
	DomainID   string `json:"domainid,omitempty" doc:"the ID of the domain to associate with this IP address"`
	ForDisplay *bool  `json:"fordisplay,omitempty" doc:"an optional field, whether to the display the ip to the end user or not"`
	IsPortable *bool  `` /* 148-byte string literal not displayed */
	NetworkdID string `json:"networkid,omitempty" doc:"The network this ip address should be associated to."`
	RegionID   int    `json:"regionid,omitempty" doc:"region ID from where portable ip is to be associated."`
	ZoneID     string `json:"zoneid,omitempty" doc:"the ID of the availability zone you want to acquire an public IP address from"`
}

AssociateIPAddress (Async) represents the IP creation

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/associateIpAddress.html

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 AsyncCommand added in v0.9.0

type AsyncCommand interface {
	Command
	// contains filtered or unexported methods
}

AsyncCommand represents a async CloudStack request

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,omitempty"`
	JobInstanceType string           `json:"jobinstancetype,omitempty"`
	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

func (*AsyncJobResult) Error added in v0.9.22

func (a *AsyncJobResult) Error() error

func (*AsyncJobResult) Response added in v0.9.22

func (a *AsyncJobResult) Response(i interface{}) error

Response return response of AsyncJobResult from a given type

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

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" doc:"an optional account for the security group. Must be used with domainId."`
	CidrList              []string            `json:"cidrlist,omitempty" doc:"the cidr list associated"`
	Description           string              `json:"description,omitempty" doc:"the description of the ingress/egress rule"`
	DomainID              string              `` /* 138-byte string literal not displayed */
	EndPort               uint16              `json:"endport,omitempty" doc:"end port for this ingress/egress rule"`
	IcmpCode              uint8               `json:"icmpcode,omitempty" doc:"error code for this icmp message"`
	IcmpType              uint8               `json:"icmptype,omitempty" doc:"type of the icmp message being sent"`
	Protocol              string              `json:"protocol,omitempty" doc:"TCP is default. UDP, ICMP, ICMPv6, AH, ESP, GRE are the other supported protocols"`
	SecurityGroupID       string              `json:"securitygroupid,omitempty" doc:"The ID of the security group. Mutually exclusive with securityGroupName parameter"`
	SecurityGroupName     string              `json:"securitygroupname,omitempty" doc:"The name of the security group. Mutually exclusive with securityGroupId parameter"`
	StartPort             uint16              `json:"startport,omitempty" doc:"start port for this ingress/egress rule"`
	UserSecurityGroupList []UserSecurityGroup `json:"usersecuritygrouplist,omitempty" doc:"user to security group mapping"`
}

AuthorizeSecurityGroupIngress (Async) represents the ingress rule creation

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/authorizeSecurityGroupIngress.html

type AuthorizeSecurityGroupIngressResponse

type AuthorizeSecurityGroupIngressResponse SecurityGroupResponse

AuthorizeSecurityGroupIngressResponse represents the new egress rule /!\ the Cloud Stack API document is not fully accurate. /!\

type CSErrorCode added in v0.9.24

type CSErrorCode int

CSErrorCode represents the CloudStack CSExceptionErrorCode enum

See: https://github.com/apache/cloudstack/blob/master/utils/src/main/java/com/cloud/utils/exception/CSExceptionErrorCode.java

const (
	// CloudRuntimeException ... (TODO)
	CloudRuntimeException CSErrorCode = 4250
	// ExecutionException ... (TODO)
	ExecutionException CSErrorCode = 4260
	// HypervisorVersionChangedException ... (TODO)
	HypervisorVersionChangedException CSErrorCode = 4265
	// CloudException ... (TODO)
	CloudException CSErrorCode = 4275
	// AccountLimitException ... (TODO)
	AccountLimitException CSErrorCode = 4280
	// AgentUnavailableException ... (TODO)
	AgentUnavailableException CSErrorCode = 4285
	// CloudAuthenticationException ... (TODO)
	CloudAuthenticationException CSErrorCode = 4290
	// ConcurrentOperationException ... (TODO)
	ConcurrentOperationException CSErrorCode = 4300
	// ConflictingNetworksException ... (TODO)
	ConflictingNetworkSettingsException CSErrorCode = 4305
	// DiscoveredWithErrorException ... (TODO)
	DiscoveredWithErrorException CSErrorCode = 4310
	// HAStateException ... (TODO)
	HAStateException CSErrorCode = 4315
	// InsufficientAddressCapacityException ... (TODO)
	InsufficientAddressCapacityException CSErrorCode = 4320
	// InsufficientCapacityException ... (TODO)
	InsufficientCapacityException CSErrorCode = 4325
	// InsufficientNetworkCapacityException ... (TODO)
	InsufficientNetworkCapacityException CSErrorCode = 4330
	// InsufficientServerCapaticyException ... (TODO)
	InsufficientServerCapacityException CSErrorCode = 4335
	// InsufficientStorageCapacityException ... (TODO)
	InsufficientStorageCapacityException CSErrorCode = 4340
	// InternalErrorException ... (TODO)
	InternalErrorException CSErrorCode = 4345
	// InvalidParameterValueException ... (TODO)
	InvalidParameterValueException CSErrorCode = 4350
	// ManagementServerException ... (TODO)
	ManagementServerException CSErrorCode = 4355
	// NetworkRuleConflictException  ... (TODO)
	NetworkRuleConflictException CSErrorCode = 4360
	// PermissionDeniedException ... (TODO)
	PermissionDeniedException CSErrorCode = 4365
	// ResourceAllocationException ... (TODO)
	ResourceAllocationException CSErrorCode = 4370
	// ResourceInUseException ... (TODO)
	ResourceInUseException CSErrorCode = 4375
	// ResourceUnavailableException ... (TODO)
	ResourceUnavailableException CSErrorCode = 4380
	// StorageUnavailableException ... (TODO)
	StorageUnavailableException CSErrorCode = 4385
	// UnsupportedServiceException ... (TODO)
	UnsupportedServiceException CSErrorCode = 4390
	// VirtualMachineMigrationException ... (TODO)
	VirtualMachineMigrationException CSErrorCode = 4395
	// AsyncCommandQueued ... (TODO)
	AsyncCommandQueued CSErrorCode = 4540
	// RequestLimitException ... (TODO)
	RequestLimitException CSErrorCode = 4545
	// ServerAPIException ... (TODO)
	ServerAPIException CSErrorCode = 9999
)

func (CSErrorCode) String added in v0.9.24

func (i CSErrorCode) String() string

type ChangeServiceForVirtualMachine added in v0.9.0

type ChangeServiceForVirtualMachine ScaleVirtualMachine

ChangeServiceForVirtualMachine changes the service offering for a virtual machine. The virtual machine must be in a "Stopped" state for this command to take effect.

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/changeServiceForVirtualMachine.html

type ChangeServiceForVirtualMachineResponse added in v0.9.0

type ChangeServiceForVirtualMachineResponse VirtualMachineResponse

ChangeServiceForVirtualMachineResponse represents an changed VM instance

type Client

type Client struct {
	// HTTPClient holds the HTTP client
	HTTPClient *http.Client
	// Endpoints is CloudStack API
	Endpoint string
	// APIKey is the API identifier
	APIKey string

	// 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 NewClient

func NewClient(endpoint, apiKey, apiSecret string) *Client

NewClient creates a CloudStack API client with default timeout (60)

func NewClientWithTimeout added in v0.9.11

func NewClientWithTimeout(endpoint, apiKey, apiSecret string, timeout time.Duration) *Client

NewClientWithTimeout creates a CloudStack API client

Timeout is set to both the HTTP client and the client itself.

func (*Client) APIName added in v0.9.22

func (client *Client) APIName(request Command) string

APIName returns the CloudStack name of the given command

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 paginate till the end)

// NB: goroutine may leak if not read until the end. Create a proper context!
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

outChan, errChan := client.AsyncListWithContext(ctx, new(egoscale.VirtualMachine))

for {
	select {
	case i, ok := <- outChan:
		if ok {
			vm := i.(egoscale.VirtualMachine)
			// ...
		} else {
			outChan = nil
		}
	case err, ok := <- errChan:
		if ok {
			// do something
		}
		// Once an error has been received, you can expect the channels to be closed.
		errChan = nil
	}
	if errChan == nil && outChan == nil {
		break
	}
}

func (*Client) AsyncRequest added in v0.9.0

func (exo *Client) AsyncRequest(request AsyncCommand, callback WaitAsyncJobResultFunc)

AsyncRequest performs the given command

func (*Client) AsyncRequestWithContext added in v0.9.22

func (exo *Client) AsyncRequestWithContext(ctx context.Context, request AsyncCommand, callback WaitAsyncJobResultFunc)

AsyncRequestWithContext preforms a request with a context

func (*Client) BooleanRequest added in v0.9.0

func (exo *Client) BooleanRequest(req Command) error

BooleanRequest performs the given boolean command

func (*Client) BooleanRequestWithContext added in v0.9.12

func (exo *Client) BooleanRequestWithContext(ctx context.Context, req Command) error

BooleanRequestWithContext performs the given boolean command

func (*Client) CreateDomain

func (exo *Client) CreateDomain(name string) (*DNSDomain, error)

CreateDomain creates a DNS domain

func (*Client) CreateRecord

func (exo *Client) CreateRecord(name string, rec DNSRecord) (*DNSRecord, error)

CreateRecord creates a DNS record

func (*Client) Delete added in v0.9.12

func (client *Client) Delete(g Deletable) error

Delete removes the given resource of fails

func (*Client) DeleteDomain

func (exo *Client) DeleteDomain(name string) error

DeleteDomain delets a DNS domain

func (*Client) DeleteRecord

func (exo *Client) DeleteRecord(name string, recordID int64) error

DeleteRecord deletes a record

func (*Client) DeleteWithContext added in v0.9.12

func (client *Client) DeleteWithContext(ctx context.Context, g Deletable) error

DeleteWithContext removes the given resource of fails

func (*Client) Get added in v0.9.12

func (client *Client) Get(g Gettable) error

Get populates the given resource or fails

func (*Client) GetDomain

func (exo *Client) GetDomain(name string) (*DNSDomain, error)

GetDomain gets a DNS domain

func (*Client) GetRecord added in v0.9.0

func (exo *Client) GetRecord(domain string, recordID int64) (*DNSRecord, error)

GetRecord returns a DNS record

func (*Client) GetRecords

func (exo *Client) GetRecords(name string) ([]DNSRecord, error)

GetRecords returns the DNS records

func (*Client) GetWithContext added in v0.9.12

func (client *Client) GetWithContext(ctx context.Context, g Gettable) error

GetWithContext populates the given resource or fails

func (*Client) List added in v0.9.16

func (client *Client) List(g Listable) ([]interface{}, error)

List lists the given resource (and paginate till the end)

func (*Client) ListWithContext added in v0.9.16

func (client *Client) ListWithContext(ctx context.Context, g Listable) ([]interface{}, error)

ListWithContext lists the given resources (and paginate till the end)

func (*Client) Paginate added in v0.9.18

func (client *Client) Paginate(req ListCommand, callback IterateItemFunc)

Paginate runs the ListCommand and paginates

func (*Client) PaginateWithContext added in v0.9.18

func (client *Client) PaginateWithContext(ctx context.Context, req ListCommand, callback IterateItemFunc)

PaginateWithContext runs the ListCommand as long as the ctx is valid

func (*Client) Payload added in v0.9.21

func (exo *Client) Payload(request Command) (string, error)

Payload builds the HTTP request from the given command

func (*Client) Request

func (exo *Client) Request(request Command) (interface{}, error)

Request performs the given command

func (*Client) RequestWithContext added in v0.9.11

func (exo *Client) RequestWithContext(ctx context.Context, request Command) (interface{}, error)

RequestWithContext preforms a request with a context

func (*Client) Response added in v0.9.22

func (client *Client) Response(request Command) interface{}

Response returns the response structure of the given command

func (*Client) Sign added in v0.9.22

func (exo *Client) Sign(query string) string

Sign signs the HTTP request and return it

func (*Client) UpdateRecord

func (exo *Client) UpdateRecord(name string, rec DNSRecord) (*DNSRecord, error)

UpdateRecord updates a DNS record

type Command added in v0.9.0

type Command interface {
	// contains filtered or unexported methods
}

Command represents a CloudStack request

type CopyTemplate added in v0.9.24

type CopyTemplate struct {
	DestZoneID   string `json:"destzoneid" doc:"ID of the zone the template is being copied to."`
	ID           string `json:"id" doc:"Template ID."`
	SourceZoneID string `` /* 192-byte string literal not displayed */
}

CopyTemplate (Async) represents a template copy

CloudStackAPI: http://cloudstack.apache.org/api/apidocs-4.10/apis/copyTemplate.html

type CopyTemplateResponse added in v0.9.24

type CopyTemplateResponse CreateTemplateResponse

CopyTemplateResponse represents the copied template

type CreateAffinityGroup added in v0.9.0

type CreateAffinityGroup struct {
	Account     string `json:"account,omitempty" doc:"an account for the affinity group. Must be used with domainId."`
	Description string `json:"description,omitempty" doc:"optional description of the affinity group"`
	DomainID    string `json:"domainid,omitempty" doc:"domainId of the account owning the affinity group"`
	Name        string `json:"name" doc:"name of the affinity group"`
	Type        string `json:"type" doc:"Type of the affinity group from the available affinity/anti-affinity group types"`
}

CreateAffinityGroup (Async) represents a new (anti-)affinity group

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/createAffinityGroup.html

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" doc:"the name of the instance group"`
	Account  string `` /* 129-byte string literal not displayed */
	DomainID string `json:"domainid,omitempty" doc:"the domain ID of account owning the instance group"`
}

CreateInstanceGroup creates a VM group

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/createInstanceGroup.html

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 {
	Account           string `json:"account,omitempty" doc:"account who will own the network"`
	ACLID             string `json:"aclid,omitempty" doc:"Network ACL Id associated for the network"`
	ACLType           string `` /* 302-byte string literal not displayed */
	DisplayNetwork    *bool  `json:"displaynetwork,omitempty" doc:"an optional field, whether to the display the network to the end user or not."`
	DisplayText       string `json:"displaytext" doc:"the display text of the network"`
	DomainID          string `json:"domainid,omitempty" doc:"domain ID of the account owning a network"`
	EndIP             net.IP `json:"endip,omitempty" doc:"the ending IP address in the network IP range. If not specified, will be defaulted to startIP"`
	EndIpv6           net.IP `json:"endipv6,omitempty" doc:"the ending IPv6 address in the IPv6 network range"`
	Gateway           net.IP `` /* 132-byte string literal not displayed */
	IP6Cidr           string `json:"ip6cidr,omitempty" doc:"the CIDR of IPv6 network, must be at least /64"`
	IP6Gateway        net.IP `` /* 140-byte string literal not displayed */
	IsolatedPVlan     string `json:"isolatedpvlan,omitempty" doc:"the isolated private vlan for this network"`
	Name              string `json:"name" doc:"the name of the network"`
	Netmask           net.IP `` /* 132-byte string literal not displayed */
	NetworkDomain     string `json:"networkdomain,omitempty" doc:"network domain"`
	NetworkOfferingID string `json:"networkofferingid" doc:"the network offering id"`
	PhysicalNetworkID string `json:"physicalnetworkid,omitempty" doc:"the Physical Network ID the network belongs to"`
	StartIP           net.IP `json:"startip,omitempty" doc:"the beginning IP address in the network IP range"`
	StartIpv6         net.IP `json:"startipv6,omitempty" doc:"the beginning IPv6 address in the IPv6 network range"`
	SubdomainAccess   *bool  `` /* 238-byte string literal not displayed */
	Vlan              string `json:"vlan,omitempty" doc:"the ID or VID of the network"`
	ZoneID            string `json:"zoneid" doc:"the Zone ID for the network"`
}

CreateNetwork creates a network

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/createNetwork.html

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" doc:"Name of the keypair"`
	Account  string `json:"account,omitempty" doc:"an optional account for the ssh key. Must be used with domainId."`
	DomainID string `` /* 131-byte string literal not displayed */
}

CreateSSHKeyPair represents a new keypair to be created

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/createSSHKeyPair.html

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" doc:"name of the security group"`
	Account     string `json:"account,omitempty" doc:"an optional account for the security group. Must be used with domainId."`
	Description string `json:"description,omitempty" doc:"the description of the security group"`
	DomainID    string `` /* 138-byte string literal not displayed */
}

CreateSecurityGroup represents a security group creation

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/createSecurityGroup.html

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" doc:"The ID of the disk volume"`
	Account   string `json:"account,omitempty" doc:"The account of the snapshot. The account parameter must be used with the domainId parameter."`
	Name      string `json:"name,omitempty" doc:"the name of the snapshot"`
	DomainID  string `` /* 166-byte string literal not displayed */
	PolicyID  string `json:"policyid,omitempty" doc:"policy id of the snapshot, if this is null, then use MANUAL_POLICY."`
	QuiesceVM *bool  `json:"quiescevm,omitempty" doc:"quiesce vm if true"`
}

CreateSnapshot (Async) creates an instant snapshot of a volume

CloudStackAPI: http://cloudstack.apache.org/api/apidocs-4.10/apis/createSnapshot.html

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" doc:"list of resources to create the tags for"`
	ResourceType string        `json:"resourcetype" doc:"type of the resource"`
	Tags         []ResourceTag `json:"tags" doc:"Map of tags (key/value pairs)"`
	Customer     string        `` /* 143-byte string literal not displayed */
}

CreateTags (Async) creates resource tag(s)

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/createTags.html

type CreateTemplate added in v0.9.24

type CreateTemplate struct {
	Bits                  int               `json:"bits,omitempty" doc:"32 or 64 bit"`
	Details               map[string]string `json:"details,omitempty" doc:"Template details in key/value pairs."`
	DisplayText           string            `json:"displaytext" doc:"the display text of the template. This is usually used for display purposes."`
	IsDynamicallyScalable *bool             `` /* 138-byte string literal not displayed */
	IsFeatured            *bool             `json:"isfeatured,omitempty" doc:"true if this template is a featured template, false otherwise"`
	IsPublic              *bool             `json:"ispublic,omitempty" doc:"true if this template is a public template, false otherwise"`
	Name                  string            `json:"name" doc:"the name of the template"`
	OsTypeID              string            `json:"ostypeid" doc:"the ID of the OS Type that best represents the OS of this template."`
	PasswordEnabled       *bool             `json:"passwordenabled,omitempty" doc:"true if the template supports the password reset feature; default is false"`
	RequiresHVM           *bool             `json:"requireshvm,omitempty" doc:"true if the template requres HVM, false otherwise"`
	SnapshotID            string            `` /* 147-byte string literal not displayed */
	TemplateTag           string            `json:"templatetag,omitempty" doc:"the tag for this template."`
	URL                   string            `json:"url,omitempty" doc:"Optional, only for baremetal hypervisor. The directory name where template stored on CIFS server"`
	VirtualMachineID      string            `` /* 198-byte string literal not displayed */
	VolumeID              string            `` /* 150-byte string literal not displayed */
}

CreateTemplate (Async) represents a template creation

CloudStackAPI: http://cloudstack.apache.org/api/apidocs-4.10/apis/createTemplate.html

type CreateTemplateResponse added in v0.9.24

type CreateTemplateResponse struct {
	Template Template `json:"template"`
}

CreateTemplateResponse represents a freshly created template

type CreateUser added in v0.9.22

type CreateUser struct {
	Account   string `` /* 141-byte string literal not displayed */
	Email     string `json:"email" doc:"email"`
	FirstName string `json:"firstname" doc:"firstname"`
	LastName  string `json:"lastname" doc:"lastname"`
	Password  string `` /* 195-byte string literal not displayed */
	UserName  string `json:"username" doc:"Unique username."`
	DomainID  string `json:"domainid,omitempty" doc:"Creates the user under the specified domain. Has to be accompanied with the account parameter"`
	Timezone  string `` /* 140-byte string literal not displayed */
	UserID    string `json:"userid,omitempty" doc:"User UUID, required for adding account from external provisioning system"`
}

CreateUser represents the creation of a User

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/createUser.html

type CreateUserResponse added in v0.9.22

type CreateUserResponse struct {
	User User `json:"user"`
}

CreateUserResponse represents the freshly created User

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 DNSError

type DNSError struct {
	Name []string `json:"name"`
}

DNSError represents an error

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" doc:"the account of the affinity group. Must be specified with domain ID"`
	DomainID string `json:"domainid,omitempty" doc:"the domain ID of account owning the affinity group"`
	ID       string `json:"id,omitempty" doc:"The ID of the affinity group. Mutually exclusive with name parameter"`
	Name     string `json:"name,omitempty" doc:"The name of the affinity group. Mutually exclusive with ID parameter"`
}

DeleteAffinityGroup (Async) represents an (anti-)affinity group to be deleted

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/deleteAffinityGroup.html

type DeleteInstanceGroup added in v0.9.7

type DeleteInstanceGroup struct {
	ID string `json:"id" doc:"the ID of the instance group"`
}

DeleteInstanceGroup deletes a VM group

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/deleteInstanceGroup.html

type DeleteNetwork added in v0.9.0

type DeleteNetwork struct {
	ID     string `json:"id" doc:"the ID of the network"`
	Forced *bool  `` /* 154-byte string literal not displayed */
}

DeleteNetwork deletes a network

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/deleteNetwork.html

type DeleteSSHKeyPair added in v0.9.0

type DeleteSSHKeyPair struct {
	Name     string `json:"name" doc:"Name of the keypair"`
	Account  string `json:"account,omitempty" doc:"the account associated with the keypair. Must be used with the domainId parameter."`
	DomainID string `json:"domainid,omitempty" doc:"the domain ID associated with the keypair"`
}

DeleteSSHKeyPair represents a new keypair to be created

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/deleteSSHKeyPair.html

type DeleteSecurityGroup added in v0.9.0

type DeleteSecurityGroup struct {
	Account  string `json:"account,omitempty" doc:"the account of the security group. Must be specified with domain ID"`
	DomainID string `json:"domainid,omitempty" doc:"the domain ID of account owning the security group"`
	ID       string `json:"id,omitempty" doc:"The ID of the security group. Mutually exclusive with name parameter"`
	Name     string `json:"name,omitempty" doc:"The ID of the security group. Mutually exclusive with id parameter"`
}

DeleteSecurityGroup represents a security group deletion

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/deleteSecurityGroup.html

type DeleteSnapshot added in v0.9.0

type DeleteSnapshot struct {
	ID string `json:"id" doc:"The ID of the snapshot"`
}

DeleteSnapshot (Async) deletes a snapshot of a disk volume

CloudStackAPI: http://cloudstack.apache.org/api/apidocs-4.10/apis/deleteSnapshot.html

type DeleteTags added in v0.9.0

type DeleteTags struct {
	ResourceIDs  []string      `json:"resourceids" doc:"Delete tags for resource id(s)"`
	ResourceType string        `json:"resourcetype" doc:"Delete tag by resource type"`
	Tags         []ResourceTag `json:"tags,omitempty" doc:"Delete tags matching key/value pairs"`
}

DeleteTags (Async) deletes the resource tag(s)

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/deleteTags.html

type DeleteTemplate added in v0.9.24

type DeleteTemplate struct {
	ID     string `json:"id" doc:"the ID of the template"`
	ZoneID string `json:"zoneid,omitempty" doc:"the ID of zone of the template"`
}

DeleteTemplate (Async) represents the deletion of a template

CloudStackAPI: http://cloudstack.apache.org/api/apidocs-4.10/apis/deleteTemplate.html

type DeployVirtualMachine added in v0.9.0

type DeployVirtualMachine struct {
	Account            string            `json:"account,omitempty" doc:"an optional account for the virtual machine. Must be used with domainId."`
	AffinityGroupIDs   []string          `` /* 188-byte string literal not displayed */
	AffinityGroupNames []string          `` /* 190-byte string literal not displayed */
	CustomID           string            `` /* 131-byte string literal not displayed */
	DeploymentPlanner  string            `json:"deploymentplanner,omitempty" doc:"Deployment planner to use for vm allocation. Available to ROOT admin only"`
	Details            map[string]string `json:"details,omitempty" doc:"used to specify the custom parameters."`
	DiskOfferingID     string            `` /* 490-byte string literal not displayed */
	DisplayName        string            `json:"displayname,omitempty" doc:"an optional user generated name for the virtual machine"`
	DisplayVM          *bool             `json:"displayvm,omitempty" doc:"an optional field, whether to the display the vm to the end user or not."`
	DomainID           string            `` /* 139-byte string literal not displayed */
	Group              string            `json:"group,omitempty" doc:"an optional group for the virtual machine"`
	HostID             string            `json:"hostid,omitempty" doc:"destination Host ID to deploy the VM to - parameter available for root admin only"`
	Hypervisor         string            `json:"hypervisor,omitempty" doc:"the hypervisor on which to deploy the virtual machine"`
	IP4                *bool             `json:"ip4,omitempty" doc:"True to set an IPv4 to the default interface"`
	IP6                *bool             `json:"ip6,omitempty" doc:"True to set an IPv6 to the default interface"`
	IP6Address         net.IP            `json:"ip6address,omitempty" doc:"the ipv6 address for default vm's network"`
	IPAddress          net.IP            `json:"ipaddress,omitempty" doc:"the ip address for default vm's network"`
	IPToNetworkList    []IPToNetwork     `` /* 281-byte string literal not displayed */
	Keyboard           string            `` /* 172-byte string literal not displayed */
	KeyPair            string            `json:"keypair,omitempty" doc:"name of the ssh key pair used to login to the virtual machine"`
	Name               string            `json:"name,omitempty" doc:"host name for the virtual machine"`
	NetworkIDs         []string          `` /* 128-byte string literal not displayed */
	RootDiskSize       int64             `` /* 243-byte string literal not displayed */
	SecurityGroupIDs   []string          `` /* 265-byte string literal not displayed */
	SecurityGroupNames []string          `` /* 268-byte string literal not displayed */
	ServiceOfferingID  string            `json:"serviceofferingid" doc:"the ID of the service offering for the virtual machine"`
	Size               int64             `json:"size,omitempty" doc:"the arbitrary size for the DATADISK volume. Mutually exclusive with diskOfferingId"`
	StartVM            *bool             `json:"startvm,omitempty" doc:"true if start vm after creating. Default value is true"`
	TemplateID         string            `json:"templateid" doc:"the ID of the template for the virtual machine"`
	UserData           string            `` /* 372-byte string literal not displayed */
	ZoneID             string            `json:"zoneid" doc:"availability zone for the virtual machine"`
}

DeployVirtualMachine (Async) represents the machine creation

Regarding the UserData field, the client is responsible to base64 (and probably gzip) it. Doing it within this library would make the integration with other tools, e.g. Terraform harder.

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/deployVirtualMachine.html

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" doc:"The ID of the virtual machine"`
	Expunge *bool  `json:"expunge,omitempty" doc:"If true is passed, the vm is expunged immediately. False by default."`
}

DestroyVirtualMachine (Async) represents the destruction of the virtual machine

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/destroyVirtualMachine.html

type DestroyVirtualMachineResponse

type DestroyVirtualMachineResponse VirtualMachineResponse

DestroyVirtualMachineResponse represents a destroyed VM instance

type DisableAccount added in v0.9.22

type DisableAccount struct {
	Lock     *bool  `json:"lock" doc:"If true, only lock the account; else disable the account"`
	Account  string `json:"account,omitempty" doc:"Disables specified account."`
	DomainID string `json:"domainid,omitempty" doc:"Disables specified account in this domain."`
	ID       string `json:"id,omitempty" doc:"Account id"`
}

DisableAccount (Async) represents the deactivation of an account

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/disableAccount.html

type DisableAccountResponse added in v0.9.22

type DisableAccountResponse EnableAccountResponse

DisableAccountResponse represents the modified account

type DisassociateIPAddress added in v0.9.0

type DisassociateIPAddress struct {
	ID string `json:"id" doc:"the id of the public ip address to disassociate"`
}

DisassociateIPAddress (Async) represents the IP deletion

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/disassociateIpAddress.html

type EgressRule added in v0.9.0

type EgressRule IngressRule

EgressRule represents the ingress rule

type EnableAccount added in v0.9.22

type EnableAccount struct {
	Account  string `json:"account,omitempty" doc:"Enables specified account."`
	DomainID string `json:"domainid,omitempty" doc:"Enables specified account in this domain."`
	ID       string `json:"id,omitempty" doc:"Account id"`
}

EnableAccount represents the activation of an account

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/enableAccount.html

type EnableAccountResponse added in v0.9.22

type EnableAccountResponse struct {
	Account Account `json:"account"`
}

EnableAccountResponse represents the modified account

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

const (
	// Unauthorized represents ... (TODO)
	Unauthorized ErrorCode = 401
	// MethodNotAllowed represents ... (TODO)
	MethodNotAllowed ErrorCode = 405
	// UnsupportedActionError represents ... (TODO)
	UnsupportedActionError ErrorCode = 422
	// APILimitExceeded represents ... (TODO)
	APILimitExceeded ErrorCode = 429
	// MalformedParameterError represents ... (TODO)
	MalformedParameterError ErrorCode = 430
	// ParamError represents ... (TODO)
	ParamError ErrorCode = 431

	// InternalError represents a server error
	InternalError ErrorCode = 530
	// AccountError represents ... (TODO)
	AccountError ErrorCode = 531
	// AccountResourceLimitError represents ... (TODO)
	AccountResourceLimitError ErrorCode = 532
	// InsufficientCapacityError represents ... (TODO)
	InsufficientCapacityError ErrorCode = 533
	// ResourceUnavailableError represents ... (TODO)
	ResourceUnavailableError ErrorCode = 534
	// ResourceAllocationError represents ... (TODO)
	ResourceAllocationError ErrorCode = 535
	// ResourceInUseError represents ... (TODO)
	ResourceInUseError ErrorCode = 536
	// NetworkRuleConflictError represents ... (TODO)
	NetworkRuleConflictError ErrorCode = 537
)

func (ErrorCode) String added in v0.9.22

func (i ErrorCode) String() string

type ErrorResponse added in v0.9.0

type ErrorResponse struct {
	ErrorCode   ErrorCode   `json:"errorcode"`
	CSErrorCode CSErrorCode `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 {
	Account     string `` /* 183-byte string literal not displayed */
	Created     string `json:"created,omitempty" doc:"the date the event was created"`
	Description string `json:"description,omitempty" doc:"a brief description of the event"`
	Domain      string `json:"domain,omitempty" doc:"the name of the account's domain"`
	DomainID    string `json:"domainid,omitempty" doc:"the id of the account's domain"`
	ID          string `json:"id,omitempty" doc:"the ID of the event"`
	Level       string `json:"level,omitempty" doc:"the event level (INFO, WARN, ERROR)"`
	ParentID    string `json:"parentid,omitempty" doc:"whether the event is parented"`
	State       string `json:"state,omitempty" doc:"the state of the event"`
	Type        string `json:"type,omitempty" doc:"the type of the event (see event types)"`
	UserName    string `` /* 209-byte string literal not displayed */
}

Event represents an event in the system

type EventType added in v0.9.0

type EventType struct {
	Name string `json:"name,omitempty" doc:"Event Type"`
}

EventType represent a type of event

type ExpungeVirtualMachine added in v0.9.0

type ExpungeVirtualMachine RebootVirtualMachine

ExpungeVirtualMachine represents the annihilation of a VM

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/expungeVirtualMachine.html

type GetAPILimit added in v0.9.24

type GetAPILimit struct{}

GetAPILimit gets API limit count for the caller

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.4/user/getApiLimit.html

type GetAPILimitResponse added in v0.9.24

type GetAPILimitResponse struct {
	APILimit APILimit `json:"apilimit"`
}

GetAPILimitResponse represents the limits towards the API call

type GetVMPassword added in v0.9.0

type GetVMPassword RebootVirtualMachine

GetVMPassword asks for an encrypted password

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/getVMPassword.html

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 GetVirtualMachineUserData added in v0.9.22

type GetVirtualMachineUserData struct {
	VirtualMachineID string `json:"virtualmachineid" doc:"The ID of the virtual machine"`
}

GetVirtualMachineUserData returns the user-data of the given VM

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/getVirtualMachineUserData.html

type GetVirtualMachineUserDataResponse added in v0.9.22

type GetVirtualMachineUserDataResponse struct {
	UserData         string `json:"userdata,omitempty" doc:"Base 64 encoded VM user data"`
	VirtualMachineID string `json:"virtualmachineid,omitempty" doc:"the ID of the virtual machine"`
}

GetVirtualMachineUserDataResponse represents the base64 encoded user-data

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 {
	Account                   string        `json:"account,omitempty" doc:"the account the public IP address is associated with"`
	Allocated                 string        `json:"allocated,omitempty" doc:"date the public IP address was acquired"`
	Associated                string        `json:"associated,omitempty" doc:"date the public IP address was associated"`
	AssociatedNetworkID       string        `json:"associatednetworkid,omitempty" doc:"the ID of the Network associated with the IP address"`
	AssociatedNetworkName     string        `json:"associatednetworkname,omitempty" doc:"the name of the Network associated with the IP address"`
	Domain                    string        `json:"domain,omitempty" doc:"the domain the public IP address is associated with"`
	DomainID                  string        `json:"domainid,omitempty" doc:"the domain ID the public IP address is associated with"`
	ForDisplay                bool          `json:"fordisplay,omitempty" doc:"is public ip for display to the regular user"`
	ForVirtualNetwork         bool          `json:"forvirtualnetwork,omitempty" doc:"the virtual network for the IP address"`
	ID                        string        `json:"id,omitempty" doc:"public IP address id"`
	IPAddress                 net.IP        `json:"ipaddress,omitempty" doc:"public IP address"`
	IsElastic                 bool          `json:"iselastic,omitempty" doc:"is an elastic ip"`
	IsPortable                bool          `json:"isportable,omitempty" doc:"is public IP portable across the zones"`
	IsSourceNat               bool          `json:"issourcenat,omitempty" doc:"true if the IP address is a source nat address, false otherwise"`
	IsStaticNat               *bool         `json:"isstaticnat,omitempty" doc:"true if this ip is for static nat, false otherwise"`
	IsSystem                  bool          `json:"issystem,omitempty" doc:"true if this ip is system ip (was allocated as a part of deployVm or createLbRule)"`
	NetworkID                 string        `json:"networkid,omitempty" doc:"the ID of the Network where ip belongs to"`
	PhysicalNetworkID         string        `json:"physicalnetworkid,omitempty" doc:"the physical network this belongs to"`
	Purpose                   string        `` /* 159-byte string literal not displayed */
	State                     string        `json:"state,omitempty" doc:"State of the ip address. Can be: Allocatin, Allocated and Releasing"`
	Tags                      []ResourceTag `json:"tags,omitempty" doc:"the list of resource tags associated with ip address"`
	VirtualMachineDisplayName string        `` /* 141-byte string literal not displayed */
	VirtualMachineID          string        `json:"virtualmachineid,omitempty" doc:"virtual machine id the ip address is assigned to (not null only for static nat Ip)"`
	VirtualMachineName        string        `` /* 126-byte string literal not displayed */
	VlanID                    string        `` /* 126-byte string literal not displayed */
	VlanName                  string        `json:"vlanname,omitempty" doc:"the VLAN associated with the IP address"`
	VMIPAddress               net.IP        `json:"vmipaddress,omitempty" doc:"virutal machine (dnat) ip address (not null only for static nat Ip)"`
	ZoneID                    string        `json:"zoneid,omitempty" doc:"the ID of the zone the public IP address belongs to"`
	ZoneName                  string        `json:"zonename,omitempty" doc:"the name of the zone the public IP address belongs to"`
}

IPAddress represents an IP Address

func (*IPAddress) Delete added in v0.9.15

func (ipaddress *IPAddress) Delete(ctx context.Context, client *Client) error

Delete removes the resource

func (*IPAddress) Get added in v0.9.15

func (ipaddress *IPAddress) Get(ctx context.Context, client *Client) error

Get fetches the resource

func (*IPAddress) ListRequest added in v0.9.20

func (ipaddress *IPAddress) ListRequest() (ListCommand, error)

ListRequest builds the ListAdresses request

func (*IPAddress) ResourceType added in v0.9.7

func (*IPAddress) ResourceType() string

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 {
	Account               string              `json:"account,omitempty" doc:"account owning the security group rule"`
	Cidr                  string              `json:"cidr,omitempty" doc:"the CIDR notation for the base IP address of the security group rule"`
	Description           string              `json:"description,omitempty" doc:"description of the security group rule"`
	EndPort               uint16              `json:"endport,omitempty" doc:"the ending IP of the security group rule "`
	IcmpCode              uint8               `json:"icmpcode,omitempty" doc:"the code for the ICMP message response"`
	IcmpType              uint8               `json:"icmptype,omitempty" doc:"the type of the ICMP message response"`
	Protocol              string              `json:"protocol,omitempty" doc:"the protocol of the security group rule"`
	RuleID                string              `json:"ruleid,omitempty" doc:"the id of the security group rule"`
	SecurityGroupID       string              `json:"securitygroupid,omitempty"`
	SecurityGroupName     string              `json:"securitygroupname,omitempty" doc:"security group name"`
	StartPort             uint16              `json:"startport,omitempty" doc:"the starting IP of the security group rule"`
	Tags                  []ResourceTag       `json:"tags,omitempty" doc:"the list of resource tags associated with the rule"`
	UserSecurityGroupList []UserSecurityGroup `json:"usersecuritygrouplist,omitempty"`
}

IngressRule represents the ingress rule

type InstanceGroup added in v0.9.7

type InstanceGroup struct {
	Account  string `json:"account,omitempty" doc:"the account owning the instance group"`
	Created  string `json:"created,omitempty" doc:"time and date the instance group was created"`
	Domain   string `json:"domain,omitempty" doc:"the domain name of the instance group"`
	DomainID string `json:"domainid,omitempty" doc:"the domain ID of the instance group"`
	ID       string `json:"id,omitempty" doc:"the id of the instance group"`
	Name     string `json:"name,omitempty" doc:"the name of the instance group"`
}

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 IterateItemFunc added in v0.9.18

type IterateItemFunc func(interface{}, error) bool

IterateItemFunc represents the callback to iterate a list of results, if false stops

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
)

func (JobStatusType) String added in v0.9.22

func (i JobStatusType) String() string

type ListAPIs added in v0.9.0

type ListAPIs struct {
	Name string `json:"name,omitempty" doc:"API name"`
}

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

type ListAPIsResponse struct {
	Count int   `json:"count"`
	API   []API `json:"api"`
}

ListAPIsResponse represents a list of API

type ListAccounts added in v0.9.7

type ListAccounts struct {
	AccountType       AccountType `` /* 132-byte string literal not displayed */
	DomainID          string      `json:"domainid,omitempty" doc:"list only resources belonging to the domain specified"`
	ID                string      `json:"id,omitempty" doc:"list account by account ID"`
	IsCleanUpRequired *bool       `json:"iscleanuprequired,omitempty" doc:"list accounts by cleanuprequred attribute (values are true or false)"`
	IsRecursive       *bool       `` /* 141-byte string literal not displayed */
	Keyword           string      `json:"keyword,omitempty" doc:"List by keyword"`
	ListAll           *bool       `` /* 195-byte string literal not displayed */
	Name              string      `json:"name,omitempty" doc:"list account by account name"`
	Page              int         `json:"page,omitempty"`
	PageSize          int         `json:"pagesize,omitempty"`
	State             string      `json:"state,omitempty" doc:"list accounts by state. Valid states are enabled, disabled, and locked."`
}

ListAccounts represents a query to display the accounts

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/listAccounts.html

type ListAccountsResponse added in v0.9.7

type ListAccountsResponse struct {
	Count   int       `json:"count"`
	Account []Account `json:"account"`
}

ListAccountsResponse represents a list of accounts

type ListAffinityGroupTypes added in v0.9.0

type ListAffinityGroupTypes struct {
	Keyword  string `json:"keyword,omitempty" doc:"List by keyword"`
	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

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" doc:"list resources by account. Must be used with the domainId parameter."`
	DomainID         string `json:"domainid,omitempty" doc:"list only resources belonging to the domain specified"`
	ID               string `json:"id,omitempty" doc:"list the affinity group by the ID provided"`
	IsRecursive      *bool  `` /* 141-byte string literal not displayed */
	Keyword          string `json:"keyword,omitempty" doc:"List by keyword"`
	ListAll          *bool  `` /* 195-byte string literal not displayed */
	Name             string `json:"name,omitempty" doc:"lists affinity groups by name"`
	Page             int    `json:"page,omitempty"`
	PageSize         int    `json:"pagesize,omitempty"`
	Type             string `json:"type,omitempty" doc:"lists affinity groups by type"`
	VirtualMachineID string `json:"virtualmachineid,omitempty" doc:"lists affinity groups by virtual machine ID"`
}

ListAffinityGroups represents an (anti-)affinity groups search

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/listAffinityGroups.html

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" doc:"list resources by account. Must be used with the domainId parameter."`
	DomainID    string `json:"domainid,omitempty" doc:"list only resources belonging to the domain specified"`
	IsRecursive *bool  `` /* 141-byte string literal not displayed */
	Keyword     string `json:"keyword,omitempty" doc:"List by keyword"`
	ListAll     *bool  `` /* 195-byte string literal not displayed */
	Page        int    `json:"page,omitempty"`
	PageSize    int    `json:"pagesize,omitempty"`
	StartDate   string `json:"startdate,omitempty" doc:"the start date of the async job"`
}

ListAsyncJobs list the asynchronous jobs

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/listAsyncJobs.html

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 ListCommand added in v0.9.18

type ListCommand interface {
	Command
	// SetPage defines the current pages
	SetPage(int)
	// SetPageSize defines the size of the page
	SetPageSize(int)
	// contains filtered or unexported methods
}

ListCommand represents a CloudStack list request

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

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" doc:"list resources by account. Must be used with the domainId parameter."`
	DomainID    string `json:"domainid,omitempty" doc:"list only resources belonging to the domain specified"`
	Duration    int    `json:"duration,omitempty" doc:"the duration of the event"`
	EndDate     string `` /* 152-byte string literal not displayed */
	EntryTime   int    `json:"entrytime,omitempty" doc:"the time the event was entered"`
	ID          string `json:"id,omitempty" doc:"the ID of the event"`
	IsRecursive *bool  `` /* 254-byte string literal not displayed */
	Keyword     string `json:"keyword,omitempty" doc:"List by keyword"`
	Level       string `json:"level,omitempty" doc:"the event level (INFO, WARN, ERROR)"`
	ListAll     *bool  `json:"listall,omitempty"`
	Page        int    `json:"page,omitempty" `
	PageSize    int    `` /* 196-byte string literal not displayed */
	StartDate   string `` /* 156-byte string literal not displayed */
	Type        string `json:"type,omitempty" doc:"the event type (see event types)"`
}

ListEvents list the events

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/listEvents.html

type ListEventsResponse added in v0.9.0

type ListEventsResponse struct {
	Count int     `json:"count"`
	Event []Event `json:"event"`
}

ListEventsResponse represents a response of a list query

type ListInstanceGroups added in v0.9.7

type ListInstanceGroups struct {
	Account     string `json:"account,omitempty" doc:"list resources by account. Must be used with the domainId parameter."`
	DomainID    string `json:"domainid,omitempty" doc:"list only resources belonging to the domain specified"`
	ID          string `json:"id,omitempty" doc:"list instance groups by ID"`
	IsRecursive *bool  `` /* 141-byte string literal not displayed */
	Keyword     string `json:"keyword,omitempty" doc:"List by keyword"`
	ListAll     *bool  `` /* 195-byte string literal not displayed */
	Name        string `json:"name,omitempty" doc:"list instance groups by name"`
	Page        int    `json:"page,omitempty"`
	PageSize    int    `json:"pagesize,omitempty"`
}

ListInstanceGroups lists VM groups

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/listInstanceGroups.html

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" doc:"the availability of network offering. Default value is Required"`
	DisplayText        string    `json:"displaytext,omitempty" doc:"list network offerings by display text"`
	GuestIPType        string    `json:"guestiptype,omitempty" doc:"list network offerings by guest type: Shared or Isolated"`
	ID                 string    `json:"id,omitempty" doc:"list network offerings by id"`
	IsDefault          *bool     `json:"isdefault,omitempty" doc:"true if need to list only default network offerings. Default value is false"`
	IsTagged           *bool     `json:"istagged,omitempty" doc:"true if offering has tags specified"`
	Keyword            string    `json:"keyword,omitempty" doc:"List by keyword"`
	Name               string    `json:"name,omitempty" doc:"list network offerings by name"`
	NetworkID          string    `` /* 152-byte string literal not displayed */
	Page               int       `json:"page,omitempty"`
	PageSize           int       `json:"pagesize,omitempty"`
	SourceNATSupported *bool     `` /* 131-byte string literal not displayed */
	SpecifyIPRanges    *bool     `json:"specifyipranges,omitempty" doc:"true if need to list only network offerings which support specifying ip ranges"`
	SpecifyVlan        *bool     `json:"specifyvlan,omitempty" doc:"the tags for the network offering."`
	State              string    `json:"state,omitempty" doc:"list network offerings by state"`
	SupportedServices  []Service `json:"supportedservices,omitempty" doc:"list network offerings supporting certain services"`
	Tags               string    `json:"tags,omitempty" doc:"list network offerings by tags"`
	TrafficType        string    `json:"traffictype,omitempty" doc:"list by traffic type"`
	ZoneID             string    `json:"zoneid,omitempty" doc:"list netowrk offerings available for network creation in specific zone"`
}

ListNetworkOfferings represents a query for network offerings

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/listNetworkOfferings.html

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" doc:"list resources by account. Must be used with the domainId parameter."`
	ACLType           string        `json:"acltype,omitempty" doc:"list networks by ACL (access control list) type. Supported values are Account and Domain"`
	CanUseForDeploy   *bool         `json:"canusefordeploy,omitempty" doc:"list networks available for vm deployment"`
	DisplayNetwork    *bool         `json:"displaynetwork,omitempty" doc:"list resources by display flag; only ROOT admin is eligible to pass this parameter"`
	DomainID          string        `json:"domainid,omitempty" doc:"list only resources belonging to the domain specified"`
	ID                string        `json:"id,omitempty" doc:"list networks by id"`
	IsRecursive       *bool         `` /* 141-byte string literal not displayed */
	IsSystem          *bool         `json:"issystem,omitempty" doc:"true if network is system, false otherwise"`
	Keyword           string        `json:"keyword,omitempty" doc:"List by keyword"`
	ListAll           *bool         `` /* 195-byte string literal not displayed */
	Page              int           `json:"page,omitempty"`
	PageSize          int           `json:"pagesize,omitempty"`
	PhysicalNetworkID string        `json:"physicalnetworkid,omitempty" doc:"list networks by physical network id"`
	RestartRequired   *bool         `json:"restartrequired,omitempty" doc:"list networks by restartRequired"`
	SpecifyIPRanges   *bool         `json:"specifyipranges,omitempty" doc:"true if need to list only networks which support specifying ip ranges"`
	SupportedServices []Service     `json:"supportedservices,omitempty" doc:"list networks supporting certain services"`
	Tags              []ResourceTag `json:"tags,omitempty" doc:"List resources by tags (key/value pairs)"`
	TrafficType       string        `json:"traffictype,omitempty" doc:"type of the traffic"`
	Type              string        `json:"type,omitempty" doc:"the type of the network. Supported values are: Isolated and Shared"`
	ZoneID            string        `json:"zoneid,omitempty" doc:"the Zone ID of the network"`
}

ListNetworks represents a query to a network

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/listNetworks.html

func (*ListNetworks) SetPage added in v0.9.21

func (listNetwork *ListNetworks) SetPage(page int)

SetPage sets the current page

func (*ListNetworks) SetPageSize added in v0.9.21

func (listNetwork *ListNetworks) SetPageSize(pageSize int)

SetPageSize sets the page size

type ListNetworksResponse added in v0.9.0

type ListNetworksResponse struct {
	Count   int       `json:"count"`
	Network []Network `json:"network"`
}

ListNetworksResponse represents the list of networks

type ListNics added in v0.9.0

type ListNics struct {
	ForDisplay       bool   `json:"fordisplay,omitempty" doc:"list resources by display flag; only ROOT admin is eligible to pass this parameter"`
	Keyword          string `json:"keyword,omitempty" doc:"List by keyword"`
	NetworkID        string `json:"networkid,omitempty" doc:"list nic of the specific vm's network"`
	NicID            string `json:"nicid,omitempty" doc:"the ID of the nic to to list IPs"`
	Page             int    `json:"page,omitempty"`
	PageSize         int    `json:"pagesize,omitempty"`
	VirtualMachineID string `json:"virtualmachineid" doc:"the ID of the vm"`
}

ListNics represents the NIC search

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/listNics.html

func (*ListNics) SetPage added in v0.9.18

func (ls *ListNics) SetPage(page int)

SetPage sets the current page

func (*ListNics) SetPageSize added in v0.9.18

func (ls *ListNics) SetPageSize(pageSize int)

SetPageSize sets the page size

type ListNicsResponse added in v0.9.0

type ListNicsResponse struct {
	Count int   `json:"count"`
	Nic   []Nic `json:"nic"`
}

ListNicsResponse represents a list of templates

type ListPublicIPAddresses added in v0.9.0

type ListPublicIPAddresses struct {
	Account             string        `json:"account,omitempty" doc:"list resources by account. Must be used with the domainId parameter."`
	AllocatedOnly       *bool         `json:"allocatedonly,omitempty" doc:"limits search results to allocated public IP addresses"`
	AssociatedNetworkID string        `json:"associatednetworkid,omitempty" doc:"lists all public IP addresses associated to the network specified"`
	DomainID            string        `json:"domainid,omitempty" doc:"list only resources belonging to the domain specified"`
	ForDisplay          *bool         `json:"fordisplay,omitempty" doc:"list resources by display flag; only ROOT admin is eligible to pass this parameter"`
	ForLoadBalancing    *bool         `json:"forloadbalancing,omitempty" doc:"list only ips used for load balancing"`
	ForVirtualNetwork   *bool         `json:"forvirtualnetwork,omitempty" doc:"the virtual network for the IP address"`
	ID                  string        `json:"id,omitempty" doc:"lists ip address by id"`
	IPAddress           net.IP        `json:"ipaddress,omitempty" doc:"lists the specified IP address"`
	IsElastic           *bool         `json:"iselastic,omitempty" doc:"list only elastic ip addresses"`
	IsRecursive         *bool         `` /* 141-byte string literal not displayed */
	IsSourceNat         *bool         `json:"issourcenat,omitempty" doc:"list only source nat ip addresses"`
	IsStaticNat         *bool         `json:"isstaticnat,omitempty" doc:"list only static nat ip addresses"`
	Keyword             string        `json:"keyword,omitempty" doc:"List by keyword"`
	ListAll             *bool         `` /* 195-byte string literal not displayed */
	Page                int           `json:"page,omitempty"`
	PageSize            int           `json:"pagesize,omitempty"`
	PhysicalNetworkID   string        `json:"physicalnetworkid,omitempty" doc:"lists all public IP addresses by physical network id"`
	Tags                []ResourceTag `json:"tags,omitempty" doc:"List resources by tags (key/value pairs)"`
	VlanID              string        `json:"vlanid,omitempty" doc:"lists all public IP addresses by VLAN ID"`
	ZoneID              string        `json:"zoneid,omitempty" doc:"lists all public IP addresses by Zone ID"`
}

ListPublicIPAddresses represents a search for public IP addresses

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/listPublicIpAddresses.html

func (*ListPublicIPAddresses) SetPage added in v0.9.20

func (ls *ListPublicIPAddresses) SetPage(page int)

SetPage sets the current page

func (*ListPublicIPAddresses) SetPageSize added in v0.9.20

func (ls *ListPublicIPAddresses) SetPageSize(pageSize int)

SetPageSize sets the page size

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 ListResourceDetails added in v0.9.22

type ListResourceDetails struct {
	ResourceType string `json:"resourcetype" doc:"list by resource type"`
	Account      string `json:"account,omitempty" doc:"list resources by account. Must be used with the domainId parameter."`
	DomainID     string `json:"domainid,omitempty" doc:"list only resources belonging to the domain specified"`
	ForDisplay   bool   `json:"fordisplay,omitempty" doc:"if set to true, only details marked with display=true, are returned. False by default"`
	Key          string `json:"key,omitempty" doc:"list by key"`
	Keyword      string `json:"keyword,omitempty" doc:"List by keyword"`
	ListAll      bool   `` /* 195-byte string literal not displayed */
	Page         int    `json:"page,omitempty"`
	PageSize     int    `json:"pagesize,omitempty"`
	ResourceID   string `json:"resourceid,omitempty" doc:"list by resource id"`
	Value        string `json:"value,omitempty" doc:"list by key, value. Needs to be passed only along with key"`
	IsRecursive  bool   `` /* 141-byte string literal not displayed */
}

ListResourceDetails lists the resource tag(s) (but different from listTags...)

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/listResourceDetails.html

type ListResourceDetailsResponse added in v0.9.22

type ListResourceDetailsResponse struct {
	Count          int           `json:"count"`
	ResourceDetail []ResourceTag `json:"resourcedetail"`
}

ListResourceDetailsResponse represents a list of resource details

type ListResourceLimits added in v0.9.7

type ListResourceLimits struct {
	Account          string           `json:"account,omitempty" doc:"list resources by account. Must be used with the domainId parameter."`
	DomainID         string           `json:"domainid,omitempty" doc:"list only resources belonging to the domain specified"`
	ID               int64            `json:"id,omitempty" doc:"Lists resource limits by ID."`
	IsRecursive      *bool            `` /* 141-byte string literal not displayed */
	Keyword          string           `json:"keyword,omitempty" doc:"List by keyword"`
	ListAll          *bool            `` /* 195-byte string literal not displayed */
	Page             int              `json:"page,omitempty"`
	PageSize         int              `json:"pagesize,omitempty"`
	ResourceType     ResourceType     `` /* 957-byte string literal not displayed */
	ResourceTypeName ResourceTypeName `` /* 1059-byte string literal not displayed */
}

ListResourceLimits lists the resource limits

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.4/user/listResourceLimits.html

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" doc:"list resources by account. Must be used with the domainId parameter."`
	DomainID    string `json:"domainid,omitempty" doc:"list only resources belonging to the domain specified"`
	Fingerprint string `json:"fingerprint,omitempty" doc:"A public key fingerprint to look for"`
	IsRecursive *bool  `` /* 141-byte string literal not displayed */
	Keyword     string `json:"keyword,omitempty" doc:"List by keyword"`
	ListAll     *bool  `` /* 195-byte string literal not displayed */
	Name        string `json:"name,omitempty" doc:"A key pair name to look for"`
	Page        int    `json:"page,omitempty"`
	PageSize    int    `json:"pagesize,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) SetPage added in v0.9.19

func (ls *ListSSHKeyPairs) SetPage(page int)

SetPage sets the current page

func (*ListSSHKeyPairs) SetPageSize added in v0.9.19

func (ls *ListSSHKeyPairs) SetPageSize(pageSize int)

SetPageSize sets the page size

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" doc:"list resources by account. Must be used with the domainId parameter."`
	DomainID          string        `json:"domainid,omitempty" doc:"list only resources belonging to the domain specified"`
	ID                string        `json:"id,omitempty" doc:"list the security group by the id provided"`
	IsRecursive       *bool         `` /* 141-byte string literal not displayed */
	Keyword           string        `json:"keyword,omitempty" doc:"List by keyword"`
	ListAll           *bool         `` /* 195-byte string literal not displayed */
	Page              int           `json:"page,omitempty"`
	PageSize          int           `json:"pagesize,omitempty"`
	SecurityGroupName string        `json:"securitygroupname,omitempty" doc:"lists security groups by name"`
	Tags              []ResourceTag `json:"tags,omitempty" doc:"List resources by tags (key/value pairs)"`
	VirtualMachineID  string        `json:"virtualmachineid,omitempty" doc:"lists security groups by virtual machine id"`
}

ListSecurityGroups represents a search for security groups

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/listSecurityGroups.html

func (*ListSecurityGroups) SetPage added in v0.9.21

func (lsg *ListSecurityGroups) SetPage(page int)

SetPage sets the current page

func (*ListSecurityGroups) SetPageSize added in v0.9.21

func (lsg *ListSecurityGroups) SetPageSize(pageSize int)

SetPageSize sets the page size

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" doc:"the ID of the domain associated with the service offering"`
	ID               string `json:"id,omitempty" doc:"ID of the service offering"`
	IsSystem         *bool  `json:"issystem,omitempty" doc:"is this a system vm offering"`
	Keyword          string `json:"keyword,omitempty" doc:"List by keyword"`
	Name             string `json:"name,omitempty" doc:"name of the service offering"`
	Page             int    `json:"page,omitempty"`
	PageSize         int    `json:"pagesize,omitempty"`
	Restricted       *bool  `` /* 185-byte string literal not displayed */
	SystemVMType     string `` /* 136-byte string literal not displayed */
	VirtualMachineID string `` /* 175-byte string literal not displayed */
}

ListServiceOfferings represents a query for service offerings

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/listServiceOfferings.html

func (*ListServiceOfferings) SetPage added in v0.9.24

func (lso *ListServiceOfferings) SetPage(page int)

SetPage sets the current page

func (*ListServiceOfferings) SetPageSize added in v0.9.24

func (lso *ListServiceOfferings) SetPageSize(pageSize int)

SetPageSize sets the page size

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" doc:"list resources by account. Must be used with the domainId parameter."`
	DomainID     string        `json:"domainid,omitempty" doc:"list only resources belonging to the domain specified"`
	ID           string        `json:"id,omitempty" doc:"lists snapshot by snapshot ID"`
	IDs          []string      `json:"ids,omitempty" doc:"the IDs of the snapshots, mutually exclusive with id"`
	IntervalType string        `json:"intervaltype,omitempty" doc:"valid values are HOURLY, DAILY, WEEKLY, and MONTHLY."`
	IsRecursive  *bool         `` /* 141-byte string literal not displayed */
	Keyword      string        `json:"keyword,omitempty" doc:"List by keyword"`
	ListAll      *bool         `` /* 195-byte string literal not displayed */
	Name         string        `json:"name,omitempty" doc:"lists snapshot by snapshot name"`
	Page         int           `json:"page,omitempty"`
	PageSize     int           `json:"pagesize,omitempty"`
	SnapshotType string        `json:"snapshottype,omitempty" doc:"valid values are MANUAL or RECURRING."`
	Tags         []ResourceTag `json:"tags,omitempty" doc:"List resources by tags (key/value pairs)"`
	VolumeID     string        `json:"volumeid,omitempty" doc:"the ID of the disk volume"`
	ZoneID       string        `json:"zoneid,omitempty" doc:"list snapshots by zone id"`
}

ListSnapshots lists the volume snapshots

CloudStackAPI: http://cloudstack.apache.org/api/apidocs-4.10/apis/listSnapshots.html

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" doc:"list resources by account. Must be used with the domainId parameter."`
	Customer     string `json:"customer,omitempty" doc:"list by customer name"`
	DomainID     string `json:"domainid,omitempty" doc:"list only resources belonging to the domain specified"`
	IsRecursive  *bool  `` /* 141-byte string literal not displayed */
	Key          string `json:"key,omitempty" doc:"list by key"`
	Keyword      string `json:"keyword,omitempty" doc:"List by keyword"`
	ListAll      *bool  `` /* 195-byte string literal not displayed */
	Page         int    `json:"page,omitempty"`
	PageSize     int    `json:"pagesize,omitempty"`
	ResourceID   string `json:"resourceid,omitempty" doc:"list by resource id"`
	ResourceType string `json:"resourcetype,omitempty" doc:"list by resource type"`
	Value        string `json:"value,omitempty" doc:"list by value"`
}

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        `` /* 737-byte string literal not displayed */
	Account        string        `json:"account,omitempty" doc:"list resources by account. Must be used with the domainId parameter."`
	DomainID       string        `json:"domainid,omitempty" doc:"list only resources belonging to the domain specified"`
	Hypervisor     string        `json:"hypervisor,omitempty" doc:"the hypervisor for which to restrict the search"`
	ID             string        `json:"id,omitempty" doc:"the template ID"`
	IsRecursive    *bool         `` /* 141-byte string literal not displayed */
	Keyword        string        `json:"keyword,omitempty" doc:"List by keyword"`
	ListAll        *bool         `` /* 195-byte string literal not displayed */
	Name           string        `json:"name,omitempty" doc:"the template name"`
	Page           int           `json:"page,omitempty"`
	PageSize       int           `json:"pagesize,omitempty"`
	ShowRemoved    *bool         `json:"showremoved,omitempty" doc:"show removed templates as well"`
	Tags           []ResourceTag `json:"tags,omitempty" doc:"List resources by tags (key/value pairs)"`
	ZoneID         string        `json:"zoneid,omitempty" doc:"list templates by zoneId"`
}

ListTemplates represents a template query filter

CloudStackAPI: http://cloudstack.apache.org/api/apidocs-4.10/apis/listTemplates.html

func (*ListTemplates) SetPage added in v0.9.20

func (ls *ListTemplates) SetPage(page int)

SetPage sets the current page

func (*ListTemplates) SetPageSize added in v0.9.20

func (ls *ListTemplates) SetPageSize(pageSize int)

SetPageSize sets the page size

type ListTemplatesResponse

type ListTemplatesResponse struct {
	Count    int        `json:"count"`
	Template []Template `json:"template"`
}

ListTemplatesResponse represents a list of templates

type ListUsers added in v0.9.22

type ListUsers struct {
	Account     string `json:"account,omitempty" doc:"list resources by account. Must be used with the domainId parameter."`
	AccountType int64  `` /* 129-byte string literal not displayed */
	DomainID    string `json:"domainid,omitempty" doc:"list only resources belonging to the domain specified"`
	ID          string `json:"id,omitempty" doc:"List user by ID."`
	IsRecursive bool   `` /* 141-byte string literal not displayed */
	Keyword     string `json:"keyword,omitempty" doc:"List by keyword"`
	ListAll     bool   `` /* 195-byte string literal not displayed */
	Page        int    `json:"page,omitempty"`
	PageSize    int    `json:"pagesize,omitempty"`
	State       string `json:"state,omitempty" doc:"List users by state of the user account."`
	Username    string `json:"username,omitempty" doc:"List user by the username"`
}

ListUsers represents the search for Users

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/listUsers.html

type ListUsersResponse added in v0.9.22

type ListUsersResponse struct {
	Count int    `json:"count"`
	User  []User `json:"user"`
}

ListUsersResponse represents a list of users

type ListVirtualMachines added in v0.9.0

type ListVirtualMachines struct {
	Account           string        `json:"account,omitempty" doc:"list resources by account. Must be used with the domainId parameter."`
	AffinityGroupID   string        `json:"affinitygroupid,omitempty" doc:"list vms by affinity group"`
	Details           []string      `` /* 253-byte string literal not displayed */
	DisplayVM         *bool         `json:"displayvm,omitempty" doc:"list resources by display flag; only ROOT admin is eligible to pass this parameter"`
	DomainID          string        `json:"domainid,omitempty" doc:"list only resources belonging to the domain specified"`
	ForVirtualNetwork *bool         `` /* 126-byte string literal not displayed */
	GroupID           string        `json:"groupid,omitempty" doc:"the group ID"`
	HostID            string        `json:"hostid,omitempty" doc:"the host ID"`
	Hypervisor        string        `json:"hypervisor,omitempty" doc:"the target hypervisor for the template"`
	ID                string        `json:"id,omitempty" doc:"the ID of the virtual machine"`
	IDs               []string      `json:"ids,omitempty" doc:"the IDs of the virtual machines, mutually exclusive with id"`
	IPAddress         net.IP        `json:"ipaddress,omitempty" doc:"an IP address to filter the result"`
	IsoID             string        `json:"isoid,omitempty" doc:"list vms by iso"`
	IsRecursive       *bool         `` /* 141-byte string literal not displayed */
	Keyword           string        `json:"keyword,omitempty" doc:"List by keyword"`
	ListAll           *bool         `` /* 195-byte string literal not displayed */
	Name              string        `json:"name,omitempty" doc:"name of the virtual machine"`
	NetworkID         string        `json:"networkid,omitempty" doc:"list by network id"`
	Page              int           `json:"page,omitempty"`
	PageSize          int           `json:"pagesize,omitempty"`
	PodID             string        `json:"podid,omitempty" doc:"the pod ID"`
	ServiceOfferindID string        `json:"serviceofferingid,omitempty" doc:"list by the service offering"`
	State             string        `json:"state,omitempty" doc:"state of the virtual machine"`
	StorageID         string        `json:"storageid,omitempty" doc:"the storage ID where vm's volumes belong to"`
	Tags              []ResourceTag `json:"tags,omitempty" doc:"List resources by tags (key/value pairs)"`
	TemplateID        string        `json:"templateid,omitempty" doc:"list vms by template"`
	ZoneID            string        `json:"zoneid,omitempty" doc:"the availability zone ID"`
}

ListVirtualMachines represents a search for a VM

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/listVirtualMachine.html

func (*ListVirtualMachines) SetPage added in v0.9.18

func (ls *ListVirtualMachines) SetPage(page int)

SetPage sets the current page

func (*ListVirtualMachines) SetPageSize added in v0.9.18

func (ls *ListVirtualMachines) SetPageSize(pageSize int)

SetPageSize sets the page size

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" doc:"list resources by account. Must be used with the domainId parameter."`
	DiskOfferingID   string        `json:"diskofferingid,omitempty" doc:"list volumes by disk offering"`
	DisplayVolume    *bool         `json:"displayvolume,omitempty" doc:"list resources by display flag; only ROOT admin is eligible to pass this parameter"`
	DomainID         string        `json:"domainid,omitempty" doc:"list only resources belonging to the domain specified"`
	HostID           string        `json:"hostid,omitempty" doc:"list volumes on specified host"`
	ID               string        `json:"id,omitempty" doc:"the ID of the disk volume"`
	IsRecursive      *bool         `` /* 141-byte string literal not displayed */
	Keyword          string        `json:"keyword,omitempty" doc:"List by keyword"`
	ListAll          *bool         `` /* 195-byte string literal not displayed */
	Name             string        `json:"name,omitempty" doc:"the name of the disk volume"`
	Page             int           `json:"page,omitempty"`
	PageSize         int           `json:"pagesize,omitempty"`
	PodID            string        `json:"podid,omitempty" doc:"the pod id the disk volume belongs to"`
	StorageID        string        `json:"storageid,omitempty" doc:"the ID of the storage pool, available to ROOT admin only"`
	Tags             []ResourceTag `json:"tags,omitempty" doc:"List resources by tags (key/value pairs)"`
	Type             string        `json:"type,omitempty" doc:"the type of disk volume"`
	VirtualMachineID string        `json:"virtualmachineid,omitempty" doc:"the ID of the virtual machine"`
	ZoneID           string        `json:"zoneid,omitempty" doc:"the ID of the availability zone"`
}

ListVolumes represents a query listing volumes

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/listVolumes.html

func (*ListVolumes) SetPage added in v0.9.18

func (ls *ListVolumes) SetPage(page int)

SetPage sets the current page

func (*ListVolumes) SetPageSize added in v0.9.18

func (ls *ListVolumes) SetPageSize(pageSize int)

SetPageSize sets the page size

type ListVolumesResponse added in v0.9.0

type ListVolumesResponse struct {
	Count  int      `json:"count"`
	Volume []Volume `json:"volume"`
}

ListVolumesResponse represents a list of volumes

type ListZones added in v0.9.0

type ListZones struct {
	Available      *bool         `` /* 180-byte string literal not displayed */
	DomainID       string        `json:"domainid,omitempty" doc:"the ID of the domain associated with the zone"`
	ID             string        `json:"id,omitempty" doc:"the ID of the zone"`
	Keyword        string        `json:"keyword,omitempty" doc:"List by keyword"`
	Name           string        `json:"name,omitempty" doc:"the name of the zone"`
	NetworkType    string        `json:"networktype,omitempty" doc:"the network type of the zone that the virtual machine belongs to"`
	Page           int           `json:"page,omitempty"`
	PageSize       int           `json:"pagesize,omitempty"`
	ShowCapacities *bool         `json:"showcapacities,omitempty" doc:"flag to display the capacity of the zones"`
	Tags           []ResourceTag `json:"tags,omitempty" doc:"List zones by resource tags (key/value pairs)"`
}

ListZones represents a query for zones

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/listZones.html

func (*ListZones) SetPage added in v0.9.18

func (ls *ListZones) SetPage(page int)

SetPage sets the current page

func (*ListZones) SetPageSize added in v0.9.18

func (ls *ListZones) SetPageSize(pageSize int)

SetPageSize sets the page size

type ListZonesResponse

type ListZonesResponse struct {
	Count int    `json:"count"`
	Zone  []Zone `json:"zone"`
}

ListZonesResponse represents a list of zones

type Listable added in v0.9.16

type Listable interface {
	// ListRequest builds the list command
	ListRequest() (ListCommand, error)
}

Listable represents an Interface that can be "List" by the client

type MigrateVirtualMachine added in v0.9.24

type MigrateVirtualMachine struct {
	HostID           string `json:"hostid,omitempty" doc:"Destination Host ID to migrate VM to. Required for live migrating a VM from host to host"`
	StorageID        string `` /* 130-byte string literal not displayed */
	VirtualMachineID string `json:"virtualmachineid" doc:"the ID of the virtual machine"`
}

MigrateVirtualMachine (Async) attempts migration of a VM to a different host or Root volume of the vm to a different storage pool

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/migrateVirtualMachine.html

type MigrateVirtualMachineResponse added in v0.9.24

type MigrateVirtualMachineResponse VirtualMachineResponse

MigrateVirtualMachineResponse represents the migrated VirtualMachine

type Network added in v0.9.0

type Network struct {
	Account                     string        `json:"account,omitempty" doc:"the owner of the network"`
	ACLID                       string        `json:"aclid,omitempty" doc:"ACL Id associated with the VPC network"`
	ACLType                     string        `json:"acltype,omitempty" doc:"acl type - access type to the network"`
	BroadcastDomainType         string        `json:"broadcastdomaintype,omitempty" doc:"Broadcast domain type of the network"`
	BroadcastURI                string        `json:"broadcasturi,omitempty" doc:"broadcast uri of the network. This parameter is visible to ROOT admins only"`
	CanUseForDeploy             bool          `json:"canusefordeploy,omitempty" doc:"list networks available for vm deployment"`
	Cidr                        string        `json:"cidr,omitempty" doc:"Cloudstack managed address space, all CloudStack managed VMs get IP address from CIDR"`
	DisplayNetwork              bool          `json:"displaynetwork,omitempty" doc:"an optional field, whether to the display the network to the end user or not."`
	DisplayText                 string        `json:"displaytext,omitempty" doc:"the displaytext of the network"`
	DNS1                        net.IP        `json:"dns1,omitempty" doc:"the first DNS for the network"`
	DNS2                        net.IP        `json:"dns2,omitempty" doc:"the second DNS for the network"`
	Domain                      string        `json:"domain,omitempty" doc:"the domain name of the network owner"`
	DomainID                    string        `json:"domainid,omitempty" doc:"the domain id of the network owner"`
	Gateway                     net.IP        `json:"gateway,omitempty" doc:"the network's gateway"`
	ID                          string        `json:"id,omitempty" doc:"the id of the network"`
	IP6Cidr                     string        `json:"ip6cidr,omitempty" doc:"the cidr of IPv6 network"`
	IP6Gateway                  net.IP        `json:"ip6gateway,omitempty" doc:"the gateway of IPv6 network"`
	IsDefault                   bool          `json:"isdefault,omitempty" doc:"true if network is default, false otherwise"`
	IsPersistent                bool          `json:"ispersistent,omitempty" doc:"list networks that are persistent"`
	IsSystem                    bool          `json:"issystem,omitempty" doc:"true if network is system, false otherwise"`
	Name                        string        `json:"name,omitempty" doc:"the name of the network"`
	Netmask                     net.IP        `json:"netmask,omitempty" doc:"the network's netmask"`
	NetworkCidr                 string        `` /* 154-byte string literal not displayed */
	NetworkDomain               string        `json:"networkdomain,omitempty" doc:"the network domain"`
	NetworkOfferingAvailability string        `json:"networkofferingavailability,omitempty" doc:"availability of the network offering the network is created from"`
	NetworkOfferingConserveMode bool          `json:"networkofferingconservemode,omitempty" doc:"true if network offering is ip conserve mode enabled"`
	NetworkOfferingDisplayText  string        `json:"networkofferingdisplaytext,omitempty" doc:"display text of the network offering the network is created from"`
	NetworkOfferingID           string        `json:"networkofferingid,omitempty" doc:"network offering id the network is created from"`
	NetworkOfferingName         string        `json:"networkofferingname,omitempty" doc:"name of the network offering the network is created from"`
	PhysicalNetworkID           string        `json:"physicalnetworkid,omitempty" doc:"the physical network id"`
	Related                     string        `json:"related,omitempty" doc:"related to what other network configuration"`
	ReservedIPRange             string        `` /* 144-byte string literal not displayed */
	RestartRequired             bool          `json:"restartrequired,omitempty" doc:"true network requires restart"`
	Service                     []Service     `json:"service,omitempty" doc:"the list of services"`
	SpecifyIPRanges             bool          `json:"specifyipranges,omitempty" doc:"true if network supports specifying ip ranges, false otherwise"`
	State                       string        `json:"state,omitempty" doc:"state of the network"`
	StrechedL2Subnet            bool          `json:"strechedl2subnet,omitempty" doc:"true if network can span multiple zones"`
	SubdomainAccess             bool          `json:"subdomainaccess,omitempty" doc:"true if users from subdomains can access the domain level network"`
	Tags                        []ResourceTag `json:"tags,omitempty" doc:"the list of resource tags associated with network"`
	TrafficType                 string        `json:"traffictype,omitempty" doc:"the traffic type of the network"`
	Type                        string        `json:"type,omitempty" doc:"the type of the network"`
	Vlan                        string        `json:"vlan,omitemtpy" doc:"The vlan of the network. This parameter is visible to ROOT admins only"`
	ZoneID                      string        `json:"zoneid,omitempty" doc:"zone id of the network"`
	ZoneName                    string        `json:"zonename,omitempty" doc:"the name of the zone the network belongs to"`
	ZonesNetworkSpans           []Zone        `` /* 144-byte string literal not displayed */
}

Network represents a network

See: http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/latest/networking_and_traffic.html

func (*Network) ListRequest added in v0.9.21

func (network *Network) ListRequest() (ListCommand, error)

ListRequest builds the ListNetworks request

func (*Network) ResourceType added in v0.9.7

func (*Network) ResourceType() string

ResourceType returns the type of the resource

type NetworkOffering added in v0.9.0

type NetworkOffering struct {
	Availability             string            `json:"availability,omitempty" doc:"availability of the network offering"`
	ConserveMode             bool              `json:"conservemode,omitempty" doc:"true if network offering is ip conserve mode enabled"`
	Created                  string            `json:"created,omitempty" doc:"the date this network offering was created"`
	Details                  map[string]string `json:"details,omitempty" doc:"additional key/value details tied with network offering"`
	DisplayText              string            `json:"displaytext,omitempty" doc:"an alternate display text of the network offering."`
	EgressDefaultPolicy      bool              `` /* 135-byte string literal not displayed */
	GuestIPType              string            `json:"guestiptype,omitempty" doc:"guest type of the network offering, can be Shared or Isolated"`
	ID                       string            `json:"id,omitempty" doc:"the id of the network offering"`
	IsDefault                bool              `json:"isdefault,omitempty" doc:"true if network offering is default, false otherwise"`
	IsPersistent             bool              `json:"ispersistent,omitempty" doc:"true if network offering supports persistent networks, false otherwise"`
	MaxConnections           int               `json:"maxconnections,omitempty" doc:"maximum number of concurrents connections to be handled by lb"`
	Name                     string            `json:"name,omitempty" doc:"the name of the network offering"`
	NetworkRate              int               `json:"networkrate,omitempty" doc:"data transfer rate in megabits per second allowed."`
	Service                  []Service         `json:"service,omitempty" doc:"the list of supported services"`
	ServiceOfferingID        string            `json:"serviceofferingid,omitempty" doc:"the ID of the service offering used by virtual router provider"`
	SpecifyIPRanges          bool              `json:"specifyipranges,omitempty" doc:"true if network offering supports specifying ip ranges, false otherwise"`
	SpecifyVlan              bool              `json:"specifyvlan,omitempty" doc:"true if network offering supports vlans, false otherwise"`
	State                    string            `json:"state,omitempty" doc:"state of the network offering. Can be Disabled/Enabled/Inactive"`
	SupportsStrechedL2Subnet bool              `json:"supportsstrechedl2subnet,omitempty" doc:"true if network offering supports network that span multiple zones"`
	Tags                     string            `json:"tags,omitempty" doc:"the tags for the network offering"`
	TrafficType              string            `` /* 150-byte string literal not displayed */
}

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 {
	BroadcastURI     string           `json:"broadcasturi,omitempty" doc:"the broadcast uri of the nic"`
	DeviceID         string           `json:"deviceid,omitempty" doc:"device id for the network when plugged into the virtual machine"`
	Gateway          net.IP           `json:"gateway,omitempty" doc:"the gateway of the nic"`
	ID               string           `json:"id,omitempty" doc:"the ID of the nic"`
	IP6Address       net.IP           `json:"ip6address,omitempty" doc:"the IPv6 address of network"`
	IP6Cidr          string           `json:"ip6cidr,omitempty" doc:"the cidr of IPv6 network"`
	IP6Gateway       net.IP           `json:"ip6gateway,omitempty" doc:"the gateway of IPv6 network"`
	IPAddress        net.IP           `json:"ipaddress,omitempty" doc:"the ip address of the nic"`
	IsDefault        bool             `json:"isdefault,omitempty" doc:"true if nic is default, false otherwise"`
	IsolationURI     string           `json:"isolationuri,omitempty" doc:"the isolation uri of the nic"`
	MacAddress       string           `json:"macaddress,omitempty" doc:"true if nic is default, false otherwise"`
	Netmask          net.IP           `json:"netmask,omitempty" doc:"the netmask of the nic"`
	NetworkID        string           `json:"networkid,omitempty" doc:"the ID of the corresponding network"`
	NetworkName      string           `json:"networkname,omitempty" doc:"the name of the corresponding network"`
	SecondaryIP      []NicSecondaryIP `json:"secondaryip,omitempty" doc:"the Secondary ipv4 addr of nic"`
	TrafficType      string           `json:"traffictype,omitempty" doc:"the traffic type of the nic"`
	Type             string           `json:"type,omitempty" doc:"the type of the nic"`
	VirtualMachineID string           `json:"virtualmachineid,omitempty" doc:"Id of the vm to which the nic belongs"`
}

Nic represents a Network Interface Controller (NIC)

See: http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/latest/networking_and_traffic.html#configuring-multiple-ip-addresses-on-a-single-nic

func (*Nic) ListRequest added in v0.9.18

func (nic *Nic) ListRequest() (ListCommand, error)

ListRequest build a ListNics request from the given Nic

type NicSecondaryIP added in v0.9.0

type NicSecondaryIP struct {
	ID               string `json:"id,omitempty" doc:"the ID of the secondary private IP addr"`
	IPAddress        net.IP `json:"ipaddress,omitempty" doc:"Secondary IP address"`
	NetworkID        string `json:"networkid,omitempty" doc:"the ID of the network"`
	NicID            string `json:"nicid,omitempty" doc:"the ID of the nic"`
	VirtualMachineID string `json:"virtualmachineid,omitempty" doc:"the ID of the vm"`
}

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 PrepareTemplate added in v0.9.24

type PrepareTemplate struct {
	TemplateID string `json:"templateid" doc:"template ID of the template to be prepared in primary storage(s)."`
	ZoneID     string `json:"zoneid" doc:"zone ID of the template to be prepared in primary storage(s)."`
}

PrepareTemplate represents a template preparation

CloudStackAPI: http://cloudstack.apache.org/api/apidocs-4.10/apis/prepareTemplate.html

type PrepareTemplateResponse added in v0.9.24

type PrepareTemplateResponse CreateTemplateResponse

PrepareTemplateResponse represents the prepared template

type QueryAsyncJobResult added in v0.9.0

type QueryAsyncJobResult struct {
	JobID string `json:"jobid" doc:"the ID of the asychronous job"`
}

QueryAsyncJobResult represents a query to fetch the status of async job

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/queryAsyncJobResult.html

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" doc:"The ID of the virtual machine"`
}

RebootVirtualMachine (Async) represents the rebooting of the virtual machine

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/rebootVirtualMachine.html

type RebootVirtualMachineResponse

type RebootVirtualMachineResponse VirtualMachineResponse

RebootVirtualMachineResponse represents a rebooted VM instance

type RecoverVirtualMachine added in v0.9.0

type RecoverVirtualMachine RebootVirtualMachine

RecoverVirtualMachine represents the restoration of the virtual machine

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/recoverVirtualMachine.html

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" doc:"Name of the keypair"`
	PublicKey string `json:"publickey" doc:"Public key material of the keypair"`
	Account   string `json:"account,omitempty" doc:"an optional account for the ssh key. Must be used with domainId."`
	DomainID  string `` /* 131-byte string literal not displayed */
}

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

type RegisterSSHKeyPairResponse added in v0.9.0

type RegisterSSHKeyPairResponse struct {
	KeyPair SSHKeyPair `json:"keypair"`
}

RegisterSSHKeyPairResponse represents the creation of an SSH Key Pair

type RegisterTemplate added in v0.9.24

type RegisterTemplate struct {
	Account               string            `json:"account,omitempty" doc:"an optional accountName. Must be used with domainId."`
	Bits                  int               `json:"bits,omitempty" doc:"32 or 64 bits support. 64 by default"`
	Checksum              string            `json:"checksum,omitempty" doc:"the MD5 checksum value of this template"`
	Details               map[string]string `json:"details,omitempty" doc:"Template details in key/value pairs."`
	DisplayText           string            `json:"displaytext" doc:"the display text of the template. This is usually used for display purposes."`
	DomainID              string            `json:"domainid,omitempty" doc:"an optional domainId. If the account parameter is used, domainId must also be used."`
	Format                string            `json:"format" doc:"the format for the template. Possible values include QCOW2, RAW, and VHD."`
	Hypervisor            string            `json:"hypervisor" doc:"the target hypervisor for the template"`
	IsDynamicallyScalable *bool             `` /* 138-byte string literal not displayed */
	IsExtractable         *bool             `json:"isextractable,omitempty" doc:"true if the template or its derivatives are extractable; default is false"`
	IsFeatured            *bool             `json:"isfeatured,omitempty" doc:"true if this template is a featured template, false otherwise"`
	IsPublic              *bool             `json:"ispublic,omitempty" doc:"true if the template is available to all accounts; default is true"`
	IsRouting             *bool             `json:"isrouting,omitempty" doc:"true if the template type is routing i.e., if template is used to deploy router"`
	IsSystem              *bool             `json:"issystem,omitempty" doc:"true if the template type is system i.e., if template is used to deploy system VM"`
	Name                  string            `json:"name" doc:"the name of the template"`
	OsTypeID              string            `json:"ostypeid" doc:"the ID of the OS Type that best represents the OS of this template."`
	PasswordEnabled       *bool             `json:"passwordenabled,omitempty" doc:"true if the template supports the password reset feature; default is false"`
	RequiresHVM           *bool             `json:"requireshvm,omitempty" doc:"true if this template requires HVM"`
	SSHKeyEnabled         *bool             `json:"sshkeyenabled,omitempty" doc:"true if the template supports the sshkey upload feature; default is false"`
	TemplateTag           string            `json:"templatetag,omitempty" doc:"the tag for this template."`
	URL                   string            `json:"url" doc:"the URL of where the template is hosted. Possible URL include http:// and https://"`
	ZoneID                string            `json:"zoneid" doc:"the ID of the zone the template is to be hosted on"`
}

RegisterTemplate represents a template registration

CloudStackAPI: http://cloudstack.apache.org/api/apidocs-4.10/apis/registerTemplate.html

type RegisterTemplateResponse added in v0.9.24

type RegisterTemplateResponse CreateTemplateResponse

RegisterTemplateResponse represents the registered template

type RegisterUserKeys added in v0.9.7

type RegisterUserKeys struct {
	ID string `json:"id" doc:"User 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

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, hence the different key name

type RemoveIPFromNic added in v0.9.0

type RemoveIPFromNic struct {
	ID string `json:"id" doc:"the ID of the secondary ip address to nic"`
}

RemoveIPFromNic (Async) represents a deletion request

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/removeIpFromNic.html

type RemoveNicFromVirtualMachine added in v0.9.0

type RemoveNicFromVirtualMachine struct {
	NicID            string `json:"nicid" doc:"NIC ID"`
	VirtualMachineID string `json:"virtualmachineid" doc:"Virtual Machine ID"`
}

RemoveNicFromVirtualMachine (Async) removes a NIC from a VM

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/removeNicFromVirtualMachine.html

type RemoveNicFromVirtualMachineResponse added in v0.9.0

type RemoveNicFromVirtualMachineResponse VirtualMachineResponse

RemoveNicFromVirtualMachineResponse represents the modified VM

type ResetPasswordForVirtualMachine added in v0.9.0

type ResetPasswordForVirtualMachine RebootVirtualMachine

ResetPasswordForVirtualMachine resets the password for virtual machine. The virtual machine must be in a "Stopped" state...

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/resetPasswordForVirtualMachine.html

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" doc:"The ID of the virtual machine"`
	KeyPair  string `json:"keypair" doc:"name of the ssh key pair used to login to the virtual machine"`
	Account  string `json:"account,omitempty" doc:"an optional account for the ssh key. Must be used with domainId."`
	DomainID string `` /* 139-byte string literal not displayed */
}

ResetSSHKeyForVirtualMachine (Async) represents a change for the key pairs

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/resetSSHKeyForVirtualMachine.html

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" doc:"the ID of the disk volume"`
	DiskOfferingID string `json:"diskofferingid,omitempty" doc:"new disk offering id"`
	ShrinkOk       *bool  `json:"shrinkok,omitempty" doc:"Verify OK to Shrink"`
	Size           int64  `json:"size,omitempty" doc:"New volume size in G"`
}

ResizeVolume (Async) resizes a volume

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/resizeVolume.html

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" doc:"the account of the resource limit"`
	Domain           string           `json:"domain,omitempty" doc:"the domain name of the resource limit"`
	DomainID         string           `json:"domainid,omitempty" doc:"the domain ID of the resource limit"`
	Max              int64            `json:"max,omitempty" doc:"the maximum number of the resource. A -1 means the resource currently has no limit."`
	ResourceType     ResourceType     `` /* 169-byte string literal not displayed */
	ResourceTypeName ResourceTypeName `` /* 194-byte string literal not displayed */
}

ResourceLimit represents the limit on a particular resource

type ResourceTag added in v0.9.0

type ResourceTag struct {
	Account      string `json:"account,omitempty" doc:"the account associated with the tag"`
	Customer     string `json:"customer,omitempty" doc:"customer associated with the tag"`
	Domain       string `json:"domain,omitempty" doc:"the domain associated with the tag"`
	DomainID     string `json:"domainid,omitempty" doc:"the ID of the domain associated with the tag"`
	Key          string `json:"key,omitempty" doc:"tag key name"`
	ResourceID   string `json:"resourceid,omitempty" doc:"id of the resource"`
	ResourceType string `json:"resourcetype,omitempty" doc:"resource type"`
	Value        string `json:"value,omitempty" doc:"tag 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
)

func (ResourceType) String added in v0.9.24

func (i ResourceType) String() string

type ResourceTypeName added in v0.9.7

type ResourceTypeName string

ResourceTypeName represents the name of a resource type (for limits)

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 ResourceTypeName = "public_ip"
	// VolumeTypeName is the resource type name of a volume
	VolumeTypeName ResourceTypeName = "volume"
	// SnapshotTypeName is the resource type name of a snapshot
	SnapshotTypeName ResourceTypeName = "snapshot"
	// TemplateTypeName is the resource type name of a template
	TemplateTypeName ResourceTypeName = "template"
	// ProjectTypeName is the resource type name of a project
	ProjectTypeName ResourceTypeName = "project"
	// NetworkTypeName is the resource type name of a network
	NetworkTypeName ResourceTypeName = "network"
	// VPCTypeName is the resource type name of a VPC
	VPCTypeName ResourceTypeName = "vpc"
	// CPUTypeName is the resource type name of a CPU
	CPUTypeName ResourceTypeName = "cpu"
	// MemoryTypeName is the resource type name of Memory
	MemoryTypeName ResourceTypeName = "memory"
	// PrimaryStorageTypeName is the resource type name of primary storage
	PrimaryStorageTypeName ResourceTypeName = "primary_storage"
	// SecondaryStorageTypeName is the resource type name of secondary storage
	SecondaryStorageTypeName ResourceTypeName = "secondary_storage"
)

type RestartNetwork added in v0.9.0

type RestartNetwork struct {
	ID      string `json:"id" doc:"The id of the network to restart."`
	Cleanup *bool  `json:"cleanup,omitempty" doc:"If cleanup old network elements"`
}

RestartNetwork (Async) updates a network

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/restartNetwork.html

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" doc:"Virtual Machine ID"`
	TemplateID       string `` /* 157-byte string literal not displayed */
	RootDiskSize     int64  `` /* 142-byte string literal not displayed */
}

RestoreVirtualMachine (Async) represents the restoration of the virtual machine

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/restoreVirtualMachine.html

type RestoreVirtualMachineResponse added in v0.9.0

type RestoreVirtualMachineResponse VirtualMachineResponse

RestoreVirtualMachineResponse represents a restored VM instance

type RetryStrategyFunc added in v0.9.11

type RetryStrategyFunc func(int64) time.Duration

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" doc:"The ID of the snapshot"`
}

RevertSnapshot (Async) reverts a volume snapshot

CloudStackAPI: http://cloudstack.apache.org/api/apidocs-4.10/apis/revertSnapshot.html

type RevokeSecurityGroupEgress added in v0.9.0

type RevokeSecurityGroupEgress RevokeSecurityGroupIngress

RevokeSecurityGroupEgress (Async) represents the ingress/egress rule deletion

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/revokeSecurityGroupEgress.html

type RevokeSecurityGroupIngress added in v0.9.0

type RevokeSecurityGroupIngress struct {
	ID string `json:"id" doc:"The ID of the ingress/egress rule"`
}

RevokeSecurityGroupIngress (Async) represents the ingress/egress rule deletion

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/revokeSecurityGroupIngress.html

type SSHKeyPair

type SSHKeyPair struct {
	Account     string `json:"account,omitempty"` // must be used with a Domain ID
	DomainID    string `json:"domainid,omitempty"`
	Fingerprint string `json:"fingerprint,omitempty"`
	Name        string `json:"name,omitempty"`
	PrivateKey  string `json:"privatekey,omitempty"`
}

SSHKeyPair represents an SSH key pair

See: http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/stable/virtual_machines.html#creating-the-ssh-keypair

func (*SSHKeyPair) Delete added in v0.9.12

func (ssh *SSHKeyPair) Delete(ctx context.Context, client *Client) error

Delete removes the given SSH key, by Name

func (*SSHKeyPair) Get added in v0.9.12

func (ssh *SSHKeyPair) Get(ctx context.Context, client *Client) error

Get populates the given SSHKeyPair

func (*SSHKeyPair) ListRequest added in v0.9.19

func (ssh *SSHKeyPair) ListRequest() (ListCommand, error)

ListRequest builds the ListSSHKeyPairs request

type ScaleVirtualMachine added in v0.9.0

type ScaleVirtualMachine struct {
	ID                string            `json:"id" doc:"The ID of the virtual machine"`
	ServiceOfferingID string            `json:"serviceofferingid" doc:"the ID of the service offering for the virtual machine"`
	Details           map[string]string `` /* 128-byte string literal not displayed */
}

ScaleVirtualMachine (Async) scales the virtual machine to a new service offering.

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

type SecurityGroup

type SecurityGroup struct {
	Account     string        `json:"account,omitempty" doc:"the account owning the security group"`
	Description string        `json:"description,omitempty" doc:"the description of the security group"`
	Domain      string        `json:"domain,omitempty" doc:"the domain name of the security group"`
	DomainID    string        `json:"domainid,omitempty" doc:"the domain ID of the security group"`
	EgressRule  []EgressRule  `json:"egressrule,omitempty" doc:"the list of egress rules associated with the security group"`
	ID          string        `json:"id,omitempty" doc:"the ID of the security group"`
	IngressRule []IngressRule `json:"ingressrule,omitempty" doc:"the list of ingress rules associated with the security group"`
	Name        string        `json:"name,omitempty" doc:"the name of the security group"`
	Tags        []ResourceTag `json:"tags,omitempty" doc:"the list of resource tags associated with the rule"`
}

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) ListRequest added in v0.9.21

func (sg *SecurityGroup) ListRequest() (ListCommand, error)

ListRequest builds the ListSecurityGroups request

func (*SecurityGroup) ResourceType added in v0.9.7

func (*SecurityGroup) ResourceType() string

ResourceType returns the type of the resource

func (*SecurityGroup) RuleByID added in v0.9.22

func (sg *SecurityGroup) RuleByID(ruleID string) (*IngressRule, *EgressRule)

RuleByID returns IngressRule or EgressRule by a rule ID

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 {
	Capability []ServiceCapability `json:"capability,omitempty"`
	Name       string              `json:"name"`
	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 {
	Authorized                bool              `json:"authorized,omitempty" doc:"is the account/domain authorized to use this service offering"`
	CPUNumber                 int               `json:"cpunumber,omitempty" doc:"the number of CPU"`
	CPUSpeed                  int               `json:"cpuspeed,omitempty" doc:"the clock rate CPU speed in Mhz"`
	Created                   string            `json:"created,omitempty" doc:"the date this service offering was created"`
	DefaultUse                bool              `json:"defaultuse,omitempty" doc:"is this a  default system vm offering"`
	DeploymentPlanner         string            `json:"deploymentplanner,omitempty" doc:"deployment strategy used to deploy VM."`
	DiskBytesReadRate         int64             `json:"diskBytesReadRate,omitempty" doc:"bytes read rate of the service offering"`
	DiskBytesWriteRate        int64             `json:"diskBytesWriteRate,omitempty" doc:"bytes write rate of the service offering"`
	DiskIopsReadRate          int64             `json:"diskIopsReadRate,omitempty" doc:"io requests read rate of the service offering"`
	DiskIopsWriteRate         int64             `json:"diskIopsWriteRate,omitempty" doc:"io requests write rate of the service offering"`
	Displaytext               string            `json:"displaytext,omitempty" doc:"an alternate display text of the service offering."`
	Domain                    string            `json:"domain,omitempty" doc:"Domain name for the offering"`
	DomainID                  string            `json:"domainid,omitempty" doc:"the domain id of the service offering"`
	HostTags                  string            `json:"hosttags,omitempty" doc:"the host tag for the service offering"`
	HypervisorSnapshotReserve int               `` /* 149-byte string literal not displayed */
	ID                        string            `json:"id,omitempty" doc:"the id of the service offering"`
	IsCustomized              bool              `json:"iscustomized,omitempty" doc:"is true if the offering is customized"`
	IsCustomizedIops          bool              `json:"iscustomizediops,omitempty" doc:"true if disk offering uses custom iops, false otherwise"`
	IsSystem                  bool              `json:"issystem,omitempty" doc:"is this a system vm offering"`
	IsVolatile                bool              `` /* 158-byte string literal not displayed */
	LimitCPUUse               bool              `json:"limitcpuuse,omitempty" doc:"restrict the CPU usage to committed service offering"`
	MaxIops                   int64             `json:"maxiops,omitempty" doc:"the max iops of the disk offering"`
	Memory                    int               `json:"memory,omitempty" doc:"the memory in MB"`
	MinIops                   int64             `json:"miniops,omitempty" doc:"the min iops of the disk offering"`
	Name                      string            `json:"name,omitempty" doc:"the name of the service offering"`
	NetworkRate               int               `json:"networkrate,omitempty" doc:"data transfer rate in megabits per second allowed."`
	OfferHA                   bool              `json:"offerha,omitempty" doc:"the ha support in the service offering"`
	Restricted                bool              `json:"restricted,omitempty" doc:"is this offering restricted"`
	ServiceOfferingDetails    map[string]string `json:"serviceofferingdetails,omitempty" doc:"additional key/value details tied with this service offering"`
	StorageType               string            `json:"storagetype,omitempty" doc:"the storage type for this service offering"`
	SystemVMType              string            `json:"systemvmtype,omitempty" doc:"is this a the systemvm type for system vm offering"`
	Tags                      string            `json:"tags,omitempty" doc:"the tags for the service offering"`
}

ServiceOffering corresponds to the Compute Offerings

A service offering correspond to some hardware features (CPU, RAM).

See: http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/latest/service_offerings.html

func (*ServiceOffering) Get added in v0.9.24

func (so *ServiceOffering) Get(ctx context.Context, client *Client) error

Get fetches the resource

func (*ServiceOffering) ListRequest added in v0.9.24

func (so *ServiceOffering) ListRequest() (ListCommand, error)

ListRequest builds the ListSecurityGroups request

type ServiceProvider added in v0.9.0

type ServiceProvider struct {
	CanEnableIndividualService   bool     `json:"canenableindividualservice"`
	DestinationPhysicalNetworkID string   `json:"destinationphysicalnetworkid"`
	ID                           string   `json:"id"`
	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 {
	Account      string        `json:"account,omitempty" doc:"the account associated with the snapshot"`
	Created      string        `json:"created,omitempty" doc:"  the date the snapshot was created"`
	Domain       string        `json:"domain,omitempty" doc:"the domain name of the snapshot's account"`
	DomainID     string        `json:"domainid,omitempty" doc:"the domain ID of the snapshot's account"`
	ID           string        `json:"id,omitempty" doc:"ID of the snapshot"`
	IntervalType string        `json:"intervaltype,omitempty" doc:"valid types are hourly, daily, weekly, monthy, template, and none."`
	Name         string        `json:"name,omitempty" doc:"name of the snapshot"`
	PhysicalSize int64         `json:"physicalsize,omitempty" doc:"physical size of the snapshot on image store"`
	Revertable   *bool         `json:"revertable,omitempty" doc:"indicates whether the underlying storage supports reverting the volume to this snapshot"`
	Size         int64         `json:"size,omitempty" doc:"the size of original volume"`
	SnapshotType string        `json:"snapshottype,omitempty" doc:"the type of the snapshot"`
	State        SnapshotState `` /* 237-byte string literal not displayed */
	Tags         []ResourceTag `json:"tags,omitempty" doc:"the list of resource tags associated with snapshot"`
	VolumeID     string        `json:"volumeid,omitempty" doc:"ID of the disk volume"`
	VolumeName   string        `json:"volumename,omitempty" doc:"name of the disk volume"`
	VolumeType   string        `json:"volumetype,omitempty" doc:"type of the disk volume"`
	ZoneID       string        `json:"zoneid,omitempty" doc:"id of the availability zone"`
}

Snapshot represents a volume snapshot

func (*Snapshot) ResourceType added in v0.9.7

func (*Snapshot) ResourceType() string

ResourceType returns the type of the resource

type SnapshotState added in v0.9.24

type SnapshotState int

SnapshotState represents the Snapshot.State enum

See: https://github.com/apache/cloudstack/blob/master/api/src/main/java/com/cloud/storage/Snapshot.java

const (
	// Allocated ... (TODO)
	Allocated SnapshotState = iota
	// Creating ... (TODO)
	Creating
	// CreatedOnPrimary ... (TODO)
	CreatedOnPrimary
	// BackingUp ... (TODO)
	BackingUp
	// BackedUp ... (TODO)
	BackedUp
	// Copying ... (TODO)
	Copying
	// Destroying ... (TODO)
	Destroying
	// Destroyed ... (TODO)
	Destroyed
	// Error ... (TODO)
	Error
)

func (SnapshotState) String added in v0.9.24

func (i SnapshotState) String() string

type StartVirtualMachine added in v0.9.0

type StartVirtualMachine struct {
	ID                string `json:"id" doc:"The ID of the virtual machine"`
	DeploymentPlanner string `json:"deploymentplanner,omitempty" doc:"Deployment planner to use for vm allocation. Available to ROOT admin only"`
	HostID            string `json:"hostid,omitempty" doc:"destination Host ID to deploy the VM to - parameter available for root admin only"`
}

StartVirtualMachine (Async) represents the creation of the virtual machine

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/startVirtualMachine.html

type StartVirtualMachineResponse

type StartVirtualMachineResponse VirtualMachineResponse

StartVirtualMachineResponse represents a started VM instance

type StopVirtualMachine added in v0.9.0

type StopVirtualMachine struct {
	ID     string `json:"id" doc:"The ID of the virtual machine"`
	Forced *bool  `` /* 161-byte string literal not displayed */
}

StopVirtualMachine (Async) represents the stopping of the virtual machine

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/stopVirtualMachine.html

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" doc:"the account name to which the template belongs"`
	AccountID             string            `json:"accountid,omitempty" doc:"the account id to which the template belongs"`
	Bootable              bool              `json:"bootable,omitempty" doc:"true if the ISO is bootable, false otherwise"`
	Checksum              string            `json:"checksum,omitempty" doc:"checksum of the template"`
	Created               string            `json:"created,omitempty" doc:"the date this template was created"`
	CrossZones            bool              `json:"crossZones,omitempty" doc:"true if the template is managed across all Zones, false otherwise"`
	Details               map[string]string `json:"details,omitempty" doc:"additional key/value details tied with template"`
	DisplayText           string            `json:"displaytext,omitempty" doc:"the template display text"`
	Domain                string            `json:"domain,omitempty" doc:"the name of the domain to which the template belongs"`
	DomainID              string            `json:"domainid,omitempty" doc:"the ID of the domain to which the template belongs"`
	Format                string            `json:"format,omitempty" doc:"the format of the template."`
	HostID                string            `json:"hostid,omitempty" doc:"the ID of the secondary storage host for the template"`
	HostName              string            `json:"hostname,omitempty" doc:"the name of the secondary storage host for the template"`
	Hypervisor            string            `json:"hypervisor,omitempty" doc:"the hypervisor on which the template runs"`
	ID                    string            `json:"id,omitempty" doc:"the template ID"`
	IsDynamicallyScalable bool              `` /* 138-byte string literal not displayed */
	IsExtractable         bool              `json:"isextractable,omitempty" doc:"true if the template is extractable, false otherwise"`
	IsFeatured            bool              `json:"isfeatured,omitempty" doc:"true if this template is a featured template, false otherwise"`
	IsPublic              bool              `json:"ispublic,omitempty" doc:"true if this template is a public template, false otherwise"`
	IsReady               bool              `json:"isready,omitempty" doc:"true if the template is ready to be deployed from, false otherwise."`
	Name                  string            `json:"name,omitempty" doc:"the template name"`
	OsTypeID              string            `json:"ostypeid,omitempty" doc:"the ID of the OS type for this template."`
	OsTypeName            string            `json:"ostypename,omitempty" doc:"the name of the OS type for this template."`
	PasswordEnabled       bool              `json:"passwordenabled,omitempty" doc:"true if the reset password feature is enabled, false otherwise"`
	Removed               string            `json:"removed,omitempty" doc:"the date this template was removed"`
	Size                  int64             `json:"size,omitempty" doc:"the size of the template"`
	SourceTemplateID      string            `json:"sourcetemplateid,omitempty" doc:"the template ID of the parent template if present"`
	SSHKeyEnabled         bool              `json:"sshkeyenabled,omitempty" doc:"true if template is sshkey enabled, false otherwise"`
	Status                string            `json:"status,omitempty" doc:"the status of the template"`
	Tags                  []ResourceTag     `json:"tags,omitempty" doc:"the list of resource tags associated with tempate"`
	TemplateDirectory     string            `json:"templatedirectory,omitempty" doc:"Template directory"`
	TemplateTag           string            `json:"templatetag,omitempty" doc:"the tag of this template"`
	TemplateType          string            `json:"templatetype,omitempty" doc:"the type of the template"`
	URL                   string            `json:"url,omitempty" doc:"Original URL of the template where it was downloaded"`
	ZoneID                string            `json:"zoneid,omitempty" doc:"the ID of the zone for this template"`
	ZoneName              string            `json:"zonename,omitempty" doc:"the name of the zone for this template"`
}

Template represents a machine to be deployed

See: http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/latest/templates.html

func (*Template) Get added in v0.9.24

func (temp *Template) Get(ctx context.Context, client *Client) error

Get fetches the resource

func (*Template) ListRequest added in v0.9.20

func (temp *Template) ListRequest() (ListCommand, error)

ListRequest builds the ListTemplates request

func (*Template) ResourceType added in v0.9.7

func (*Template) ResourceType() string

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 RemoveNicFromVirtualMachine

UpdateDefaultNicForVirtualMachine (Async) adds a NIC to a VM

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/updateDefaultNicForVirtualMachine.html

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" doc:"the id of the public ip address to update"`
	CustomID   string `` /* 131-byte string literal not displayed */
	ForDisplay *bool  `json:"fordisplay,omitempty" doc:"an optional field, whether to the display the ip to the end user or not"`
}

UpdateIPAddress (Async) represents the IP modification

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/updateIpAddress.html

type UpdateIPAddressResponse added in v0.9.0

type UpdateIPAddressResponse AssociateIPAddressResponse

UpdateIPAddressResponse represents the modified IP Address

type UpdateInstanceGroup added in v0.9.7

type UpdateInstanceGroup struct {
	ID   string `json:"id" doc:"Instance group ID"`
	Name string `json:"name,omitempty" doc:"new instance group name"`
}

UpdateInstanceGroup updates a VM group

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/updateInstanceGroup.html

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" doc:"the ID of the network"`
	ChangeCidr        *bool  `json:"changecidr,omitempty" doc:"Force update even if cidr type is different"`
	CustomID          string `` /* 131-byte string literal not displayed */
	DisplayNetwork    *bool  `json:"displaynetwork,omitempty" doc:"an optional field, whether to the display the network to the end user or not."`
	DisplayText       string `json:"displaytext,omitempty" doc:"the new display text for the network"`
	GuestVMCidr       string `json:"guestvmcidr,omitempty" doc:"CIDR for Guest VMs,Cloudstack allocates IPs to Guest VMs only from this CIDR"`
	Name              string `json:"name,omitempty" doc:"the new name for the network"`
	NetworkDomain     string `json:"networkdomain,omitempty" doc:"network domain"`
	NetworkOfferingID string `json:"networkofferingid,omitempty" doc:"network offering ID"`
}

UpdateNetwork (Async) updates a network

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/updateNetwork.html

type UpdateNetworkOffering added in v0.9.22

type UpdateNetworkOffering struct {
	Availability     string `` /* 178-byte string literal not displayed */
	DisplayText      string `json:"displaytext,omitempty" doc:"the display text of the network offering"`
	ID               string `json:"id,omitempty" doc:"the id of the network offering"`
	KeepAliveEnabled *bool  `` /* 227-byte string literal not displayed */
	MaxConnections   int    `json:"maxconnections,omitempty" doc:"maximum number of concurrent connections supported by the network offering"`
	Name             string `json:"name,omitempty" doc:"the name of the network offering"`
	SortKey          int    `json:"sortkey,omitempty" doc:"sort key of the network offering, integer"`
	State            string `json:"state,omitempty" doc:"update state for the network offering"`
}

UpdateNetworkOffering represents a modification of a network offering

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/updateNetworkOffering.html

type UpdateNetworkOfferingResponse added in v0.9.22

type UpdateNetworkOfferingResponse struct {
	NetworkOffering NetworkOffering `json:"networkoffering"`
}

UpdateNetworkOfferingResponse represents a newly modified network offering

type UpdateNetworkResponse added in v0.9.0

type UpdateNetworkResponse NetworkResponse

UpdateNetworkResponse represents a freshly created network

type UpdateResourceLimit added in v0.9.24

type UpdateResourceLimit struct {
	Account      string       `json:"account,omitempty" doc:"Update resource for a specified account. Must be used with the domainId parameter."`
	DomainID     string       `` /* 197-byte string literal not displayed */
	Max          int64        `json:"max,omitempty" doc:"Maximum resource limit."`
	ResourceType ResourceType `` /* 733-byte string literal not displayed */
}

UpdateResourceLimit updates the resource limit

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.4/root_admin/updateResourceLimit.html

type UpdateResourceLimitResponse added in v0.9.24

type UpdateResourceLimitResponse struct {
	ResourceLimit ResourceLimit `json:"resourcelimit"`
}

UpdateResourceLimitResponse represents an updated resource limit

type UpdateTemplate added in v0.9.24

type UpdateTemplate struct {
	Bootable              *bool             `json:"bootable,omitempty" doc:"true if image is bootable, false otherwise"`
	Details               map[string]string `json:"details,omitempty" doc:"Details in key/value pairs."`
	DisplayText           string            `json:"displaytext,omitempty" doc:"the display text of the image"`
	Format                string            `json:"format,omitempty" doc:"the format for the image"`
	ID                    string            `json:"id" doc:"the ID of the image file"`
	IsDynamicallyScalable *bool             `` /* 142-byte string literal not displayed */
	IsRouting             *bool             `json:"isrouting,omitempty" doc:"true if the template type is routing i.e., if template is used to deploy router"`
	Name                  string            `json:"name,omitempty" doc:"the name of the image file"`
	OsTypeID              string            `json:"ostypeid,omitempty" doc:"the ID of the OS type that best represents the OS of this image."`
	PasswordEnabled       *bool             `json:"passwordenabled,omitempty" doc:"true if the image supports the password reset feature; default is false"`
	SortKey               int               `json:"sortkey,omitempty" doc:"sort key of the template, integer"`
}

UpdateTemplate represents a template change

CloudStackAPI: http://cloudstack.apache.org/api/apidocs-4.10/apis/updateTemplate.html

type UpdateTemplateResponse added in v0.9.24

type UpdateTemplateResponse CreateTemplateResponse

UpdateTemplateResponse represents the updated template

type UpdateUser added in v0.9.22

type UpdateUser struct {
	ID            string `json:"id" doc:"User uuid"`
	Email         string `json:"email,omitempty" doc:"email"`
	FirstName     string `json:"firstname,omitempty" doc:"first name"`
	LastName      string `json:"lastname,omitempty" doc:"last name"`
	Password      string `` /* 254-byte string literal not displayed */
	Timezone      string `` /* 140-byte string literal not displayed */
	UserAPIKey    string `json:"userapikey,omitempty" doc:"The API key for the user. Must be specified with userSecretKey"`
	UserName      string `json:"username,omitempty" doc:"Unique username"`
	UserSecretKey string `json:"usersecretkey,omitempty" doc:"The secret key for the user. Must be specified with userApiKey"`
}

UpdateUser represents the modification of a User

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/updateUser.html

type UpdateUserResponse added in v0.9.22

type UpdateUserResponse CreateUserResponse

UpdateUserResponse represents the freshly modified User

type UpdateVMAffinityGroup added in v0.9.0

type UpdateVMAffinityGroup struct {
	ID                 string   `json:"id" doc:"The ID of the virtual machine"`
	AffinityGroupIDs   []string `` /* 269-byte string literal not displayed */
	AffinityGroupNames []string `` /* 272-byte string literal not displayed */
}

UpdateVMAffinityGroup (Async) represents a modification of a (anti-)affinity group

CloudStack API: http://cloudstack.apache.org/api/apidocs-4.10/apis/updateVMAffinityGroup.html

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" doc:"The ID of the virtual machine"`
	CustomID              string            `` /* 131-byte string literal not displayed */
	Details               map[string]string `json:"details,omitempty" doc:"Details in key/value pairs."`
	DisplayName           string            `json:"displayname,omitempty" doc:"user generated name"`
	DisplayVM             *bool             `json:"displayvm,omitempty" doc:"an optional field, whether to the display the vm to the end user or not."`
	Group                 string            `json:"group,omitempty" doc:"group of the virtual machine"`
	HAEnable              *bool             `json:"haenable,omitempty" doc:"true if high-availability is enabled for the virtual machine, false otherwise"`
	IsDynamicallyScalable *bool             `` /* 132-byte string literal not displayed */
	Name                  string            `json:"name,omitempty" doc:"new host name of the vm. The VM has to be stopped/started for this update to take affect"`
	SecurityGroupIDs      []string          `json:"securitygroupids,omitempty" doc:"list of security group ids to be applied on the virtual machine."`
	UserData              string            `` /* 372-byte string literal not displayed */
}

UpdateVirtualMachine represents the update of the virtual machine

CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/updateVirtualMachine.html

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 {
	APIKey              string `json:"apikey,omitempty" doc:"the api key of the user"`
	Account             string `json:"account,omitempty" doc:"the account name of the user"`
	AccountID           string `json:"accountid,omitempty" doc:"the account ID of the user"`
	AccountType         int16  `json:"accounttype,omitempty" doc:"the account type of the user"`
	Created             string `json:"created,omitempty" doc:"the date and time the user account was created"`
	Domain              string `json:"domain,omitempty" doc:"the domain name of the user"`
	DomainID            string `json:"domainid,omitempty" doc:"the domain ID of the user"`
	Email               string `json:"email,omitempty" doc:"the user email address"`
	FirstName           string `json:"firstname,omitempty" doc:"the user firstname"`
	ID                  string `json:"id,omitempty" doc:"the user ID"`
	IsCallerChildDomain bool   `json:"iscallerchilddomain,omitempty" doc:"the boolean value representing if the updating target is in caller's child domain"`
	IsDefault           bool   `json:"isdefault,omitempty" doc:"true if user is default, false otherwise"`
	LastName            string `json:"lastname,omitempty" doc:"the user lastname"`
	RoleID              string `json:"roleid,omitempty" doc:"the ID of the role"`
	RoleName            string `json:"rolename,omitempty" doc:"the name of the role"`
	RoleType            string `json:"roletype,omitempty" doc:"the type of the role"`
	SecretKey           string `json:"secretkey,omitempty" doc:"the secret key of the user"`
	State               string `json:"state,omitempty" doc:"the user state"`
	Timezone            string `json:"timezone,omitempty" doc:"the timezone user was created in"`
	UserName            string `json:"username,omitempty" doc:"the user name"`
}

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 {
	Account               string            `json:"account,omitempty" doc:"the account associated with the virtual machine"`
	AffinityGroup         []AffinityGroup   `json:"affinitygroup,omitempty" doc:"list of affinity groups associated with the virtual machine"`
	ClusterID             string            `json:"clusterid,omitempty" doc:"the ID of the vm's cluster"`
	ClusterName           string            `json:"clustername,omitempty" doc:"the name of the vm's cluster"`
	CPUNumber             int               `json:"cpunumber,omitempty" doc:"the number of cpu this virtual machine is running with"`
	CPUSpeed              int               `json:"cpuspeed,omitempty" doc:"the speed of each cpu"`
	CPUUsed               string            `json:"cpuused,omitempty" doc:"the amount of the vm's CPU currently used"`
	Created               string            `json:"created,omitempty" doc:"the date when this virtual machine was created"`
	Details               map[string]string `json:"details,omitempty" doc:"Vm details in key/value pairs."`
	DiskIoRead            int64             `json:"diskioread,omitempty" doc:"the read (io) of disk on the vm"`
	DiskIoWrite           int64             `json:"diskiowrite,omitempty" doc:"the write (io) of disk on the vm"`
	DiskKbsRead           int64             `json:"diskkbsread,omitempty" doc:"the read (bytes) of disk on the vm"`
	DiskKbsWrite          int64             `json:"diskkbswrite,omitempty" doc:"the write (bytes) of disk on the vm"`
	DiskOfferingID        string            `json:"diskofferingid,omitempty" doc:"the ID of the disk offering of the virtual machine"`
	DiskOfferingName      string            `json:"diskofferingname,omitempty" doc:"the name of the disk offering of the virtual machine"`
	DisplayName           string            `json:"displayname,omitempty" doc:"user generated name. The name of the virtual machine is returned if no displayname exists."`
	DisplayVM             bool              `json:"displayvm,omitempty" doc:"an optional field whether to the display the vm to the end user or not."`
	Domain                string            `json:"domain,omitempty" doc:"the name of the domain in which the virtual machine exists"`
	DomainID              string            `json:"domainid,omitempty" doc:"the ID of the domain in which the virtual machine exists"`
	ForVirtualNetwork     bool              `json:"forvirtualnetwork,omitempty" doc:"the virtual network for the service offering"`
	Group                 string            `json:"group,omitempty" doc:"the group name of the virtual machine"`
	GroupID               string            `json:"groupid,omitempty" doc:"the group ID of the virtual machine"`
	HAEnable              bool              `json:"haenable,omitempty" doc:"true if high-availability is enabled, false otherwise"`
	HostID                string            `json:"hostid,omitempty" doc:"the ID of the host for the virtual machine"`
	HostName              string            `json:"hostname,omitempty" doc:"the name of the host for the virtual machine"`
	Hypervisor            string            `json:"hypervisor,omitempty" doc:"the hypervisor on which the template runs"`
	ID                    string            `json:"id,omitempty" doc:"the ID of the virtual machine"`
	InstanceName          string            `json:"instancename,omitempty" doc:"instance name of the user vm; this parameter is returned to the ROOT admin only"`
	IsDynamicallyScalable bool              `` /* 133-byte string literal not displayed */
	IsoDisplayText        string            `json:"isodisplaytext,omitempty" doc:"an alternate display text of the ISO attached to the virtual machine"`
	IsoID                 string            `json:"isoid,omitempty" doc:"the ID of the ISO attached to the virtual machine"`
	IsoName               string            `json:"isoname,omitempty" doc:"the name of the ISO attached to the virtual machine"`
	KeyPair               string            `json:"keypair,omitempty" doc:"ssh key-pair"`
	Memory                int               `json:"memory,omitempty" doc:"the memory allocated for the virtual machine"`
	Name                  string            `json:"name,omitempty" doc:"the name of the virtual machine"`
	NetworkKbsRead        int64             `json:"networkkbsread,omitempty" doc:"the incoming network traffic on the vm"`
	NetworkKbsWrite       int64             `json:"networkkbswrite,omitempty" doc:"the outgoing network traffic on the host"`
	Nic                   []Nic             `json:"nic,omitempty" doc:"the list of nics associated with vm"`
	OsCategoryID          string            `json:"oscategoryid,omitempty" doc:"Os category ID of the virtual machine"`
	Password              string            `json:"password,omitempty" doc:"the password (if exists) of the virtual machine"`
	PasswordEnabled       bool              `json:"passwordenabled,omitempty" doc:"true if the password rest feature is enabled, false otherwise"`
	PCIDevices            []string          `json:"pcidevices,omitempty" doc:"list of PCI devices"`
	PodID                 string            `json:"podid,omitempty" doc:"the ID of the vm's pod"`
	PodName               string            `json:"podname,omitempty" doc:"the name of the vm's pod"`
	PublicIP              string            `json:"publicip,omitempty" doc:"public IP address id associated with vm via Static nat rule"`
	PublicIPID            string            `json:"publicipid,omitempty" doc:"public IP address id associated with vm via Static nat rule"`
	RootDeviceID          int64             `json:"rootdeviceid,omitempty" doc:"device ID of the root volume"`
	RootDeviceType        string            `json:"rootdevicetype,omitempty" doc:"device type of the root volume"`
	SecurityGroup         []SecurityGroup   `json:"securitygroup,omitempty" doc:"list of security groups associated with the virtual machine"`
	ServiceOfferingID     string            `json:"serviceofferingid,omitempty" doc:"the ID of the service offering of the virtual machine"`
	ServiceOfferingName   string            `json:"serviceofferingname,omitempty" doc:"the name of the service offering of the virtual machine"`
	ServiceState          string            `json:"servicestate,omitempty" doc:"State of the Service from LB rule"`
	State                 string            `json:"state,omitempty" doc:"the state of the virtual machine"`
	Tags                  []ResourceTag     `json:"tags,omitempty" doc:"the list of resource tags associated with vm"`
	TemplateDisplayText   string            `json:"templatedisplaytext,omitempty" doc:"an alternate display text of the template for the virtual machine"`
	TemplateID            string            `` /* 151-byte string literal not displayed */
	TemplateName          string            `json:"templatename,omitempty" doc:"the name of the template for the virtual machine"`
	ZoneID                string            `json:"zoneid,omitempty" doc:"the ID of the availablility zone for the virtual machine"`
	ZoneName              string            `json:"zonename,omitempty" doc:"the name of the availability zone for the virtual machine"`
}

VirtualMachine represents a virtual machine

See: http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/stable/virtual_machines.html

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) IP added in v0.9.18

func (vm *VirtualMachine) IP() *net.IP

IP returns the default nic IP address

func (*VirtualMachine) ListRequest added in v0.9.18

func (vm *VirtualMachine) ListRequest() (ListCommand, error)

ListRequest builds the ListVirtualMachines request

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 {
	Account                    string        `json:"account,omitempty" doc:"the account associated with the disk volume"`
	Attached                   string        `json:"attached,omitempty" doc:"the date the volume was attached to a VM instance"`
	ChainInfo                  string        `json:"chaininfo,omitempty" doc:"the chain info of the volume"`
	ClusterID                  string        `json:"clusterid,omitempty" doc:"ID of the cluster"`
	ClusterName                string        `json:"clustername,omitempty" doc:"name of the cluster"`
	Created                    string        `json:"created,omitempty" doc:"the date the disk volume was created"`
	Destroyed                  bool          `json:"destroyed,omitempty" doc:"the boolean state of whether the volume is destroyed or not"`
	DeviceID                   int64         `` /* 143-byte string literal not displayed */
	DiskBytesReadRate          int64         `json:"diskBytesReadRate,omitempty" doc:"bytes read rate of the disk volume"`
	DiskBytesWriteRate         int64         `json:"diskBytesWriteRate,omitempty" doc:"bytes write rate of the disk volume"`
	DiskIopsReadRate           int64         `json:"diskIopsReadRate,omitempty" doc:"io requests read rate of the disk volume"`
	DiskIopsWriteRate          int64         `json:"diskIopsWriteRate,omitempty" doc:"io requests write rate of the disk volume"`
	DiskOfferingDisplayText    string        `json:"diskofferingdisplaytext,omitempty" doc:"the display text of the disk offering"`
	DiskOfferingID             string        `json:"diskofferingid,omitempty" doc:"ID of the disk offering"`
	DiskOfferingName           string        `json:"diskofferingname,omitempty" doc:"name of the disk offering"`
	DisplayVolume              bool          `json:"displayvolume,omitempty" doc:"an optional field whether to the display the volume to the end user or not."`
	Domain                     string        `json:"domain,omitempty" doc:"the domain associated with the disk volume"`
	DomainID                   string        `json:"domainid,omitempty" doc:"the ID of the domain associated with the disk volume"`
	Hypervisor                 string        `json:"hypervisor,omitempty" doc:"Hypervisor the volume belongs to"`
	ID                         string        `json:"id,omitempty" doc:"ID of the disk volume"`
	IsExtractable              *bool         `json:"isextractable,omitempty" doc:"true if the volume is extractable, false otherwise"`
	IsoDisplayText             string        `json:"isodisplaytext,omitempty" doc:"an alternate display text of the ISO attached to the virtual machine"`
	IsoID                      string        `json:"isoid,omitempty" doc:"the ID of the ISO attached to the virtual machine"`
	IsoName                    string        `json:"isoname,omitempty" doc:"the name of the ISO attached to the virtual machine"`
	MaxIops                    int64         `json:"maxiops,omitempty" doc:"max iops of the disk volume"`
	MinIops                    int64         `json:"miniops,omitempty" doc:"min iops of the disk volume"`
	Name                       string        `json:"name,omitempty" doc:"name of the disk volume"`
	Path                       string        `json:"path,omitempty" doc:"the path of the volume"`
	PodID                      string        `json:"podid,omitempty" doc:"ID of the pod"`
	PodName                    string        `json:"podname,omitempty" doc:"name of the pod"`
	QuiesceVM                  bool          `json:"quiescevm,omitempty" doc:"need quiesce vm or not when taking snapshot"`
	ServiceOfferingDisplayText string        `json:"serviceofferingdisplaytext,omitempty" doc:"the display text of the service offering for root disk"`
	ServiceOfferingID          string        `json:"serviceofferingid,omitempty" doc:"ID of the service offering for root disk"`
	ServiceOfferingName        string        `json:"serviceofferingname,omitempty" doc:"name of the service offering for root disk"`
	Size                       uint64        `json:"size,omitempty" doc:"size of the disk volume"`
	SnapshotID                 string        `json:"snapshotid,omitempty" doc:"ID of the snapshot from which this volume was created"`
	State                      string        `json:"state,omitempty" doc:"the state of the disk volume"`
	Status                     string        `json:"status,omitempty" doc:"the status of the volume"`
	Storage                    string        `json:"storage,omitempty" doc:"name of the primary storage hosting the disk volume"`
	StorageID                  string        `json:"storageid,omitempty" doc:"id of the primary storage hosting the disk volume; returned to admin user only"`
	StorageType                string        `json:"storagetype,omitempty" doc:"shared or local storage"`
	Tags                       []ResourceTag `json:"tags,omitempty" doc:"the list of resource tags associated with volume"`
	TemplateDisplayText        string        `json:"templatedisplaytext,omitempty" doc:" an alternate display text of the template for the virtual machine"`
	TemplateID                 string        `` /* 151-byte string literal not displayed */
	TemplateName               string        `json:"templatename,omitempty" doc:"the name of the template for the virtual machine"`
	Type                       string        `json:"type,omitempty" doc:"type of the disk volume (ROOT or DATADISK)"`
	VirtualMachineID           string        `json:"virtualmachineid,omitempty" doc:"id of the virtual machine"`
	VMDisplayName              string        `json:"vmdisplayname,omitempty" doc:"display name of the virtual machine"`
	VMName                     string        `json:"vmname,omitempty" doc:"name of the virtual machine"`
	VMState                    string        `json:"vmstate,omitempty" doc:"state of the virtual machine"`
	ZoneID                     string        `json:"zoneid,omitempty" doc:"ID of the availability zone"`
	ZoneName                   string        `json:"zonename,omitempty" doc:"name of the availability zone"`
}

Volume represents a volume linked to a VM

func (*Volume) Get added in v0.9.21

func (vol *Volume) Get(ctx context.Context, client *Client) error

Get fetches the given volume by ID

func (*Volume) ListRequest added in v0.9.18

func (vol *Volume) ListRequest() (ListCommand, error)

ListRequest builds the ListVolumes request

func (*Volume) ResourceType added in v0.9.7

func (*Volume) ResourceType() string

ResourceType returns the type of the resource

type WaitAsyncJobResultFunc added in v0.9.22

type WaitAsyncJobResultFunc func(*AsyncJobResult, error) bool

WaitAsyncJobResultFunc represents the callback to wait a results of an async request, if false stops

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

func (*Zone) Get added in v0.9.21

func (zone *Zone) Get(ctx context.Context, client *Client) error

Get fetches the given zone by ID or Name

func (*Zone) ListRequest added in v0.9.18

func (zone *Zone) ListRequest() (ListCommand, error)

ListRequest builds the ListZones request

Directories

Path Synopsis
cmd
cs
cs Inspired by its older brother cs (https://pypi.org/project/cs) a convenient and flexible client for CloudStack tailored for Exoscale infrastructure.
cs Inspired by its older brother cs (https://pypi.org/project/cs) a convenient and flexible client for CloudStack tailored for Exoscale infrastructure.

Jump to

Keyboard shortcuts

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