cloudstack

package
v0.0.0-...-e0df0e5 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*cloudstack.CloudStackClient
}

Client wraps the official CloudStack Go SDK client

func NewClient

func NewClient(ctx context.Context, cfg Config) (*Client, error)

NewClient creates a new CloudStack client

func (*Client) CreateTags

CreateTags creates tags

func (*Client) DeleteTags

DeleteTags deletes tags

func (*Client) DeployVirtualMachine

DeployVirtualMachine deploys a virtual machine

func (*Client) DestroyVirtualMachine

DestroyVirtualMachine destroys a virtual machine

func (*Client) GetDiskOfferingID

func (c *Client) GetDiskOfferingID(name string, opts ...cloudstack.OptionFunc) (string, int, error)

GetDiskOfferingID gets the disk offering ID by name

func (*Client) GetNetworkID

func (c *Client) GetNetworkID(name string, opts ...cloudstack.OptionFunc) (string, int, error)

GetNetworkID gets the network ID by name

func (*Client) GetServiceOfferingID

func (c *Client) GetServiceOfferingID(name string, opts ...cloudstack.OptionFunc) (string, int, error)

GetServiceOfferingID gets the service offering ID by name

func (*Client) GetTemplateID

func (c *Client) GetTemplateID(name string, filter string, zoneid string, opts ...cloudstack.OptionFunc) (string, int, error)

GetTemplateID gets the template ID by name

func (*Client) GetVirtualMachineID

func (c *Client) GetVirtualMachineID(name string, opts ...cloudstack.OptionFunc) (string, int, error)

GetVirtualMachineID gets the VM ID by name

func (*Client) GetZoneID

func (c *Client) GetZoneID(name string, opts ...cloudstack.OptionFunc) (string, int, error)

GetZoneID gets the zone ID by name

func (*Client) ListDiskOfferings

ListDiskOfferings lists disk offerings

func (*Client) ListNetworks

ListNetworks lists networks

func (*Client) ListServiceOfferings

ListServiceOfferings lists service offerings

func (*Client) ListTags

ListTags lists tags

func (*Client) ListTemplates

ListTemplates lists templates

func (*Client) ListVirtualMachines

ListVirtualMachines lists virtual machines

func (*Client) ListZones

ListZones lists zones

func (*Client) WaitForAsyncJob

func (c *Client) WaitForAsyncJob(ctx context.Context, jobID string, timeout time.Duration) (*cloudstack.QueryAsyncJobResultResponse, error)

WaitForAsyncJob waits for an async job to complete and returns the result

type CloudStackAPI

type CloudStackAPI interface {
	// VirtualMachine operations
	DeployVirtualMachine(p *cloudstack.DeployVirtualMachineParams) (*cloudstack.DeployVirtualMachineResponse, error)
	GetVirtualMachineID(name string, opts ...cloudstack.OptionFunc) (string, int, error)
	ListVirtualMachines(p *cloudstack.ListVirtualMachinesParams) (*cloudstack.ListVirtualMachinesResponse, error)
	DestroyVirtualMachine(p *cloudstack.DestroyVirtualMachineParams) (*cloudstack.DestroyVirtualMachineResponse, error)

	// Service Offering operations
	ListServiceOfferings(p *cloudstack.ListServiceOfferingsParams) (*cloudstack.ListServiceOfferingsResponse, error)
	GetServiceOfferingID(name string, opts ...cloudstack.OptionFunc) (string, int, error)

	// Template operations
	ListTemplates(p *cloudstack.ListTemplatesParams) (*cloudstack.ListTemplatesResponse, error)
	GetTemplateID(name string, filter string, zoneid string, opts ...cloudstack.OptionFunc) (string, int, error)

	// Network operations
	ListNetworks(p *cloudstack.ListNetworksParams) (*cloudstack.ListNetworksResponse, error)
	GetNetworkID(name string, opts ...cloudstack.OptionFunc) (string, int, error)

	// Zone operations
	ListZones(p *cloudstack.ListZonesParams) (*cloudstack.ListZonesResponse, error)
	GetZoneID(name string, opts ...cloudstack.OptionFunc) (string, int, error)

	// Disk Offering operations
	ListDiskOfferings(p *cloudstack.ListDiskOfferingsParams) (*cloudstack.ListDiskOfferingsResponse, error)
	GetDiskOfferingID(name string, opts ...cloudstack.OptionFunc) (string, int, error)

	// Tag operations
	CreateTags(p *cloudstack.CreateTagsParams) (*cloudstack.CreateTagsResponse, error)
	DeleteTags(p *cloudstack.DeleteTagsParams) (*cloudstack.DeleteTagsResponse, error)
	ListTags(p *cloudstack.ListTagsParams) (*cloudstack.ListTagsResponse, error)
}

CloudStackAPI is an interface for CloudStack API operations This allows for easier testing and mocking

type Config

type Config struct {
	APIURL    string
	APIKey    string
	SecretKey string
	VerifySSL bool
	Timeout   time.Duration
}

Config contains the configuration for the CloudStack client

Jump to

Keyboard shortcuts

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