achim

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: GPL-3.0 Imports: 19 Imported by: 0

README

achim

Advanced Cloud Hyperscaling Infrastructure Manager (reimplementation in Go) using the urfave/cli and Egoscale libraries.

Status

This Go implementation is a port from the Python implementation

  • command structure (and existing achim command, if different)
    • tenant
      • add ([new])
      • default ([new])
      • remove ([new])
    • instance
      • create (create-instance)
      • deprotect
      • destroy
      • inventory (export-inventory)
      • label (label-all-instances)
      • list (list-instances)
      • overview (export-group-overview)
      • probe
        • TODO: extend to domain probing once DNS is implemented
      • protect
      • resize embiggen (resize-disk)
      • scale (scale-instance)
      • start
      • stop
      • type (list-instance-types)
    • group
      • create (create-group)
      • file-from-text
      • playbook (export-user-playbook)
    • dns
      • flush
      • sync (sync-dns)
    • network (2nd priority)
      • attach
      • create (create-network)
      • cleanup (cleanup-network)
      • flush (flush-networks)
      • list (list-network)
      • destroy (destroy-network)
    • scenario (3rd priority)
      • create (create-scenario)
      • destroy (destroy-scenario)
      • export-overview (export-scenario-overview)
    • image
      • list (list-images)
  • other tasks
    • add useful output to commands, especially ones involving --by selection

Documentation

Index

Constants

View Source
const ConfigFilePerm = 0600

Variables

This section is empty.

Functions

func AddTenant

func AddTenant(tenant Tenant, path string) error

func AsMap

func AsMap(labels []Label) map[string]string

func CreateGroup added in v0.0.2

func CreateGroup(ctx context.Context, params NewGroupParams) error

func CreateInstance

func CreateInstance(ctx context.Context, params NewInstanceParams) error

func DeprotectInstances

func DeprotectInstances(ctx context.Context, by string) error

func DestroyInstances

func DestroyInstances(ctx context.Context, by string) error

func EmbiggenDisk

func EmbiggenDisk(ctx context.Context, by string, gb int64) error

func ExportInventory added in v0.0.3

func ExportInventory(ctx context.Context, file, by string) error

func ExportPlaybook added in v0.0.3

func ExportPlaybook(ctx context.Context, groupfile, playbookPath string) error

func FlushRecords added in v0.0.3

func FlushRecords(ctx context.Context, domain string) error

func FormatInstance

func FormatInstance(instance v3.Instance) string

func GetInstanceTypeBySize

func GetInstanceTypeBySize(ctx context.Context, size string) (*v3.InstanceType, error)

func GetSSHKeyByName

func GetSSHKeyByName(ctx context.Context, name string) (*v3.SSHKey, error)

func GetTemplateByName

func GetTemplateByName(ctx context.Context, name string) (*v3.Template, error)

func GroupFileFromText added in v0.0.2

func GroupFileFromText(inputPath, outputPath string) error

func LabelInstances

func LabelInstances(ctx context.Context, label, value, by string) error

func ListImages

func ListImages(ctx context.Context, contains string) ([]string, error)

func ListInstanceTypes

func ListInstanceTypes(ctx context.Context, family string) ([]v3.InstanceType, error)

func ListInstances

func ListInstances(ctx context.Context, by string) ([]v3.Instance, error)

func MergeMaps added in v0.0.2

func MergeMaps[K, V comparable](l, r map[K]V) map[K]V

func Overview added in v0.0.2

func Overview(ctx context.Context, by, file string) error

func ProbeInstances

func ProbeInstances(ctx context.Context, by, suffix string, secure bool) error

func ProtectInstances

func ProtectInstances(ctx context.Context, by string) error

func RemoveTenant

func RemoveTenant(name, path string) error

func ScaleInstances

func ScaleInstances(ctx context.Context, by string, size string) error

func SetDefaultTenant

func SetDefaultTenant(name, path string) error

func StartInstances

func StartInstances(ctx context.Context, by string) error

func StopInstances

func StopInstances(ctx context.Context, by string) error

func SyncRecords added in v0.0.3

func SyncRecords(ctx context.Context, domain string) error

Types

type DNSEntry added in v0.0.3

type DNSEntry struct {
	Name    string
	Content string
}

type Group added in v0.0.2

type Group struct {
	Name  string `yaml:"name"`
	Users []User `yaml:"users"`
}

func ParseGroupFile added in v0.0.2

func ParseGroupFile(yamlPath string) (*Group, error)

type InstanceGroup added in v0.0.2

type InstanceGroup struct {
	Names         []string
	Key           *v3.SSHKey
	Autostart     bool
	Template      *v3.Template
	InstanceType  *v3.InstanceType
	DiskSizeGB    int64
	Labels        []Label
	CloudInitData map[string]string
}

func (*InstanceGroup) Create added in v0.0.2

func (p *InstanceGroup) Create(ctx context.Context) error

type Label

type Label struct {
	Key   string
	Value string
}

func ParseLabels

func ParseLabels(raw string) ([]Label, error)

type NewGroupParams added in v0.0.2

type NewGroupParams struct {
	GroupFile string
	Key       string
	Autostart bool
	Image     string
	Size      string
	Labels    string
	CloudInit string
}

type NewInstanceGroupParam added in v0.0.3

type NewInstanceGroupParam struct {
	Names     map[string]User
	Key       string
	Autostart bool
	Image     string
	Size      string
	Labels    string
	CloudInit string
}

func (*NewInstanceGroupParam) Compile added in v0.0.3

type NewInstanceParams

type NewInstanceParams struct {
	Name      string
	Key       string
	Autostart bool
	Image     string
	Size      string
	Labels    string
	CloudInit string
}

type Play added in v0.0.3

type Play struct {
	Become bool   `yaml:"become"`
	Hosts  string `yaml:"hosts"`
	Name   string `yaml:"name"`
	Tasks  []Task `yaml:"tasks"`
}

type Task added in v0.0.3

type Task struct {
	Name          string            `yaml:"name"`
	User          TaskUser          `yaml:"user,omitempty"`
	AuthorizedKey TaskAuthorizedKey `yaml:"authorized_key,omitempty"`
}

type TaskAuthorizedKey added in v0.0.3

type TaskAuthorizedKey struct {
	Key  string `yaml:"key"`
	User string `yaml:"user"`
}

type TaskUser added in v0.0.3

type TaskUser struct {
	Append     bool     `yaml:"append"`
	CreateHome bool     `yaml:"create_home"`
	Groups     []string `yaml:"groups"`
	Home       string   `yaml:"home"`
	Name       string   `yaml:"name"`
	Password   string   `yaml:"password"`
	Shell      string   `yaml:"shell"`
}

type Tenant

type Tenant struct {
	Name   string `json:"name"`
	Key    string `json:"key"`
	Secret string `json:"secret"`
	Zone   string `json:"zone"`
}

func GetDefaultTenant

func GetDefaultTenant(path string) (*Tenant, error)

func GetTenant

func GetTenant(name, path string) (*Tenant, error)

func (Tenant) Client

func (t Tenant) Client() (*v3.Client, error)

func (Tenant) IsNonEmpty

func (t Tenant) IsNonEmpty() bool

type TenantFile

type TenantFile struct {
	Default string            `json:"default"`
	Tenants map[string]Tenant `json:"tenants"`
}

func ReadTenants

func ReadTenants(path string) (*TenantFile, error)

type User added in v0.0.2

type User struct {
	Email  string `yaml:"email"`
	Name   string `yaml:"name"`
	SSHKey string `yaml:"ssh-key"`
}

Directories

Path Synopsis
cmd
achim command

Jump to

Keyboard shortcuts

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