Documentation
¶
Overview ¶
Package install is the resource module for running install scripts and docker-compose stacks against a remote VM via the tenant node.
The SDK does not bundle service install scripts (the way vxcli does). Two flows are supported:
- Script: caller supplies a shell script as bytes; the node SCPs and executes it on the target VM. Suitable for any custom installer.
- Compose: caller supplies a docker-compose.yml; the node materializes it on the target VM and runs `docker compose up -d`.
Service-by-name (e.g. `vxcli install grafana`) is intentionally not exposed — that path requires the install scripts that ship inside the vxcli binary. Customers should either (a) supply the script themselves or (b) use docker-compose.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
T *transport.Transport
NodeURL string
AuthedUsername string // user from auth state (used as vault default)
}
Client is the install resource module facade.
type ComposeOpts ¶
type ComposeOpts struct {
SSH SSH
StackName string // unique workload name (lowercase, ^[a-z0-9][a-z0-9_-]{0,62}$)
Compose []byte // raw bytes of docker-compose.yml
EnvFile []byte // optional .env contents
// RegistrySlug references a workspace docker-registry credential
// stored in vault. Use this OR DockerUsername/DockerPassword.
RegistrySlug string
DockerUsername string
DockerPassword string
}
ComposeOpts describes a docker-compose-based install.
type Result ¶
type Result struct {
SessionID string `json:"session_id"`
Status string `json:"status,omitempty"`
Hostname string `json:"hostname,omitempty"`
ExitCode int `json:"exit_code,omitempty"`
ExecutionTime string `json:"execution_time,omitempty"`
Script string `json:"script,omitempty"`
StackName string `json:"stack_name,omitempty"`
Stdout string `json:"stdout,omitempty"`
Stderr string `json:"stderr,omitempty"`
}
Result is the response shape every install / deploy endpoint returns.
type SSH ¶
type SSH struct {
Host string // target VM IP or DNS name (required)
User string // SSH login user (typically "ubuntu") (required)
KeyPairName string // workspace vault key entry, e.g. "AWSPRODKEY1.PEM" (required)
// WorkspaceUser, if set, overrides the workspace owner used for vault
// path resolution (secret/workspaces/<org>/<user>/...). Useful when a
// keypair lives under a different user's workspace.
WorkspaceUser string
// Organization, if set, overrides the org segment of the vault path.
Organization string
}
SSH is the common SSH target shared by every install flow.
type ScriptOpts ¶
type ScriptOpts struct {
SSH SSH
ScriptName string // basename uploaded to remote /tmp; e.g. "bootstrap.sh"
Script []byte // raw bytes of the shell script
Args []string // appended to the script invocation
Env []string // KEY=value pairs exported before the script runs
}
ScriptOpts describes a custom-script install.