egoscale

package module
v0.9.23 Latest Latest
Warning

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

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

README

egoscale: exoscale driver for golang

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 (
	// VirtualMachineTypeName is the resource type name of a VM
	VirtualMachineTypeName ResourceTypeName = "user_vm"
	// IPAddressTypeName is the resource type name of an IP address
	IPAddressTypeName = "public_ip"
	// VolumeTypeName is the resource type name of a volume
	VolumeTypeName = "volume"
	// SnapshotTypeName is the resource type name of a snapshot
	SnapshotTypeName = "snapshot"
	// TemplateTypeName is the resource type name of a template
	TemplateTypeName = "template"
	// ProjectTypeName is the resource type name of a project
	ProjectTypeName = "project"
	// NetworkTypeName is the resource type name of a network
	NetworkTypeName = "network"
	// VPCTypeName is the resource type name of a VPC
	VPCTypeName = "vpc"
	// CPUTypeName is the resource type name of a CPU
	CPUTypeName = "cpu"
	// MemoryTypeName is the resource type name of Memory
	MemoryTypeName = "memory"
	// PrimaryStorageTypeName is the resource type name of primary storage
	PrimaryStorageTypeName = "primary_storage"
	// SecondaryStorageTypeName is the resource type name of secondary storage
	SecondaryStorageTypeName = "secondary_storage"
)
View Source
const Version = "0.9.23"

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 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"`
	VpcAvailable              string            `json:"vpcavailable,omitempty" doc:"the total number of vpcs available to be created for this account"`
	VpcLimit                  string            `json:"vpclimit,omitempty" doc:"the total number of vpcs the account can own"`
	VpcTotal                  int64             `json:"vpctotal,omitempty" doc:"the total number of vpcs owned by 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"`
}

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"`
	IPAddress net.IP `json:"ipaddress"`
}

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 {
	ID                string   `json:"id,omitempty"`
	Account           string   `json:"account,omitempty"`
	Description       string   `json:"description,omitempty"`
	Domain            string   `json:"domain,omitempty"`
	DomainID          string   `json:"domainid,omitempty"`
	Name              string   `json:"name,omitempty"`
	Project           string   `json:"project,omitempty"`
	ProjectID         string   `json:"projectid,omitempty"`
	Type              string   `json:"type,omitempty"`
	VirtualMachineIDs []string `json:"virtualmachineIds,omitempty"` // *I*ds is not a typo
}

AffinityGroup represents an (anti-)affinity group

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"`
}

AffinityGroupType represent an affinity group type

type AssociateIPAddress added in v0.9.0

type AssociateIPAddress struct {
	Account    string `json:"account,omitempty"`
	DomainID   string `json:"domainid,omitempty"`
	ForDisplay *bool  `json:"fordisplay,omitempty"`
	IsPortable *bool  `json:"isportable,omitempty"`
	NetworkdID string `json:"networkid,omitempty"`
	ProjectID  string `json:"projectid,omitempty"`
	RegionID   string `json:"regionid,omitempty"`
	VpcID      string `json:"vpcid,omitempty"`
	ZoneID     string `json:"zoneid,omitempty"`
}

AssociateIPAddress (Async) represents the IP creation

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

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"`
	CidrList              []string            `json:"cidrlist,omitempty"`
	Description           string              `json:"description,omitempty"`
	DomainID              string              `json:"domainid,omitempty"`
	IcmpType              uint8               `json:"icmptype,omitempty"`
	IcmpCode              uint8               `json:"icmpcode,omitempty"`
	StartPort             uint16              `json:"startport,omitempty"`
	EndPort               uint16              `json:"endport,omitempty"`
	ProjectID             string              `json:"projectid,omitempty"`
	Protocol              string              `json:"protocol,omitempty"`
	SecurityGroupID       string              `json:"securitygroupid,omitempty"`
	SecurityGroupName     string              `json:"securitygroupname,omitempty"`
	UserSecurityGroupList []UserSecurityGroup `json:"usersecuritygrouplist,omitempty"`
}

AuthorizeSecurityGroupIngress (Async) represents the ingress rule creation

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

type AuthorizeSecurityGroupIngressResponse

type AuthorizeSecurityGroupIngressResponse SecurityGroupResponse

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

type ChangeServiceForVirtualMachine added in v0.9.0

type ChangeServiceForVirtualMachine ScaleVirtualMachine

ChangeServiceForVirtualMachine represents the scaling of a VM

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

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

type CreateAffinityGroup struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	Account     string `json:"account,omitempty"`
	Description string `json:"description,omitempty"`
	DomainID    string `json:"domainid,omitempty"`
}

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

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

type CreateAffinityGroupResponse

type CreateAffinityGroupResponse struct {
	AffinityGroup AffinityGroup `json:"affinitygroup"`
}

CreateAffinityGroupResponse represents the response of the creation of an (anti-)affinity group

type CreateInstanceGroup added in v0.9.7

type CreateInstanceGroup struct {
	Name      string `json:"name"`
	Account   string `json:"account,omitempty"`
	DomainID  string `json:"domainid,omitempty"`
	ProjectID string `json:"projectid,omitempty"`
}

CreateInstanceGroup creates a VM group

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

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"`
	ProjectID         string `json:"projectid,omitempty" doc:"an optional project for the ssh key"`
	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"`
	VpcID             string `json:"vpcid,omitempty" doc:"the VPC network belongs to"`
	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 */
	ProjectID string `json:"projectid,omitempty" doc:"an optional project for the ssh key"`
}

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"`
	Description string `json:"description,omitempty"`
}

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 represents a request to create a volume snapshot

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 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"` // must be specified with DomainID
	DomainID  string `json:"domainid,omitempty"`
	ID        string `json:"id,omitempty"`   // mutually exclusive with Name
	Name      string `json:"name,omitempty"` // mutually exclusive with ID
	ProjectID string `json:"projectid,omitempty"`
}

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

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

type DeleteInstanceGroup added in v0.9.7

type DeleteInstanceGroup struct {
	Name      string `json:"name"`
	Account   string `json:"account,omitempty"`
	DomainID  string `json:"domainid,omitempty"`
	ProjectID string `json:"projectid,omitempty"`
}

DeleteInstanceGroup creates a VM group

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

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"`
	ProjectID string `json:"projectid,omitempty" doc:"the project associated with 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"`  // Must be specified with Domain ID
	DomainID  string `json:"domainid,omitempty"` // Must be specified with Account
	ID        string `json:"id,omitempty"`       // Mutually exclusive with name
	Name      string `json:"name,omitempty"`     // Mutually exclusive with id
	ProjectID string `json:"project,omitempty"`
}

DeleteSecurityGroup represents a security group deletion

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

type DeleteSnapshot added in v0.9.0

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

DeleteSnapshot represents the deletion of a volume snapshot

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 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 */
	ProjectID          string            `json:"projectid,omitempty" doc:"Deploy vm for the project"`
	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"`
}

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 int        `json:"cserrorcode"`
	ErrorText   string     `json:"errortext"`
	UUIDList    []UUIDItem `json:"uuidList,omitempty"` // uuid*L*ist is not a typo
}

ErrorResponse represents the standard error response from CloudStack

func (*ErrorResponse) Error added in v0.9.0

func (e *ErrorResponse) Error() string

Error formats a CloudStack error into a standard error

type Event added in v0.9.0

type Event struct {
	ID          string `json:"id"`
	Account     string `json:"account"`
	Created     string `json:"created"`
	Description string `json:"description,omitempty"`
	Domain      string `json:"domain,omitempty"`
	DomainID    string `json:"domainid,omitempty"`
	Level       string `json:"level"` // INFO, WARN, ERROR
	ParentID    string `json:"parentid,omitempty"`
	Project     string `json:"project,omitempty"`
	ProjectID   string `json:"projectid,omitempty"`
	State       string `json:"state,omitempty"`
	Type        string `json:"type"`
	UserName    string `json:"username,omitempty"`
}

Event represents an event in the system

type EventType added in v0.9.0

type EventType struct {
	Name string `json:"name"`
}

EventType represent a type of event

type ExpungeVirtualMachine added in v0.9.0

type ExpungeVirtualMachine RebootVirtualMachine

ExpungeVirtualMachine represents the annihilation of a VM

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

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 RebootVirtualMachine

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 {
	ID                        string        `json:"id"`
	Account                   string        `json:"account,omitempty"`
	AllocatedAt               string        `json:"allocated,omitempty"`
	AssociatedNetworkID       string        `json:"associatednetworkid,omitempty"`
	AssociatedNetworkName     string        `json:"associatednetworkname,omitempty"`
	DomainID                  string        `json:"domainid,omitempty"`
	DomainName                string        `json:"domainname,omitempty"`
	ForDisplay                bool          `json:"fordisplay,omitempty"`
	ForVirtualNetwork         bool          `json:"forvirtualnetwork,omitempty"`
	IPAddress                 net.IP        `json:"ipaddress"`
	IsElastic                 bool          `json:"iselastic,omitempty"`
	IsPortable                bool          `json:"isportable,omitempty"`
	IsSourceNat               bool          `json:"issourcenat,omitempty"`
	IsSystem                  bool          `json:"issystem,omitempty"`
	NetworkID                 string        `json:"networkid,omitempty"`
	PhysicalNetworkID         string        `json:"physicalnetworkid,omitempty"`
	Project                   string        `json:"project,omitempty"`
	ProjectID                 string        `json:"projectid,omitempty"`
	Purpose                   string        `json:"purpose,omitempty"`
	State                     string        `json:"state,omitempty"`
	VirtualMachineDisplayName string        `json:"virtualmachinedisplayname,omitempty"`
	VirtualMachineID          string        `json:"virtualmachineid,omitempty"`
	VirtualMachineName        string        `json:"virtualmachineName,omitempty"`
	VlanID                    string        `json:"vlanid,omitempty"`
	VlanName                  string        `json:"vlanname,omitempty"`
	VMIPAddress               net.IP        `json:"vmipaddress,omitempty"`
	VpcID                     string        `json:"vpcid,omitempty"`
	ZoneID                    string        `json:"zoneid,omitempty"`
	ZoneName                  string        `json:"zonename,omitempty"`
	Tags                      []ResourceTag `json:"tags,omitempty"`
	JobID                     string        `json:"jobid,omitempty"`
	JobStatus                 JobStatusType `json:"jobstatus,omitempty"`
}

IPAddress represents an IP Address

func (*IPAddress) 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 {
	RuleID                string              `json:"ruleid"`
	Account               string              `json:"account,omitempty"`
	Cidr                  string              `json:"cidr,omitempty"`
	Description           string              `json:"description,omitempty"`
	IcmpType              uint8               `json:"icmptype,omitempty"`
	IcmpCode              uint8               `json:"icmpcode,omitempty"`
	StartPort             uint16              `json:"startport,omitempty"`
	EndPort               uint16              `json:"endport,omitempty"`
	Protocol              string              `json:"protocol,omitempty"`
	Tags                  []ResourceTag       `json:"tags,omitempty"`
	SecurityGroupID       string              `json:"securitygroupid,omitempty"`
	SecurityGroupName     string              `json:"securitygroupname,omitempty"`
	UserSecurityGroupList []UserSecurityGroup `json:"usersecuritygrouplist,omitempty"`
	JobID                 string              `json:"jobid,omitempty"`
	JobStatus             JobStatusType       `json:"jobstatus,omitempty"`
}

IngressRule represents the ingress rule

type InstanceGroup added in v0.9.7

type InstanceGroup struct {
	ID        string `json:"id"`
	Account   string `json:"account,omitempty"`
	Created   string `json:"created,omitempty"`
	Domain    string `json:"domain,omitempty"`
	DomainID  string `json:"domainid,omitempty"`
	Name      string `json:"name,omitempty"`
	Project   string `json:"project,omitempty"`
	ProjectID string `json:"projectid,omitempty"`
}

InstanceGroup represents a group of VM

type InstanceGroupResponse added in v0.9.7

type InstanceGroupResponse struct {
	InstanceGroup InstanceGroup `json:"instancegroup"`
}

InstanceGroupResponse represents a VM group

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

type JobResultResponse struct {
	AccountID     string           `json:"accountid,omitempty"`
	Cmd           string           `json:"cmd"`
	Created       string           `json:"created"`
	JobID         string           `json:"jobid"`
	JobProcStatus int              `json:"jobprocstatus"`
	JobResult     *json.RawMessage `json:"jobresult"`
	JobStatus     JobStatusType    `json:"jobstatus"`
	JobResultType string           `json:"jobresulttype"`
	UserID        string           `json:"userid,omitempty"`
}

JobResultResponse represents a generic response to a job task

type JobStatusType added in v0.9.0

type JobStatusType int

JobStatusType represents the status of a Job

const (
	// Pending represents a job in progress
	Pending JobStatusType = iota
	// Success represents a successfully completed job
	Success
	// Failure represents a job that has failed to complete
	Failure
)

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"`
	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"`
	DomainID         string `json:"domainid,omitempty"`
	ID               string `json:"id,omitempty"`
	IsRecursive      *bool  `json:"isrecursive,omitempty"`
	Keyword          string `json:"keyword,omitempty"`
	ListAll          *bool  `json:"listall,omitempty"`
	Name             string `json:"name,omitempty"`
	Page             int    `json:"page,omitempty"`
	PageSize         int    `json:"pagesize,omitempty"`
	Type             string `json:"type,omitempty"`
	VirtualMachineID string `json:"virtualmachineid,omitempty"`
}

ListAffinityGroups represents an (anti-)affinity groups search

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

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"`
	DomainID    string `json:"domainid,omitempty"`
	Duration    int    `json:"duration,omitempty"`
	EndDate     string `json:"enddate,omitempty"`
	EntryTime   int    `json:"entrytime,omitempty"`
	ID          string `json:"id,omitempty"`
	IsRecursive *bool  `json:"isrecursive,omitempty"`
	Keyword     string `json:"keyword,omitempty"`
	Level       string `json:"level,omitempty"` // INFO, WARN, ERROR
	ListAll     *bool  `json:"listall,omitempty"`
	Page        int    `json:"page,omitempty"`
	PageSize    int    `json:"pagesize,omitempty"`
	ProjectID   string `json:"projectid,omitempty"`
	StartDate   string `json:"startdate,omitempty"`
	Type        string `json:"type,omitempty"`
}

ListEvents list the events

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

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"`
	DomainID    string `json:"domainid,omitempty"`
	ID          string `json:"id,omitempty"`
	IsRecursive *bool  `json:"isrecursive,omitempty"`
	Keyword     string `json:"keyword,omitempty"`
	ListAll     *bool  `json:"listall,omitempty"`
	Page        int    `json:"page,omitempty"`
	PageSize    int    `json:"pagesize,omitempty"`
	State       string `json:"state,omitempty"`
	ProjectID   string `json:"projectid,omitempty"`
}

ListInstanceGroups lists VM groups

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

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"`
	ForVPC             *bool     `json:"forvpc,omitempty" doc:"the network offering can be used only for network creation inside the VPC"`
	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"`
	ForVpc            *bool         `json:"forvpc,omitempty" doc:"the network belongs to vpc"`
	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"`
	ProjectID         string        `json:"projectid,omitempty" doc:"list objects by project"`
	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"`
	VpcID             string        `json:"vpcid,omitempty" doc:"List networks by VPC"`
	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 {
	VirtualMachineID string `json:"virtualmachineid"`
	ForDisplay       bool   `json:"fordisplay,omitempty"`
	Keyword          string `json:"keyword,omitempty"`
	NetworkID        string `json:"networkid,omitempty"`
	NicID            string `json:"nicid,omitempty"`
	Page             int    `json:"page,omitempty"`
	PageSize         int    `json:"pagesize,omitempty"`
}

ListNics represents the NIC search

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

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"` // must be used with the DomainID
	AllocatedOnly      *bool         `json:"allocatedonly,omitempty"`
	AllocatedNetworkID string        `json:"allocatednetworkid,omitempty"`
	DomainID           string        `json:"domainid,omitempty"`
	ForDisplay         *bool         `json:"fordisplay,omitempty"`
	ForLoadBalancing   *bool         `json:"forloadbalancing,omitempty"`
	ForVirtualNetwork  string        `json:"forvirtualnetwork,omitempty"`
	ID                 string        `json:"id,omitempty"`
	IPAddress          net.IP        `json:"ipaddress,omitempty"`
	IsElastic          *bool         `json:"iselastic,omitempty"`
	IsRecursive        *bool         `json:"isrecursive,omitempty"`
	IsSourceNat        *bool         `json:"issourcenat,omitempty"`
	IsStaticNat        *bool         `json:"isstaticnat,omitempty"`
	Keyword            string        `json:"keyword,omitempty"`
	ListAll            *bool         `json:"listall,omitempty"`
	Page               int           `json:"page,omitempty"`
	PageSize           int           `json:"pagesize,omitempty"`
	PhysicalNetworkID  string        `json:"physicalnetworkid,omitempty"`
	ProjectID          string        `json:"projectid,omitempty"`
	Tags               []ResourceTag `json:"tags,omitempty"`
	VlanID             string        `json:"vlanid,omitempty"`
	VpcID              string        `json:"vpcid,omitempty"`
	ZoneID             string        `json:"zoneid,omitempty"`
}

ListPublicIPAddresses represents a search for public IP addresses

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

func (*ListPublicIPAddresses) 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"`
	ProjectID    string `json:"projectid,omitempty" doc:"list objects by project"`
	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,omittempty"`
	DomainID         string           `json:"domainid,omitempty"`
	ID               string           `json:"id,omitempty"`
	IsRecursive      *bool            `json:"isrecursive,omitempty"`
	Keyword          string           `json:"keyword,omitempty"`
	ListAll          *bool            `json:"listall,omitempty"`
	Page             int              `json:"page,omitempty"`
	PageSize         int              `json:"pagesize,omitempty"`
	ProjectID        string           `json:"projectid,omitempty"`
	ResourceType     ResourceType     `json:"resourcetype,omitempty"`
	ResourceTypeName ResourceTypeName `json:"resourcetypename,omitempty"`
}

ListResourceLimits lists the resource limits

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

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"`
	ProjectID   string `json:"projectid,omitempty" doc:"list objects by project"`
}

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"`
	DomainID          string        `json:"domainid,omitempty"`
	ID                string        `json:"id,omitempty"`
	IsRecursive       *bool         `json:"isrecursive,omitempty"`
	Keyword           string        `json:"keyword,omitempty"`
	ListAll           *bool         `json:"listall,omitempty"`
	Page              int           `json:"page,omitempty"`
	PageSize          int           `json:"pagesize,omitempty"`
	ProjectID         string        `json:"projectid,omitempty"`
	Type              string        `json:"type,omitempty"`
	SecurityGroupName string        `json:"securitygroupname,omitempty"`
	Tags              []ResourceTag `json:"tags,omitempty"`
	VirtualMachineID  string        `json:"virtualmachineid,omitempty"`
}

ListSecurityGroups represents a search for security groups

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

func (*ListSecurityGroups) 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

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"`
	ProjectID    string        `json:"projectid,omitempty" doc:"list objects by project"`
	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"`
	ProjectID    string `json:"projectid,omitempty" doc:"list objects by project"`
	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        `json:"templatefilter"` // featured, etc.
	Account        string        `json:"account,omitempty"`
	DomainID       string        `json:"domainid,omitempty"`
	Hypervisor     string        `json:"hypervisor,omitempty"`
	ID             string        `json:"id,omitempty"`
	IsRecursive    *bool         `json:"isrecursive,omitempty"`
	Keyword        string        `json:"keyword,omitempty"`
	ListAll        *bool         `json:"listall,omitempty"`
	Name           string        `json:"name,omitempty"`
	Page           int           `json:"page,omitempty"`
	PageSize       int           `json:"pagesize,omitempty"`
	ProjectID      string        `json:"projectid,omitempty"`
	ShowRemoved    *bool         `json:"showremoved,omitempty"`
	Tags           []ResourceTag `json:"tags,omitempty"`
	ZoneID         string        `json:"zoneid,omitempty"`
}

ListTemplates represents a template query filter

func (*ListTemplates) 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"`
	ProjectID         string        `json:"projectid,omitempty" doc:"list objects by project"`
	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"`
	VpcID             string        `json:"vpcid,omitempty" doc:"list vms by vpc"`
	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"`
	DiskOfferingID   string        `json:"diskoffering,omitempty"`
	DisplayVolume    string        `json:"displayvolume,omitempty"` // root only
	DomainID         string        `json:"domainid,omitempty"`
	HostID           string        `json:"hostid,omitempty"`
	ID               string        `json:"id,omitempty"`
	IsRecursive      *bool         `json:"isrecursive,omitempty"`
	Keyword          string        `json:"keyword,omitempty"`
	ListAll          *bool         `json:"listall,omitempty"`
	Name             string        `json:"name,omitempty"`
	Page             int           `json:"page,omitempty"`
	PageSize         int           `json:"pagesize,omitempty"`
	PodID            string        `json:"podid,omitempty"`
	ProjectID        string        `json:"projectid,omitempty"`
	StorageID        string        `json:"storageid,omitempty"`
	Tags             []ResourceTag `json:"tags,omitempty"`
	Type             string        `json:"type,omitempty"`
	VirtualMachineID string        `json:"virtualmachineid,omitempty"`
	ZoneID           string        `json:"zoneid,omitempty"`
}

ListVolumes represents a query listing volumes

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

func (*ListVolumes) 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 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"`
	Project                     string        `json:"project,omitempty" doc:"the project name of the address"`
	ProjectID                   string        `json:"projectid,omitempty" doc:"the project id of the ipaddress"`
	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"`
	VpcID                       string        `json:"vpcid,omitempty" doc:"VPC the network belongs to"`
	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 */
	ForVPC                   bool              `json:"forvpc,omitempty" doc:"true if network offering can be used by VPC networks only"`
	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 {
	ID               string           `json:"id,omitempty"`
	BroadcastURI     string           `json:"broadcasturi,omitempty"`
	Gateway          net.IP           `json:"gateway,omitempty"`
	IP6Address       net.IP           `json:"ip6address,omitempty"`
	IP6Cidr          string           `json:"ip6cidr,omitempty"`
	IP6Gateway       net.IP           `json:"ip6gateway,omitempty"`
	IPAddress        net.IP           `json:"ipaddress,omitempty"`
	IsDefault        bool             `json:"isdefault,omitempty"`
	IsolationURI     string           `json:"isolationuri,omitempty"`
	MacAddress       string           `json:"macaddress,omitempty"`
	Netmask          net.IP           `json:"netmask,omitempty"`
	NetworkID        string           `json:"networkid,omitempty"`
	NetworkName      string           `json:"networkname,omitempty"`
	SecondaryIP      []NicSecondaryIP `json:"secondaryip,omitempty"`
	TrafficType      string           `json:"traffictype,omitempty"`
	Type             string           `json:"type,omitempty"`
	VirtualMachineID string           `json:"virtualmachineid,omitempty"`
}

Nic represents a Network Interface Controller (NIC)

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"`
	IPAddress        net.IP `json:"ipaddress"`
	NetworkID        string `json:"networkid,omitempty"`
	NicID            string `json:"nicid,omitempty"`
	VirtualMachineID string `json:"virtualmachineid,omitempty"`
}

NicSecondaryIP represents a link between NicID and IPAddress

type Password added in v0.9.14

type Password struct {
	EncryptedPassword string `json:"encryptedpassword"`
}

Password represents an encrypted password

TODO: method to decrypt it, https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=34014652

type QueryAsyncJobResult added in v0.9.0

type QueryAsyncJobResult struct {
	JobID string `json:"jobid" 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 */
	ProjectID string `json:"projectid,omitempty" doc:"an optional project for the ssh key"`
}

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 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"`
}

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 */
	ProjectID string `json:"projectid,omitempty" doc:"an optional project for the ssh key"`
}

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"`
	DiskOfferingID string `json:"diskofferingid,omitempty"`
	ShrinkOk       *bool  `json:"shrinkok,omitempty"`
	Size           int64  `json:"size,omitempty"` // in GiB
}

ResizeVolume (Async) resizes a volume

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

type ResizeVolumeResponse added in v0.9.0

type ResizeVolumeResponse struct {
	Volume Volume `json:"volume"`
}

ResizeVolumeResponse represents the new Volume

type ResourceLimit added in v0.9.7

type ResourceLimit struct {
	Account          string           `json:"account,omitempty"`
	Domain           string           `json:"domain,omitempty"`
	DomainID         string           `json:"domainid,omitempty"`
	Max              int64            `json:"max,omitempty"` // -1 means the sky is the limit
	Project          string           `json:"project,omitempty"`
	ProjectID        string           `json:"projectid,omitempty"`
	ResourceType     ResourceType     `json:"resourcetype,omitempty"`
	ResourceTypeName ResourceTypeName `json:"resourcetypename,omitempty"`
}

ResourceLimit represents the limit on a particular resource

type ResourceTag added in v0.9.0

type ResourceTag struct {
	Account      string `json:"account,omitempty" 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"`
	Project      string `json:"project,omitempty" doc:"the project name where tag belongs to"`
	ProjectID    string `json:"projectid,omitempty" doc:"the project id the tag belongs to"`
	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
)

type ResourceTypeName added in v0.9.7

type ResourceTypeName string

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

type RestartNetwork added in v0.9.0

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 revert a volume snapshot

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

type RevokeSecurityGroupEgress added in v0.9.0

type RevokeSecurityGroupEgress struct {
	ID string `json:"id"`
}

RevokeSecurityGroupEgress (Async) represents the ingress/egress rule deletion

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

type RevokeSecurityGroupIngress added in v0.9.0

type RevokeSecurityGroupIngress struct {
	ID string `json:"id"`
}

RevokeSecurityGroupIngress (Async) represents the ingress/egress rule deletion

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

type SSHKeyPair

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

SSHKeyPair represents an SSH key pair

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) represents the scaling of a VM

ChangeServiceForVirtualMachine does the same thing but returns the new Virtual Machine which is more consistent with the rest of the API.

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

type SecurityGroup

type SecurityGroup struct {
	ID                  string        `json:"id"`
	Account             string        `json:"account,omitempty"`
	Description         string        `json:"description,omitempty"`
	Domain              string        `json:"domain,omitempty"`
	DomainID            string        `json:"domainid,omitempty"`
	Name                string        `json:"name"`
	Project             string        `json:"project,omitempty"`
	ProjectID           string        `json:"projectid,omitempty"`
	VirtualMachineCount int           `json:"virtualmachinecount,omitempty"` // CloudStack 4.6+
	VirtualMachineIDs   []string      `json:"virtualmachineids,omitempty"`   // CloudStack 4.6+
	IngressRule         []IngressRule `json:"ingressrule"`
	EgressRule          []EgressRule  `json:"egressrule"`
	Tags                []ResourceTag `json:"tags,omitempty"`
	JobID               string        `json:"jobid,omitempty"`
	JobStatus           JobStatusType `json:"jobstatus,omitempty"`
}

SecurityGroup represent a firewalling set of rules

func (*SecurityGroup) Delete added in v0.9.12

func (sg *SecurityGroup) Delete(ctx context.Context, client *Client) error

Delete deletes the given Security Group

func (*SecurityGroup) Get added in v0.9.12

func (sg *SecurityGroup) Get(ctx context.Context, client *Client) error

Get loads the given Security Group

func (*SecurityGroup) 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

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 {
	ID           string        `json:"id"`
	Account      string        `json:"account"`
	Created      string        `json:"created,omitempty"`
	Domain       string        `json:"domain"`
	DomainID     string        `json:"domainid"`
	IntervalType string        `json:"intervaltype,omitempty"` // hourly, daily, weekly, monthly, ..., none
	Name         string        `json:"name,omitempty"`
	PhysicalSize int64         `json:"physicalsize"`
	Project      string        `json:"project"`
	ProjectID    string        `json:"projectid"`
	Revertable   bool          `json:"revertable,omitempty"`
	Size         int64         `json:"size,omitempty"`
	SnapshotType string        `json:"snapshottype,omitempty"`
	State        string        `json:"state"` // BackedUp, Creating, BackingUp, ...
	VolumeID     string        `json:"volumeid"`
	VolumeName   string        `json:"volumename,omitempty"`
	VolumeType   string        `json:"volumetype,omitempty"`
	ZoneID       string        `json:"zoneid"`
	Tags         []ResourceTag `json:"tags"`
	JobID        string        `json:"jobid,omitempty"`
	JobStatus    JobStatusType `json:"jobstatus,omitempty"`
}

Snapshot represents a volume snapshot

func (*Snapshot) ResourceType added in v0.9.7

func (*Snapshot) ResourceType() string

ResourceType returns the type of the resource

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"`
	AccountID             string            `json:"accountid,omitempty"`
	Bootable              bool              `json:"bootable,omitempty"`
	Checksum              string            `json:"checksum,omitempty"`
	Created               string            `json:"created,omitempty"`
	CrossZones            bool              `json:"crossZones,omitempty"` // not a typo
	Details               map[string]string `json:"details,omitempty"`
	DisplayText           string            `json:"displaytext,omitempty"`
	Domain                string            `json:"domain,omitempty"`
	DomainID              string            `json:"domainid,omitempty"`
	Format                string            `json:"format,omitempty"`
	HostID                string            `json:"hostid,omitempty"`
	HostName              string            `json:"hostname,omitempty"`
	Hypervisor            string            `json:"hypervisor,omitempty"`
	ID                    string            `json:"id,omitempty"`
	IsDynamicallyScalable bool              `json:"isdynamicallyscalable,omitempty"`
	IsExtractable         bool              `json:"isextractable,omitempty"`
	IsFeatured            bool              `json:"isfeatured,omitempty"`
	IsPublic              bool              `json:"ispublic,omitempty"`
	IsReady               bool              `json:"isready,omitempty"`
	Name                  string            `json:"name,omitempty"`
	OsTypeID              string            `json:"ostypeid,omitempty"`
	OsTypeName            string            `json:"ostypename,omitempty"`
	PasswordEnabled       bool              `json:"passwordenabled,omitempty"`
	Project               string            `json:"project,omitempty"`
	ProjectID             string            `json:"projectid,omitempty"`
	Removed               string            `json:"removed,omitempty"`
	Size                  int64             `json:"size,omitempty"`
	SourceTemplateID      string            `json:"sourcetemplateid,omitempty"`
	SSHKeyEnabled         bool              `json:"sshkeyenabled,omitempty"`
	Status                string            `json:"status,omitempty"`
	ZoneID                string            `json:"zoneid,omitempty"`
	ZoneName              string            `json:"zonename,omitempty"`
	Tags                  []ResourceTag     `json:"tags,omitempty"`
}

Template represents a machine to be deployed

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

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"`
	CustomID   string `json:"customid,omitempty"` // root only
	ForDisplay *bool  `json:"fordisplay,omitempty"`
}

UpdateIPAddress (Async) represents the IP modification

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

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"`
	Name string `json:"name,omitempty"`
}

UpdateInstanceGroup creates 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 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"`
	AffinityGroupIDs   []string `json:"affinitygroupids,omitempty"`   // mutually exclusive with names
	AffinityGroupNames []string `json:"affinitygroupnames,omitempty"` // mutually exclusive with ids
}

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

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

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"`
	Project               string            `json:"project,omitempty" doc:"the project name of the vm"`
	ProjectID             string            `json:"projectid,omitempty" doc:"the project id of the vm"`
	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 {
	ID                         string        `json:"id"`
	Account                    string        `json:"account,omitempty"`
	Attached                   string        `json:"attached,omitempty"`
	ChainInfo                  string        `json:"chaininfo,omitempty"`
	Created                    string        `json:"created,omitempty"`
	Destroyed                  bool          `json:"destroyed,omitempty"`
	DisplayVolume              bool          `json:"displayvolume,omitempty"`
	Domain                     string        `json:"domain,omitempty"`
	DomainID                   string        `json:"domainid,omitempty"`
	Name                       string        `json:"name,omitempty"`
	QuiesceVM                  bool          `json:"quiescevm,omitempty"`
	ServiceOfferingDisplayText string        `json:"serviceofferingdisplaytext,omitempty"`
	ServiceOfferingID          string        `json:"serviceofferingid,omitempty"`
	ServiceOfferingName        string        `json:"serviceofferingname,omitempty"`
	Size                       uint64        `json:"size,omitempty"`
	State                      string        `json:"state,omitempty"`
	Type                       string        `json:"type,omitempty"`
	VirtualMachineID           string        `json:"virtualmachineid,omitempty"`
	VMName                     string        `json:"vmname,omitempty"`
	VMState                    string        `json:"vmstate,omitempty"`
	ZoneID                     string        `json:"zoneid,omitempty"`
	ZoneName                   string        `json:"zonename,omitempty"`
	Tags                       []ResourceTag `json:"tags,omitempty"`
	JobID                      string        `json:"jobid,omitempty"`
	JobStatus                  JobStatusType `json:"jobstatus,omitempty"`
}

Volume represents a volume linked to a VM

func (*Volume) 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
internal
integ module

Jump to

Keyboard shortcuts

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