cistore

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudConfigFile

type CloudConfigFile struct {
	Content  []byte `json:"content"`
	Name     string `json:"filename"`
	Encoding string `json:"encoding,omitempty"` // base64 or plain
}

func (*CloudConfigFile) UnmarshalJSON

func (f *CloudConfigFile) UnmarshalJSON(data []byte) error

Custom unmarshaler for CloudConfigFile

type ClusterDefaults

type ClusterDefaults struct {
	CloudProvider    string   `json:"cloud_provider,omitempty" yaml:"cloud-provider,omitempty"`
	Region           string   `json:"region,omitempty" yaml:"region,omitempty"`
	AvailabilityZone string   `json:"availability-zone,omitempty" yaml:"availability-zone,omitempty"`
	ClusterName      string   `json:"cluster-name,omitempty" yaml:"cluster-name,omitempty"`
	PublicKeys       []string `json:"public-keys,omitempty" yaml:"public-keys,omitempty"`
	BaseUrl          string   `json:"base-url,omitempty" yaml:"base-url,omitempty"`
	BootSubnet       string   `json:"boot-subnet,omitempty" yaml:"boot-subnet,omitempty"`
	WGSubnet         string   `json:"wg-subnet,omitempty" yaml:"wg-subnet,omitempty"`
	ShortName        string   `json:"short-name,omitempty" yaml:"short-name,omitempty"`
	NidLength        int      `json:"nid-length,omitempty" yaml:"nid-length,omitempty"`
}

type GroupData

type GroupData struct {
	Name        string                 `json:"name"`
	Description string                 `json:"description,omitempty"`
	Data        map[string]interface{} `json:"meta-data,omitempty"`
	File        CloudConfigFile        `json:"file,omitempty"`
}

func (*GroupData) ParseFromJSON added in v1.0.2

func (g *GroupData) ParseFromJSON(body []byte) error

type OpenCHAMIComponent

type OpenCHAMIComponent struct {
	base.Component
	MAC  string `json:"mac"`            // MAC address of the inteface used to boot the component
	IP   string `json:"ip"`             // IP address of the interface used to boot the component
	WGIP string `json:"wgip,omitempty"` // Wireguard IP address of the interface used for cloud-init
}

type OpenCHAMIInstanceInfo

type OpenCHAMIInstanceInfo struct {
	ID               string   `json:"id"`
	InstanceID       string   `json:"instance-id" yaml:"instance-id"`
	LocalHostname    string   `json:"local-hostname,omitempty" yaml:"local-hostname"`
	Hostname         string   `json:"hostname,omitempty" yaml:"hostname"`
	ClusterName      string   `json:"cluster-name,omitempty" yaml:"cluster-name"`
	Region           string   `json:"region,omitempty" yaml:"region"`
	AvailabilityZone string   `json:"availability-zone,omitempty" yaml:"availability-zone"`
	CloudProvider    string   `json:"cloud-provider,omitempty" yaml:"cloud-provider"`
	InstanceType     string   `json:"instance-type,omitempty" yaml:"instance-type"`
	CloudInitBaseURL string   `json:"cloud-init-base-url,omitempty" yaml:"cloud-init-base-url"`
	PublicKeys       []string `json:"public-keys,omitempty" yaml:"public-keys,omitempty"`
}

type Store

type Store interface {
	// groups API
	GetGroups() map[string]GroupData
	AddGroupData(groupName string, groupData GroupData) error
	GetGroupData(groupName string) (GroupData, error)
	UpdateGroupData(groupName string, groupData GroupData, create bool) error
	RemoveGroupData(groupName string) error
	// Extended Instance Information API
	GetInstanceInfo(nodeName string) (OpenCHAMIInstanceInfo, error)
	SetInstanceInfo(nodeName string, instanceInfo OpenCHAMIInstanceInfo) error
	DeleteInstanceInfo(nodeName string) error
	// Cluster Defaults
	GetClusterDefaults() (ClusterDefaults, error)
	SetClusterDefaults(clusterDefaults ClusterDefaults) error
}

ciStore is an interface for storing cloud-init entries

Jump to

Keyboard shortcuts

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