cloudstack

package
v0.0.0-...-88e46a9 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoRawCloudStackRequest

func DoRawCloudStackRequest(ctx context.Context, apiURL string, toolName string, username, password string, params map[string]string) (json.RawMessage, error)

func DoTypedCloudStackRequest

func DoTypedCloudStackRequest[T any](ctx context.Context, apiURL string, toolName string, username, password string, params map[string]string) (*T, error)

func GetAPICredentials

func GetAPICredentials(ctx context.Context, apiURL, username, password string) (string, string, error)

Types

type API

type API interface {
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents a CloudStack API client

func NewClient

func NewClient(config *Config) (*Client, error)

NewClient creates a new CloudStack API client

func (*Client) DeployVM

func (c *Client) DeployVM(name, templateID, serviceOfferingID, zoneID string) (string, error)

DeployVM deploys a new virtual machine in CloudStack

func (*Client) GetAPIClient

func (c *Client) GetAPIClient() *cloudstack.CloudStackClient

GetAPIClient returns the underlying CloudStack API client

func (*Client) GetDefaultZone

func (c *Client) GetDefaultZone() (string, error)

GetDefaultZone retrieves the default zone from CloudStack

func (*Client) GetVMStatus

func (c *Client) GetVMStatus(id string) (string, error)

GetVMStatus retrieves the status of a virtual machine

func (*Client) ListApis

func (c *Client) ListApis(ctx context.Context, params *cloudstack.ListApisParams) ([]*cloudstack.Api, error)

func (*Client) ListTemplates

func (c *Client) ListTemplates() ([]map[string]string, error)

ListTemplates retrieves a list of templates from CloudStack

func (*Client) ListZones

func (c *Client) ListZones() ([]map[string]string, error)

ListZones retrieves all zones from CloudStack

func (*Client) Request

func (c *Client) Request(apiName string, params map[string]string) (interface{}, error)

Request makes a generic request to the CloudStack API using the available service methods

type Config

type Config struct {
	APIURL    string
	APIKey    string
	SecretKey string
	Timeout   int64
}

Config holds the CloudStack API connection configuration

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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