egoscale

package module
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

README

egoscale: exoscale driver for golang

Build Status Maintainability

An API wrapper for the exoscale public cloud

godoc

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.ch/) infrastructure but should fit other CloudStack services.

Affinity and Anti-Affinity groups

Affinity and Anti-Affinity groups provide a way to influence where VMs should run. See: http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/stable/virtual_machines.html#affinity-groups

APIs

All the available APIs on the server and provided by the API Discovery plugin

cs := egoscale.NewClient("https://api.exoscale.ch/compute", "EXO...", "...")

resp, err := cs.Request(&egoscale.ListAPIs{})
if err != nil {
	panic(err)
}

for _, api := range resp.(*ListAPIsResponse).API {
	fmt.Println("%s %s", api.Name, api.Description)
}
// Output:
// listNetworks Lists all available networks
// ...

Elastic IPs

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

Networks

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

NICs

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

Security Groups

Security Groups provide a way to isolate traffic to VMs.

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

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

Service 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

SSH Key Pairs

In addition to username and password (disabled on Exoscale), SSH keys are used to log into the infrastructure.

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

Virtual Machines

... todo ...

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

Zones

A Zone corresponds to a Data Center.

Index

Constants

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

	// InternalError represents a server error
	InternalError = 530
	// AccountError represents ... (TODO)
	AccountError
	// AccountResourceLimitError represents ... (TODO)
	AccountResourceLimitError
	// InsufficientCapacityError represents ... (TODO)
	InsufficientCapacityError
	// ResourceUnavailableError represents ... (TODO)
	ResourceUnavailableError
	// ResourceAllocationError represents ... (TODO)
	ResourceAllocationError
	// ResourceInUseError represents ... (TODO)
	ResourceInUseError
	// NetworkRuleConflictError represents ... (TODO)
	NetworkRuleConflictError
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API added in v0.9.0

type API struct {
	Description string         `json:"description"`
	IsAsync     bool           `json:"isasync"`
	Name        string         `json:"name"`
	Related     string         `json:"related"` // comma separated
	Since       string         `json:"since"`
	Type        string         `json:"type"`
	Params      []*APIParam    `json:"params"`
	Response    []*APIResponse `json:"responses"`
}

API represents an API service

type APIParam added in v0.9.0

type APIParam struct {
	Description string `json:"description"`
	Length      int64  `json:"length"`
	Name        string `json:"name"`
	Related     string `json:"related"` // comma separated
	Since       string `json:"since"`
	Type        string `json:"type"`
}

APIParam represents an API parameter field

type APIResponse added in v0.9.0

type APIResponse struct {
	Description string         `json:"description"`
	Name        string         `json:"name"`
	Response    []*APIResponse `json:"response"`
	Type        string         `json:"type"`
}

APIResponse represents an API response field

type AddIPToNic added in v0.9.0

type AddIPToNic struct {
	NicID     string `json:"nicid"`
	IPAddress net.IP `json:"ipaddress"`
}

AddIPToNic represents the assignation of a secondary IP

type AddIPToNicResponse added in v0.9.0

type AddIPToNicResponse struct {
	NicSecondaryIP *NicSecondaryIP `json:"nicsecondaryip"`
}

AddIPToNicResponse represents the addition of an IP to a NIC

type AddNicToVirtualMachine added in v0.9.0

type AddNicToVirtualMachine struct {
	NetworkID        string `json:"networkid"`
	VirtualMachineID string `json:"virtualmachineid"`
	IPAddress        net.IP `json:"ipaddress,omitempty"`
}

AddNicToVirtualMachine (Async) adds a NIC to a VM

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

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"`
	Type              string   `json:"type,omitempty"`
	VirtualMachineIDs []string `json:"virtualmachineIDs,omitempty"` // *I*ds is not a typo
}

AffinityGroup represents an (anti-)affinity group

type AffinityGroupType added in v0.9.0

type AffinityGroupType struct {
	Type string `json:"type"`
}

AffinityGroupType represent an affinity group type

type AssociateIPAddress added in v0.9.0

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

AssociateIPAddress (Async) represents the IP creation

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

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 {
	// contains filtered or unexported methods
}

AsyncCommand represents a async CloudStack request

type AsyncInfo added in v0.9.0

type AsyncInfo struct {
	Retries int
	Delay   int
}

AsyncInfo represents the details for any async call

It retries at most Retries time and waits for Delay between each retry

type AsyncJobResult added in v0.9.0

type AsyncJobResult struct {
	AccountID       string           `json:"accountid"`
	Cmd             string           `json:"cmd"`
	Created         string           `json:"created"`
	JobInstanceID   string           `json:"jobinstanceid"`
	JobInstanceType string           `json:"jobinstancetype"`
	JobProcStatus   int              `json:"jobprocstatus"`
	JobResult       *json.RawMessage `json:"jobresult"`
	JobResultCode   int              `json:"jobresultcode"`
	JobResultType   string           `json:"jobresulttype"`
	JobStatus       JobStatusType    `json:"jobstatus"`
	UserID          string           `json:"userid"`
	JobID           string           `json:"jobid"`
}

AsyncJobResult represents an asynchronous job result

type AuthorizeSecurityGroupEgress added in v0.9.0

type AuthorizeSecurityGroupEgress AuthorizeSecurityGroupIngress

AuthorizeSecurityGroupEgress (Async) represents the egress rule creation

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

type AuthorizeSecurityGroupEgressResponse

type AuthorizeSecurityGroupEgressResponse CreateSecurityGroupResponse

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

type AuthorizeSecurityGroupIngress added in v0.9.0

type AuthorizeSecurityGroupIngress struct {
	Account               string               `json:"account,omitempty"`
	CidrList              []string             `json:"cidrlist,omitempty"`
	Description           string               `json:"description,omitempty"`
	DomainID              string               `json:"domainid,omitempty"`
	IcmpType              int                  `json:"icmptype,omitempty"`
	IcmpCode              int                  `json:"icmpcode,omitempty"`
	StartPort             int                  `json:"startport,omitempty"`
	EndPort               int                  `json:"endport,omitempty"`
	ProjectID             string               `json:"projectid,omitempty"`
	Protocol              string               `json:"protocol,omitempty"`
	SecurityGroupID       string               `json:"securitygroupid,omitempty"`
	SecurityGroupName     string               `json:"securitygroupname,omitempty"`
	UserSecurityGroupList []*UserSecurityGroup `json:"usersecuritygrouplist,omitempty"`
}

AuthorizeSecurityGroupIngress (Async) represents the ingress rule creation

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

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 {
	// contains filtered or unexported fields
}

Client represents the CloudStack API client

func NewClient

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

NewClient creates a CloudStack API client

func (*Client) AddIPToNic deprecated added in v0.9.0

func (exo *Client) AddIPToNic(nicID string, ipAddress string, async AsyncInfo) (*NicSecondaryIP, error)

AddIPToNic adds an IP to a NIC

Deprecated: use the API directly

func (*Client) AsyncRequest added in v0.9.0

func (exo *Client) AsyncRequest(req AsyncCommand, async AsyncInfo) (interface{}, error)

AsyncRequest performs an asynchronous request and polls it for retries * day [s]

func (*Client) BooleanAsyncRequest added in v0.9.0

func (exo *Client) BooleanAsyncRequest(req AsyncCommand, async AsyncInfo) error

BooleanAsyncRequest performs a sync request on a boolean call

func (*Client) BooleanRequest added in v0.9.0

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

BooleanRequest performs a sync request on a boolean call

func (*Client) CreateAffinityGroup deprecated

func (exo *Client) CreateAffinityGroup(name string, async AsyncInfo) (*AffinityGroup, error)

CreateAffinityGroup creates a group

Deprecated: Use the API directly

func (*Client) CreateDomain

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

CreateDomain creates a DNS domain

func (*Client) CreateEgressRule deprecated

func (exo *Client) CreateEgressRule(req *AuthorizeSecurityGroupEgress, async AsyncInfo) ([]*EgressRule, error)

CreateEgressRule creates a set of egress rules

Deprecated: use the API directly

func (*Client) CreateIngressRule deprecated

func (exo *Client) CreateIngressRule(req *AuthorizeSecurityGroupIngress, async AsyncInfo) ([]*IngressRule, error)

CreateIngressRule creates a set of ingress rules

Deprecated: use the API directly

func (*Client) CreateKeypair deprecated

func (exo *Client) CreateKeypair(name string) (*SSHKeyPair, error)

CreateKeypair create a new SSH Key Pair

Deprecated: will go away, use the API directly

func (*Client) CreateRecord

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

CreateRecord creates a DNS record

func (*Client) CreateSecurityGroupWithRules deprecated

func (exo *Client) CreateSecurityGroupWithRules(name string, ingress []*AuthorizeSecurityGroupIngress, egress []*AuthorizeSecurityGroupEgress, async AsyncInfo) (*SecurityGroup, error)

CreateSecurityGroupWithRules create a security group with its rules Warning: it doesn't rollback in case of a failure!

Deprecated: use the API directly

func (*Client) DeleteAffinityGroup deprecated

func (exo *Client) DeleteAffinityGroup(name string, async AsyncInfo) error

DeleteAffinityGroup deletes a group

Deprecated: Use the API directly

func (*Client) DeleteDomain

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

DeleteDomain delets a DNS domain

func (*Client) DeleteKeypair deprecated

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

DeleteKeypair deletes an SSH key pair

Deprecated: will go away, use the API directly

func (*Client) DeleteRecord

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

DeleteRecord deletes a record

func (*Client) DeleteSecurityGroup deprecated

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

DeleteSecurityGroup deletes a security group

Deprecated: use the API directly

func (*Client) GetAffinityGroups deprecated

func (exo *Client) GetAffinityGroups() (map[string]string, error)

GetAffinityGroups returns a mapping of the (anti-)affinity groups

Deprecated: do it yourself

func (*Client) GetAllZones deprecated added in v0.9.0

func (exo *Client) GetAllZones() (map[string]string, error)

GetAllZones returns all the zone id by name

Deprecated: do it yourself

func (*Client) GetDomain

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

GetDomain gets a DNS domain

func (*Client) GetImages deprecated

func (exo *Client) GetImages() (map[string]map[int64]string, error)

GetImages list the available featured images and group them by name, then size.

Deprecated: do it yourself

func (*Client) GetKeypairs deprecated

func (exo *Client) GetKeypairs() ([]SSHKeyPair, error)

GetKeypairs returns the list of SSH keyPairs

Deprecated: do it yourself

func (*Client) GetProfiles deprecated

func (exo *Client) GetProfiles() (map[string]string, error)

GetProfiles returns a mapping of the service offerings by name

Deprecated: do it yourself

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) GetRootVolumeForVirtualMachine deprecated added in v0.9.0

func (exo *Client) GetRootVolumeForVirtualMachine(virtualMachineID string) (*Volume, error)

GetRootVolumeForVirtualMachine returns the root volume of a VM

Deprecated: helper function shouldn't be used

func (*Client) GetSecurityGroupID deprecated added in v0.9.0

func (exo *Client) GetSecurityGroupID(name string) (string, error)

GetSecurityGroupID returns security group by name

Deprecated: do it yourself

func (*Client) GetSecurityGroups deprecated

func (exo *Client) GetSecurityGroups() (map[string]SecurityGroup, error)

GetSecurityGroups returns all security groups

Deprecated: do it yourself

func (*Client) GetTopology deprecated

func (exo *Client) GetTopology() (*Topology, error)

GetTopology returns an big, yet incomplete view of the world

Deprecated: will go away in the future

func (*Client) ListNics deprecated added in v0.9.0

func (exo *Client) ListNics(req *ListNics) ([]*Nic, error)

ListNics lists the NIC of a VM

Deprecated: use the API directly

func (*Client) RegisterKeypair deprecated

func (exo *Client) RegisterKeypair(name string, publicKey string) (*SSHKeyPair, error)

RegisterKeypair registers a public key in a keypair

Deprecated: will go away, use the API directly

func (*Client) RemoveIPFromNic deprecated added in v0.9.0

func (exo *Client) RemoveIPFromNic(secondaryNicID string, async AsyncInfo) error

RemoveIPFromNic removes an IP from a NIC

Deprecated: use the API directly

func (*Client) Request

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

Request performs a sync request on a generic command

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

type CreateNetwork struct {
	DisplayText       string `json:"displaytext"`
	Name              string `json:"name"`
	NetworkOfferingID string `json:"networkofferingid"`
	ZoneID            string `json:"zoneid"`
	Account           string `json:"account,omitempty"`
	ACLID             string `json:"aclid,omitempty"`
	ACLType           string `json:"acltype,omitempty"`        // Account or Domain
	DisplayNetwork    bool   `json:"displaynetwork,omitempty"` // root only
	DomainID          string `json:"domainid,omitempty"`
	EndIP             net.IP `json:"endip,omitempty"`
	EndIpv6           net.IP `json:"endipv6,omitempty"`
	Gateway           net.IP `json:"gateway,omitempty"`
	IP6Cidr           string `json:"ip6cidr,omitempty"`
	IP6Gateway        net.IP `json:"ip6gateway,omitempty"`
	IsolatedPVlan     string `json:"isolatedpvlan,omitempty"`
	Netmask           net.IP `json:"netmask,omitempty"`
	NetworkDomain     string `json:"networkdomain,omitempty"`
	PhysicalNetworkID string `json:"physicalnetworkid,omitempty"`
	ProjectID         string `json:"projectid,omitempty"`
	StartIP           net.IP `json:"startip,omitempty"`
	StartIpv6         net.IP `json:"startipv6,omitempty"`
	SubdomainAccess   string `json:"subdomainaccess,omitempty"`
	Vlan              string `json:"vlan,omitempty"`
	VpcID             string `json:"vpcid,omitempty"`
}

CreateNetwork creates a network

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

type CreateNetworkResponse added in v0.9.0

type CreateNetworkResponse NetworkResponse

CreateNetworkResponse represents a freshly created network

type CreateSSHKeyPair added in v0.9.0

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

CreateSSHKeyPair represents a new keypair to be created

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

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"`
	Account   string `json:"account,omitempty"`
	DomainID  string `json:"domainid,omitempty"`
	PolicyID  string `json:"policyid,omitempty"`
	QuiesceVM bool   `json:"quiescevm,omitempty"`
}

CreateSnapshot represents a request to create a volume snapshot

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

type CreateSnapshotResponse added in v0.9.0

type CreateSnapshotResponse struct {
	Snapshot *Snapshot `json:"snapshot"`
}

CreateSnapshotResponse represents a freshly created snapshot

type CreateTags added in v0.9.0

type CreateTags struct {
	ResourceIDs  []string       `json:"resourceids"`
	ResourceType string         `json:"resourcetype"`
	Tags         []*ResourceTag `json:"tags"`
	Customer     string         `json:"customer,omitempty"`
}

CreateTags (Async) creates resource tag(s)

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

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

type DeleteAffinityGroup struct {
	ID          string `json:"id,omitempty"`
	Name        string `json:"name,omitempty"`
	Type        string `json:"type,omitempty"`
	Account     string `json:"account,omitempty"`
	Description string `json:"description,omitempty"`
	DomainID    string `json:"domainid,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 DeleteNetwork added in v0.9.0

type DeleteNetwork struct {
	ID     string `json:"id"`
	Forced bool   `json:"forced,omitempty"`
}

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"`
	Account   string `json:"account,omitempty"`
	DomainID  string `json:"domainid,omitempty"`
	ProjectID string `json:"projectid,omitempty"`
}

DeleteSSHKeyPair represents a new keypair to be created

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

type DeleteSecurityGroup added in v0.9.0

type DeleteSecurityGroup struct {
	Account   string `json:"account,omitempty"`
	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:"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"`
}

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"`
	ResourceType string         `json:"resourcetype"`
	Tags         []*ResourceTag `json:"tags,omitempty"`
}

DeleteTags (Async) deletes the resource tag(s)

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

type DeployVirtualMachine added in v0.9.0

type DeployVirtualMachine struct {
	ServiceOfferingID  string            `json:"serviceofferingid"`
	TemplateID         string            `json:"templateid"`
	ZoneID             string            `json:"zoneid"`
	Account            string            `json:"account,omitempty"`
	AffinityGroupIDs   []string          `json:"affinitygroupids,omitempty"`
	AffinityGroupNames []string          `json:"affinitygroupnames,omitempty"`
	CustomID           string            `json:"customid,omitempty"`          // root only
	DeploymentPlanner  string            `json:"deploymentplanner,omitempty"` // root only
	Details            map[string]string `json:"details,omitempty"`
	DiskOfferingID     string            `json:"diskofferingid,omitempty"`
	DisplayName        string            `json:"displayname,omitempty"`
	DisplayVM          bool              `json:"displayvm,omitempty"`
	DomainID           string            `json:"domainid,omitempty"`
	Group              string            `json:"group,omitempty"`
	HostID             string            `json:"hostid,omitempty"`
	Hypervisor         string            `json:"hypervisor,omitempty"`
	IP6Address         net.IP            `json:"ip6address,omitempty"`
	IPAddress          net.IP            `json:"ipaddress,omitempty"`
	IPToNetworkList    []*IPToNetwork    `json:"iptonetworklist,omitempty"`
	Keyboard           string            `json:"keyboard,omitempty"`
	KeyPair            string            `json:"keypair,omitempty"`
	Name               string            `json:"name,omitempty"`
	NetworkIDs         []string          `json:"networkids,omitempty"` // mutually exclusive with IPToNetworkList
	ProjectID          string            `json:"projectid,omitempty"`
	RootDiskSize       int64             `json:"rootdisksize,omitempty"` // in GiB
	SecurityGroupIDs   []string          `json:"securitygroupids,omitempty"`
	SecurityGroupNames []string          `json:"securitygroupnames,omitempty"` // does nothing, mutually exclusive
	Size               string            `json:"size,omitempty"`               // mutually exclusive with DiskOfferingID
	StartVM            bool              `json:"startvm,omitempty"`
	UserData           []byte            `json:"userdata,omitempty"`
}

DeployVirtualMachine (Async) represents the machine creation

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"`
	Expunge bool   `json:"expunge,omitempty"`
}

DestroyVirtualMachine (Async) represents the destruction of the virtual machine

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

type DestroyVirtualMachineResponse

type DestroyVirtualMachineResponse VirtualMachineResponse

DestroyVirtualMachineResponse represents a destroyed VM instance

type DisassociateIPAddress added in v0.9.0

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

DisassociateIPAddress (Async) represents the IP deletion

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

type EgressRule added in v0.9.0

type EgressRule IngressRule

EgressRule represents the ingress rule

type ErrorCode added in v0.9.2

type ErrorCode int

ErrorCode represents the CloudStack ApiErrorCode enum

See: https://github.com/apache/cloudstack/blob/master/api/src/org/apache/cloudstack/api/ApiErrorCode.java

type ErrorResponse added in v0.9.0

type ErrorResponse struct {
	ErrorCode   ErrorCode `json:"errorcode"`
	CsErrorCode int       `json:"cserrorcode"`
	ErrorText   string    `json:"errortext"`
	UUIDList    []string  `json:"uuidList,omitempty"` // uuid*L*ist is not a typo
}

ErrorResponse represents the standard error response from CloudStack

func (*ErrorResponse) Error added in v0.9.0

func (e *ErrorResponse) Error() string

Error formats a CloudStack error into a standard error

type Event added in v0.9.0

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

Event represents an event in the system

type EventType added in v0.9.0

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

EventType represent a type of event

type ExpungeVirtualMachine added in v0.9.0

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

ExpungeVirtualMachine represents the annihilation of a VM

type GetVMPassword added in v0.9.0

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

GetVMPassword asks for an encrypted password

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

type GetVMPasswordResponse added in v0.9.0

type GetVMPasswordResponse struct {
	// Base64 encrypted password for the VM
	EncryptedPassword string `json:"encryptedpassword"`
}

GetVMPasswordResponse represents the encrypted password

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

type IPToNetwork added in v0.9.0

type IPToNetwork struct {
	IP        string `json:"ip,omitempty"`
	IPV6      string `json:"ipv6,omitempty"`
	NetworkID string `json:"networkid,omitempty"`
}

IPToNetwork represents a mapping between ip and networks

type IngressRule added in v0.9.0

type IngressRule struct {
	RuleID                string               `json:"ruleid"`
	Account               string               `json:"account,omitempty"`
	Cidr                  string               `json:"cidr,omitempty"`
	Description           string               `json:"description,omitempty"`
	IcmpType              int                  `json:"icmptype,omitempty"`
	IcmpCode              int                  `json:"icmpcode,omitempty"`
	StartPort             int                  `json:"startport,omitempty"`
	EndPort               int                  `json:"endport,omitempty"`
	Protocol              string               `json:"protocol,omitempty"`
	Tags                  []*ResourceTag       `json:"tags,omitempty"`
	SecurityGroupID       string               `json:"securitygroupid,omitempty"`
	SecurityGroupName     string               `json:"securitygroupname,omitempty"`
	UserSecurityGroupList []*UserSecurityGroup `json:"usersecuritygrouplist,omitempty"`
	JobID                 string               `json:"jobid,omitempty"`
	JobStatus             JobStatusType        `json:"jobstatus,omitempty"`
}

IngressRule represents the ingress rule

type JobResultResponse added in v0.9.0

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

JobResultResponse represents a generic response to a job task

type JobStatusType added in v0.9.0

type JobStatusType int

JobStatusType represents the status of a Job

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

type ListAPIs added in v0.9.0

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

ListAPIs represents a query to list the api

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

type ListAPIsResponse added in v0.9.0

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

ListAPIsResponse represents a list of API

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"`
	DomainID    string `json:"domainid,omitempty"`
	IsRecursive bool   `json:"isrecursive,omitempty"`
	Keyword     string `json:"keyword,omitempty"`
	Page        int    `json:"page,omitempty"`
	PageSize    int    `json:"pagesize,omitempty"`
	StartDate   string `json:"startdate,omitempty"`
}

ListAsyncJobs list the asynchronous jobs

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

type ListAsyncJobsResponse added in v0.9.0

type ListAsyncJobsResponse struct {
	Count     int               `json:"count"`
	AsyncJobs []*AsyncJobResult `json:"asyncjobs"`
}

ListAsyncJobsResponse represents a list of job results

type ListEventTypes added in v0.9.0

type ListEventTypes struct{}

ListEventTypes list the event types

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

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

type ListNetworkOfferings struct {
	Availability       string         `json:"availability,omitempty"`
	DisplayText        string         `json:"displaytext,omitempty"`
	ForVPC             bool           `json:"forvpc,omitempty"`
	GuestIPType        string         `json:"guestiptype,omitempty"` // shared of isolated
	ID                 string         `json:"id,omitempty"`
	IsDefault          bool           `json:"isdefault,omitempty"`
	IsTagged           bool           `json:"istagged,omitempty"`
	Keyword            string         `json:"keyword,omitempty"`
	Name               string         `json:"name,omitempty"`
	NetworkID          string         `json:"networkid,omitempty"`
	Page               int            `json:"page,omitempty"`
	PageSize           int            `json:"pagesize,omitempty"`
	SourceNATSupported bool           `json:"sourcenatsupported,omitempty"`
	SpecifyIPRanges    bool           `json:"specifyipranges,omitempty"`
	SpecifyVlan        string         `json:"specifyvlan,omitempty"`
	State              string         `json:"state,omitempty"`
	SupportedServices  string         `json:"supportedservices,omitempty"`
	Tags               []*ResourceTag `json:"tags,omitempty"`
	TrafficType        string         `json:"traffictype,omitempty"`
	ZoneID             string         `json:"zoneid,omitempty"`
}

ListNetworkOfferings represents a query for network offerings

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

type ListNetworkOfferingsResponse added in v0.9.0

type ListNetworkOfferingsResponse struct {
	Count           int                `json:"count"`
	NetworkOffering []*NetworkOffering `json:"networkoffering"`
}

ListNetworkOfferingsResponse represents a list of service offerings

type ListNetworks added in v0.9.0

type ListNetworks struct {
	Account           string         `json:"account,omitempty"`
	ACLType           string         `json:"acltype,omitempty"` // Account or Domain
	CanUseForDeploy   bool           `json:"canusefordeploy,omitempty"`
	DisplayNetwork    bool           `json:"displaynetwork,omitempty"` // root only
	DomainID          string         `json:"domainid,omitempty"`
	ForVpc            string         `json:"forvpc,omitempty"`
	ID                string         `json:"id,omitempty"`
	IsRecursive       bool           `json:"isrecursive,omitempty"`
	IsSystem          bool           `json:"issystem,omitempty"`
	Keyword           string         `json:"keyword,omitempty"`
	ListAll           bool           `json:"listall,omitempty"`
	Page              int            `json:"page,omitempty"`
	PageSize          int            `json:"pagesize,omitempty"`
	PhysicalNetworkID string         `json:"physicalnetworkid,omitempty"`
	ProjectID         string         `json:"projectid,omitempty"`
	RestartRequired   bool           `json:"restartrequired,omitempty"`
	SpecifyRanges     bool           `json:"specifyranges,omitempty"`
	SupportedServices []*Service     `json:"supportedservices,omitempty"`
	Tags              []*ResourceTag `json:"resourcetag,omitempty"`
	TrafficType       string         `json:"traffictype,omitempty"`
	Type              string         `json:"type,omitempty"`
	VpcID             string         `json:"vpcid,omitempty"`
	ZoneID            string         `json:"zoneid,omitempty"`
}

ListNetworks represents a query to a network

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

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

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"`
	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,omiempty"`
	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

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

type ListSSHKeyPairs struct {
	Account     string `json:"account,omitempty"`
	DomainID    string `json:"domainid,omitempty"`
	Fingerprint string `json:"fingerprint,omitempty"`
	IsRecursive bool   `json:"isrecursive,omitempty"`
	Keyword     string `json:"keyword,omitempty"`
	ListAll     bool   `json:"listall,omitempty"`
	Name        string `json:"name,omitempty"`
	Page        int    `json:"page,omitempty"`
	PageSize    int    `json:"pagesize,omitempty"`
	ProjectID   string `json:"projectid,omitempty"`
}

ListSSHKeyPairs represents a query for a list of SSH KeyPairs

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

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

type ListSecurityGroupsResponse

type ListSecurityGroupsResponse struct {
	Count         int              `json:"count"`
	SecurityGroup []*SecurityGroup `json:"securitygroup"`
}

ListSecurityGroupsResponse represents a list of security groups

type ListServiceOfferings added in v0.9.0

type ListServiceOfferings struct {
	DomainID         string `json:"domainid,omitempty"`
	ID               string `json:"id,omitempty"`
	IsRecursive      bool   `json:"isrecursive,omitempty"`
	IsSystem         bool   `json:"issystem,omitempty"`
	Keyword          string `json:"keyword,omitempty"`
	Name             string `json:"name,omitempty"`
	Page             int    `json:"page,omitempty"`
	PageSize         int    `json:"pagesize,omitempty"`
	SystemVMType     string `json:"systemvmtype,omitempty"` // consoleproxy, secondarystoragevm, or domainrouter
	VirtualMachineID string `json:"virtualmachineid,omitempty"`
}

ListServiceOfferings represents a query for service offerings

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

type ListServiceOfferingsResponse

type ListServiceOfferingsResponse struct {
	Count           int                `json:"count"`
	ServiceOffering []*ServiceOffering `json:"serviceoffering"`
}

ListServiceOfferingsResponse represents a list of service offerings

type ListSnapshots added in v0.9.0

type ListSnapshots struct {
	Account      string         `json:"account,omitempty"`
	DomainID     string         `json:"domainid,omitempty"`
	ID           string         `json:"id,omitempty"`
	IntervalType string         `json:"intervaltype,omitempty"`
	IsRecursive  bool           `json:"isrecursive,omitempty"`
	Keyword      string         `json:"keyword,omitempty"`
	ListAll      bool           `json:"listall,omitempty"`
	Name         string         `json:"name,omitempty"`
	Page         int            `json:"page,omitempty"`
	PageSize     int            `json:"pagesize,omitempty"`
	ProjectID    string         `json:"projectid,omitempty"`
	SnapshotType string         `json:"snapshottype,omitempty"`
	Tags         []*ResourceTag `json:"tags,omitempty"`
	VolumeID     string         `json:"volumeid,omitempty"`
	ZoneID       string         `json:"zoneid,omitempty"`
}

ListSnapshots lists the volume snapshots

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

type ListSnapshotsResponse added in v0.9.0

type ListSnapshotsResponse struct {
	Count    int         `json:"count"`
	Snapshot []*Snapshot `json:"snapshot"`
}

ListSnapshotsResponse represents a list of volume snapshots

type ListTags added in v0.9.0

type ListTags struct {
	Account      string `json:"account,omitempty"`
	Customer     string `json:"customer,omitempty"`
	DomainID     string `json:"domainid,omitempty"`
	IsRecursive  bool   `json:"isrecursive,omitempty"`
	Key          string `json:"key,omitempty"`
	Keyword      string `json:"keyword,omitempty"`
	ListAll      bool   `json:"listall,omitempty"`
	Page         int    `json:"page,omitempty"`
	PageSize     int    `json:"pagesize,omitempty"`
	ProjectID    string `json:"projectid,omitempty"`
	ResourceID   string `json:"resourceid,omitempty"`
	ResourceType string `json:"resourcetype,omitempty"`
	Value        string `json:"value,omitempty"`
}

ListTags list resource tag(s)

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

type ListTagsResponse added in v0.9.0

type ListTagsResponse struct {
	Count int            `json:"count"`
	Tag   []*ResourceTag `json:"tag"`
}

ListTagsResponse represents a list of resource tags

type ListTemplates added in v0.9.0

type ListTemplates struct {
	TemplateFilter string         `json:"templatefilter"` // featured, etc.
	Account        string         `json:"account,omitempty"`
	DomainID       string         `json:"domainid,omitempty"`
	Hypervisor     string         `json:"hypervisor,omitempty"`
	ID             string         `json:"id,omitempty"`
	IsRecursive    bool           `json:"isrecursive,omitempty"`
	Keyword        string         `json:"keyword,omitempty"`
	ListAll        bool           `json:"listall,omitempty"`
	Name           string         `json:"name,omitempty"`
	Page           int            `json:"page,omitempty"`
	PageSize       int            `json:"pagesize,omitempty"`
	ProjectID      string         `json:"projectid,omitempty"`
	ShowRemoved    bool           `json:"showremoved,omitempty"`
	Tags           []*ResourceTag `json:"tags,omitempty"`
	ZoneID         string         `json:"zoneid,omitempty"`
}

ListTemplates represents a template query filter

type ListTemplatesResponse

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

ListTemplatesResponse represents a list of templates

type ListVirtualMachines added in v0.9.0

type ListVirtualMachines struct {
	Account           string            `json:"account,omitempty"`
	AffinityGroupID   string            `json:"affinitygroupid,omitempty"`
	Details           map[string]string `json:"details,omitempty"`
	DisplayVM         bool              `json:"displayvm,omitempty"` // root only
	DomainID          string            `json:"domainid,omitempty"`
	ForVirtualNetwork bool              `json:"forvirtualnetwork,omitempty"`
	GroupID           string            `json:"groupid,omitempty"`
	HostID            string            `json:"hostid,omitempty"`
	Hypervisor        string            `json:"hypervisor,omitempty"`
	ID                string            `json:"id,omitempty"`
	IDs               []string          `json:"ids,omitempty"` // mutually exclusive with id
	IsoID             string            `json:"isoid,omitempty"`
	IsRecursive       bool              `json:"isrecursive,omitempty"`
	KeyPair           string            `json:"keypair,omitempty"`
	Keyword           string            `json:"keyword,omitempty"`
	ListAll           bool              `json:"listall,omitempty"`
	Name              string            `json:"name,omitempty"`
	NetworkID         string            `json:"networkid,omitempty"`
	Page              int               `json:"page,omitempty"`
	PageSize          int               `json:"pagesize,omitempty"`
	PodID             string            `json:"podid,omitempty"`
	ProjectID         string            `json:"projectid,omitempty"`
	ServiceOfferindID string            `json:"serviceofferingid,omitempty"`
	State             string            `json:"state,omitempty"` // Running, Stopped, Present, ...
	StorageID         string            `json:"storageid,omitempty"`
	Tags              []*ResourceTag    `json:"tags,omitempty"`
	TemplateID        string            `json:"templateid,omitempty"`
	UserID            string            `json:"userid,omitempty"`
	VpcID             string            `json:"vpcid,omitempty"`
	ZoneID            string            `json:"zoneid,omitempty"`
}

ListVirtualMachines represents a search for a VM

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

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

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           `json:"available,omitempty"`
	DomainID       string         `json:"domainid,omitempty"`
	ID             string         `json:"id,omitempty"`
	Keyword        string         `json:"keyword,omitempty"`
	Name           string         `json:"name,omitempty"`
	Page           int            `json:"page,omitempty"`
	PageSize       int            `json:"pagesize,omitempty"`
	ShowCapacities bool           `json:"showcapacities,omitempty"`
	Tags           []*ResourceTag `json:"tags,omitempty"`
}

ListZones represents a query for zones

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

type ListZonesResponse

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

ListZonesResponse represents a list of zones

type Network added in v0.9.0

type Network struct {
	ID                          string         `json:"id"`
	Account                     string         `json:"account"`
	ACLID                       string         `json:"aclid,omitempty"`
	ACLType                     string         `json:"acltype,omitempty"`
	BroadcastDomainType         string         `json:"broadcastdomaintype,omitempty"`
	BroadcastURI                string         `json:"broadcasturi,omitempty"`
	CanUseForDeploy             bool           `json:"canusefordeploy,omitempty"`
	Cidr                        string         `json:"cidr,omitempty"`
	DisplayNetwork              bool           `json:"diplaynetwork,omitempty"`
	DisplayText                 string         `json:"displaytext"`
	DNS1                        net.IP         `json:"dns1,omitempty"`
	DNS2                        net.IP         `json:"dns2,omitempty"`
	Domain                      string         `json:"domain,omitempty"`
	DomainID                    string         `json:"domainid,omitempty"`
	Gateway                     net.IP         `json:"gateway,omitempty"`
	IP6Cidr                     string         `json:"ip6cidr,omitempty"`
	IP6Gateway                  net.IP         `json:"ip6gateway,omitempty"`
	IsDefault                   bool           `json:"isdefault,omitempty"`
	IsPersistent                bool           `json:"ispersistent,omitempty"`
	Name                        string         `json:"name"`
	Netmask                     net.IP         `json:"netmask,omitempty"`
	NetworkCidr                 string         `json:"networkcidr,omitempty"`
	NetworkDomain               string         `json:"networkdomain,omitempty"`
	NetworkOfferingAvailability string         `json:"networkofferingavailability,omitempty"`
	NetworkOfferingConserveMode bool           `json:"networkofferingconservemode,omitempty"`
	NetworkOfferingDisplayText  string         `json:"networkofferingdisplaytext,omitempty"`
	NetworkOfferingID           string         `json:"networkofferingid,omitempty"`
	NetworkOfferingName         string         `json:"networkofferingname,omitempty"`
	PhysicalNetworkID           string         `json:"physicalnetworkid,omitempty"`
	Project                     string         `json:"project,omitempty"`
	ProjectID                   string         `json:"projectid,omitempty"`
	Related                     string         `json:"related,omitempty"`
	ReserveIPRange              string         `json:"reserveiprange,omitempty"`
	RestartRequired             bool           `json:"restartrequired,omitempty"`
	SpecifyIPRanges             bool           `json:"specifyipranges,omitempty"`
	State                       string         `json:"state"`
	StrechedL2Subnet            bool           `json:"strechedl2subnet,omitempty"`
	SubdomainAccess             bool           `json:"subdomainaccess,omitempty"`
	TrafficType                 string         `json:"traffictype"`
	Type                        string         `json:"type"`
	Vlan                        string         `json:"vlan,omitemtpy"` // root only
	VpcID                       string         `json:"vpcid,omitempty"`
	ZoneID                      string         `json:"zoneid,omitempty"`
	ZoneName                    string         `json:"zonename,omitempty"`
	ZonesNetworkSpans           string         `json:"zonesnetworkspans,omitempty"`
	Service                     []*Service     `json:"service"`
	Tags                        []*ResourceTag `json:"tags"`
}

Network represents a network

type NetworkOffering added in v0.9.0

type NetworkOffering struct {
	ID                       string            `json:"id"`
	Availability             string            `json:"availability,omitempty"`
	ConserveMode             bool              `json:"conservemode,omitempty"`
	Created                  string            `json:"created"`
	Details                  map[string]string `json:"details,omitempty"`
	DisplayText              string            `json:"displaytext,omitempty"`
	EgressDefaultPolicy      bool              `json:"egressdefaultpolicy,omitempty"`
	ForVPC                   bool              `json:"forvpc,omitempty"`
	GuestIPType              string            `json:"guestiptype,omitempty"`
	IsDefault                bool              `json:"isdefault,omitempty"`
	IsPersistent             bool              `json:"ispersistent,omitempty"`
	MaxConnections           int               `json:"maxconnections,omitempty"`
	Name                     string            `json:"name,omitempty"`
	NetworkRate              int               `json:"networkrate,omitempty"`
	ServiceOfferingID        string            `json:"serviceofferingid,omitempty"`
	SpecifyIPRanges          bool              `json:"specifyipranges,omitempty"`
	SpecifyVlan              bool              `json:"specifyvlan,omitempty"`
	State                    string            `json:"state"` // Disabled/Enabled/Inactive
	SupportsPublicAccess     bool              `json:"supportspublicaccess,omitempty"`
	SupportsStrechedL2Subnet bool              `json:"supportsstrechedl2subnet,omitempty"`
	Tags                     []*ResourceTag    `json:"tags,omitempty"`
	TrafficType              string            `json:"traffictype,omitempty"` // Public, Management, Control, ...
	Service                  []*Service        `json:"service,omitempty"`
}

NetworkOffering corresponds to the Compute Offerings

type NetworkResponse added in v0.9.0

type NetworkResponse struct {
	Network *Network `json:"network"`
}

NetworkResponse represents a network

type Nic added in v0.9.0

type Nic struct {
	ID               string            `json:"id,omitempty"`
	BroadcastURI     string            `json:"broadcasturi,omitempty"`
	Gateway          net.IP            `json:"gateway,omitempty"`
	IP6Address       net.IP            `json:"ip6address,omitempty"`
	IP6Cidr          string            `json:"ip6cidr,omitempty"`
	IP6Gateway       net.IP            `json:"ip6gateway,omitempty"`
	IPAddress        net.IP            `json:"ipaddress,omitempty"`
	IsDefault        bool              `json:"isdefault,omitempty"`
	IsolationURI     string            `json:"isolationuri,omitempty"`
	MacAddress       string            `json:"macaddress,omitempty"`
	Netmask          net.IP            `json:"netmask,omitempty"`
	NetworkID        string            `json:"networkid,omitempty"`
	NetworkName      string            `json:"networkname,omitempty"`
	SecondaryIP      []*NicSecondaryIP `json:"secondaryip,omitempty"`
	Traffictype      string            `json:"traffictype,omitempty"`
	Type             string            `json:"type,omitempty"`
	VirtualMachineID string            `json:"virtualmachineid,omitempty"`
}

Nic represents a Network Interface Controller (NIC)

type NicSecondaryIP added in v0.9.0

type NicSecondaryIP struct {
	ID               string `json:"id"`
	IPAddress        net.IP `json:"ipaddress"`
	NetworkID        string `json:"networkid"`
	NicID            string `json:"nicid"`
	VirtualMachineID string `json:"virtualmachineid,omitempty"`
}

NicSecondaryIP represents a link between NicID and IPAddress

type QueryAsyncJobResult added in v0.9.0

type QueryAsyncJobResult struct {
	JobID string `json:"jobid"`
}

QueryAsyncJobResult represents a query to fetch the status of async job

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

type QueryAsyncJobResultResponse

type QueryAsyncJobResultResponse AsyncJobResult

QueryAsyncJobResultResponse represents the current status of an asynchronous job

type RebootVirtualMachine added in v0.9.0

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

RebootVirtualMachine (Async) represents the rebooting of the virtual machine

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

type RebootVirtualMachineResponse

type RebootVirtualMachineResponse VirtualMachineResponse

RebootVirtualMachineResponse represents a rebooted VM instance

type RecoverVirtualMachine added in v0.9.0

type RecoverVirtualMachine struct {
	ID string `json:"virtualmachineid"`
}

RecoverVirtualMachine represents the restoration of the virtual machine

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

type RecoverVirtualMachineResponse added in v0.9.0

type RecoverVirtualMachineResponse VirtualMachineResponse

RecoverVirtualMachineResponse represents a recovered VM instance

type RegisterSSHKeyPair added in v0.9.0

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

RegisterSSHKeyPair represents a new registration of a public key in a keypair

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

type RegisterSSHKeyPairResponse added in v0.9.0

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

RegisterSSHKeyPairResponse represents the creation of an SSH Key Pair

type RemoveIPFromNic added in v0.9.0

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

RemoveIPFromNic represents a deletion request

type RemoveNicFromVirtualMachine added in v0.9.0

type RemoveNicFromVirtualMachine struct {
	NicID            string `json:"nicid"`
	VirtualMachineID string `json:"virtualmachineid"`
}

RemoveNicFromVirtualMachine (Async) removes a NIC from a VM

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

type RemoveNicFromVirtualMachineResponse added in v0.9.0

type RemoveNicFromVirtualMachineResponse VirtualMachineResponse

RemoveNicFromVirtualMachineResponse represents the modified VM

type ResetPasswordForVirtualMachine added in v0.9.0

type ResetPasswordForVirtualMachine ScaleVirtualMachine

ResetPasswordForVirtualMachine (Async) represents the scaling of a VM

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

type ResetPasswordForVirtualMachineResponse added in v0.9.0

type ResetPasswordForVirtualMachineResponse VirtualMachineResponse

ResetPasswordForVirtualMachineResponse represents the updated vm

type ResetSSHKeyForVirtualMachine added in v0.9.0

type ResetSSHKeyForVirtualMachine struct {
	ID        string `json:"id"`
	KeyPair   string `json:"keypair"`
	Account   string `json:"account,omitempty"`
	DomainID  string `json:"domainid,omitempty"`
	ProjectID string `json:"projectid,omitempty"`
}

ResetSSHKeyForVirtualMachine (Async) represents a change for the key pairs

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

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

type ResourceTag struct {
	Account      string `json:"account,omitempty"`
	Customer     string `json:"customer,omitempty"`
	Domain       string `json:"domain,omitempty"`
	DomainID     string `json:"domainid,omitempty"`
	Key          string `json:"key"`
	Project      string `json:"project,omitempty"`
	ProjectID    string `json:"projectid,omitempty"`
	ResourceID   string `json:"resourceid,omitempty"`
	ResourceType string `json:"resourcetype,omitempty"`
	Value        string `json:"value"`
}

ResourceTag is a tag associated with a resource

http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/4.9/management.html

type RestartNetwork added in v0.9.0

type RestartNetwork struct {
	ID      string `json:"id"`
	Cleanup bool   `json:"cleanup,omitempty"`
}

RestartNetwork 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"`
	TemplateID       string `json:"templateid,omitempty"`
}

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

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

RevertSnapshot revert a volume snapshot

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

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"`
	DomainID    string `json:"domainid,omitempty"`
	ProjectID   string `json:"projectid,omitempty"`
	Fingerprint string `json:"fingerprint,omitempty"`
	Name        string `json:"name,omitempty"`
	PrivateKey  string `json:"privatekey,omitempty"`
}

SSHKeyPair represents an SSH key pair

type ScaleVirtualMachine added in v0.9.0

type ScaleVirtualMachine struct {
	ID                string            `json:"id"`
	ServiceOfferingID string            `json:"serviceofferingid"`
	Details           map[string]string `json:"details,omitempty"`
}

ScaleVirtualMachine (Async) represents the scaling of a VM

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

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

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

type SecurityGroupResponse added in v0.9.0

type SecurityGroupResponse struct {
	SecurityGroup *SecurityGroup `json:"securitygroup"`
}

SecurityGroupResponse represents a generic security group response

type Service added in v0.9.0

type Service struct {
	Name       string               `json:"name"`
	Capability []*ServiceCapability `json:"capability,omitempty"`
	Provider   []*ServiceProvider   `json:"provider,omitempty"`
}

Service is a feature of a network

type ServiceCapability added in v0.9.0

type ServiceCapability struct {
	CanChooseServiceCapability bool   `json:"canchooseservicecapability"`
	Name                       string `json:"name"`
	Value                      string `json:"value"`
}

ServiceCapability represents optional capability of a service

type ServiceOffering

type ServiceOffering struct {
	ID                        string            `json:"id"`
	CPUNumber                 int               `json:"cpunumber"`
	CPUSpeed                  int               `json:"cpuspeed"`
	Created                   string            `json:"created"`
	DefaultUse                bool              `json:"defaultuse,omitempty"`
	DeploymentPlanner         string            `json:"deploymentplanner,omitempty"`
	DiskBytesReadRate         int64             `json:"diskBytesReadRate,omitempty"`
	DiskBytesWriteRate        int64             `json:"diskBytesWriteRate,omitempty"`
	DiskIopsReadRate          int64             `json:"diskIopsReadRate,omitempty"`
	DiskIopsWriteRate         int64             `json:"diskIopsWriteRate,omitempty"`
	DisplayText               string            `json:"displaytext,omitempty"`
	Domain                    string            `json:"domain"`
	DomainID                  string            `json:"domainid"`
	HostTags                  string            `json:"hosttags,omitempty"`
	HypervisorSnapshotReserve int               `json:"hypervisorsnapshotreserve,omitempty"`
	IsCustomized              bool              `json:"iscustomized,omitempty"`
	IsCustomizedIops          bool              `json:"iscustomizediops,omitempty"`
	IsSystem                  bool              `json:"issystem,omitempty"`
	IsVolatile                bool              `json:"isvolatile,omitempty"`
	LimitCPUUse               bool              `json:"limitcpuuse,omitempty"`
	MaxIops                   int64             `json:"maxiops,omitempty"`
	Memory                    int               `json:"memory,omitempty"`
	MinIops                   int64             `json:"miniops,omitempty"`
	Name                      string            `json:"name,omitempty"`
	NetworkRate               int               `json:"networkrate,omitempty"`
	OfferHA                   bool              `json:"offerha,omitempty"`
	ServiceOfferingDetails    map[string]string `json:"serviceofferingdetails,omitempty"`
	StorageType               string            `json:"storagetype,omitempty"`
	SystemVMType              string            `json:"systemvmtype,omitempty"`
	Tags                      []*ResourceTag    `json:"tags,omitempty"`
}

ServiceOffering corresponds to the Compute Offerings

type ServiceProvider added in v0.9.0

type ServiceProvider struct {
	ID                           string   `json:"id"`
	CanEnableIndividualService   bool     `json:"canenableindividualservice"`
	DestinationPhysicalNetworkID string   `json:"destinationphysicalnetworkid"`
	Name                         string   `json:"name"`
	PhysicalNetworkID            string   `json:"physicalnetworkid"`
	ServiceList                  []string `json:"servicelist,omitempty"`
}

ServiceProvider represents the provider of the service

type Snapshot added in v0.9.0

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

Snapshot represents a volume snapshot

type StartVirtualMachine added in v0.9.0

type StartVirtualMachine struct {
	ID                string `json:"id"`
	DeploymentPlanner string `json:"deploymentplanner,omitempty"` // root only
	HostID            string `json:"hostid,omitempty"`            // root only
}

StartVirtualMachine (Async) represents the creation of the virtual machine

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

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"`
	Forced bool   `json:"forced,omitempty"`
}

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 Template

type Template struct {
	Account               string            `json:"account,omitempty"`
	AccountID             string            `json:"accountid,omitempty"`
	Bootable              bool              `json:"bootable,omitempty"`
	Checksum              string            `json:"checksum,omitempty"`
	Created               string            `json:"created,omitempty"`
	CrossZones            bool              `json:"crossZones,omitempty"`
	Details               map[string]string `json:"details,omitempty"`
	DisplayText           string            `json:"displaytext,omitempty"`
	Domain                string            `json:"domain,omitempty"`
	DomainID              string            `json:"domainid,omitempty"`
	Format                string            `json:"format,omitempty"`
	HostID                string            `json:"hostid,omitempty"`
	HostName              string            `json:"hostname,omitempty"`
	Hypervisor            string            `json:"hypervisor,omitempty"`
	ID                    string            `json:"id,omitempty"`
	IsDynamicallyScalable bool              `json:"isdynamicallyscalable,omitempty"`
	IsExtractable         bool              `json:"isextractable,omitempty"`
	IsFeatured            bool              `json:"isfeatured,omitempty"`
	IsPublic              bool              `json:"ispublic,omitempty"`
	IsReady               bool              `json:"isready,omitempty"`
	Name                  string            `json:"name,omitempty"`
	OsTypeID              string            `json:"ostypeid,omitempty"`
	OsTypeName            string            `json:"ostypename,omitempty"`
	PasswordEnabled       bool              `json:"passwordenabled,omitempty"`
	Project               string            `json:"project,omitempty"`
	ProjectID             string            `json:"projectid,omitempty"`
	Removed               string            `json:"removed,omitempty"`
	Size                  int64             `json:"size,omitempty"`
	SourceTemplateID      string            `json:"sourcetemplateid,omitempty"`
	SSHKeyEnabled         bool              `json:"sshkeyenabled,omitempty"`
	Status                string            `json:"status,omitempty"`
	Zoneid                string            `json:"zoneid,omitempty"`
	Zonename              string            `json:"zonename,omitempty"`
}

Template represents a machine to be deployed

type Topology

type Topology struct {
	Zones          map[string]string
	Images         map[string]map[int64]string
	Profiles       map[string]string
	Keypairs       []string
	SecurityGroups map[string]string
	AffinityGroups map[string]string
}

Topology represents a view of the servers

type UpdateDefaultNicForVirtualMachine added in v0.9.0

type UpdateDefaultNicForVirtualMachine struct {
	NetworkID        string `json:"networkid"`
	VirtualMachineID string `json:"virtualmachineid"`
	IPAddress        net.IP `json:"ipaddress,omitempty"`
}

UpdateDefaultNicForVirtualMachine (Async) adds a NIC to a VM

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

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

type UpdateNetwork struct {
	ID                string `json:"id"`
	ChangeCidr        bool   `json:"changecidr,omitempty"`
	CustomID          string `json:"customid,omitempty"` // root only
	DisplayNetwork    string `json:"displaynetwork,omitempty"`
	DisplayText       string `json:"displaytext,omitempty"`
	Forced            bool   `json:"forced,omitempty"`
	GuestVMCidr       string `json:"guestvmcidr,omitempty"`
	Name              string `json:"name,omitempty"`
	NetworkDomain     string `json:"networkdomain,omitempty"`
	NetworkOfferingID string `json:"networkofferingid,omitempty"`
	UpdateInSequence  bool   `json:"updateinsequence,omitempty"`
}

UpdateNetwork updates a network

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

type UpdateNetworkResponse added in v0.9.0

type UpdateNetworkResponse NetworkResponse

UpdateNetworkResponse represents a freshly created network

type UpdateVMAffinityGroup added in v0.9.0

type UpdateVMAffinityGroup struct {
	ID                 string   `json:"id"`
	AffinityGroupIDs   []string `json:"affinitygroupids,omitempty"`   // mutually exclusive with names
	AffinityGroupNames []string `json:"affinitygroupnames,omitempty"` // mutually exclusive with ids
}

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

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

type UpdateVMAffinityGroupResponse added in v0.9.0

type UpdateVMAffinityGroupResponse VirtualMachineResponse

UpdateVMAffinityGroupResponse represents the new VM

type UpdateVirtualMachine added in v0.9.0

type UpdateVirtualMachine struct {
	ID                    string            `json:"id"`
	CustomID              string            `json:"customid,omitempty"` // root only
	Details               map[string]string `json:"details,omitempty"`
	DisplayName           string            `json:"displayname,omitempty"`
	DisplayVM             bool              `json:"displayvm,omitempty"`
	Group                 string            `json:"group,omitempty"`
	HAEnable              bool              `json:"haenable,omitempty"`
	IsDynamicallyScalable bool              `json:"isdynamicallyscalable,omitempty"`
	Name                  string            `json:"name,omitempty"` // must reboot
	OsTypeID              int64             `json:"ostypeid,omitempty"`
	SecurityGroupIDs      []string          `json:"securitygroupids,omitempty"`
	UserData              []byte            `json:"userdata,omitempty"`
}

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 UserSecurityGroup

type UserSecurityGroup struct {
	Group   string `json:"group,omitempty"`
	Account string `json:"account,omitempty"`
}

UserSecurityGroup represents the traffic of another security group

type VirtualMachine

type VirtualMachine struct {
	ID                    string            `json:"id,omitempty"`
	Account               string            `json:"account,omitempty"`
	ClusterID             string            `json:"clusterid,omitempty"`
	ClusterName           string            `json:"clustername,omitempty"`
	CPUNumber             int64             `json:"cpunumber,omitempty"`
	CPUSpeed              int64             `json:"cpuspeed,omitempty"`
	CPUUsed               string            `json:"cpuused,omitempty"`
	Created               string            `json:"created,omitempty"`
	Details               map[string]string `json:"details,omitempty"`
	DiskIoRead            int64             `json:"diskioread,omitempty"`
	DiskIoWrite           int64             `json:"diskiowrite,omitempty"`
	DiskKbsRead           int64             `json:"diskkbsread,omitempty"`
	DiskKbsWrite          int64             `json:"diskkbswrite,omitempty"`
	DiskOfferingID        string            `json:"diskofferingid,omitempty"`
	DiskOfferingName      string            `json:"diskofferingname,omitempty"`
	DisplayName           string            `json:"displayname,omitempty"`
	DisplayVM             bool              `json:"displayvm,omitempty"`
	Domain                string            `json:"domain,omitempty"`
	DomainID              string            `json:"domainid,omitempty"`
	ForVirtualNetwork     bool              `json:"forvirtualnetwork,omitempty"`
	Group                 string            `json:"group,omitempty"`
	GroupID               string            `json:"groupid,omitempty"`
	GuestOsID             string            `json:"guestosid,omitempty"`
	HaEnable              bool              `json:"haenable,omitempty"`
	HostID                string            `json:"hostid,omitempty"`
	HostName              string            `json:"hostname,omitempty"`
	Hypervisor            string            `json:"hypervisor,omitempty"`
	InstanceName          string            `json:"instancename,omitempty"` // root only
	IsDynamicallyScalable bool              `json:"isdynamicallyscalable,omitempty"`
	IsoDisplayText        string            `json:"isodisplaytext,omitempty"`
	IsoID                 string            `json:"isoid,omitempty"`
	IsoName               string            `json:"isoname,omitempty"`
	KeyPair               string            `json:"keypair,omitempty"`
	Memory                int64             `json:"memory,omitempty"`
	MemoryIntFreeKbs      int64             `json:"memoryintfreekbs,omitempty"`
	MemoryKbs             int64             `json:"memorykbs,omitempty"`
	MemoryTargetKbs       int64             `json:"memorytargetkbs,omitempty"`
	Name                  string            `json:"name,omitempty"`
	NetworkKbsRead        int64             `json:"networkkbsread,omitempty"`
	NetworkKbsWrite       int64             `json:"networkkbswrite,omitempty"`
	OsCategoryID          string            `json:"oscategoryid,omitempty"`
	OsTypeID              int64             `json:"ostypeid,omitempty"`
	Password              string            `json:"password,omitempty"`
	PasswordEnabled       bool              `json:"passwordenabled,omitempty"`
	PCIDevices            string            `json:"pcidevices,omitempty"` // not in the doc
	PodID                 string            `json:"podid,omitempty"`
	PodName               string            `json:"podname,omitempty"`
	Project               string            `json:"project,omitempty"`
	ProjectID             string            `json:"projectid,omitempty"`
	PublicIP              string            `json:"publicip,omitempty"`
	PublicIPID            string            `json:"publicipid,omitempty"`
	RootDeviceID          int64             `json:"rootdeviceid,omitempty"`
	RootDeviceType        string            `json:"rootdevicetype,omitempty"`
	ServiceOfferingID     string            `json:"serviceofferingid,omitempty"`
	ServiceOfferingName   string            `json:"serviceofferingname,omitempty"`
	ServiceState          string            `json:"servicestate,omitempty"`
	State                 string            `json:"state,omitempty"`
	TemplateDisplayText   string            `json:"templatedisplaytext,omitempty"`
	TemplateID            string            `json:"templateid,omitempty"`
	TemplateName          string            `json:"templatename,omitempty"`
	UserID                string            `json:"userid,omitempty"`   // not in the doc
	UserName              string            `json:"username,omitempty"` // not in the doc
	Vgpu                  string            `json:"vgpu,omitempty"`     // not in the doc
	ZoneID                string            `json:"zoneid,omitempty"`
	ZoneName              string            `json:"zonename,omitempty"`
	AffinityGroup         []*AffinityGroup  `json:"affinitygroup,omitempty"`
	Nic                   []*Nic            `json:"nic,omitempty"`
	SecurityGroup         []*SecurityGroup  `json:"securitygroup,omitempty"`
	Tags                  []*ResourceTag    `json:"tags,omitempty"`
	JobID                 string            `json:"jobid,omitempty"`
	JobStatus             JobStatusType     `json:"jobstatus,omitempty"`
}

VirtualMachine reprents a virtual machine

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

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

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

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

Directories

Path Synopsis
internal
integ module

Jump to

Keyboard shortcuts

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