achim

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: GPL-3.0 Imports: 10 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)
        • handle cloud-init data
      • [ ] check (check-state) (handled by list)
      • deprotect
      • destroy
      • label (label-all-instances)
      • list (list-instances)
      • probe
      • protect
      • resize embiggen (resize-disk)
      • scale (scale-instance)
      • start
      • stop
      • type (list-instance-types)
    • group
      • create (create-group)
      • export-overview (export-group-overview)
      • export-inventory (export-inventory)
      • export-playbook (export-user-playbook)
      • file-from-text (TBD)
    • network
      • attach
      • create (create-network)
      • cleanup (cleanup-network)
      • flush (flush-networks)
      • list (list-network)
      • destroy (destroy-network)
    • scenario
      • create (create-scenario)
      • destroy (destroy-scenario)
      • export-overview (export-scenario-overview)
    • dns
      • flush
      • sync (sync-dns)
    • image
      • list (list-images)
  • other tasks
    • replace %v with %w everywhere for proper error wrapping
    • consider --verbose/-v (or --silent/-s?) flag for certain commands
      • alternative: --dry/-d run flag (what would happen if?)
      • instance create/destroy, start/stop, protect/deprotect, resize/scale

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 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 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 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 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

Types

type Label

type Label struct {
	Key   string
	Value string
}

func ParseLabels

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

type NewInstanceParams

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

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)

Directories

Path Synopsis
cmd
achim command

Jump to

Keyboard shortcuts

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