Documentation
¶
Index ¶
- func GetServerAddresses(server *cloudsigma.Server) []clusterv1.MachineAddress
- type Client
- func (c *Client) AllocatePublicIP(ctx context.Context, name string) (*cloudsigma.IP, error)
- func (c *Client) CloneDrive(ctx context.Context, sourceUUID, name string, size int64) (*cloudsigma.Drive, error)
- func (c *Client) CreateServer(ctx context.Context, spec ServerSpec) (*cloudsigma.Server, error)
- func (c *Client) CreateVLAN(ctx context.Context, name string, meta map[string]string) (*cloudsigma.VLAN, error)
- func (c *Client) DeleteDrive(ctx context.Context, uuid string) error
- func (c *Client) DeleteIP(ctx context.Context, uuid string) error
- func (c *Client) DeleteServer(ctx context.Context, uuid string) error
- func (c *Client) DeleteVLAN(ctx context.Context, uuid string) error
- func (c *Client) GetDrive(ctx context.Context, uuid string) (*cloudsigma.Drive, error)
- func (c *Client) GetIP(ctx context.Context, uuid string) (*cloudsigma.IP, error)
- func (c *Client) GetServer(ctx context.Context, uuid string) (*cloudsigma.Server, error)
- func (c *Client) GetServerAddressesWithClient(ctx context.Context, server *cloudsigma.Server) ([]clusterv1.MachineAddress, error)
- func (c *Client) GetVLAN(ctx context.Context, uuid string) (*cloudsigma.VLAN, error)
- func (c *Client) ListServers(ctx context.Context) ([]cloudsigma.Server, error)
- func (c *Client) ListVLANs(ctx context.Context) ([]cloudsigma.VLAN, error)
- func (c *Client) Region() string
- func (c *Client) StartServer(ctx context.Context, uuid string) error
- func (c *Client) StopServer(ctx context.Context, uuid string) error
- func (c *Client) Username() string
- func (c *Client) VerifyConnection(ctx context.Context) error
- func (c *Client) WaitForDriveReady(ctx context.Context, uuid string, timeout time.Duration) (*cloudsigma.Drive, error)
- type CustomIPRef
- type CustomIPv4Conf
- type CustomServer
- type CustomServerCreateRequest
- type CustomServerDrive
- type CustomServerNIC
- type ServerSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetServerAddresses ¶
func GetServerAddresses(server *cloudsigma.Server) []clusterv1.MachineAddress
GetServerAddresses extracts network addresses from a CloudSigma Server Returns addresses in CAPI MachineAddress format for node registration Note: For DHCP/NAT configurations, the IP is assigned by CloudSigma but may not appear in the API until the server is fully booted. Use GetServerAddressesWithClient to fetch IPs from the API if needed.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the CloudSigma SDK client with CAPI-specific functionality
func (*Client) AllocatePublicIP ¶
AllocatePublicIP allocates a new public IP address
func (*Client) CloneDrive ¶
func (c *Client) CloneDrive(ctx context.Context, sourceUUID, name string, size int64) (*cloudsigma.Drive, error)
CloneDrive clones a drive (typically a library image) to create a new drive
func (*Client) CreateServer ¶
func (c *Client) CreateServer(ctx context.Context, spec ServerSpec) (*cloudsigma.Server, error)
CreateServer creates a new CloudSigma server
func (*Client) CreateVLAN ¶
func (c *Client) CreateVLAN(ctx context.Context, name string, meta map[string]string) (*cloudsigma.VLAN, error)
CreateVLAN creates a new VLAN Note: CloudSigma VLAN creation is typically done through the web UI or requires special permissions This is a placeholder for future implementation
func (*Client) DeleteDrive ¶
DeleteDrive deletes a drive
func (*Client) DeleteServer ¶
DeleteServer deletes a server and its associated drives
func (*Client) DeleteVLAN ¶
DeleteVLAN deletes a VLAN Note: CloudSigma VLAN deletion is typically done through the web UI This is a placeholder for future implementation
func (*Client) GetServerAddressesWithClient ¶
func (c *Client) GetServerAddressesWithClient(ctx context.Context, server *cloudsigma.Server) ([]clusterv1.MachineAddress, error)
GetServerAddressesWithClient fetches server addresses by retrieving IP resources from CloudSigma API This is needed because Server objects contain IP UUIDs but not the actual IP address strings
func (*Client) ListServers ¶
ListServers lists all servers
func (*Client) StartServer ¶
StartServer starts a stopped server
func (*Client) StopServer ¶
StopServer stops a running server
func (*Client) VerifyConnection ¶
VerifyConnection tests the connection to CloudSigma API
type CustomIPRef ¶
type CustomIPRef struct {
UUID string `json:"uuid"` // IP UUID string
}
CustomIPRef represents an IP address reference
type CustomIPv4Conf ¶
type CustomIPv4Conf struct {
Conf string `json:"conf"` // dhcp, static, or manual
IP *CustomIPRef `json:"ip,omitempty"` // IP reference for static config
}
CustomIPv4Conf represents IPv4 configuration for a NIC
type CustomServer ¶
type CustomServer struct {
Name string `json:"name"`
CPU int `json:"cpu"`
Memory int `json:"mem"`
VNCPassword string `json:"vnc_password"`
Drives []CustomServerDrive `json:"drives"`
NICs []CustomServerNIC `json:"nics,omitempty"` // Omit if empty - CloudSigma auto-assigns public IP
Meta map[string]string `json:"meta,omitempty"`
}
CustomServer represents a server for creation
type CustomServerCreateRequest ¶
type CustomServerCreateRequest struct {
Servers []CustomServer `json:"objects"`
}
CustomServerCreateRequest wraps servers for creation
type CustomServerDrive ¶
type CustomServerDrive struct {
BootOrder int `json:"boot_order,omitempty"`
DevChannel string `json:"dev_channel,omitempty"`
Device string `json:"device,omitempty"`
Drive string `json:"drive"` // UUID string instead of object
}
CustomServerDrive represents a server drive with string drive reference
type CustomServerNIC ¶
type CustomServerNIC struct {
VLAN string `json:"vlan,omitempty"` // UUID string
IPv4Conf *CustomIPv4Conf `json:"ip_v4_conf,omitempty"` // IPv4 configuration (CloudSigma uses ip_v4_conf with underscores)
}
CustomServerNIC represents a server NIC with string VLAN reference
type ServerSpec ¶
type ServerSpec struct {
Name string
CPU int
Memory int
Disks []infrav1.CloudSigmaDisk
NICs []infrav1.CloudSigmaNIC
Tags []string
Meta map[string]string
BootstrapData string // Cloud-init user data
}
ServerSpec defines the specifications for creating a server