fix: Rename freeflowuniverse to incubaid
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
module cloudhypervisor
|
||||
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import freeflowuniverse.herolib.installers.virt.cloudhypervisor as cloudhypervisorinstaller
|
||||
import incubaid.herolib.ui.console
|
||||
import incubaid.herolib.installers.virt.cloudhypervisor as cloudhypervisorinstaller
|
||||
import os
|
||||
|
||||
@[heap]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module crun
|
||||
|
||||
import freeflowuniverse.herolib.core.texttools
|
||||
import incubaid.herolib.core.texttools
|
||||
|
||||
@[params]
|
||||
pub struct FactoryArgs {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module crun
|
||||
|
||||
import json
|
||||
import freeflowuniverse.herolib.core.pathlib
|
||||
import incubaid.herolib.core.pathlib
|
||||
|
||||
// Simple JSON generation using V's built-in json module
|
||||
pub fn (config CrunConfig) to_json() !string {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module docker
|
||||
|
||||
import freeflowuniverse.herolib.data.paramsparser { Params }
|
||||
import incubaid.herolib.data.paramsparser { Params }
|
||||
|
||||
@[params]
|
||||
pub struct BuildArgs {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
module docker
|
||||
|
||||
import freeflowuniverse.herolib.data.paramsparser { Params }
|
||||
import freeflowuniverse.herolib.core.texttools
|
||||
import freeflowuniverse.herolib.osal.core as osal { exec, file_write }
|
||||
import incubaid.herolib.data.paramsparser { Params }
|
||||
import incubaid.herolib.core.texttools
|
||||
import incubaid.herolib.osal.core as osal { exec, file_write }
|
||||
import os
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import incubaid.herolib.ui.console
|
||||
|
||||
@[heap]
|
||||
pub struct DockerComposeRecipe {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module docker
|
||||
|
||||
import v.embed_file
|
||||
import freeflowuniverse.herolib.data.paramsparser { Params }
|
||||
import incubaid.herolib.data.paramsparser { Params }
|
||||
|
||||
@[heap]
|
||||
pub struct ComposeService {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
module docker
|
||||
|
||||
import time
|
||||
import freeflowuniverse.herolib.osal.core as osal { exec }
|
||||
import freeflowuniverse.herolib.data.ipaddress { IPAddress }
|
||||
import freeflowuniverse.herolib.virt.utils
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import incubaid.herolib.osal.core as osal { exec }
|
||||
import incubaid.herolib.data.ipaddress { IPAddress }
|
||||
import incubaid.herolib.virt.utils
|
||||
import incubaid.herolib.ui.console
|
||||
|
||||
// pub enum DockerContainerStatus {
|
||||
// up
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module docker
|
||||
|
||||
import freeflowuniverse.herolib.osal.core as osal { exec }
|
||||
import freeflowuniverse.herolib.virt.utils
|
||||
import incubaid.herolib.osal.core as osal { exec }
|
||||
import incubaid.herolib.virt.utils
|
||||
|
||||
@[params]
|
||||
pub struct DockerContainerCreateArgs {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
module docker
|
||||
|
||||
import freeflowuniverse.herolib.osal.core as osal { exec }
|
||||
import freeflowuniverse.herolib.core.texttools
|
||||
import freeflowuniverse.herolib.virt.utils
|
||||
import freeflowuniverse.herolib.core
|
||||
import incubaid.herolib.osal.core as osal { exec }
|
||||
import incubaid.herolib.core.texttools
|
||||
import incubaid.herolib.virt.utils
|
||||
import incubaid.herolib.core
|
||||
import time
|
||||
|
||||
// import freeflowuniverse.herolib.installers.swarm
|
||||
// import incubaid.herolib.installers.swarm
|
||||
|
||||
// https://docs.docker.com/reference/
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
module docker
|
||||
|
||||
import time
|
||||
import freeflowuniverse.herolib.osal.core as osal { exec }
|
||||
import freeflowuniverse.herolib.virt.utils
|
||||
import incubaid.herolib.osal.core as osal { exec }
|
||||
import incubaid.herolib.virt.utils
|
||||
|
||||
@[heap]
|
||||
pub struct DockerImage {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
module docker
|
||||
|
||||
import freeflowuniverse.herolib.data.paramsparser { Params }
|
||||
import freeflowuniverse.herolib.core.texttools
|
||||
import freeflowuniverse.herolib.osal.core as osal { exec, file_write }
|
||||
import incubaid.herolib.data.paramsparser { Params }
|
||||
import incubaid.herolib.core.texttools
|
||||
import incubaid.herolib.osal.core as osal { exec, file_write }
|
||||
import crypto.md5
|
||||
import v.embed_file
|
||||
import os
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import incubaid.herolib.ui.console
|
||||
|
||||
// only 2 supported for now
|
||||
pub enum PlatformType {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module docker
|
||||
|
||||
import freeflowuniverse.herolib.osal.core as osal { file_read }
|
||||
import incubaid.herolib.osal.core as osal { file_read }
|
||||
|
||||
@[params]
|
||||
pub struct AddFileEmbeddedArgs {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
module docker
|
||||
|
||||
import freeflowuniverse.herolib.develop.gittools
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
// import freeflowuniverse.herolib.core.pathlib
|
||||
import incubaid.herolib.develop.gittools
|
||||
import incubaid.herolib.ui.console
|
||||
// import incubaid.herolib.core.pathlib
|
||||
|
||||
@[params]
|
||||
pub struct CodeGetArgs {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module docker
|
||||
|
||||
// import freeflowuniverse.herolib.develop.gittools
|
||||
// import freeflowuniverse.herolib.core.pathlib
|
||||
// import incubaid.herolib.develop.gittools
|
||||
// import incubaid.herolib.core.pathlib
|
||||
|
||||
@[params]
|
||||
pub struct RustBuildArgs {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module docker
|
||||
|
||||
import freeflowuniverse.herolib.core.pathlib
|
||||
import freeflowuniverse.herolib.osal.core as osal { download }
|
||||
import incubaid.herolib.core.pathlib
|
||||
import incubaid.herolib.osal.core as osal { download }
|
||||
|
||||
@[params]
|
||||
pub struct DownloadArgs {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module docker
|
||||
|
||||
// import freeflowuniverse.herolib.builder
|
||||
// import incubaid.herolib.builder
|
||||
|
||||
@[params]
|
||||
pub struct EntryPointArgs {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module docker
|
||||
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import incubaid.herolib.ui.console
|
||||
|
||||
@[params]
|
||||
pub struct PackageArgs {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module docker
|
||||
|
||||
import freeflowuniverse.herolib.core.texttools
|
||||
import incubaid.herolib.core.texttools
|
||||
|
||||
@[params]
|
||||
pub struct RunArgs {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module docker
|
||||
|
||||
// import freeflowuniverse.herolib.develop.gittools
|
||||
// import freeflowuniverse.herolib.core.pathlib
|
||||
// import incubaid.herolib.develop.gittools
|
||||
// import incubaid.herolib.core.pathlib
|
||||
|
||||
pub fn (mut r DockerBuilderRecipe) add_zinit() ! {
|
||||
mut pkg_manager := 'apk add'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module docker
|
||||
|
||||
import freeflowuniverse.herolib.core.texttools
|
||||
import freeflowuniverse.herolib.core.pathlib
|
||||
import incubaid.herolib.core.texttools
|
||||
import incubaid.herolib.core.pathlib
|
||||
|
||||
@[params]
|
||||
pub struct WriteFileArgs {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module docker
|
||||
|
||||
import freeflowuniverse.herolib.core.pathlib
|
||||
import freeflowuniverse.herolib.core.texttools
|
||||
import incubaid.herolib.core.pathlib
|
||||
import incubaid.herolib.core.texttools
|
||||
|
||||
pub struct ZinitItem {
|
||||
pub mut:
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
module docker
|
||||
|
||||
import freeflowuniverse.herolib.crypt.openssl
|
||||
import freeflowuniverse.herolib.core.httpconnection
|
||||
import freeflowuniverse.herolib.osal.core as osal
|
||||
import incubaid.herolib.crypt.openssl
|
||||
import incubaid.herolib.core.httpconnection
|
||||
import incubaid.herolib.osal.core as osal
|
||||
import os
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import incubaid.herolib.ui.console
|
||||
|
||||
@[heap]
|
||||
pub struct DockerRegistry {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module docker
|
||||
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import incubaid.herolib.ui.console
|
||||
|
||||
fn test_docker1() {
|
||||
// mut engine := engine_local([]) or { panic(err) }
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
module heropods
|
||||
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import freeflowuniverse.herolib.osal.tmux
|
||||
import freeflowuniverse.herolib.osal.core as osal
|
||||
import freeflowuniverse.herolib.virt.crun
|
||||
import incubaid.herolib.ui.console
|
||||
import incubaid.herolib.osal.tmux
|
||||
import incubaid.herolib.osal.core as osal
|
||||
import incubaid.herolib.virt.crun
|
||||
import time
|
||||
import freeflowuniverse.herolib.builder
|
||||
import incubaid.herolib.builder
|
||||
import json
|
||||
|
||||
@[heap]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
module heropods
|
||||
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import freeflowuniverse.herolib.osal.core as osal
|
||||
import freeflowuniverse.herolib.virt.crun
|
||||
import freeflowuniverse.herolib.installers.virt.herorunner as herorunner_installer
|
||||
import incubaid.herolib.ui.console
|
||||
import incubaid.herolib.osal.core as osal
|
||||
import incubaid.herolib.virt.crun
|
||||
import incubaid.herolib.installers.virt.herorunner as herorunner_installer
|
||||
import os
|
||||
|
||||
// Updated enum to be more flexible
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
module heropods
|
||||
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import freeflowuniverse.herolib.osal.core as osal
|
||||
import freeflowuniverse.herolib.core.pathlib
|
||||
import freeflowuniverse.herolib.core.texttools
|
||||
import incubaid.herolib.ui.console
|
||||
import incubaid.herolib.osal.core as osal
|
||||
import incubaid.herolib.core.pathlib
|
||||
import incubaid.herolib.core.texttools
|
||||
import os
|
||||
import json
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
module heropods
|
||||
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import freeflowuniverse.herolib.osal.core as osal
|
||||
import freeflowuniverse.herolib.virt.crun
|
||||
import incubaid.herolib.ui.console
|
||||
import incubaid.herolib.osal.core as osal
|
||||
import incubaid.herolib.virt.crun
|
||||
import os
|
||||
|
||||
@[heap]
|
||||
|
||||
@@ -28,7 +28,7 @@ lib/virt/herorun/
|
||||
### Basic Example
|
||||
|
||||
```v
|
||||
import freeflowuniverse.herolib.virt.herorun
|
||||
import incubaid.herolib.virt.herorun
|
||||
|
||||
// Create user with SSH key
|
||||
mut user := herorun.new_user(keyname: 'id_ed25519')!
|
||||
@@ -92,10 +92,10 @@ chmod +x examples/virt/herorun/herorun.vsh
|
||||
|
||||
## Dependencies
|
||||
|
||||
- `freeflowuniverse.herolib.osal.sshagent`
|
||||
- `freeflowuniverse.herolib.osal.tmux`
|
||||
- `freeflowuniverse.herolib.installers.web.hetznermanager`
|
||||
- `freeflowuniverse.herolib.ui.console`
|
||||
- `incubaid.herolib.osal.sshagent`
|
||||
- `incubaid.herolib.osal.tmux`
|
||||
- `incubaid.herolib.installers.web.hetznermanager`
|
||||
- `incubaid.herolib.ui.console`
|
||||
|
||||
## Future Enhancements
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module herorun2
|
||||
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import freeflowuniverse.herolib.osal.tmux
|
||||
import incubaid.herolib.ui.console
|
||||
import incubaid.herolib.osal.tmux
|
||||
import time
|
||||
|
||||
// Container struct and related functionality
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
module herorun2
|
||||
|
||||
import freeflowuniverse.herolib.osal.tmux
|
||||
import freeflowuniverse.herolib.osal.sshagent
|
||||
import freeflowuniverse.herolib.osal.core as osal
|
||||
import incubaid.herolib.osal.tmux
|
||||
import incubaid.herolib.osal.sshagent
|
||||
import incubaid.herolib.osal.core as osal
|
||||
import time
|
||||
import os
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module herorun2
|
||||
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import incubaid.herolib.ui.console
|
||||
|
||||
// Provider types
|
||||
pub enum Provider {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
module herorun2
|
||||
|
||||
import os
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import freeflowuniverse.herolib.osal.tmux
|
||||
import incubaid.herolib.ui.console
|
||||
import incubaid.herolib.osal.tmux
|
||||
|
||||
// HetznerBackend implements NodeBackend for Hetzner cloud servers
|
||||
pub struct HetznerBackend {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module herorun2
|
||||
|
||||
import freeflowuniverse.herolib.osal.core as osal
|
||||
import incubaid.herolib.osal.core as osal
|
||||
|
||||
// Package installer functions for herorun dependencies
|
||||
// Each function installs a specific package on the remote node
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module herorun2
|
||||
|
||||
import freeflowuniverse.herolib.osal.sshagent
|
||||
import incubaid.herolib.osal.sshagent
|
||||
|
||||
// Node-related structs and functionality
|
||||
pub struct NodeSettings {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module hetznermanager
|
||||
|
||||
import freeflowuniverse.herolib.core.texttools
|
||||
import incubaid.herolib.core.texttools
|
||||
|
||||
pub struct SSHKey {
|
||||
pub mut:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
module hetznermanager
|
||||
|
||||
import freeflowuniverse.herolib.core.base
|
||||
import freeflowuniverse.herolib.core.playbook { PlayBook }
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import incubaid.herolib.core.base
|
||||
import incubaid.herolib.core.playbook { PlayBook }
|
||||
import incubaid.herolib.ui.console
|
||||
import json
|
||||
|
||||
__global (
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
module hetznermanager
|
||||
|
||||
import freeflowuniverse.herolib.core.httpconnection
|
||||
import freeflowuniverse.herolib.data.encoderhero
|
||||
import freeflowuniverse.herolib.core.playbook
|
||||
import incubaid.herolib.core.httpconnection
|
||||
import incubaid.herolib.data.encoderhero
|
||||
import incubaid.herolib.core.playbook
|
||||
|
||||
pub const version = '0.0.0'
|
||||
const singleton = false
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// File: lib/virt/hetznermanager/play.v
|
||||
module hetznermanager
|
||||
|
||||
import freeflowuniverse.herolib.core.playbook { PlayBook }
|
||||
import incubaid.herolib.core.playbook { PlayBook }
|
||||
|
||||
// play processes playbook actions for the hetznermanager module.
|
||||
// It allows configuring and managing Hetzner servers through heroscript.
|
||||
|
||||
@@ -8,11 +8,11 @@ Before using the module, you need to configure at least one client instance with
|
||||
|
||||
```hs
|
||||
!!hetznermanager.configure
|
||||
name:"main"
|
||||
user:"<your_robot_username>"
|
||||
password:"${HETZNER_PASSWORD}"
|
||||
whitelist:"2111181, 2392178" // Optional: comma-separated list of server IDs to operate on
|
||||
sshkey: "name of sshkey as used with hetzner"
|
||||
name:"main"
|
||||
user:"<your_robot_username>"
|
||||
password:"${HETZNER_PASSWORD}"
|
||||
whitelist:"2111181, 2392178" // Optional: comma-separated list of server IDs to operate on
|
||||
sshkey: "name of sshkey as used with hetzner"
|
||||
```
|
||||
|
||||
## 2. Usage
|
||||
@@ -24,6 +24,7 @@ You can interact with the Hetzner module in two ways: via HeroScript for automat
|
||||
HeroScript provides a simple, declarative way to execute server operations. You can run a script containing these actions using `playcmds.run()`.
|
||||
|
||||
**Example Script:**
|
||||
|
||||
```hs
|
||||
|
||||
# Place a server into rescue mode
|
||||
@@ -53,40 +54,39 @@ HeroScript provides a simple, declarative way to execute server operations. You
|
||||
data: 'ssh-rsa AAAA...'
|
||||
```
|
||||
|
||||
#### Available Heroscript Actions:
|
||||
|
||||
* `!!hetznermanager.configure`: Configures a new client instance.
|
||||
* `name` (string): A unique name for this configuration.
|
||||
* `user` (string): Hetzner Robot username.
|
||||
* `password` (string): Hetzner Robot password.
|
||||
* `whitelist` (string, optional): Comma-separated list of server IDs to restrict operations to.
|
||||
* `sshkey` (string, optional): Default public SSH key to deploy in rescue mode.
|
||||
* `!!hetznermanager.server_rescue`: Activates the rescue system.
|
||||
* `instance` (string, optional): The client instance to use (defaults to 'default').
|
||||
* `server_name` or `id` (string/int): Identifies the target server.
|
||||
* `wait` (bool, optional): Wait for the server to reboot into rescue (default: `true`).
|
||||
* `hero_install` (bool, optional): Install Herolib in the rescue system (default: `false`).
|
||||
* `reset` (bool, optional): Force activation even if already in rescue mode (default: `false`).
|
||||
* `!!hetznermanager.ubuntu_install`: Performs a fresh installation of Ubuntu 24.04.
|
||||
* `instance` (string, optional): The client instance to use (defaults to 'default').
|
||||
* `server_name` or `id` (string/int): Identifies the target server.
|
||||
* `wait` (bool, optional): Wait for the installation and reboot to complete (default: `true`).
|
||||
* `hero_install` (bool, optional): Install Herolib on the newly installed system (default: `false`).
|
||||
* `!!hetznermanager.server_reset`: Triggers a hardware reset.
|
||||
* All parameters are the same as `server_rescue`, except for `hero_install` and `reset`.
|
||||
* `!!hetznermanager.key_create` / `key_delete`: Manages SSH keys in your account.
|
||||
* `instance` (string, optional): The client instance to use.
|
||||
* `key_name` (string): The name of the key.
|
||||
* `data` (string, for create): The public key data.
|
||||
#### Available Heroscript Actions
|
||||
|
||||
* `!!hetznermanager.configure`: Configures a new client instance.
|
||||
* `name` (string): A unique name for this configuration.
|
||||
* `user` (string): Hetzner Robot username.
|
||||
* `password` (string): Hetzner Robot password.
|
||||
* `whitelist` (string, optional): Comma-separated list of server IDs to restrict operations to.
|
||||
* `sshkey` (string, optional): Default public SSH key to deploy in rescue mode.
|
||||
* `!!hetznermanager.server_rescue`: Activates the rescue system.
|
||||
* `instance` (string, optional): The client instance to use (defaults to 'default').
|
||||
* `server_name` or `id` (string/int): Identifies the target server.
|
||||
* `wait` (bool, optional): Wait for the server to reboot into rescue (default: `true`).
|
||||
* `hero_install` (bool, optional): Install Herolib in the rescue system (default: `false`).
|
||||
* `reset` (bool, optional): Force activation even if already in rescue mode (default: `false`).
|
||||
* `!!hetznermanager.ubuntu_install`: Performs a fresh installation of Ubuntu 24.04.
|
||||
* `instance` (string, optional): The client instance to use (defaults to 'default').
|
||||
* `server_name` or `id` (string/int): Identifies the target server.
|
||||
* `wait` (bool, optional): Wait for the installation and reboot to complete (default: `true`).
|
||||
* `hero_install` (bool, optional): Install Herolib on the newly installed system (default: `false`).
|
||||
* `!!hetznermanager.server_reset`: Triggers a hardware reset.
|
||||
* All parameters are the same as `server_rescue`, except for `hero_install` and `reset`.
|
||||
* `!!hetznermanager.key_create` / `key_delete`: Manages SSH keys in your account.
|
||||
* `instance` (string, optional): The client instance to use.
|
||||
* `key_name` (string): The name of the key.
|
||||
* `data` (string, for create): The public key data.
|
||||
|
||||
### 2.2. V Language Usage
|
||||
|
||||
For more granular control, you can call the module functions directly from your V code.
|
||||
|
||||
```v
|
||||
import freeflowuniverse.herolib.virt.hetznermanager
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import incubaid.herolib.virt.hetznermanager
|
||||
import incubaid.herolib.ui.console
|
||||
|
||||
// Get a configured client instance by the name you provided during configuration
|
||||
mut cl := hetznermanager.get(name: 'main')!
|
||||
@@ -114,19 +114,19 @@ println('Server has been reset.')
|
||||
|
||||
## Features
|
||||
|
||||
- Server listing and information retrieval
|
||||
- Hardware reset functionality
|
||||
- Rescue mode management with optional Herolib installation
|
||||
- Automated Ubuntu 24.04 installation
|
||||
- SSH key management
|
||||
- Automatic server status monitoring during long operations
|
||||
- Built-in caching for API responses to reduce rate-limiting
|
||||
- Integration with Herolib installation tools
|
||||
* Server listing and information retrieval
|
||||
* Hardware reset functionality
|
||||
* Rescue mode management with optional Herolib installation
|
||||
* Automated Ubuntu 24.04 installation
|
||||
* SSH key management
|
||||
* Automatic server status monitoring during long operations
|
||||
* Built-in caching for API responses to reduce rate-limiting
|
||||
* Integration with Herolib installation tools
|
||||
|
||||
## Notes
|
||||
|
||||
- The module uses Redis for caching API responses (default 60-second cache duration).
|
||||
- Server operations that include `wait: true` will monitor the server until the operation completes, providing feedback on the process.
|
||||
- Reset operations with `wait: true` will timeout after 2 minutes if the server doesn't respond to SSH.
|
||||
- The module automatically manages `ssh-keygen -R` to remove old host keys during reboots and reinstalls.
|
||||
- The official API documentation can be found at [https://robot.hetzner.com/doc/webservice/en.html#preface](https://robot.hetzner.com/doc/webservice/en.html#preface).
|
||||
* The module uses Redis for caching API responses (default 60-second cache duration).
|
||||
* Server operations that include `wait: true` will monitor the server until the operation completes, providing feedback on the process.
|
||||
* Reset operations with `wait: true` will timeout after 2 minutes if the server doesn't respond to SSH.
|
||||
* The module automatically manages `ssh-keygen -R` to remove old host keys during reboots and reinstalls.
|
||||
* The official API documentation can be found at [https://robot.hetzner.com/doc/webservice/en.html#preface](https://robot.hetzner.com/doc/webservice/en.html#preface).
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
module hetznermanager
|
||||
|
||||
import freeflowuniverse.herolib.core.texttools
|
||||
import incubaid.herolib.core.texttools
|
||||
import time
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import freeflowuniverse.herolib.osal.core as osal
|
||||
import freeflowuniverse.herolib.builder
|
||||
import incubaid.herolib.ui.console
|
||||
import incubaid.herolib.osal.core as osal
|
||||
import incubaid.herolib.builder
|
||||
import os
|
||||
|
||||
// ///////////////////////////RESCUE
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
module hetznermanager
|
||||
|
||||
import freeflowuniverse.herolib.core.texttools
|
||||
import incubaid.herolib.core.texttools
|
||||
import time
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import freeflowuniverse.herolib.osal.core as osal
|
||||
import freeflowuniverse.herolib.builder
|
||||
import incubaid.herolib.ui.console
|
||||
import incubaid.herolib.osal.core as osal
|
||||
import incubaid.herolib.builder
|
||||
|
||||
// /////////////////////////////////////RESET
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
module hetznermanager
|
||||
|
||||
import freeflowuniverse.herolib.core.texttools
|
||||
import incubaid.herolib.core.texttools
|
||||
import time
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import freeflowuniverse.herolib.osal.core as osal
|
||||
import freeflowuniverse.herolib.builder
|
||||
import incubaid.herolib.ui.console
|
||||
import incubaid.herolib.osal.core as osal
|
||||
import incubaid.herolib.builder
|
||||
|
||||
/////////////////////////// LIST
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module lima
|
||||
|
||||
import freeflowuniverse.herolib.installers.virt.lima
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import incubaid.herolib.installers.virt.lima
|
||||
import incubaid.herolib.ui.console
|
||||
import virt.lima.raw
|
||||
import os
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ module raw
|
||||
|
||||
import os
|
||||
import json
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import incubaid.herolib.ui.console
|
||||
|
||||
pub fn list() ![]VM {
|
||||
// console.print_debug(" - list vm")
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
module lima
|
||||
|
||||
import os
|
||||
import freeflowuniverse.herolib.builder
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import incubaid.herolib.builder
|
||||
import incubaid.herolib.ui.console
|
||||
|
||||
@[heap]
|
||||
pub struct VM {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
module lima
|
||||
|
||||
import os
|
||||
import freeflowuniverse.herolib.core.pathlib
|
||||
// import freeflowuniverse.herolib.core.texttools
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import freeflowuniverse.herolib.osal.core as osal
|
||||
import incubaid.herolib.core.pathlib
|
||||
// import incubaid.herolib.core.texttools
|
||||
import incubaid.herolib.ui.console
|
||||
import incubaid.herolib.osal.core as osal
|
||||
|
||||
@[params]
|
||||
pub struct VMNewArgs {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
module podman
|
||||
|
||||
import time
|
||||
import freeflowuniverse.herolib.osal.core as osal { exec }
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import incubaid.herolib.osal.core as osal { exec }
|
||||
import incubaid.herolib.ui.console
|
||||
import json
|
||||
|
||||
// BuildError represents errors that occur during build operations
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
module podman
|
||||
|
||||
import time
|
||||
import freeflowuniverse.herolib.osal.core as osal { exec }
|
||||
import freeflowuniverse.herolib.data.ipaddress { IPAddress }
|
||||
import freeflowuniverse.herolib.core.texttools
|
||||
import incubaid.herolib.osal.core as osal { exec }
|
||||
import incubaid.herolib.data.ipaddress { IPAddress }
|
||||
import incubaid.herolib.core.texttools
|
||||
|
||||
// PodmanContainer represents a podman container with structured data from CLI JSON output
|
||||
pub struct PodmanContainer {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
module herocontainers
|
||||
|
||||
import freeflowuniverse.herolib.osal.core as osal { exec }
|
||||
import freeflowuniverse.herolib.core
|
||||
import freeflowuniverse.herolib.installers.virt.podman as podman_installer
|
||||
import incubaid.herolib.osal.core as osal { exec }
|
||||
import incubaid.herolib.core
|
||||
import incubaid.herolib.installers.virt.podman as podman_installer
|
||||
|
||||
@[heap]
|
||||
pub struct PodmanFactory {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
module podman
|
||||
|
||||
import freeflowuniverse.herolib.osal.core as osal { exec }
|
||||
import incubaid.herolib.osal.core as osal { exec }
|
||||
import time
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import incubaid.herolib.ui.console
|
||||
|
||||
// PodmanImage represents a podman image with structured data from CLI JSON output
|
||||
pub struct PodmanImage {
|
||||
|
||||
@@ -39,7 +39,7 @@ This module provides **two complementary APIs** for Podman functionality:
|
||||
For simple container operations, use the direct functions:
|
||||
|
||||
```v
|
||||
import freeflowuniverse.herolib.virt.podman
|
||||
import incubaid.herolib.virt.podman
|
||||
|
||||
// List containers and images
|
||||
containers := podman.list_containers(true)! // true = include stopped
|
||||
@@ -66,7 +66,7 @@ podman.remove_image('nginx:latest', force: false)!
|
||||
For complex operations and state management, use the factory pattern:
|
||||
|
||||
```v
|
||||
import freeflowuniverse.herolib.virt.podman
|
||||
import incubaid.herolib.virt.podman
|
||||
|
||||
// Create factory (with auto-install)
|
||||
mut factory := podman.new(install: true, herocompile: false)!
|
||||
@@ -274,7 +274,7 @@ builder.run('invalid_command') or {
|
||||
## Installation and Setup
|
||||
|
||||
```v
|
||||
import freeflowuniverse.herolib.virt.podman
|
||||
import incubaid.herolib.virt.podman
|
||||
|
||||
// Automatic installation
|
||||
mut factory := podman.new(install: true)! // Will install podman if needed
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module qemu
|
||||
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import freeflowuniverse.herolib.installers.virt.qemu as qemuinstaller
|
||||
import incubaid.herolib.ui.console
|
||||
import incubaid.herolib.installers.virt.qemu as qemuinstaller
|
||||
import virt.qemu.raw
|
||||
import os
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
module qemu
|
||||
|
||||
import os
|
||||
import freeflowuniverse.herolib.builder
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import incubaid.herolib.builder
|
||||
import incubaid.herolib.ui.console
|
||||
|
||||
@[heap]
|
||||
pub struct VM {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
module qemu
|
||||
|
||||
import os
|
||||
import freeflowuniverse.herolib.core.pathlib
|
||||
// import freeflowuniverse.herolib.core.texttools
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import freeflowuniverse.herolib.osal.core as osal
|
||||
import incubaid.herolib.core.pathlib
|
||||
// import incubaid.herolib.core.texttools
|
||||
import incubaid.herolib.ui.console
|
||||
import incubaid.herolib.osal.core as osal
|
||||
|
||||
@[params]
|
||||
pub struct VMNewArgs {
|
||||
|
||||
Reference in New Issue
Block a user