diff --git a/.gitignore b/.gitignore
index 62791f6..01829f4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@ config.toml
# Ignore database files
*.db
+*.db-journal
# Ignore dependency directories and lock files
node_modules
diff --git a/README.md b/README.md
index 29cf29c..6c797d8 100644
--- a/README.md
+++ b/README.md
@@ -12,6 +12,9 @@ This project modernizes the original [proxmox KOTH](https://github.com/UNHCSC/pr
- Go 1.20+ (or later) for the server binaries.
- Node.js 20+ / npm for building the dashboard assets.
- A valid `config.toml` next to the repository root to describe the database, Proxmox, and LDAP settings.
+- A service user on your Proxmox cluster set up with `VM.Audit, VM.Console` permissions on Proxmox. (You can create a custom role with these permissions and assign only that role to the service user for better security.)
+- Container setup and scoring are performed via the Proxmox console (raw exec), not SSH. If your setup scripts rely on SSH access, be sure to install and enable an OpenSSH server inside the container.
+- Some container templates do not ship an SSH server; add `openssh-server` (or your distro equivalent) in your setup scripts if you require SSH.
## Installation
diff --git a/app/api.go b/app/api.go
index 93ad40c..f2bff80 100644
--- a/app/api.go
+++ b/app/api.go
@@ -403,6 +403,10 @@ func apiCreateCompetition(c *fiber.Ctx) (err error) {
compReq.EnableAdvancedLogging = enableAdvancedLogging
ctx.logf("advanced logging: %t", enableAdvancedLogging)
+ if err = validateCompetitionTemplates(&compReq); err != nil {
+ return ctx.fail(c, fiber.StatusBadRequest, "invalid container configuration", err)
+ }
+
var packageRecord *db.CompetitionPackage
if packageRecord, err = persistCompetitionPackage(&compReq, configData, fHeader.Filename); err != nil {
return ctx.fail(c, fiber.StatusInternalServerError, "failed to store competition package", err)
@@ -1490,6 +1494,82 @@ func persistCompetitionPackage(req *db.CreateCompetitionRequest, configBytes []b
return record, nil
}
+func validateCompetitionTemplates(req *db.CreateCompetitionRequest) error {
+ if req == nil {
+ return fmt.Errorf("competition request is nil")
+ }
+
+ var lookup map[string]db.ContainerSpecTemplate
+ var err error
+ if lookup, err = koth.BuildContainerSpecTemplateIndex(req.ContainerSpecsTemplates); err != nil {
+ return err
+ }
+ req.TemplateLookup = lookup
+
+ restrictions := config.Config.ContainerRestrictions
+ for name, spec := range lookup {
+ if strings.TrimSpace(spec.TemplatePath) == "" {
+ return fmt.Errorf("template %q missing templatePath", name)
+ }
+ if strings.TrimSpace(spec.StoragePool) == "" {
+ return fmt.Errorf("template %q missing storagePool", name)
+ }
+ if strings.TrimSpace(spec.RootPassword) == "" {
+ return fmt.Errorf("template %q missing rootPassword", name)
+ }
+ if spec.StorageSizeGB <= 0 {
+ return fmt.Errorf("template %q invalid storageSizeGB (%d)", name, spec.StorageSizeGB)
+ }
+ if spec.MemoryMB <= 0 {
+ return fmt.Errorf("template %q invalid memoryMB (%d)", name, spec.MemoryMB)
+ }
+ if spec.Cores <= 0 {
+ return fmt.Errorf("template %q invalid cores (%d)", name, spec.Cores)
+ }
+
+ if len(restrictions.AllowedLXCTemplates) > 0 && !containsString(restrictions.AllowedLXCTemplates, spec.TemplatePath) {
+ return fmt.Errorf("template %q uses disallowed template path %q", name, spec.TemplatePath)
+ }
+ if len(restrictions.AllowedStoragePools) > 0 && !containsString(restrictions.AllowedStoragePools, spec.StoragePool) {
+ return fmt.Errorf("template %q uses disallowed storage pool %q", name, spec.StoragePool)
+ }
+
+ if restrictions.MaxDiskMB > 0 {
+ storageMB := int64(spec.StorageSizeGB) * 1024
+ if storageMB > int64(restrictions.MaxDiskMB) {
+ return fmt.Errorf("template %q requests %d MB which exceeds maxDiskMB (%d)", name, storageMB, restrictions.MaxDiskMB)
+ }
+ }
+ if restrictions.MaxMemoryMB > 0 && spec.MemoryMB > restrictions.MaxMemoryMB {
+ return fmt.Errorf("template %q requests %d MB of RAM which exceeds maxMemoryMB (%d)", name, spec.MemoryMB, restrictions.MaxMemoryMB)
+ }
+ if restrictions.MaxCPUCores > 0 && spec.Cores > restrictions.MaxCPUCores {
+ return fmt.Errorf("template %q requests %d cores which exceeds maxCPUCores (%d)", name, spec.Cores, restrictions.MaxCPUCores)
+ }
+ }
+
+ for _, cfg := range req.TeamContainerConfigs {
+ if strings.TrimSpace(cfg.ContainerSpecsTemplate) == "" {
+ return fmt.Errorf("team container %s missing containerSpecsTemplate", cfg.Name)
+ }
+ if _, err = koth.ResolveContainerSpecTemplate(lookup, cfg.ContainerSpecsTemplate); err != nil {
+ return fmt.Errorf("team container %s references invalid template %q: %w", cfg.Name, cfg.ContainerSpecsTemplate, err)
+ }
+ }
+
+ return nil
+}
+
+func containsString(list []string, value string) bool {
+ value = strings.TrimSpace(value)
+ for _, entry := range list {
+ if strings.EqualFold(strings.TrimSpace(entry), value) {
+ return true
+ }
+ }
+ return false
+}
+
func sanitizeIdentifier(value string) string {
var cleanValue = strings.ToLower(strings.TrimSpace(value))
if cleanValue == "" {
diff --git a/app/views.go b/app/views.go
index e770d50..7ed290a 100644
--- a/app/views.go
+++ b/app/views.go
@@ -2,8 +2,10 @@ package app
import (
"github.com/UNHCSC/pve-koth/auth"
+ "github.com/UNHCSC/pve-koth/config"
"github.com/UNHCSC/pve-koth/db"
"github.com/gofiber/fiber/v2"
+ "strings"
)
func showLanding(c *fiber.Ctx) (err error) {
@@ -98,14 +100,85 @@ func showDashboard(c *fiber.Ctx) (err error) {
displayName = "Guest"
}
+ comps, compsErr := db.Competitions.SelectAll()
+ if compsErr != nil {
+ appLog.Errorf("failed to load competitions for dashboard resources: %v\n", compsErr)
+ comps = nil
+ }
+
return c.Render("dashboard", bindWithLocals(c, fiber.Map{
- "Title": "Dashboard",
- "User": displayName,
- "LoggedIn": user != nil,
- "CanManage": canManage,
+ "Title": "Dashboard",
+ "User": displayName,
+ "LoggedIn": user != nil,
+ "CanManage": canManage,
+ "ResourceInfo": fiber.Map{"Restrictions": config.Config.ContainerRestrictions, "Network": buildNetworkResourceStats(comps)},
}), "layout")
}
+func buildNetworkResourceStats(comps []*db.Competition) fiber.Map {
+ network := config.Config.Network
+ info := fiber.Map{
+ "PoolCIDR": network.PoolCIDR,
+ "CompetitionPrefix": network.CompetitionSubnetPrefix,
+ "TeamPrefix": network.TeamSubnetPrefix,
+ "ContainerCIDR": network.ContainerCIDR,
+ "Gateway": network.ContainerGateway,
+ "Nameserver": network.ContainerNameserver,
+ "SearchDomain": network.ContainerSearchDomain,
+ "TotalSubnets": 0,
+ "UsedSubnets": 0,
+ "FreeSubnets": 0,
+ "UsagePercent": 0.0,
+ }
+
+ pool := network.ParsedPool()
+ if pool == nil {
+ return info
+ }
+
+ maskOnes, _ := pool.Mask.Size()
+ diff := network.CompetitionSubnetPrefix - maskOnes
+ total := 0
+ if diff >= 0 && diff < 63 {
+ total = 1 << diff
+ }
+
+ seen := map[string]struct{}{}
+ for _, comp := range comps {
+ if comp == nil {
+ continue
+ }
+ cidr := strings.TrimSpace(comp.NetworkCIDR)
+ if cidr == "" {
+ continue
+ }
+ if _, ok := seen[cidr]; ok {
+ continue
+ }
+ seen[cidr] = struct{}{}
+ }
+
+ used := len(seen)
+ free := total - used
+ if free < 0 {
+ free = 0
+ }
+
+ usage := 0.0
+ if total > 0 {
+ usage = (float64(used) / float64(total)) * 100
+ if usage > 100 {
+ usage = 100
+ }
+ }
+
+ info["TotalSubnets"] = total
+ info["UsedSubnets"] = used
+ info["FreeSubnets"] = free
+ info["UsagePercent"] = usage
+ return info
+}
+
func showUnauthorized(c *fiber.Ctx) error {
var user *auth.AuthUser = auth.IsAuthenticated(c, jwtSigningKey)
diff --git a/config/config.go b/config/config.go
index cbe8902..ce266a5 100644
--- a/config/config.go
+++ b/config/config.go
@@ -41,6 +41,8 @@ type Configuration struct {
Port string `toml:"port" default:"8006" validate:"required"` // Proxmox VE API port (usually "8006")
TokenID string `toml:"token_id" default:"" validate:"required"` // Proxmox VE API token ID (e.g. "laas-api-token-id")
Secret string `toml:"secret" default:"" validate:"required"` // Proxmox VE API token secret
+ Username string `toml:"username" default:""` // Proxmox VE username (with realm) for ticket-based console auth, e.g. "root@pam"
+ Password string `toml:"password" default:""` // Proxmox VE password for ticket-based console auth
Testing struct {
Enabled bool `toml:"enabled" default:"false"` // Enable Proxmox VE integration testing mode
SubnetCIDR string `toml:"subnet_cidr" default:"10.255.0.0/16"` // Subnet CIDR to use for testing VMs
@@ -56,7 +58,8 @@ type Configuration struct {
BasePath string `toml:"base_path" default:"./koth_live_data" validate:"required"` // Root directory where uploaded competition packages are stored
} `toml:"storage"`
- Network NetworkConfig `toml:"network"`
+ Network NetworkConfig `toml:"network"`
+ ContainerRestrictions ContainerRestrictionsConfig `toml:"container_restrictions"`
}
var Config Configuration
@@ -66,10 +69,21 @@ type NetworkConfig struct {
CompetitionSubnetPrefix int `toml:"competition_subnet_prefix" default:"16" validate:"min=8,max=30"`
TeamSubnetPrefix int `toml:"team_subnet_prefix" default:"24" validate:"min=8,max=30"`
ContainerCIDR int `toml:"container_cidr" default:"8" validate:"min=1,max=30"`
+ ContainerGateway string `toml:"container_gateway" default:"10.0.0.1" validate:"required,ipv4"`
+ ContainerNameserver string `toml:"container_nameserver" default:"10.0.0.2" validate:"required,ipv4"`
+ ContainerSearchDomain string `toml:"container_search_domain" default:"cyber.lab" validate:"required"`
parsedPool *net.IPNet `toml:"-"`
}
+type ContainerRestrictionsConfig struct {
+ AllowedLXCTemplates []string `toml:"allowed_lxc_templates" default:"[]"`
+ AllowedStoragePools []string `toml:"allowed_storage_pools" default:"[]"`
+ MaxCPUCores int `toml:"max_cpu_cores" default:"4" validate:"min=1"`
+ MaxMemoryMB int `toml:"max_memory_mb" default:"8192" validate:"min=1"`
+ MaxDiskMB int `toml:"max_disk_mb" default:"32768" validate:"min=1"`
+}
+
func (n *NetworkConfig) initialize() error {
if n == nil {
return fmt.Errorf("network configuration missing")
diff --git a/db/types.go b/db/types.go
index a4f388e..08a396b 100644
--- a/db/types.go
+++ b/db/types.go
@@ -165,12 +165,22 @@ type ScoringCheck struct {
FailPoints int `json:"failPoints"`
}
+type ContainerSpecTemplate struct {
+ TemplatePath string `json:"templatePath"`
+ StoragePool string `json:"storagePool"`
+ RootPassword string `json:"rootPassword"`
+ StorageSizeGB int `json:"storageSizeGB"`
+ MemoryMB int `json:"memoryMB"`
+ Cores int `json:"cores"`
+}
+
type TeamContainerConfig struct {
- Name string `json:"name"`
- LastOctetValue int `json:"lastOctetValue"`
- SetupScript []string `json:"setupScript"`
- ScoringScript []string `json:"scoringScript"`
- ScoringSchema []ScoringCheck `json:"scoringSchema"`
+ Name string `json:"name"`
+ LastOctetValue int `json:"lastOctetValue"`
+ SetupScript []string `json:"setupScript"`
+ ScoringScript []string `json:"scoringScript"`
+ ScoringSchema []ScoringCheck `json:"scoringSchema"`
+ ContainerSpecsTemplate string `json:"containerSpecsTemplate"`
}
type CreateCompetitionRequest struct {
@@ -183,22 +193,12 @@ type CreateCompetitionRequest struct {
Public bool `json:"public"`
LDAPAllowedGroupsFilter flexibleStringList `json:"ldapAllowedGroupsFilter"`
} `json:"privacy"`
- ContainerSpecs struct {
- TemplatePath string `json:"templatePath"`
- StoragePool string `json:"storagePool"`
- RootPassword string `json:"rootPassword"`
- StorageSizeGB int `json:"storageSizeGB"`
- MemoryMB int `json:"memoryMB"`
- Cores int `json:"cores"`
- GatewayIPv4 string `json:"gatewayIPv4"`
- CIDRBlock flexibleInt `json:"cidrBlock"`
- NameServerIPv4 string `json:"nameServerIPv4"`
- SearchDomain string `json:"searchDomain"`
- } `json:"containerSpecs"`
- TeamContainerConfigs []TeamContainerConfig `json:"teamContainerConfigs"`
- SetupPublicFolder string `json:"setupPublicFolder"`
- WriteupFilePath string `json:"writeupFilePath"`
- AttachedFiles []struct {
+ ContainerSpecsTemplates map[string]ContainerSpecTemplate `json:"containerSpecsTemplates"`
+ TeamContainerConfigs []TeamContainerConfig `json:"teamContainerConfigs"`
+ TemplateLookup map[string]ContainerSpecTemplate `json:"-"`
+ SetupPublicFolder string `json:"setupPublicFolder"`
+ WriteupFilePath string `json:"writeupFilePath"`
+ AttachedFiles []struct {
SourceFilePath string `json:"sourceFilePath"`
FileContent []byte `json:"fileContent"`
} `json:"attachedFiles"`
diff --git a/docs/creating_your_first_competition.md b/docs/creating_your_first_competition.md
index 5e86f0b..88971d8 100644
--- a/docs/creating_your_first_competition.md
+++ b/docs/creating_your_first_competition.md
@@ -20,15 +20,18 @@ Use the sample `config.json` as a template. Important keys:
- `competitionID`, `competitionName`, `competitionDescription`, and `competitionHost` describe the competition itself.
- `numTeams` controls how many team slots are created.
- `privacy.public` toggles visibility; `ldapAllowedGroupsFilter` can limit access to specific groups.
-- `containerSpecs` defines defaults for every container (template, storage pool, resources, gateway, DNS, etc.).
+- `containerSpecsTemplates` maps a name to the resource definition every container may use (template path, storage pool, root password, disk/memory/CPU limits, etc.).
- `teamContainerConfigs` contains an array of container definitions with:
- `name` (human label used in the dashboard),
- `lastOctetValue` (the octet offset used when allocating IPs in the competition block),
+ - `containerSpecsTemplate` (the template name defined above that the container should be built from),
- `setupScript`/`scoringScript` arrays that reference files inside `scripts/`,
- `scoringSchema`, the checks the scoring loops execute.
- `setupPublicFolder` points to a subdirectory (like `public`) that will be served to containers when they download static assets.
- `writeupFilePath` can reference a Markdown or PDF file to share with participants after provisioning.
+The new network defaults (gateway, DNS, search domain, constraint CIDRs) now live under `config.toml`'s `[network]` section so individual competition configs stop repeating them, and `[container_restrictions]` lets operators whitelist specific templates/pools and cap CPU/memory/disk usage for uploaded packages.
+
When you're ready to upload, zip the folder so that `config.json` is at the archive root and upload via the dashboard's create competition modal.
### Available Environment Variables
diff --git a/examples/competition_config.zip b/examples/competition_config.zip
index 5d9a28d..8dc6faa 100644
Binary files a/examples/competition_config.zip and b/examples/competition_config.zip differ
diff --git a/examples/competition_config/README.md b/examples/competition_config/README.md
index 50fe69c..c56dece 100644
--- a/examples/competition_config/README.md
+++ b/examples/competition_config/README.md
@@ -4,4 +4,6 @@ This is where the admins information will go.
Stuff to hand out to the participants goes in writeup.md/writeup.pdf
-Make sure to explain scoring and setup scripts here.
\ No newline at end of file
+Make sure to explain scoring and setup scripts here.
+
+Note: Provisioning and scoring run via the Proxmox console (raw exec), not SSH. If your container images do not include an SSH server and you want SSH access, ensure your setup scripts install and enable OpenSSH (or your distro equivalent).
diff --git a/examples/competition_config/config.json b/examples/competition_config/config.json
index 943568e..0d7aee6 100644
--- a/examples/competition_config/config.json
+++ b/examples/competition_config/config.json
@@ -8,23 +8,30 @@
"public": true,
"ldapAllowedGroupsFilter": []
},
- "containerSpecs": {
- "templatePath": "isos-ct_templates:vztmpl/ubuntu-25.04-standard_25.04-1.1_amd64.tar.zst",
- "storagePool": "team",
- "rootPassword": "password123",
- "storageSizeGB": 8,
- "memoryMB": 1024,
- "cores": 1,
- "gatewayIPv4": "10.0.0.1",
- "cidrBlock": 8,
- "nameServerIPv4": "10.0.0.2",
- "searchDomain": "cyber.lab"
+ "containerSpecsTemplates": {
+ "ubuntu-light": {
+ "templatePath": "isos-ct_templates:vztmpl/ubuntu-25.04-standard_25.04-1.1_amd64.tar.zst",
+ "storagePool": "team",
+ "rootPassword": "password123",
+ "storageSizeGB": 8,
+ "memoryMB": 512,
+ "cores": 1
+ },
+ "ubuntu-heavy": {
+ "templatePath": "isos-ct_templates:vztmpl/ubuntu-25.04-standard_25.04-1.1_amd64.tar.zst",
+ "storagePool": "team",
+ "rootPassword": "password123",
+ "storageSizeGB": 16,
+ "memoryMB": 2048,
+ "cores": 2
+ }
},
"teamContainerConfigs": [
{
"name": "website",
"lastOctetValue": 1,
- "setupScript": ["scripts/setup_global.sh", "scripts/setup_website.sh"],
+ "containerSpecsTemplate": "ubuntu-heavy",
+ "setupScript": ["scripts/setup_global_apt.sh", "scripts/setup_website.sh"],
"scoringScript": ["scripts/score_global.sh", "scripts/score_website.sh"],
"scoringSchema": [
{
@@ -52,10 +59,12 @@
"failPoints": -2
}
]
- }, {
+ },
+ {
"name": "grafana",
"lastOctetValue": 2,
- "setupScript": ["scripts/setup_global.sh", "scripts/setup_grafana.sh"],
+ "containerSpecsTemplate": "ubuntu-light",
+ "setupScript": ["scripts/setup_global_apt.sh", "scripts/setup_grafana.sh"],
"scoringScript": ["scripts/score_global.sh", "scripts/score_grafana.sh"],
"scoringSchema": [
{
diff --git a/examples/competition_config/scripts/setup_global.sh b/examples/competition_config/scripts/setup_global_apt.sh
similarity index 100%
rename from examples/competition_config/scripts/setup_global.sh
rename to examples/competition_config/scripts/setup_global_apt.sh
diff --git a/examples/config.example.toml b/examples/config.example.toml
index ac94fce..74ba9f1 100644
--- a/examples/config.example.toml
+++ b/examples/config.example.toml
@@ -38,4 +38,17 @@
pool_cidr = "10.128.0.0/11"
competition_subnet_prefix = 16
team_subnet_prefix = 24
- container_cidr = 8
\ No newline at end of file
+ container_cidr = 8
+ container_gateway = "10.0.0.1"
+ container_nameserver = "10.0.0.2"
+ container_search_domain = "cyber.lab"
+
+[container_restrictions]
+ allowed_lxc_templates = [
+ "isos-ct_templates:vztmpl/ubuntu-25.04-standard_25.04-1.1_amd64.tar.zst",
+ "isos-ct_templates:vztmpl/rockylinux-9-default_20240912_amd64.tar.xz"
+ ]
+ allowed_storage_pools = ["team"]
+ max_cpu_cores = 4
+ max_memory_mb = 8192
+ max_disk_mb = 32768
diff --git a/go-proxmox/.github/workflows/ci.yaml b/go-proxmox/.github/workflows/ci.yaml
deleted file mode 100644
index a2bbf69..0000000
--- a/go-proxmox/.github/workflows/ci.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-name: Continuous Integration
-
-on: [pull_request]
-
-jobs:
- ci:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v3
- - name: Set up Go
- uses: actions/setup-go@v3
- with:
- go-version: "1.25"
- - name: Continuous Integration
- uses: magefile/mage-action@v2
- with:
- version: latest
- args: ci
- - name: Upload to Codecov
- uses: codecov/codecov-action@v3
\ No newline at end of file
diff --git a/go-proxmox/.gitignore b/go-proxmox/.gitignore
deleted file mode 100644
index 3c56ae0..0000000
--- a/go-proxmox/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.idea
-coverage.txt
\ No newline at end of file
diff --git a/go-proxmox/.golangci.yaml b/go-proxmox/.golangci.yaml
deleted file mode 100644
index 6359795..0000000
--- a/go-proxmox/.golangci.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-version: "2"
-linters:
-formatters:
-issues:
-output:
-run:
-severity:
diff --git a/go-proxmox/LICENSE b/go-proxmox/LICENSE
deleted file mode 100644
index 4947287..0000000
--- a/go-proxmox/LICENSE
+++ /dev/null
@@ -1,177 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
\ No newline at end of file
diff --git a/go-proxmox/README.md b/go-proxmox/README.md
deleted file mode 100644
index b315724..0000000
--- a/go-proxmox/README.md
+++ /dev/null
@@ -1,135 +0,0 @@
-
-# Proxmox API Client Go Package
-[](https://github.com/luthermonson/go-proxmox/actions/workflows/ci.yaml) [](https://github.com/luthermonson/go-proxmox/blob/main/LICENSE)
-[](https://github.com/luthermonson/go-proxmox/issues)
-[](https://GitHub.com/luthermonson/go-proxmox/releases/) [](https://codecov.io/gh/luthermonson/go-proxmox) [](https://goreportcard.com/report/github.com/luthermonson/go-proxmox) [](https://pkg.go.dev/github.com/luthermonson/go-proxmox)
-
-Join the community to discuss ongoing client development usage, the proxmox API or tooling in the [#go-proxmox](https://gophers.slack.com/archives/C05920LDDD3) channel on the Gophers Slack and see the [self generated docs](https://pkg.go.dev/github.com/luthermonson/go-proxmox) for more usage details.
-
-[](https://gophers.slack.com/archives/C05920LDDD3)
-
-
-A go client for [Proxmox VE](https://www.proxmox.com/). The client implements [/api2/json](https://pve.proxmox.com/pve-docs/api-viewer/index.html) and inspiration was drawn from the existing [Telmate](https://github.com/Telmate/proxmox-api-go/tree/master/proxmox) package but looking to improve in the following ways...
-* Treated as a proper standalone go package
-* Types and JSON marshal/unmarshalling for all end points
-* Full Testing, unit testing with mocks and integration tests against an API endpoint
-* Configuration options when creating a client for flexible usage
-* Client logging for debugging within your code
-* Context support
-* Added functionality for better go tooling built on this library, some things we'd like
- * Boot VM from qcow URL, inspiration: [Proxmox Linux Templates](https://www.phillipsj.net/posts/proxmox-linux-templates/)
- * Dynamic host targeting for VM, Proxmox lacks a scheduler when given VM params it will try and locate a host with resources to put it
- * cloud-init support via no-cloud ISOs uploaded to node data stores and auto-mounted before boot, inspiration [quiso](https://github.com/luthermonson/quiso)
- * Unattended XML Support via ISOs similar to cloud-init ideas
- * node/vm/container shell command support via KVM proxy already built into proxmox
-
-Core developers are home lab enthusiasts working in the virtualization and kubernetes space. The common use case we have for
-Proxmox is dev stress testing and validation of functionality in the products we work on, we plan to build the following tooling
-around this library to make that easier.
-* [Docker Machine Driver](https://github.com/luthermonson/docker-machine-driver-proxmox) for consumption by [Rancher](https://rancher.com/docs/rancher/v1.5/en/configuration/machine-drivers/)
-* [Terminal UI](https://github.com/luthermonson/p9s) inspired by [k9s](https://github.com/derailed/k9s) for quick management of PVE Clusters
-* [Terraform Provider](https://github.com/luthermonson/terraform-provider-proxmox) with better local-exec and cloud-init/unattend xml support
-* [Cluster API Provider Proxmox](https://github.com/luthermonson/cluster-api-provider-proxmox) to create kubernetes clusters
-
-## Usage
-Create a client and use the public methods to access Proxmox resources.
-
-### Basic usage with login with a username and password credential
-```go
-package main
-
-import (
- "context"
- "fmt"
-
- "github.com/luthermonson/go-proxmox"
-)
-
-func main() {
- credentials := proxmox.Credentials{
- Username: "root@pam",
- Password: "12345",
- }
- client := proxmox.NewClient("https://localhost:8006/api2/json",
- proxmox.WithCredentials(&credentials),
- )
-
- version, err := client.Version(context.Background())
- if err != nil {
- panic(err)
- }
- fmt.Println(version.Release) // 7.4
-}
-```
-
-### Usage with Client Options
-```go
-package main
-
-import (
- "context"
- "crypto/tls"
- "fmt"
- "net/http"
-
- "github.com/luthermonson/go-proxmox"
-)
-
-func main() {
- insecureHTTPClient := http.Client{
- Transport: &http.Transport{
- TLSClientConfig: &tls.Config{
- InsecureSkipVerify: true,
- },
- },
- }
- tokenID := "root@pam!mytoken"
- secret := "somegeneratedapitokenguidefromtheproxmoxui"
-
- client := proxmox.NewClient("https://localhost:8006/api2/json",
- proxmox.WithHTTPClient(&insecureHTTPClient),
- proxmox.WithAPIToken(tokenID, secret),
- )
-
- version, err := client.Version(context.Background())
- if err != nil {
- panic(err)
- }
- fmt.Println(version.Release) // 6.3
-}
-```
-
-# Developing
-This project relies on [Mage](https://magefile.org/) for cross os/arch compatibility, please see their installation guide.
-
-## Unit Testing
-Run `mage test` to run the unit tests in the root directory.
-
-## Integration Testing
-To run the integration testing suite against an existing Proxmox API set some env vars in your shell before running `mage testIntegration`. The integration tests will test logging in and using an API token credentials so make sure you set all five env vars before running tests for them to pass.
-
-Please leave no trace when developing integration tests. All tests should create and remove all testing data they generate then they can be repeatably run against the same proxmox environment. Most people working on this package will likely use their personal Proxmox VE home lab and consuming extra resources via tests will lead to frustration.
-
-### Bash
-```shell
-export PROXMOX_URL="https://192.168.1.6:8006/api2/json"
-export PROXMOX_USERNAME="root@pam"
-export PROXMOX_PASSWORD="password"
-export PROXMOX_TOKENID="root@pam!mytoken"
-export PROXMOX_SECRET="somegeneratedapitokenguidefromtheproxmoxui"
-
-mage test:integration
-```
-
-### Powershell
-```powershell
-$Env:PROXMOX_URL = "https://192.168.1.6:8006/api2/json"
-$Env:PROXMOX_USERNAME = "root@pam"
-$Env:PROXMOX_PASSWORD = "password"
-$Env:PROXMOX_TOKENID = "root@pam!mytoken"
-$Env:PROXMOX_SECRET = "somegeneratedapitokenguidefromtheproxmoxui"
-
-mage test:integration
-```
-
-
diff --git a/go-proxmox/access.go b/go-proxmox/access.go
deleted file mode 100644
index a38f9c5..0000000
--- a/go-proxmox/access.go
+++ /dev/null
@@ -1,250 +0,0 @@
-package proxmox
-
-import (
- "context"
- "errors"
- "fmt"
- "net/url"
-)
-
-// Deprecated: Use WithCredentials Option
-func (c *Client) Login(ctx context.Context, username, password string) error {
- c.sessionMux.Lock()
- defer c.sessionMux.Unlock()
-
- _, err := c.Ticket(ctx, &Credentials{
- Username: username,
- Password: password,
- })
-
- return err
-}
-
-// Deprecated: Use the WithAPIToken Option
-func (c *Client) APIToken(tokenID, secret string) {
- c.token = fmt.Sprintf("%s=%s", tokenID, secret)
-}
-
-func (c *Client) CreateSession(ctx context.Context) error {
- c.sessionMux.Lock()
- defer c.sessionMux.Unlock()
-
- if c.session != nil {
- return ErrSessionExists
- }
-
- if _, err := c.Ticket(ctx, c.credentials); err != nil {
- return err
- }
-
- return nil
-}
-
-func (c *Client) Ticket(ctx context.Context, credentials *Credentials) (*Session, error) {
- return c.session, c.Post(ctx, "/access/ticket", credentials, &c.session)
-}
-
-func (c *Client) ACL(ctx context.Context) (acl ACLs, err error) {
- return acl, c.Get(ctx, "/access/acl", &acl)
-}
-
-func (c *Client) UpdateACL(ctx context.Context, aclOptions ACLOptions) error {
- return c.Put(ctx, "/access/acl", &aclOptions, nil)
-}
-
-// Permissions get permissions for the current user for the client which passes no params, use Permission
-func (c *Client) Permissions(ctx context.Context, o *PermissionsOptions) (permissions Permissions, err error) {
- u := url.URL{Path: "/access/permissions"}
-
- if o != nil { // params are optional
- params := url.Values{}
- if o.UserID != "" {
- params.Add("userid", o.UserID)
- }
- if o.Path != "" {
- params.Add("path", o.Path)
- }
- u.RawQuery = params.Encode()
- }
-
- return permissions, c.Get(ctx, u.String(), &permissions)
-}
-
-func (c *Client) Password(ctx context.Context, userid, password string) error {
- return c.Put(ctx, "/access/password", map[string]string{
- "userid": userid,
- "password": password,
- }, nil)
-}
-
-// NewDomain create a new domain with the required two parameters pull it and use domain.Update to configure
-func (c *Client) NewDomain(ctx context.Context, realm string, domainType DomainType) error {
- return c.Post(ctx, "/access/domains", map[string]string{
- "realm": realm,
- "type": string(domainType),
- }, nil)
-}
-
-func (c *Client) Domain(ctx context.Context, realm string) (domain *Domain, err error) {
- err = c.Get(ctx, fmt.Sprintf("/access/domains/%s", realm), &domain)
- if nil == err {
- domain.Realm = realm
- domain.client = c
- }
- return
-}
-
-func (c *Client) Domains(ctx context.Context) (domains Domains, err error) {
- err = c.Get(ctx, "/access/domains", &domains)
- if nil == err {
- for _, d := range domains {
- d.client = c
- }
- }
- return
-}
-
-func (d *Domain) Update(ctx context.Context) error {
- if d.Realm == "" {
- return errors.New("realm can not be empty")
- }
- return d.client.Put(ctx, fmt.Sprintf("/access/domains/%s", d.Realm), d, nil)
-}
-
-func (d *Domain) Delete(ctx context.Context) error {
- if d.Realm == "" {
- return errors.New("realm can not be empty")
- }
- return d.client.Delete(ctx, fmt.Sprintf("/access/domains/%s", d.Realm), nil)
-}
-
-func (d *Domain) Sync(ctx context.Context, options DomainSyncOptions) error {
- if d.Realm == "" {
- return errors.New("realm can not be empty")
- }
- return d.client.Post(ctx, fmt.Sprintf("/access/domains/%s", d.Realm), options, nil)
-}
-
-// NewGroup makes a new group, comment is option and can be left empty
-func (c *Client) NewGroup(ctx context.Context, groupid, comment string) error {
- return c.Post(ctx, "/access/groups", map[string]string{
- "groupid": groupid,
- "comment": comment,
- }, nil)
-}
-
-func (c *Client) Group(ctx context.Context, groupid string) (group *Group, err error) {
- err = c.Get(ctx, fmt.Sprintf("/access/groups/%s", groupid), &group)
- if nil == err {
- group.GroupID = groupid
- group.client = c
- }
- return
-}
-
-func (c *Client) Groups(ctx context.Context) (groups Groups, err error) {
- err = c.Get(ctx, "/access/groups", &groups)
- if nil == err {
- for _, g := range groups {
- g.client = c
- }
- }
- return
-}
-
-func (g *Group) Update(ctx context.Context) error {
- return g.client.Put(ctx, fmt.Sprintf("/access/groups/%s", g.GroupID), g, nil)
-}
-
-func (g *Group) Delete(ctx context.Context) error {
- return g.client.Delete(ctx, fmt.Sprintf("/access/groups/%s", g.GroupID), nil)
-}
-
-func (c *Client) User(ctx context.Context, userid string) (user *User, err error) {
- err = c.Get(ctx, fmt.Sprintf("/access/users/%s", userid), &user)
- if nil == err {
- user.UserID = userid
- user.client = c
- }
- return
-}
-
-func (c *Client) Users(ctx context.Context) (users Users, err error) {
- err = c.Get(ctx, "/access/users", &users)
- if nil == err {
- for _, g := range users {
- g.client = c
- }
- }
- return
-}
-
-func (c *Client) NewUser(ctx context.Context, user *NewUser) (err error) {
- return c.Post(ctx, "/access/users", user, nil)
-}
-
-func (u *User) Update(ctx context.Context, options UserOptions) error {
- return u.client.Put(ctx, fmt.Sprintf("/access/users/%s", u.UserID), &options, nil)
-}
-
-func (u *User) Delete(ctx context.Context) error {
- return u.client.Delete(ctx, fmt.Sprintf("/access/users/%s", u.UserID), nil)
-}
-
-func (u *User) GetAPITokens(ctx context.Context) (tokens Tokens, err error) {
- return tokens, u.client.Get(ctx, fmt.Sprintf("/access/users/%s/token", u.UserID), &tokens)
-}
-
-func (u *User) APIToken(ctx context.Context, tokenid string) (token Token, err error) {
- return token, u.client.Get(ctx, fmt.Sprintf("/access/users/%s/token/%s", u.UserID, tokenid), &token)
-}
-
-func (u *User) NewAPIToken(ctx context.Context, token Token) (newtoken NewAPIToken, err error) {
- return newtoken, u.client.Post(ctx, fmt.Sprintf("/access/users/%s/token/%s", u.UserID, token.TokenID), token, &newtoken)
-}
-
-func (u *User) UpdateAPIToken(ctx context.Context, tokenid string) (token Token, err error) {
- return token, u.client.Put(ctx, fmt.Sprintf("/access/users/%s/token/%s", u.UserID, tokenid), token, nil)
-}
-
-func (u *User) DeleteAPIToken(ctx context.Context, tokenid string) error {
- return u.client.Delete(ctx, fmt.Sprintf("/access/users/%s/token/%s", u.UserID, tokenid), nil)
-}
-
-func (u *User) GetTFA(ctx context.Context) (tfa TFA, err error) {
- return tfa, u.client.Get(ctx, fmt.Sprintf("/access/users/%s/tfa", u.UserID), &tfa)
-}
-
-func (u *User) UnlockTFA(ctx context.Context) error {
- return u.client.Delete(ctx, fmt.Sprintf("/access/users/%s/tfa", u.UserID), nil)
-}
-
-func (c *Client) Role(ctx context.Context, roleid string) (role Permission, err error) {
- err = c.Get(ctx, fmt.Sprintf("/access/roles/%s", roleid), &role)
- return
-}
-
-func (c *Client) NewRole(ctx context.Context, roleID string, privs string) (err error) {
- return c.Post(ctx, "/access/roles", map[string]string{
- "roleid": roleID,
- "privs": privs,
- }, nil)
-}
-
-func (c *Client) Roles(ctx context.Context) (roles Roles, err error) {
- err = c.Get(ctx, "/access/roles", &roles)
- if nil == err {
- for _, g := range roles {
- g.client = c
- }
- }
- return
-}
-
-func (r *Role) Update(ctx context.Context) error {
- return r.client.Put(ctx, fmt.Sprintf("/access/roles/%s", r.RoleID), r, nil)
-}
-
-func (r *Role) Delete(ctx context.Context) error {
- return r.client.Delete(ctx, fmt.Sprintf("/access/roles/%s", r.RoleID), nil)
-}
diff --git a/go-proxmox/access_test.go b/go-proxmox/access_test.go
deleted file mode 100644
index e8e6774..0000000
--- a/go-proxmox/access_test.go
+++ /dev/null
@@ -1,409 +0,0 @@
-package proxmox
-
-import (
- "context"
- "testing"
-
- "github.com/luthermonson/go-proxmox/tests/mocks"
- "github.com/stretchr/testify/assert"
-)
-
-func TestTicket(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
-
- // todo current mocks are hardcoded with test data, make configurable via mock config
- client := mockClient(WithCredentials(
- &Credentials{
- Username: "root@pam",
- Password: "1234",
- }))
- ctx := context.Background()
-
- session, err := client.Ticket(ctx, client.credentials)
- assert.Nil(t, err)
- assert.Equal(t, "root@pam", session.Username)
- assert.Equal(t, "pve-cluster", session.ClusterName)
-}
-
-func TestPermissions(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- perms, err := client.Permissions(ctx, nil)
- assert.Nil(t, err)
- assert.Equal(t, 8, len(perms))
- assert.Equal(t, IntOrBool(true), perms["/"]["Datastore.Allocate"])
-
- // test path option
- perms, err = client.Permissions(ctx, &PermissionsOptions{
- Path: "path",
- })
- assert.Nil(t, err)
- assert.Equal(t, IntOrBool(true), perms["path"]["permission"])
-
- // test userid
- perms, err = client.Permissions(ctx, &PermissionsOptions{
- UserID: "userid",
- })
- assert.Nil(t, err)
- assert.Equal(t, IntOrBool(true), perms["path"]["permission"])
-
- // test both path and userid
- perms, err = client.Permissions(ctx, &PermissionsOptions{
- UserID: "userid",
- Path: "path",
- })
- assert.Nil(t, err)
- assert.Equal(t, IntOrBool(true), perms["path"]["permission"])
-}
-
-func TestPassword(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- assert.Nil(t, client.Password(ctx, "userid", "password"))
-}
-
-func TestDomains(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- ds, err := client.Domains(ctx)
- assert.Nil(t, err)
- assert.Equal(t, 3, len(ds))
-}
-
-func TestDomain(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- d, err := client.Domain(ctx, "test")
- assert.Nil(t, err)
- assert.Equal(t, d.Realm, "test")
- assert.False(t, bool(d.AutoCreate))
-}
-
-func TestNewGroup(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- assert.Nil(t, client.NewGroup(ctx, "groupid", "comment"))
-}
-
-func TestGroup(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- g, err := client.Group(ctx, "test")
- assert.Nil(t, err)
- assert.Equal(t, g.GroupID, "test")
- assert.Len(t, g.Members, 2)
-}
-
-func TestGroups(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- gs, err := client.Groups(ctx)
- assert.Nil(t, err)
- assert.Len(t, gs, 2)
- for _, g := range gs {
- assert.Len(t, g.Members, 0) // empty from lister
- assert.NotEmpty(t, g.Users)
- }
-}
-
-func TestGroup_Update(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- group := Group{
- client: client,
- }
- assert.Error(t, group.Update(ctx)) // no groupid
- group.GroupID = "groupid"
- assert.Nil(t, group.Update(ctx))
-}
-
-func TestGroup_Delete(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- group := Group{
- client: client,
- }
-
- assert.Error(t, group.Delete(ctx))
- group.GroupID = "groupid"
- assert.Nil(t, group.Delete(ctx))
-}
-
-func TestUser(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- u, err := client.User(ctx, "root@pam")
- assert.Nil(t, err)
- assert.Equal(t, u.UserID, "root@pam")
-}
-
-func TestUsers(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- users, err := client.Users(ctx)
- assert.Nil(t, err)
- assert.Len(t, users, 4)
-}
-
-func TestRole(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- u, err := client.Role(ctx, "Administrator")
- assert.Nil(t, err)
- assert.Contains(t, u, "SDN.Allocate")
- assert.Len(t, u, 38)
-
- u, err = client.Role(ctx, "NoAccess")
- assert.Nil(t, err)
- assert.Len(t, u, 0)
-}
-
-func TestRoles(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- roles, err := client.Roles(ctx)
- assert.Nil(t, err)
- assert.Len(t, roles, 16)
-}
-
-func TestACL(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- acls, err := client.ACL(ctx)
- assert.Nil(t, err)
- assert.Len(t, acls, 1)
-}
-
-func TestNewDomain(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- assert.Nil(t, client.NewDomain(ctx, "test", "t"))
-}
-
-func TestDomain_Update(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- // no realm name
- domain := Domain{
- client: client,
- }
-
- assert.Error(t, domain.Update(ctx))
- domain.Realm = "test"
- assert.Nil(t, domain.Update(ctx))
-}
-
-func TestDomain_Delete(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- // no realm name
- domain := Domain{
- client: client,
- }
-
- assert.Error(t, domain.Delete(ctx))
- domain.Realm = "test"
- assert.Nil(t, domain.Delete(ctx))
-}
-
-func TestDomain_Sync(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- // no realm name
- domain := Domain{
- client: client,
- }
-
- assert.Error(t, domain.Sync(ctx, DomainSyncOptions{}))
- domain.Realm = "test"
- assert.Nil(t, domain.Sync(ctx, DomainSyncOptions{}))
-}
-
-func TestNewUser(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- user := NewUser{
- UserID: "test",
- }
- assert.Nil(t, client.NewUser(ctx, &user))
-
-}
-
-func TestAPITokens(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- user := &User{
- client: client,
- UserID: "test",
- }
-
- apitokens, err := user.GetAPITokens(ctx)
- assert.Nil(t, err)
- assert.Len(t, apitokens, 2)
-}
-
-func TestAPIToken(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- User := &User{
- client: client,
- UserID: "root@pam",
- }
- token, err := User.APIToken(ctx, "test")
- assert.Nil(t, err)
- assert.NotNil(t, token)
-
-}
-
-func TestUpdateAPIToken(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- User := &User{
- client: client,
- UserID: "userid",
- }
- token, err := User.UpdateAPIToken(ctx, "tokenid")
- assert.Nil(t, err)
- assert.NotNil(t, token)
-}
-
-// func TestNewAPIToken(t *testing.T) {
-// mocks.On(mockConfig)
-// defer mocks.Off()
-// client := mockClient()
-// ctx := context.Background()
-
-// // Users
-// user := &User{
-// client: client,
-// UserID: "userid",
-// }
-
-// token := &Token{
-// TokenID: "test",
-// Comment: "test",
-// Expire: 0,
-// }
-
-// newToken, err := user.NewAPIToken(ctx, *token)
-// assert.Nil(t, err)
-// // Check if newToken.Value is not empty
-// assert.NotEmpty(t, newToken.Value)
-// // Check if fullTokenid = userid!tokenid
-// assert.Equal(t, "userid!test", newToken.FullTokenID)
-// }
-
-func TestDeleteAPIToken(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- User := &User{
- client: client,
- UserID: "root@pam",
- }
- assert.Nil(t, User.DeleteAPIToken(ctx, "test"))
-}
-
-func TestNewRole(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- assert.Nil(t, client.NewRole(ctx, "test", "test"))
-}
-
-func TestGetTFA(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- user := &User{
- client: client,
- UserID: "userid",
- }
-
- tfa, err := user.GetTFA(ctx)
- assert.Nil(t, err)
- assert.Equal(t, "userid", tfa.User)
-}
-
-func TestUnlockTFA(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- user := &User{
- client: client,
- UserID: "userid",
- }
- assert.Nil(t, user.UnlockTFA(ctx))
-}
diff --git a/go-proxmox/build.go b/go-proxmox/build.go
deleted file mode 100644
index ece9af0..0000000
--- a/go-proxmox/build.go
+++ /dev/null
@@ -1,6 +0,0 @@
-//go:build test
-// +build test
-
-package proxmox
-
-func main() {}
diff --git a/go-proxmox/ceph.go b/go-proxmox/ceph.go
deleted file mode 100644
index 0292986..0000000
--- a/go-proxmox/ceph.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package proxmox
-
-import "context"
-
-func (ce *Ceph) Status(ctx context.Context) (*ClusterCephStatus, error) {
- cephStatus := &ClusterCephStatus{}
-
- if err := ce.client.Get(ctx, "/cluster/ceph/status", cephStatus); !IsNotAuthorized(err) {
- return cephStatus, err
- }
-
- return cephStatus, nil
-}
diff --git a/go-proxmox/ceph_test.go b/go-proxmox/ceph_test.go
deleted file mode 100644
index 6c7b7b4..0000000
--- a/go-proxmox/ceph_test.go
+++ /dev/null
@@ -1,46 +0,0 @@
-package proxmox
-
-import (
- "context"
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- "github.com/luthermonson/go-proxmox/tests/mocks"
-)
-
-func TestClusterCeph_Status(t *testing.T) {
- mocks.ProxmoxVE8x(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- ceph := Ceph{
- client: client,
- }
-
- expectedOsdNearFullCheck := CephHealthCheck{
- Detail: []CephHealthCheckDetail{
- {
- Message: "osd.3 is near full",
- },
- {
- Message: "osd.8 is near full",
- },
- {
- Message: "osd.9 is near full",
- },
- },
- Muted: false,
- Severity: "HEALTH_WARN",
- Summary: CephHealthCheckSummary{
- Count: 3,
- Message: "3 nearfull osd(s)",
- },
- }
-
- actual, err := ceph.Status(ctx)
- assert.Nil(t, err)
- assert.Equal(t, "HEALTH_WARN", actual.Health.Status)
- assert.Equal(t, []string{"proxmox-node01", "proxmox-node03", "proxmox-node02"}, actual.QuorumNames)
- assert.Equal(t, expectedOsdNearFullCheck, actual.Health.Checks["OSD_NEARFULL"])
-}
diff --git a/go-proxmox/cluster.go b/go-proxmox/cluster.go
deleted file mode 100644
index 1fea342..0000000
--- a/go-proxmox/cluster.go
+++ /dev/null
@@ -1,101 +0,0 @@
-package proxmox
-
-import (
- "context"
- "fmt"
- "net/url"
- "strconv"
- "strings"
-)
-
-func (c *Client) Cluster(ctx context.Context) (*Cluster, error) {
- cluster := &Cluster{
- client: c,
- }
-
- // requires (/, Sys.Audit), do not error out if no access to still get the cluster
- if err := cluster.Status(ctx); !IsNotAuthorized(err) {
- return cluster, err
- }
-
- return cluster, nil
-}
-
-func (cl *Cluster) New(c *Client) *Cluster {
- return &Cluster{
- client: c,
- }
-}
-
-func (cl *Cluster) Status(ctx context.Context) error {
- return cl.client.Get(ctx, "/cluster/status", cl)
-}
-
-func (cl *Cluster) NextID(ctx context.Context) (int, error) {
- var ret string
- if err := cl.client.Get(ctx, "/cluster/nextid", &ret); err != nil {
- return 0, err
- }
- return strconv.Atoi(ret)
-}
-
-// CheckID checks if the given vmid is free.
-// CheckID calls the /cluster/nextid endpoint with the "vmid" parameter.
-// The API documentation describes the check as: "Pass a VMID to assert that its free (at time of check)."
-// Returns true if the vmid is free, false otherwise.
-func (cl *Cluster) CheckID(ctx context.Context, vmid int) (bool, error) {
- var ret string
- err := cl.client.Get(ctx, fmt.Sprintf("/cluster/nextid?vmid=%d", vmid), ret)
- if err != nil && strings.Contains(err.Error(), fmt.Sprintf("VM %d already exists", vmid)) {
- return false, nil
- } else if err != nil {
- return false, err
- }
- return true, nil
-}
-
-// Resources retrieves a summary list of all resources in the cluster.
-// It calls /cluster/resources api v2 endpoint with an optional "type" parameter
-// to filter searched values.
-// It returns a list of ClusterResources.
-func (cl *Cluster) Resources(ctx context.Context, filters ...string) (rs ClusterResources, err error) {
- u := url.URL{Path: "/cluster/resources"}
-
- // filters are variadic because they're optional, munging everything passed into one big string to make
- // a good request and the api will error out if there's an issue
- if f := strings.ReplaceAll(strings.Join(filters, ""), " ", ""); f != "" {
- params := url.Values{}
- params.Add("type", f)
- u.RawQuery = params.Encode()
- }
-
- return rs, cl.client.Get(ctx, u.String(), &rs)
-}
-
-func (cl *Cluster) Tasks(ctx context.Context) (Tasks, error) {
- var tasks Tasks
-
- if err := cl.client.Get(ctx, "/cluster/tasks", &tasks); err != nil {
- return nil, err
- }
-
- for index := range tasks {
- tasks[index].client = cl.client
- }
-
- return tasks, nil
-}
-
-func (cl *Cluster) Ceph(ctx context.Context) (*Ceph, error) {
- ceph := &Ceph{
- client: cl.client,
- }
-
- // TODO?
- //// requires (/, Sys.Audit), do not error out if no access to still get the ceph
- //if err := ceph.Status(ctx); !IsNotAuthorized(err) {
- // return ceph, err
- //}
-
- return ceph, nil
-}
diff --git a/go-proxmox/cluster_firewall.go b/go-proxmox/cluster_firewall.go
deleted file mode 100644
index 073418b..0000000
--- a/go-proxmox/cluster_firewall.go
+++ /dev/null
@@ -1,51 +0,0 @@
-package proxmox
-
-import (
- "context"
- "fmt"
-)
-
-func (cl *Cluster) FWGroups(ctx context.Context) (groups []*FirewallSecurityGroup, err error) {
- err = cl.client.Get(ctx, "/cluster/firewall/groups", &groups)
-
- if nil == err {
- for _, g := range groups {
- g.client = cl.client
- }
- }
- return
-}
-
-func (cl *Cluster) FWGroup(ctx context.Context, name string) (group *FirewallSecurityGroup, err error) {
- group = &FirewallSecurityGroup{}
- err = cl.client.Get(ctx, fmt.Sprintf("/cluster/firewall/groups/%s", name), &group.Rules)
- if nil == err {
- group.Group = name
- group.client = cl.client
- }
- return
-}
-
-func (cl *Cluster) NewFWGroup(ctx context.Context, group *FirewallSecurityGroup) error {
- return cl.client.Post(ctx, "/cluster/firewall/groups", group, &group)
-}
-
-func (g *FirewallSecurityGroup) GetRules(ctx context.Context) ([]*FirewallRule, error) {
- return g.Rules, g.client.Get(ctx, fmt.Sprintf("/cluster/firewall/groups/%s", g.Group), &g.Rules)
-}
-
-func (g *FirewallSecurityGroup) Delete(ctx context.Context) error {
- return g.client.Delete(ctx, fmt.Sprintf("/cluster/firewall/groups/%s", g.Group), nil)
-}
-
-func (g *FirewallSecurityGroup) RuleCreate(ctx context.Context, rule *FirewallRule) error {
- return g.client.Post(ctx, fmt.Sprintf("/cluster/firewall/groups/%s", g.Group), rule, nil)
-}
-
-func (g *FirewallSecurityGroup) RuleUpdate(ctx context.Context, rule *FirewallRule) error {
- return g.client.Put(ctx, fmt.Sprintf("/cluster/firewall/groups/%s/%d", g.Group, rule.Pos), rule, nil)
-}
-
-func (g *FirewallSecurityGroup) RuleDelete(ctx context.Context, rulePos int) error {
- return g.client.Delete(ctx, fmt.Sprintf("/cluster/firewall/groups/%s/%d", g.Group, rulePos), nil)
-}
diff --git a/go-proxmox/cluster_firewall_test.go b/go-proxmox/cluster_firewall_test.go
deleted file mode 100644
index 71e737b..0000000
--- a/go-proxmox/cluster_firewall_test.go
+++ /dev/null
@@ -1,170 +0,0 @@
-package proxmox
-
-import (
- "context"
- "testing"
-
- "github.com/luthermonson/go-proxmox/tests/mocks"
- "github.com/stretchr/testify/assert"
-)
-
-func TestCluster_FWGroups(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- cluster, err := client.Cluster(ctx)
- assert.Nil(t, err)
-
- groups, err := cluster.FWGroups(ctx)
- assert.Nil(t, err)
- assert.NotEmpty(t, groups)
- assert.GreaterOrEqual(t, len(groups), 1)
-
- // Check first group
- assert.NotEmpty(t, groups[0].Group)
- assert.NotNil(t, groups[0].client)
-}
-
-func TestCluster_FWGroup(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- cluster, err := client.Cluster(ctx)
- assert.Nil(t, err)
-
- group, err := cluster.FWGroup(ctx, "test-group")
- assert.Nil(t, err)
- assert.NotNil(t, group)
- assert.Equal(t, "test-group", group.Group)
- assert.NotNil(t, group.client)
- assert.NotEmpty(t, group.Rules)
- assert.GreaterOrEqual(t, len(group.Rules), 1)
-}
-
-func TestCluster_NewFWGroup(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- cluster, err := client.Cluster(ctx)
- assert.Nil(t, err)
-
- newGroup := &FirewallSecurityGroup{
- Group: "new-group",
- Comment: "New test group",
- }
-
- err = cluster.NewFWGroup(ctx, newGroup)
- assert.Nil(t, err)
-}
-
-func TestFirewallSecurityGroup_GetRules(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- cluster, err := client.Cluster(ctx)
- assert.Nil(t, err)
-
- group, err := cluster.FWGroup(ctx, "test-group")
- assert.Nil(t, err)
-
- rules, err := group.GetRules(ctx)
- assert.Nil(t, err)
- assert.NotEmpty(t, rules)
- assert.GreaterOrEqual(t, len(rules), 1)
-
- // Check first rule
- rule := rules[0]
- assert.NotEmpty(t, rule.Type)
- assert.NotEmpty(t, rule.Action)
-}
-
-func TestFirewallSecurityGroup_RuleCreate(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- cluster, err := client.Cluster(ctx)
- assert.Nil(t, err)
-
- group, err := cluster.FWGroup(ctx, "test-group")
- assert.Nil(t, err)
-
- newRule := &FirewallRule{
- Type: "in",
- Action: "ACCEPT",
- Enable: 1,
- Proto: "tcp",
- Dport: "443",
- Comment: "Allow HTTPS",
- }
-
- err = group.RuleCreate(ctx, newRule)
- assert.Nil(t, err)
-}
-
-func TestFirewallSecurityGroup_RuleUpdate(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- cluster, err := client.Cluster(ctx)
- assert.Nil(t, err)
-
- group, err := cluster.FWGroup(ctx, "test-group")
- assert.Nil(t, err)
-
- updateRule := &FirewallRule{
- Pos: 0,
- Type: "in",
- Action: "DROP",
- Enable: 1,
- Proto: "tcp",
- Dport: "22",
- Comment: "Block SSH",
- }
-
- err = group.RuleUpdate(ctx, updateRule)
- assert.Nil(t, err)
-}
-
-func TestFirewallSecurityGroup_RuleDelete(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- cluster, err := client.Cluster(ctx)
- assert.Nil(t, err)
-
- group, err := cluster.FWGroup(ctx, "test-group")
- assert.Nil(t, err)
-
- err = group.RuleDelete(ctx, 0)
- assert.Nil(t, err)
-}
-
-func TestFirewallSecurityGroup_Delete(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- cluster, err := client.Cluster(ctx)
- assert.Nil(t, err)
-
- group, err := cluster.FWGroup(ctx, "test-group")
- assert.Nil(t, err)
-
- err = group.Delete(ctx)
- assert.Nil(t, err)
-}
diff --git a/go-proxmox/cluster_sdn.go b/go-proxmox/cluster_sdn.go
deleted file mode 100644
index c091bd9..0000000
--- a/go-proxmox/cluster_sdn.go
+++ /dev/null
@@ -1,70 +0,0 @@
-package proxmox
-
-import (
- "context"
- "fmt"
- "net/url"
- "strings"
-)
-
-func (cl *Cluster) SDNSubnets(ctx context.Context, VNetName string) (subnets []*VNetSubnet, err error) {
- err = cl.client.Get(ctx, fmt.Sprintf("/cluster/sdn/vnets/%s/subnets", VNetName), &subnets)
-
- return
-}
-
-func (cl *Cluster) SDNApply(ctx context.Context) (*Task, error) {
- var upid UPID
- err := cl.client.Put(ctx, "/cluster/sdn/", nil, &upid)
- return NewTask(upid, cl.client), err
-}
-
-func (cl *Cluster) SDNVNets(ctx context.Context) (vnets []*VNet, err error) {
- return vnets, cl.client.Get(ctx, "/cluster/sdn/vnets", &vnets)
-}
-
-func (cl *Cluster) SDNVNet(ctx context.Context, name string) (vnet *VNet, err error) {
- return vnet, cl.client.Get(ctx, fmt.Sprintf("/cluster/sdn/vnets/%s", name), &vnet)
-}
-
-func (cl *Cluster) NewSDNVNet(ctx context.Context, vnet *VNetOptions) error {
- return cl.client.Post(ctx, "/cluster/sdn/vnets", vnet, nil)
-}
-
-func (cl *Cluster) UpdateSDNVNet(ctx context.Context, vnet *VNet) error {
- return cl.client.Put(ctx, fmt.Sprintf("/cluster/sdn/vnets/%s", vnet.Name), vnet, nil)
-}
-
-func (cl *Cluster) DeleteSDNVNet(ctx context.Context, name string) error {
- return cl.client.Delete(ctx, fmt.Sprintf("/cluster/sdn/vnets/%s", name), nil)
-}
-
-func (cl *Cluster) SDNZones(ctx context.Context, filters ...string) (zones []*SDNZone, err error) {
- u := url.URL{Path: "/cluster/sdn/zones"}
-
- // filters are variadic because they're optional, munging everything passed into one big string to make
- // a good request and the api will error out if there's an issue
- if f := strings.ReplaceAll(strings.Join(filters, ""), " ", ""); f != "" {
- params := url.Values{}
- params.Add("type", f)
- u.RawQuery = params.Encode()
- }
-
- return zones, cl.client.Get(ctx, u.String(), &zones)
-}
-
-func (cl *Cluster) SDNZone(ctx context.Context, name string) (zone *SDNZone, err error) {
- return zone, cl.client.Get(ctx, fmt.Sprintf("/cluster/sdn/zones/%s", name), &zone)
-}
-
-func (cl *Cluster) NewSDNZone(ctx context.Context, zone *SDNZoneOptions) error {
- return cl.client.Post(ctx, "/cluster/sdn/zones", zone, nil)
-}
-
-func (cl *Cluster) UpdateSDNZone(ctx context.Context, zone *SDNZoneOptions) error {
- return cl.client.Put(ctx, fmt.Sprintf("/cluster/sdn/zones/%s", zone.Name), zone, nil)
-}
-
-func (cl *Cluster) DeleteSDNZone(ctx context.Context, name string) error {
- return cl.client.Delete(ctx, fmt.Sprintf("/cluster/sdn/zones/%s", name), nil)
-}
diff --git a/go-proxmox/cluster_test.go b/go-proxmox/cluster_test.go
deleted file mode 100644
index 77a5338..0000000
--- a/go-proxmox/cluster_test.go
+++ /dev/null
@@ -1,121 +0,0 @@
-package proxmox
-
-import (
- "context"
- "testing"
-
- "github.com/luthermonson/go-proxmox/tests/mocks"
- "github.com/stretchr/testify/assert"
-)
-
-func TestCluster(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- cluster, err := client.Cluster(ctx)
- assert.Nil(t, err)
- assert.Equal(t, 4, cluster.Version)
- assert.Equal(t, "cluster", cluster.ID)
- for _, n := range cluster.Nodes {
- assert.Contains(t, n.ID, "node/node")
- assert.Equal(t, "node", n.Type)
- }
-}
-
-func TestNextID(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- cluster, err := client.Cluster(ctx)
- assert.Nil(t, err)
- nextid, err := cluster.NextID(ctx)
- assert.Nil(t, err)
- assert.Equal(t, 100, nextid)
-}
-
-func TestCheckID(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- cluster, err := client.Cluster(ctx)
- assert.Nil(t, err)
- checkIDFree, err := cluster.CheckID(ctx, 100)
- assert.Nil(t, err)
- assert.Equal(t, true, checkIDFree)
- checkIDTaken, err := cluster.CheckID(ctx, 200)
- assert.Nil(t, err)
- assert.Equal(t, false, checkIDTaken)
-}
-
-func TestCluster_Resources(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- cluster, err := client.Cluster(ctx)
- assert.Nil(t, err)
-
- // json unmarshaling tests
- rs, err := cluster.Resources(ctx)
- assert.Nil(t, err)
- assert.Equal(t, 20, len(rs))
-
- // type param test
- rs, err = cluster.Resources(ctx, "node")
- assert.Nil(t, err)
- assert.Equal(t, 1, len(rs))
-}
-
-func TestCluster_SDNZones(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- cluster, err := client.Cluster(ctx)
- assert.Nil(t, err)
-
- // json unmarshaling tests
- zones, err := cluster.SDNZones(ctx)
- assert.Nil(t, err)
- assert.Equal(t, 2, len(zones))
-
- // type param test
- zones, err = cluster.SDNZones(ctx, "vxlan")
- assert.Nil(t, err)
- assert.Equal(t, 1, len(zones))
- assert.Equal(t, "vxlan", zones[0].Type)
- assert.Equal(t, "test1", zones[0].Name)
- assert.Equal(t, "pve", zones[0].IPAM)
-}
-
-func TestCluster_SDNVNets(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- cluster, err := client.Cluster(ctx)
- assert.Nil(t, err)
-
- // json unmarshaling tests
- vnets, err := cluster.SDNVNets(ctx)
- assert.Nil(t, err)
- assert.Equal(t, 5, len(vnets))
-
- // vnet name test
- vnet, err := cluster.SDNVNet(ctx, "user1")
- assert.Nil(t, err)
- assert.Equal(t, "user1", vnet.Name)
- assert.Equal(t, "vnet", vnet.Type)
- assert.Equal(t, "test1", vnet.Zone)
- assert.Equal(t, 1, vnet.VlanAware)
- assert.Equal(t, uint16(10), vnet.Tag)
-}
diff --git a/go-proxmox/container_config.go b/go-proxmox/container_config.go
deleted file mode 100644
index 4468885..0000000
--- a/go-proxmox/container_config.go
+++ /dev/null
@@ -1,66 +0,0 @@
-package proxmox
-
-import (
- "reflect"
- "strconv"
- "strings"
-)
-
-// mergeIndexedString uses reflection to merge the ordinal/indexed fields
-// returned by the Proxmox API. Such as Mp0..9, and Net0..9
-func (cc *ContainerConfig) mergeIndexedFields(prefix string) map[string]string {
- stringMap := make(map[string]string)
- t := reflect.TypeOf(*cc)
- v := reflect.ValueOf(*cc)
- count := v.NumField()
-
- for i := 0; i < count; i++ {
- fn := t.Field(i).Name
- fv := v.Field(i).String()
- if fv == "" {
- continue
- }
- if strings.HasPrefix(fn, prefix) {
- // Ignore non-numeric suffixes like SCSIHW
- suffix := strings.TrimPrefix(fn, prefix)
- if _, err := strconv.Atoi(suffix); err != nil {
- continue
- }
- stringMap[strings.ToLower(fn)] = fv
- }
- }
-
- return stringMap
-}
-
-// MergeDevs merges and assigns the indexed Dev0..9 fields to a string map
-func (cc *ContainerConfig) MergeDevs() map[string]string {
- if cc.Devs == nil {
- cc.Devs = cc.mergeIndexedFields("Dev")
- }
- return cc.Devs
-}
-
-// MergeMps merges and assigns the indexed Mp0..9 fields to a string map
-func (cc *ContainerConfig) MergeMps() map[string]string {
- if cc.Mps == nil {
- cc.Mps = cc.mergeIndexedFields("Mp")
- }
- return cc.Mps
-}
-
-// MergeNets merges and assigns the indexed Net0..9 fields to a string map
-func (cc *ContainerConfig) MergeNets() map[string]string {
- if cc.Nets == nil {
- cc.Nets = cc.mergeIndexedFields("Net")
- }
- return cc.Nets
-}
-
-// MergeUnuseds merges and assigns the indexed Unused0..9 fields to a string map
-func (cc *ContainerConfig) MergeUnuseds() map[string]string {
- if cc.Unuseds == nil {
- cc.Unuseds = cc.mergeIndexedFields("Unused")
- }
- return cc.Unuseds
-}
diff --git a/go-proxmox/containers.go b/go-proxmox/containers.go
deleted file mode 100644
index 6971365..0000000
--- a/go-proxmox/containers.go
+++ /dev/null
@@ -1,418 +0,0 @@
-package proxmox
-
-import (
- "context"
- "errors"
- "fmt"
- "net/url"
- "strconv"
- "strings"
-)
-
-func (c *Container) Clone(ctx context.Context, params *ContainerCloneOptions) (newid int, task *Task, err error) {
- var upid UPID
-
- if params == nil {
- params = &ContainerCloneOptions{}
- }
- if params.NewID <= 0 {
- cluster, err := c.client.Cluster(ctx)
- if err != nil {
- return newid, nil, err
- }
- newid, err = cluster.NextID(ctx)
- if err != nil {
- return newid, nil, err
- }
- params.NewID = newid
- } else {
- newid = params.NewID
- }
- if err := c.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/clone", c.Node, c.VMID), params, &upid); err != nil {
- return 0, nil, err
- }
- return newid, NewTask(upid, c.client), nil
-}
-
-func (c *Container) Delete(ctx context.Context) (task *Task, err error) {
- var upid UPID
- if err := c.client.Delete(ctx, fmt.Sprintf("/nodes/%s/lxc/%d", c.Node, c.VMID), &upid); err != nil {
- return nil, err
- }
-
- return NewTask(upid, c.client), nil
-}
-
-// Config sets ContainerOptions for Container
-// see https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/lxc/{vmid}/config for available attributes
-func (c *Container) Config(ctx context.Context, options ...ContainerOption) (*Task, error) {
- var upid UPID
- data := make(map[string]interface{})
- for _, option := range options {
- data[option.Name] = option.Value
- }
- err := c.client.Put(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/config", c.Node, c.VMID), data, &upid)
- return NewTask(upid, c.client), err
-}
-
-func (c *Container) Start(ctx context.Context) (task *Task, err error) {
- var upid UPID
- if err := c.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/status/start", c.Node, c.VMID), nil, &upid); err != nil {
- return nil, err
- }
- return NewTask(upid, c.client), nil
-}
-
-func (c *Container) Stop(ctx context.Context) (task *Task, err error) {
- var upid UPID
- if err := c.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/status/stop", c.Node, c.VMID), nil, &upid); err != nil {
- return nil, err
- }
- return NewTask(upid, c.client), nil
-}
-
-func (c *Container) Suspend(ctx context.Context) (task *Task, err error) {
- var upid UPID
- if err := c.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/status/suspend", c.Node, c.VMID), nil, &upid); err != nil {
- return nil, err
- }
- return NewTask(upid, c.client), nil
-}
-
-func (c *Container) Reboot(ctx context.Context) (task *Task, err error) {
- var upid UPID
- if err := c.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/status/reboot", c.Node, c.VMID), nil, &upid); err != nil {
- return nil, err
- }
- return NewTask(upid, c.client), nil
-}
-
-func (c *Container) Resume(ctx context.Context) (task *Task, err error) {
- var upid UPID
- if err := c.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/status/resume", c.Node, c.VMID), nil, &upid); err != nil {
- return nil, err
- }
- return NewTask(upid, c.client), nil
-}
-
-func (c *Container) Shutdown(ctx context.Context, force bool, timeout int) (task *Task, err error) {
- var upid UPID
- if err := c.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/status/shutdown", c.Node, c.VMID), map[string]interface{}{"forceStop": force, "timeout": timeout}, &upid); err != nil {
- return nil, err
- }
- return NewTask(upid, c.client), nil
-}
-
-func (c *Container) TermProxy(ctx context.Context) (term *Term, err error) {
- return term, c.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/termproxy", c.Node, c.VMID), nil, &term)
-}
-
-func (c *Container) TermWebSocket(term *Term) (chan []byte, chan []byte, chan error, func() error, error) {
- p := fmt.Sprintf("/nodes/%s/lxc/%d/vncwebsocket?port=%d&vncticket=%s",
- c.Node, c.VMID, term.Port, url.QueryEscape(term.Ticket))
-
- return c.client.TermWebSocket(p, term)
-}
-
-func (c *Container) Exec(ctx context.Context, options *ContainerExecOptions) (pid int, err error) {
- if options == nil {
- return 0, errors.New("exec options required")
- }
-
- var result ContainerExecResult
- if err := c.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/exec", c.Node, c.VMID), options, &result); err != nil {
- return 0, err
- }
-
- return int(result.PID), nil
-}
-
-func (c *Container) ExecStatus(ctx context.Context, pid int) (status *ContainerExecStatus, err error) {
- u := url.URL{Path: fmt.Sprintf("/nodes/%s/lxc/%d/exec-status", c.Node, c.VMID)}
- params := url.Values{}
- params.Add("pid", strconv.Itoa(pid))
- u.RawQuery = params.Encode()
-
- return status, c.client.Get(ctx, u.String(), &status)
-}
-
-func (c *Container) VNCWebSocket(vnc *VNC) (chan []byte, chan []byte, chan error, func() error, error) {
- p := fmt.Sprintf("/nodes/%s/lxc/%d/vncwebsocket?port=%d&vncticket=%s",
- c.Node, c.VMID, vnc.Port, url.QueryEscape(vnc.Ticket))
-
- return c.client.VNCWebSocket(p, vnc)
-}
-
-func (c *Container) Feature(ctx context.Context) (hasFeature bool, err error) {
- var feature struct {
- HasFeature bool `json:"hasFeature"`
- }
- err = c.client.Get(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/feature", c.Node, c.VMID), &feature)
- return feature.HasFeature, err
-}
-
-func (c *Container) Interfaces(ctx context.Context) (interfaces ContainerInterfaces, err error) {
- err = c.client.Get(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/interfaces", c.Node, c.VMID), &interfaces)
- return interfaces, err
-}
-
-func (c *Container) Migrate(ctx context.Context, params *ContainerMigrateOptions) (task *Task, err error) {
- var upid UPID
- if err := c.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/migrate", c.Node, c.VMID), params, &upid); err != nil {
- return nil, err
- }
- return NewTask(upid, c.client), nil
-}
-
-func (c *Container) Resize(ctx context.Context, disk, size string) (task *Task, err error) {
- var upid UPID
- if err := c.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/resize", c.Node, c.VMID), map[string]interface{}{"disk": disk, "size": size}, &upid); err != nil {
- return nil, err
- }
- return NewTask(upid, c.client), nil
-}
-
-func (c *Container) MoveVolume(ctx context.Context, params *VirtualMachineMoveDiskOptions) (task *Task, err error) {
- var upid UPID
- if err := c.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/move_volume", c.Node, c.VMID), params, &upid); err != nil {
- return nil, err
- }
- return NewTask(upid, c.client), nil
-}
-
-func (c *Container) RRDData(ctx context.Context, timeframe Timeframe, consolidationFunction ...ConsolidationFunction) (rrddata []*RRDData, err error) {
- u := url.URL{Path: fmt.Sprintf("/lxc/%s/qemu/%d/rrddata", c.Node, c.VMID)}
-
- // consolidation functions are variadic because they're optional, but Proxmox only allows one cf parameter
- params := url.Values{}
- if len(consolidationFunction) > 0 {
- if len(consolidationFunction) != 1 {
- return nil, fmt.Errorf("only one consolidation function allowed")
- }
-
- params.Add("cf", string(consolidationFunction[0]))
- }
-
- params.Add("timeframe", string(timeframe))
- u.RawQuery = params.Encode()
-
- err = c.client.Get(ctx, u.String(), &rrddata)
- return
-}
-
-func (c *Container) Template(ctx context.Context) error {
- return c.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/template", c.Node, c.VMID), nil, nil)
-}
-
-func (c *Container) VNCProxy(ctx context.Context, vncOptions VNCProxyOptions) (vnc *VNC, err error) {
- return vnc, c.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/vncproxy", c.Node, c.VMID), vncOptions, &vnc)
-}
-
-func (c *Container) Snapshots(ctx context.Context) (snapshots []*ContainerSnapshot, err error) {
- err = c.client.Get(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/snapshot", c.Node, c.VMID), &snapshots)
- return
-}
-
-func (c *Container) NewSnapshot(ctx context.Context, snapName string) (task *Task, err error) {
- var upid UPID
- if err := c.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/snapshot", c.Node, c.VMID), map[string]interface{}{"snapname": snapName}, &upid); err != nil {
- return nil, err
- }
- return NewTask(upid, c.client), nil
-}
-
-func (c *Container) GetSnapshot(ctx context.Context, snapshot string) (snap []*ContainerSnapshot, err error) {
- return snap, c.client.Get(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/snapshot/%s", c.Node, c.VMID, snapshot), &snap)
-}
-
-func (c *Container) DeleteSnapshot(ctx context.Context, snapshot string) (task *Task, err error) {
- var upid UPID
- if err := c.client.Delete(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/snapshot/%s", c.Node, c.VMID, snapshot), &upid); err != nil {
- return nil, err
- }
- return NewTask(upid, c.client), nil
-}
-
-func (c *Container) RollbackSnapshot(ctx context.Context, snapshot string, start bool) (task *Task, err error) {
- var upid UPID
- if err := c.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/snapshot/%s/rollback", c.Node, c.VMID, snapshot), map[string]interface{}{"start": start}, &upid); err != nil {
- return nil, err
- }
- return NewTask(upid, c.client), nil
-}
-
-func (c *Container) GetSnapshotConfig(ctx context.Context, snapshot string) (config map[string]interface{}, err error) {
- return config, c.client.Get(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/snapshot/%s/config", c.Node, c.VMID, snapshot), &config)
-}
-
-func (c *Container) UpdateSnapshot(ctx context.Context, snapshot string) error {
- return c.client.Put(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/snapshot/%s/config", c.Node, c.VMID, snapshot), nil, nil)
-}
-
-func (c *Container) Firewall(ctx context.Context) (firewall *Firewall, err error) {
- return firewall, c.client.Get(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall", c.Node, c.VMID), &firewall)
-}
-
-func (c *Container) GetFirewallAliases(ctx context.Context) (aliases []*FirewallAlias, err error) {
- return aliases, c.client.Get(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall/aliases", c.Node, c.VMID), &aliases)
-}
-
-func (c *Container) NewFirewallAlias(ctx context.Context, alias *FirewallAlias) error {
- return c.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall/aliases", c.Node, c.VMID), alias, nil)
-}
-
-func (c *Container) GetFirewallAlias(ctx context.Context, name string) (alias *FirewallAlias, err error) {
- return alias, c.client.Get(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall/aliases/%s", c.Node, c.VMID, name), &alias)
-}
-
-func (c *Container) UpdateFirewallAlias(ctx context.Context, name string, alias *FirewallAlias) error {
- return c.client.Put(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall/aliases/%s", c.Node, c.VMID, name), alias, nil)
-}
-
-func (c *Container) DeleteFirewallAlias(ctx context.Context, name string) error {
- return c.client.Delete(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall/aliases/%s", c.Node, c.VMID, name), nil)
-}
-
-func (c *Container) GetFirewallIPSet(ctx context.Context) (ipsets []*FirewallIPSet, err error) {
- return ipsets, c.client.Get(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall/ipset", c.Node, c.VMID), &ipsets)
-}
-
-func (c *Container) NewFirewallIPSet(ctx context.Context, ipset FirewallIPSetCreationOption) error {
- return c.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall/ipset", c.Node, c.VMID), ipset, nil)
-}
-
-func (c *Container) DeleteFirewallIPSet(ctx context.Context, name string, force bool) error {
- return c.client.Delete(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall/ipset/%s", c.Node, c.VMID, name), map[string]interface{}{"force": force})
-}
-
-func (c *Container) GetFirewallIPSetEntries(ctx context.Context, name string) (entries []*FirewallIPSetEntry, err error) {
- return entries, c.client.Get(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall/ipset/%s", c.Node, c.VMID, name), &entries)
-}
-
-func (c *Container) NewFirewallIPSetEntry(ctx context.Context, name string, entry FirewallIPSetEntryCreationOption) error {
- return c.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall/ipset/%s", c.Node, c.VMID, name), entry, nil)
-}
-
-func (c *Container) DeleteFirewallIPSetEntry(ctx context.Context, name string, cidr string, digest string) error {
- return c.client.Delete(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall/ipset/%s/%s", c.Node, c.VMID, name, cidr), map[string]interface{}{
- "digest": digest,
- })
-}
-
-func (c *Container) GetFirewallIPSetEntry(ctx context.Context, name string, cidr string) (entry *FirewallIPSetEntry, err error) {
- err = c.client.Get(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall/ipset/%s/%s", c.Node, c.VMID, name, cidr), &entry)
- return
-}
-
-func (c *Container) UpdateFirewallIPSetEntry(ctx context.Context, name string, cidr string, entry *FirewallIPSetEntryUpdateOption) error {
- return c.client.Put(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall/ipset/%s/%s", c.Node, c.VMID, name, cidr), entry, nil)
-}
-
-func (c *Container) FirewallRules(ctx context.Context) (rules []*FirewallRule, err error) {
- return rules, c.client.Get(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall/rules", c.Node, c.VMID), &rules)
-}
-
-func (c *Container) NewFirewallRule(ctx context.Context, rule *FirewallRule) error {
- return c.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall/rules", c.Node, c.VMID), rule, nil)
-}
-
-func (c *Container) GetFirewallRule(ctx context.Context, rulePos int) (rule *FirewallRule, err error) {
- return rule, c.client.Get(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall/rules/%d", c.Node, c.VMID, rulePos), &rule)
-}
-
-func (c *Container) UpdateFirewallRule(ctx context.Context, rulePos int, rule *FirewallRule) error {
- return c.client.Put(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall/rules/%d", c.Node, c.VMID, rulePos), rule, nil)
-}
-
-func (c *Container) DeleteFirewallRule(ctx context.Context, rulePos int) error {
- return c.client.Delete(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall/rules/%d", c.Node, c.VMID, rulePos), nil)
-}
-
-func (c *Container) GetFirewallOptions(ctx context.Context) (options *FirewallVirtualMachineOption, err error) {
- return options, c.client.Get(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall/options", c.Node, c.VMID), &options)
-}
-
-func (c *Container) UpdateFirewallOptions(ctx context.Context, options *FirewallVirtualMachineOption) error {
- return c.client.Put(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/firewall/options", c.Node, c.VMID), options, nil)
-}
-
-// Tag Management Helpers
-
-// HasTag returns if a Tag is present in TagSlice
-func (c *Container) HasTag(value string) bool {
- if c.ContainerConfig == nil {
- return false
- }
-
- if c.ContainerConfig.Tags == "" {
- return false
- }
-
- if c.ContainerConfig.TagsSlice == nil {
- c.SplitTags()
- }
-
- for _, tag := range c.ContainerConfig.TagsSlice {
- if tag == value {
- return true
- }
- }
-
- return false
-}
-
-// AddTag appends the passed value to TagsSlice and updates Tags via c.Config
-// If accurate state is important, then reassign the value of Container after the task
-// has completed.
-func (c *Container) AddTag(ctx context.Context, value string) (*Task, error) {
- if c.HasTag(value) {
- return nil, ErrNoop
- }
-
- if c.ContainerConfig.TagsSlice == nil {
- c.SplitTags()
- }
-
- c.ContainerConfig.TagsSlice = append(c.ContainerConfig.TagsSlice, value)
- c.ContainerConfig.Tags = strings.Join(c.ContainerConfig.TagsSlice, TagSeperator)
- c.Tags = c.ContainerConfig.Tags // Keep the parent object up to date
-
- return c.Config(ctx, ContainerOption{
- Name: "tags",
- Value: c.ContainerConfig.Tags,
- })
-}
-
-// RemoveTag removes the passed value from TagsSlice and updates Tags via c.Config
-// If accurate state is important, then reassign the value of Container after the task
-// has completed.
-func (c *Container) RemoveTag(ctx context.Context, value string) (*Task, error) {
- if !c.HasTag(value) {
- return nil, ErrNoop
- }
-
- if c.ContainerConfig.TagsSlice == nil {
- c.SplitTags()
- }
-
- for i, tag := range c.ContainerConfig.TagsSlice {
- if tag == value {
- c.ContainerConfig.TagsSlice = append(
- c.ContainerConfig.TagsSlice[:i],
- c.ContainerConfig.TagsSlice[i+1:]...,
- )
- }
- }
-
- c.ContainerConfig.Tags = strings.Join(c.ContainerConfig.TagsSlice, TagSeperator)
- c.Tags = c.ContainerConfig.Tags // keep the parent object up to date
- return c.Config(ctx, ContainerOption{
- Name: "tags",
- Value: c.ContainerConfig.Tags,
- })
-}
-
-// SplitTags sets ContainerConfig TagsSlice my splitting the value of ContainerConfig.Tags with TagSeparator
-func (c *Container) SplitTags() {
- c.ContainerConfig.TagsSlice = strings.Split(c.ContainerConfig.Tags, TagSeperator)
-}
diff --git a/go-proxmox/containers_test.go b/go-proxmox/containers_test.go
deleted file mode 100644
index 9c0ba61..0000000
--- a/go-proxmox/containers_test.go
+++ /dev/null
@@ -1,358 +0,0 @@
-package proxmox
-
-import (
- "context"
- "testing"
-
- "github.com/luthermonson/go-proxmox/tests/mocks"
- "github.com/stretchr/testify/assert"
-)
-
-func TestContainer(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- node := Node{
- client: client,
- Name: "node1",
- }
- container, err := node.Container(ctx, 101)
- assert.Nil(t, err)
- assert.NotEmpty(t, container, container.ContainerConfig)
-}
-
-func TestContainers(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- node := Node{
- client: client,
- Name: "node1",
- }
- containers, err := node.Containers(ctx)
- assert.Nil(t, err)
- assert.Len(t, containers, 3)
-}
-
-func TestContainerClone(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- container := Container{
- client: client,
- Node: "node1",
- VMID: 101,
- }
- cloneOptions := ContainerCloneOptions{
- NewID: 102,
- }
- newid, _, err := container.Clone(ctx, &cloneOptions)
- assert.Equal(t, cloneOptions.NewID, newid)
- assert.Nil(t, err)
-}
-
-func TestContainerCloneWithoutNewID(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- container := Container{
- client: client,
- Node: "node1",
- VMID: 101,
- }
- cloneOptions := ContainerCloneOptions{}
- newid, _, err := container.Clone(ctx, &cloneOptions)
- assert.Equal(t, 100, newid)
- assert.Nil(t, err)
-}
-
-func TestContainerDelete(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- container := Container{
- client: client,
- Node: "node1",
- VMID: 101,
- }
- task, err := container.Delete(ctx)
- assert.Nil(t, err)
- assert.NotEmpty(t, task)
-}
-
-func TestContainerConfig(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- container := Container{
- client: client,
- Node: "node1",
- VMID: 101,
- }
- task, err := container.Config(ctx)
- assert.Nil(t, err)
- assert.NotEmpty(t, task)
-}
-
-func TestContainerStart(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- container := Container{
- client: client,
- Node: "node1",
- VMID: 101,
- }
- task, err := container.Start(ctx)
- assert.Nil(t, err)
- assert.NotEmpty(t, task)
-}
-
-func TestContainerStop(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- container := Container{
- client: client,
- Node: "node1",
- VMID: 101,
- }
- task, err := container.Stop(ctx)
- assert.Nil(t, err)
- assert.NotEmpty(t, task)
-}
-
-func TestContainerSuspend(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- container := Container{
- client: client,
- Node: "node1",
- VMID: 101,
- }
- task, err := container.Suspend(ctx)
- assert.Nil(t, err)
- assert.NotEmpty(t, task)
-}
-
-func TestContainerReboot(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- container := Container{
- client: client,
- Node: "node1",
- VMID: 101,
- }
- task, err := container.Reboot(ctx)
- assert.Nil(t, err)
- assert.NotEmpty(t, task)
-}
-
-func TestContainerResume(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- container := Container{
- client: client,
- Node: "node1",
- VMID: 101,
- }
- task, err := container.Resume(ctx)
- assert.Nil(t, err)
- assert.NotEmpty(t, task)
-}
-
-func TestContainerShutdown(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- container := Container{
- client: client,
- Node: "node1",
- VMID: 101,
- }
- task, err := container.Shutdown(ctx, false, 60)
- assert.Nil(t, err)
- assert.NotEmpty(t, task)
-}
-
-func TestContainerTemplate(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- container := Container{
- client: client,
- Node: "node1",
- VMID: 101,
- }
- err := container.Template(ctx)
- assert.Nil(t, err)
-}
-
-func TestContainerSnapshots(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- container := Container{
- client: client,
- Node: "node1",
- VMID: 101,
- }
- snapshots, err := container.Snapshots(ctx)
- assert.Nil(t, err)
- assert.Len(t, snapshots, 3)
-}
-
-func TestContainerNewSnapshot(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- container := Container{
- client: client,
- Node: "node1",
- VMID: 101,
- }
- task, err := container.NewSnapshot(ctx, "snapshot1")
- assert.Nil(t, err)
- assert.NotEmpty(t, task)
-}
-
-func TestContainerGetSnapshot(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- container := Container{
- client: client,
- Node: "node1",
- VMID: 101,
- }
- snapshot, err := container.GetSnapshot(ctx, "snapshot1")
- assert.Nil(t, err)
- assert.NotNil(t, snapshot)
-}
-
-func TestContainerDeleteSnapshot(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- container := Container{
- client: client,
- Node: "node1",
- VMID: 101,
- }
- task, err := container.DeleteSnapshot(ctx, "snapshot1")
- assert.Nil(t, err)
- assert.NotEmpty(t, task)
-}
-
-func TestContainerRollbackSnapshot(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- container := Container{
- client: client,
- Node: "node1",
- VMID: 101,
- }
- task, err := container.RollbackSnapshot(ctx, "snapshot1", true)
- assert.Nil(t, err)
- assert.NotEmpty(t, task)
-}
-
-func TestContainerInterfaces(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- container := Container{
- client: client,
- Node: "node1",
- VMID: 101,
- }
- interfaces, err := container.Interfaces(ctx)
- assert.Nil(t, err)
- assert.NotEmpty(t, interfaces)
- assert.Equal(t, interfaces, ContainerInterfaces{{HWAddr: "00:00:00:00:00:00", Inet: "127.0.0.1/8", Name: "lo", Inet6: "::1/128"}, {Inet6: "fe80::be24:11ff:fe89:6707/64", Name: "eth0", HWAddr: "bc:24:11:89:67:07", Inet: "192.168.3.95/22"}})
-}
-
-func TestContainerTagsSlice(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- container, err := node.Container(ctx, 101)
- assert.Nil(t, err)
-
- assert.NotEmpty(t, container.ContainerConfig.TagsSlice)
-}
-
-func TestContainer_AddTag(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- container, err := node.Container(ctx, 101)
- assert.Nil(t, err)
-
- _, err = container.AddTag(ctx, "newTag")
- assert.Nil(t, err)
- assert.True(t, container.HasTag("newTag"))
-}
-
-func TestContainer_HasTag(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- container, err := node.Container(ctx, 101)
- assert.Nil(t, err)
-
- assert.True(t, container.HasTag("tag1"))
- assert.False(t, container.HasTag("not_there"))
-}
-
-func TestContainer_RemoveTag(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- container, err := node.Container(ctx, 101)
- assert.Nil(t, err)
-
- assert.True(t, container.HasTag("tag1"))
- _, err = container.RemoveTag(ctx, "tag1")
- assert.Nil(t, err)
- assert.False(t, container.HasTag("tag1"))
-}
diff --git a/go-proxmox/examples/term-and-vnc/.air.toml b/go-proxmox/examples/term-and-vnc/.air.toml
deleted file mode 100644
index b2a3222..0000000
--- a/go-proxmox/examples/term-and-vnc/.air.toml
+++ /dev/null
@@ -1,51 +0,0 @@
-root = "."
-testdata_dir = "testdata"
-tmp_dir = "tmp"
-
-[build]
- args_bin = []
- bin = "./tmp/main"
- cmd = "go build -o ./tmp/main ."
- delay = 1000
- exclude_dir = ["assets", "tmp", "vendor", "testdata"]
- exclude_file = []
- exclude_regex = ["_test.go"]
- exclude_unchanged = false
- follow_symlink = false
- full_bin = ""
- include_dir = []
- include_ext = ["go", "tpl", "tmpl", "html"]
- include_file = []
- kill_delay = "0s"
- log = "build-errors.log"
- poll = false
- poll_interval = 0
- post_cmd = []
- pre_cmd = []
- rerun = false
- rerun_delay = 500
- send_interrupt = false
- stop_on_error = true
-
-[color]
- app = ""
- build = "yellow"
- main = "magenta"
- runner = "green"
- watcher = "cyan"
-
-[log]
- main_only = false
- time = false
-
-[misc]
- clean_on_exit = false
-
-[proxy]
- app_port = 0
- enabled = false
- proxy_port = 0
-
-[screen]
- clear_on_rebuild = false
- keep_scroll = true
diff --git a/go-proxmox/examples/term-and-vnc/.env.sample b/go-proxmox/examples/term-and-vnc/.env.sample
deleted file mode 100644
index fcc4937..0000000
--- a/go-proxmox/examples/term-and-vnc/.env.sample
+++ /dev/null
@@ -1,5 +0,0 @@
-PROXMOX_USERNAME=root@pam
-PROXMOX_PASSWORD=password
-PROXMOX_URL=https://192.168.0.200:8006/api2/json
-PROXMOX_NODE=proxmox5
-PROXMOX_VM=216
\ No newline at end of file
diff --git a/go-proxmox/examples/term-and-vnc/.gitignore b/go-proxmox/examples/term-and-vnc/.gitignore
deleted file mode 100644
index 5736aa3..0000000
--- a/go-proxmox/examples/term-and-vnc/.gitignore
+++ /dev/null
@@ -1,26 +0,0 @@
-# If you prefer the allow list template instead of the deny list, see community template:
-# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
-#
-# Binaries for programs and plugins
-*.exe
-*.exe~
-*.dll
-*.so
-*.dylib
-
-# Test binary, built with `go test -c`
-*.test
-
-# Output of the go coverage tool, specifically when used with LiteIDE
-*.out
-
-# Dependency directories (remove the comment below to include it)
-# vendor/
-tmp/
-
-# Go workspace file
-go.work
-go.work.sum
-
-# env file
-.env
\ No newline at end of file
diff --git a/go-proxmox/examples/term-and-vnc/README.md b/go-proxmox/examples/term-and-vnc/README.md
deleted file mode 100644
index a03e15b..0000000
--- a/go-proxmox/examples/term-and-vnc/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-# Proxmox VNC and Terminal Proxy
-
-This project provides a Go-based server for interacting with Proxmox virtual machines via VNC and terminal proxies. The server supports secure WebSocket connections and can be accessed through a simple web client.
-
-## Getting Started
-
-### Prerequisites
-
-- Go 1.18 or higher
-- OpenSSL for generating SSL certificates
-- Proxmox environment with a valid configuration
-
-### Installation
-
-1. **Generate SSL Certificates**
-
- Create self-signed SSL certificates for secure communication:
-
- ```bash
- openssl req -newkey rsa:2048 -nodes -keyout server.key -x509 -days 365 -out server.crt
- ```
-
-2. **Create the `.env` File**
-
- Add the following environment variables to a `.env` file in the root directory:
-
- ```plaintext
- PROXMOX_USERNAME=root@pam
- PROXMOX_PASSWORD=password
- PROXMOX_URL=https://192.168.0.200:8006/api2/json
- PROXMOX_NODE=proxmox5
- PROXMOX_VM=216
- ```
-
-3. **Install Dependencies**
-
- Install the necessary Go modules:
-
- ```bash
- go mod tidy
- ```
-
-### Running the Server
-
-Start the server with SSL enabled:
-
-```bash
-go run main.go
-```
-
-The server will be accessible at `https://localhost:8523`.
-
-### Endpoints
-
-- **`/`**: Returns "hello world".
-- **`/term`**: WebSocket endpoint for terminal access.
-- **`/vnc`**: WebSocket endpoint for VNC access. Requires a valid ticket.
-- **`/vnc-ticket`**: Generates and returns a VNC ticket.
-
-### Code Overview
-
-- **`main.go`**: The main application file that sets up the server and routes.
-- **`impl/term.go`**: Contains the implementation for the terminal WebSocket endpoint.
-- **`impl/vnc.go`**: Contains the implementation for the VNC WebSocket endpoint and ticket generation.
-
-### Code Overview
-
-- **`main.go`**: The main application file that sets up the server and routes. It configures logging, loads environment variables, and starts the server with SSL.
-
-- **`impl/term.go`**: Contains the implementation for the terminal WebSocket endpoint. It sets up a WebSocket connection for terminal access and handles communication between the client and the Proxmox virtual machine.
-
-- **`impl/vnc.go`**: Contains the implementation for the VNC WebSocket endpoint and ticket generation. It manages VNC connections and tickets:
- - The `tickets` map is used for learning purposes to store VNC tickets temporarily. In a real-world scenario, you should store tickets in a distributed cache or a persistent storage solution.
- - It is also possible to use a password instead of a ticket for authentication.
-
-### Acknowledgments
-
-A big thank you to ChatGPT for helping with the documentation and code improvements!
diff --git a/go-proxmox/examples/term-and-vnc/go.mod b/go-proxmox/examples/term-and-vnc/go.mod
deleted file mode 100644
index 102d422..0000000
--- a/go-proxmox/examples/term-and-vnc/go.mod
+++ /dev/null
@@ -1,49 +0,0 @@
-module term-and-vnc
-
-go 1.22.0
-
-replace github.com/luthermonson/go-proxmox => ../../
-
-require (
- github.com/gin-contrib/cors v1.7.2
- github.com/gin-gonic/gin v1.10.0
- github.com/gorilla/websocket v1.5.3
- github.com/joho/godotenv v1.5.1
- github.com/luthermonson/go-proxmox v0.1.1
- github.com/rs/zerolog v1.33.0
-)
-
-require (
- github.com/buger/goterm v1.0.4 // indirect
- github.com/bytedance/sonic v1.11.6 // indirect
- github.com/bytedance/sonic/loader v0.1.1 // indirect
- github.com/cloudwego/base64x v0.1.4 // indirect
- github.com/cloudwego/iasm v0.2.0 // indirect
- github.com/diskfs/go-diskfs v1.2.0 // indirect
- github.com/gabriel-vasile/mimetype v1.4.3 // indirect
- github.com/gin-contrib/sse v0.1.0 // indirect
- github.com/go-playground/locales v0.14.1 // indirect
- github.com/go-playground/universal-translator v0.18.1 // indirect
- github.com/go-playground/validator/v10 v10.20.0 // indirect
- github.com/goccy/go-json v0.10.2 // indirect
- github.com/jinzhu/copier v0.3.4 // indirect
- github.com/json-iterator/go v1.1.12 // indirect
- github.com/klauspost/cpuid/v2 v2.2.7 // indirect
- github.com/leodido/go-urn v1.4.0 // indirect
- github.com/magefile/mage v1.14.0 // indirect
- github.com/mattn/go-colorable v0.1.13 // indirect
- github.com/mattn/go-isatty v0.0.20 // indirect
- github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
- github.com/modern-go/reflect2 v1.0.2 // indirect
- github.com/pelletier/go-toml/v2 v2.2.2 // indirect
- github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
- github.com/ugorji/go/codec v1.2.12 // indirect
- golang.org/x/arch v0.8.0 // indirect
- golang.org/x/crypto v0.23.0 // indirect
- golang.org/x/net v0.25.0 // indirect
- golang.org/x/sys v0.20.0 // indirect
- golang.org/x/text v0.15.0 // indirect
- google.golang.org/protobuf v1.34.1 // indirect
- gopkg.in/djherbis/times.v1 v1.2.0 // indirect
- gopkg.in/yaml.v3 v3.0.1 // indirect
-)
diff --git a/go-proxmox/examples/term-and-vnc/go.sum b/go-proxmox/examples/term-and-vnc/go.sum
deleted file mode 100644
index a49306e..0000000
--- a/go-proxmox/examples/term-and-vnc/go.sum
+++ /dev/null
@@ -1,171 +0,0 @@
-4d63.com/gochecknoinits v0.0.0-20200108094044-eb73b47b9fc4/go.mod h1:4o1i5aXtIF5tJFt3UD1knCVmWOXg7fLYdHVu6jeNcnM=
-github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/buger/goterm v1.0.4 h1:Z9YvGmOih81P0FbVtEYTFF6YsSgxSUKEhf/f9bTMXbY=
-github.com/buger/goterm v1.0.4/go.mod h1:HiFWV3xnkolgrBV3mY8m0X0Pumt4zg4QhbdOzQtB8tE=
-github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0=
-github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4=
-github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM=
-github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
-github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y=
-github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w=
-github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg=
-github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY=
-github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
-github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
-github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/diskfs/go-diskfs v1.2.0 h1:Ow4xorEDw1VNYKbC+SA/qQNwi5gWIwdKUxmUcLFST24=
-github.com/diskfs/go-diskfs v1.2.0/go.mod h1:ZTeTbzixuyfnZW5y5qKMtjV2o+GLLHo1KfMhotJI4Rk=
-github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
-github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
-github.com/gin-contrib/cors v1.7.2 h1:oLDHxdg8W/XDoN/8zamqk/Drgt4oVZDvaV0YmvVICQw=
-github.com/gin-contrib/cors v1.7.2/go.mod h1:SUJVARKgQ40dmrzgXEVxj2m7Ig1v1qIboQkPDTQ9t2E=
-github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
-github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
-github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU=
-github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y=
-github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
-github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
-github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
-github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
-github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
-github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
-github.com/go-playground/validator/v10 v10.20.0 h1:K9ISHbSaI0lyB2eWMPJo+kOS/FBExVwjEviJTixqxL8=
-github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
-github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
-github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
-github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
-github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
-github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
-github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/gordonklaus/ineffassign v0.0.0-20190601041439-ed7b1b5ee0f8/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU=
-github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
-github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
-github.com/h2non/gock v1.2.0 h1:K6ol8rfrRkUOefooBC8elXoaNGYkpp7y2qcxGG6BzUE=
-github.com/h2non/gock v1.2.0/go.mod h1:tNhoxHYW2W42cYkYb1WqzdbYIieALC99kpYr7rH/BQk=
-github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw=
-github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI=
-github.com/jgautheron/goconst v0.0.0-20170703170152-9740945f5dcb/go.mod h1:82TxjOpWQiPmywlbIaB2ZkqJoSYJdLGPgAJDvM3PbKc=
-github.com/jinzhu/copier v0.3.4 h1:mfU6jI9PtCeUjkjQ322dlff9ELjGDu975C2p/nrubVI=
-github.com/jinzhu/copier v0.3.4/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg=
-github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
-github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
-github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
-github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
-github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
-github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM=
-github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
-github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
-github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
-github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
-github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
-github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
-github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
-github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
-github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
-github.com/magefile/mage v1.14.0 h1:6QDX3g6z1YvJ4olPhT1wksUcSa/V0a1B+pJb73fBjyo=
-github.com/magefile/mage v1.14.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
-github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
-github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
-github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
-github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
-github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
-github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
-github.com/mibk/dupl v1.0.0/go.mod h1:pCr4pNxxIbFGvtyCOi0c7LVjmV6duhKWV+ex5vh38ME=
-github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
-github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
-github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
-github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
-github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
-github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
-github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
-github.com/pierrec/lz4 v2.3.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
-github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/pkg/xattr v0.4.1/go.mod h1:W2cGD0TBEus7MkUgv0tNZ9JutLtVO3cXu+IBRuHqnFs=
-github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
-github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
-github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
-github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
-github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
-github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8=
-github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
-github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
-github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
-github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
-github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
-github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
-github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
-github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
-github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
-github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
-github.com/stripe/safesql v0.2.0/go.mod h1:q7b2n0JmzM1mVGfcYpanfVb2j23cXZeWFxcILPn3JV4=
-github.com/tsenart/deadcode v0.0.0-20160724212837-210d2dc333e9/go.mod h1:q+QjxYvZ+fpjMXqs+XEriussHjSYqeXVnAdSV1tkMYk=
-github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
-github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
-github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE=
-github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
-github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8=
-golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
-golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc=
-golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
-golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
-golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
-golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
-golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
-golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
-golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
-golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sys v0.0.0-20181021155630-eda9bb28ed51/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210331175145-43e1dd70ce54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
-golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
-golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
-golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
-golang.org/x/tools v0.0.0-20200102200121-6de373a2766c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
-golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
-google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
-gopkg.in/djherbis/times.v1 v1.2.0 h1:UCvDKl1L/fmBygl2Y7hubXCnY7t4Yj46ZrBFNUipFbM=
-gopkg.in/djherbis/times.v1 v1.2.0/go.mod h1:AQlg6unIsrsCEdQYhTzERy542dz6SFdQFZFv6mUY0P8=
-gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
-gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
-gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
-mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
-mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4=
-nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50=
-rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
diff --git a/go-proxmox/examples/term-and-vnc/impl/common.go b/go-proxmox/examples/term-and-vnc/impl/common.go
deleted file mode 100644
index 2f08f9e..0000000
--- a/go-proxmox/examples/term-and-vnc/impl/common.go
+++ /dev/null
@@ -1,51 +0,0 @@
-package impl
-
-import (
- "context"
- "crypto/tls"
- "net/http"
- "os"
- "strconv"
-
- "github.com/luthermonson/go-proxmox"
-)
-
-var client *proxmox.Client
-
-func Init() {
- insecureHTTPClient := http.Client{
- Transport: &http.Transport{
- TLSClientConfig: &tls.Config{
- InsecureSkipVerify: true,
- },
- },
- }
-
- credentials := proxmox.Credentials{
- Username: os.Getenv("PROXMOX_USERNAME"),
- Password: os.Getenv("PROXMOX_PASSWORD"),
- }
- client = proxmox.NewClient(os.Getenv("PROXMOX_URL"),
- proxmox.WithHTTPClient(&insecureHTTPClient),
- proxmox.WithCredentials(&credentials),
- )
-}
-
-func GetVm() (*proxmox.VirtualMachine, error) {
- node, err := client.Node(context.Background(), os.Getenv("PROXMOX_NODE"))
- if err != nil {
- return nil, err
- }
-
- vmId, err := strconv.Atoi(os.Getenv("PROXMOX_VM"))
- if err != nil {
- return nil, err
- }
-
- vm, err := node.VirtualMachine(context.Background(), vmId)
- if err != nil {
- return nil, err
- }
-
- return vm, nil
-}
diff --git a/go-proxmox/examples/term-and-vnc/impl/term.go b/go-proxmox/examples/term-and-vnc/impl/term.go
deleted file mode 100644
index af26452..0000000
--- a/go-proxmox/examples/term-and-vnc/impl/term.go
+++ /dev/null
@@ -1,88 +0,0 @@
-package impl
-
-import (
- "context"
- "net/http"
-
- "github.com/gin-gonic/gin"
- "github.com/gorilla/websocket"
- "github.com/rs/zerolog/log"
-)
-
-func Term(c *gin.Context) {
- vm, err := GetVm()
- if err != nil {
- log.Error().Err(err).Msg("Error getting version")
- return
- }
-
- term, err := vm.TermProxy(context.Background())
- if err != nil {
- log.Error().Err(err).Msg("Error getting version")
- return
- }
- log.Debug().Any("VNC", term).Send()
-
- send, recv, errs, close, err := vm.TermWebSocket(term)
- if err != nil {
- log.Error().Err(err).Msg("Error getting version")
- return
- }
- defer close()
-
- var upgrader = websocket.Upgrader{
- ReadBufferSize: 1024,
- WriteBufferSize: 1024,
- CheckOrigin: func(r *http.Request) bool { return true },
- }
-
- ws, err := upgrader.Upgrade(c.Writer, c.Request, nil)
- if err != nil {
- return
- }
- defer ws.Close()
-
- done := make(chan struct{})
- go reader(ws, send, done)
- go writer(ws, recv, errs, done)
-
- <-done
-}
-
-func reader(ws *websocket.Conn, send chan []byte, done chan struct{}) {
- for {
- _, msg, err := ws.ReadMessage()
- if err != nil {
- if websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway, websocket.CloseAbnormalClosure) {
- log.Error().Err(err).Send()
- }
- done <- struct{}{}
- return
- }
- send <- msg
- }
-}
-
-func writer(ws *websocket.Conn, recv chan []byte, errs chan error, done chan struct{}) {
- for {
- select {
- case msg := <-recv:
- err := ws.WriteMessage(websocket.TextMessage, msg)
- if err != nil {
- done <- struct{}{}
- log.Error().Err(err).Send()
- return
- }
-
- case err := <-errs:
- if err != nil {
- log.Error().Err(err).Send()
- }
- done <- struct{}{}
- return
- case <-done:
- return
- }
-
- }
-}
diff --git a/go-proxmox/examples/term-and-vnc/impl/vnc.go b/go-proxmox/examples/term-and-vnc/impl/vnc.go
deleted file mode 100644
index 50d6d52..0000000
--- a/go-proxmox/examples/term-and-vnc/impl/vnc.go
+++ /dev/null
@@ -1,129 +0,0 @@
-package impl
-
-import (
- "context"
- "encoding/base64"
- "net/http"
- "strings"
-
- "github.com/gin-gonic/gin"
- "github.com/gorilla/websocket"
- "github.com/luthermonson/go-proxmox"
- "github.com/rs/zerolog/log"
-)
-
-var tickets = make(map[string]*proxmox.VNC)
-
-func VncTicket(c *gin.Context) {
- vm, err := GetVm()
- if err != nil {
- log.Error().Err(err).Msg("Error getting version")
- return
- }
-
- vnc, err := vm.VNCProxy(context.Background(), nil)
- if err != nil {
- log.Error().Err(err).Msg("Error getting version")
- return
- }
-
- // log.Debug().Str("Ticket", vnc.Ticket).Send()
- id := base64.StdEncoding.EncodeToString([]byte(vnc.Ticket))
- tickets[id] = vnc
-
- c.JSON(http.StatusOK, gin.H{"ticket": id})
-}
-
-func Vnc(c *gin.Context) {
- log.Debug().Msg("New VNC connection")
- // vnc, err := vm.VNCProxy(context.Background(), nil)
- id := c.Query("ticket")
- vm, err := GetVm()
- if err != nil {
- log.Error().Err(err).Msg("Error getting version")
- return
- }
-
- // vnc, err := vm.VNCProxy(context.Background(), nil)
- // if err != nil {
- // log.Error().Err(err).Msg("Error getting version")
- // return
- // }
- vnc := tickets[string(id)]
-
- if vnc == nil {
- log.Error().Msg("VNC ticket not found")
- return
- }
-
- // log.Debug().Str("Ticket", vnc.Ticket).Send()
- send, recv, errs, close, err := vm.VNCWebSocket(vnc)
- if err != nil {
- log.Error().Err(err).Msg("Error getting version")
- return
- }
- defer close()
-
- var upgrader = websocket.Upgrader{
- ReadBufferSize: 1024,
- WriteBufferSize: 1024,
- CheckOrigin: func(r *http.Request) bool { return true },
- }
-
- ws, err := upgrader.Upgrade(c.Writer, c.Request, nil)
- if err != nil {
- return
- }
- defer ws.Close()
-
- done := make(chan struct{})
-
- go func() {
- for {
- select {
- case <-done:
- return
- case msg := <-recv:
- // log.Debug().Bytes("msg", msg).Msg("proxmox:")
- err = ws.WriteMessage(websocket.BinaryMessage, msg)
- if err != nil {
- done <- struct{}{}
- log.Error().Err(err).Send()
- return
- }
- }
- }
- }()
-
- go func() {
- for {
- select {
- case <-done:
- return
- case err := <-errs:
- if err != nil {
- log.Error().Err(err).Send()
- }
- done <- struct{}{}
- return
- default:
- _, msg, err := ws.ReadMessage()
- if err != nil {
- done <- struct{}{}
- if strings.Contains(err.Error(), "use of closed network connection") {
- return
- }
- if !websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway, websocket.CloseAbnormalClosure) {
- return
- }
- log.Error().Err(err).Msg("Error reading from websocket")
- return
- }
- // log.Debug().Bytes("msg", msg).Msg("Client:")
- send <- msg
- }
- }
- }()
-
- <-done
-}
diff --git a/go-proxmox/examples/term-and-vnc/main.go b/go-proxmox/examples/term-and-vnc/main.go
deleted file mode 100644
index 7ab5466..0000000
--- a/go-proxmox/examples/term-and-vnc/main.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package main
-
-import (
- "net/http"
- "os"
- "path/filepath"
- "strconv"
- "term-and-vnc/impl"
-
- "github.com/gin-contrib/cors"
- "github.com/gin-gonic/gin"
- "github.com/joho/godotenv"
- "github.com/rs/zerolog"
- "github.com/rs/zerolog/log"
-)
-
-func main() {
- zerolog.CallerMarshalFunc = func(pc uintptr, file string, line int) string {
- return filepath.Base(file) + ":" + strconv.Itoa(line)
- }
- log.Logger = log.
- With().
- Caller().
- Logger().
- Output(zerolog.ConsoleWriter{Out: os.Stderr})
- godotenv.Load()
-
- impl.Init()
-
- log.Info().Msg("starting server")
- r := gin.Default()
- r.Use(cors.Default())
-
- r.GET("/", func(c *gin.Context) {
- c.String(http.StatusOK, "hello world")
- })
- r.GET("/term", impl.Term)
- r.GET("/vnc", impl.Vnc)
- r.GET("/vnc-ticket", impl.VncTicket)
-
- r.RunTLS(":8523", "server.crt", "server.key")
-}
diff --git a/go-proxmox/examples/term-and-vnc/server.crt b/go-proxmox/examples/term-and-vnc/server.crt
deleted file mode 100644
index ea26bd8..0000000
--- a/go-proxmox/examples/term-and-vnc/server.crt
+++ /dev/null
@@ -1,20 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDWzCCAkOgAwIBAgIUYGRkMwCIazjPiT4W5GC6A4L2Ww4wDQYJKoZIhvcNAQEL
-BQAwPTELMAkGA1UEBhMCQlIxCzAJBgNVBAgMAlJKMSEwHwYDVQQKDBhJbnRlcm5l
-dCBXaWRnaXRzIFB0eSBMdGQwHhcNMjQwOTEyMDQyNjQ0WhcNMjUwOTEyMDQyNjQ0
-WjA9MQswCQYDVQQGEwJCUjELMAkGA1UECAwCUkoxITAfBgNVBAoMGEludGVybmV0
-IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
-AL5GpQIw8TsB86PnLvJ5MwQjBHE3jVPaVj2f3tsFGaSUpKW1O/te3Icctu3qm+6M
-uOXQi4TSl6krDF2Qm/bQo4B14GBTvSlkhowQLAzZRqxswQetEdMOkA+JuErNhOyc
-GqMifxkemLSr7DgnuApgw1Y3/mKTelB4UfFJT+j5uLxJYoL9lvdp73VG0QaHPpzO
-ybS4N2LCu8GXb7uj4k/7yCXHTEWJxd5GbactPXZyUPbXEv1sLTgd+108oa+0QP+L
-b+ZPLsUZavlZy7vAVKfWNXP1GvIw9bghNXoKuopACUb6r4CMDHlsTtuFI/vKmuhY
-Lr5jp3gnyOHy1a5J6aqARRUCAwEAAaNTMFEwHQYDVR0OBBYEFASiWaeWhF3HhScq
-BYu3M5Tgn2fbMB8GA1UdIwQYMBaAFASiWaeWhF3HhScqBYu3M5Tgn2fbMA8GA1Ud
-EwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBALwyCaXwKiXNxoZAQNaDdjlT
-hibmruWxS0tG8QrUvk2iqm/wGpkIMl3WB7sMzCFpRXCiCiJw6CupUWWGeptAmISK
-+MbmluA2wyLt84gtWoEpClv2GeVUiZqOQA3J85FyrC2uWMoCGE6rEd8gF4dF945Y
-F5bh4vc4cBKKHamWRgk0VoE11bzbZD8/ZgShxKcIq7vPLn/OO/CHw3Llm06klnvG
-rx+cIHcychCP4BRxm+pJNjqKKvxVJnZgz1QS9EiCcIFEpE3TaxSy0XZwlm8a4OgO
-EpceWw7qpH42Rm44hOWScUhELgP026kBimOP4CRhmRhweLiChmk1NfR0s4OrA5E=
------END CERTIFICATE-----
diff --git a/go-proxmox/examples/term-and-vnc/server.key b/go-proxmox/examples/term-and-vnc/server.key
deleted file mode 100644
index 2f1f216..0000000
--- a/go-proxmox/examples/term-and-vnc/server.key
+++ /dev/null
@@ -1,28 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC+RqUCMPE7AfOj
-5y7yeTMEIwRxN41T2lY9n97bBRmklKSltTv7XtyHHLbt6pvujLjl0IuE0pepKwxd
-kJv20KOAdeBgU70pZIaMECwM2UasbMEHrRHTDpAPibhKzYTsnBqjIn8ZHpi0q+w4
-J7gKYMNWN/5ik3pQeFHxSU/o+bi8SWKC/Zb3ae91RtEGhz6czsm0uDdiwrvBl2+7
-o+JP+8glx0xFicXeRm2nLT12clD21xL9bC04HftdPKGvtED/i2/mTy7FGWr5Wcu7
-wFSn1jVz9RryMPW4ITV6CrqKQAlG+q+AjAx5bE7bhSP7yproWC6+Y6d4J8jh8tWu
-SemqgEUVAgMBAAECggEABLzODXap/vHevtk5+EQPwt3bVbVQIcMZLBofqpzfJVOl
-INIZHvpe68dJf7V8ce1TijdNzf4PVCE0At1foL7Tn1ZwAn37Qv1Tg0fAzQYY5iCk
-EryaqcJeUGC5s7UXxuthF2g7uWSjYTY5oLFOegWsP2iP/yTUYg4I3kTYxkB3esqe
-+KClmMXKZUUxXk5I3ITr0V9mY/RRZhQUnqYQlN7uxGgEIuqiAp/yt6/+2tfv2pmW
-aBHtwsLEbfP2oORC27yjOP0nXjnb0lcuyiDYp6JLIQzRNIJbAMFPAJ/ppfC8WiwT
-5ntSlc87gDJm7PdC4nwtIoxqFVk8p2wtfUUtHR5fuQKBgQDiO7VkYsyyHizbh+G2
-nl6A68rRssT6JOxPGTrbgcs1fVIvjjeUIB5jYNtR0LIg2YXcyrzk6W9BWCVmu1rh
-LIpPqxzkKwvirtEoevjluHkPX+tn+qctigEgA1Tww3+KjJtP6CXBHu7+oPt9EL6n
-IwytVxjljjc0+IYrUX3onxG4OQKBgQDXT8ZMouiY6dDeAEoeUnxPzHZbeTR+XO+7
-/quCrXoDchdJhJCvmqDKDCj3ZmaxOf9a4oCOhg8klwMi0REgwY0nWYjCKxkseyr+
-v2eSAJcdya6WFnmAx4L/8QREaAy8PfjqPBNyl/p/5OSMdte7fPXnqIyXCt/8kcpX
-OH2oR2dbvQKBgFBBYEMBbZ5OaBlk5eST3/CaNTQY2BnpGU+iIqgWLlGGaK5oJD1O
-+5jDlmo6v8Y5hGxkG4iVaxtiOrpsAnxZAaPrju8+ehPrclWK8lsECyYyH9+eIspb
-57REmlBi+g7bfIlnUGVnJN99mlmupAPEwk2H1VQyFFGdTHN3kFQCghW5AoGAXDg4
-8P4drdEHuu5Y0J/3yp4CW6+QQkdADz9G6pOu3Oby/nQfHHeYQrHuofhkJ6h1rNGy
-yli1B7D+kN0G/wanlKEOqEuZXqnqgm4syCYkk4eclYBOzk+l1kW+1CXUvpO0l27f
-zYc2ray2D0ufnxgoou5YOSFZSm6PQchaWccrh+kCgYBiB5t2e4eW6aPFiarKbkz3
-5kx4WPe4OfjNF0i1sVDcdV+4QNDnjRkmkyhxPpjfK6BkfUUCgi355xYTg0wLzZgR
-4G1SPBLaXS4YIda3BDqxy1C91uBTxflwQBX3SlYjBAgMRyjYnLzA2wqKdyUAL8MP
-Kk7tm1pZjgRSnl3Q8jSpzQ==
------END PRIVATE KEY-----
diff --git a/go-proxmox/examples/term-and-vnc/website/.gitignore b/go-proxmox/examples/term-and-vnc/website/.gitignore
deleted file mode 100644
index a547bf3..0000000
--- a/go-proxmox/examples/term-and-vnc/website/.gitignore
+++ /dev/null
@@ -1,24 +0,0 @@
-# Logs
-logs
-*.log
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-pnpm-debug.log*
-lerna-debug.log*
-
-node_modules
-dist
-dist-ssr
-*.local
-
-# Editor directories and files
-.vscode/*
-!.vscode/extensions.json
-.idea
-.DS_Store
-*.suo
-*.ntvs*
-*.njsproj
-*.sln
-*.sw?
diff --git a/go-proxmox/examples/term-and-vnc/website/index.html b/go-proxmox/examples/term-and-vnc/website/index.html
deleted file mode 100644
index 987320b..0000000
--- a/go-proxmox/examples/term-and-vnc/website/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
- Document
-
-
-
- Term
- VNC
-
-
-
\ No newline at end of file
diff --git a/go-proxmox/examples/term-and-vnc/website/package.json b/go-proxmox/examples/term-and-vnc/website/package.json
deleted file mode 100644
index 1b42f3b..0000000
--- a/go-proxmox/examples/term-and-vnc/website/package.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "website",
- "private": true,
- "version": "0.0.0",
- "type": "module",
- "scripts": {
- "dev": "vite",
- "build": "vite build",
- "preview": "vite preview"
- },
- "devDependencies": {
- "@vitejs/plugin-basic-ssl": "^1.1.0",
- "vite": "^5.4.1"
- },
- "dependencies": {
- "@novnc/novnc": "^1.5.0",
- "@xterm/addon-attach": "^0.11.0",
- "@xterm/xterm": "^5.5.0"
- }
-}
\ No newline at end of file
diff --git a/go-proxmox/examples/term-and-vnc/website/public/vite.svg b/go-proxmox/examples/term-and-vnc/website/public/vite.svg
deleted file mode 100644
index e7b8dfb..0000000
--- a/go-proxmox/examples/term-and-vnc/website/public/vite.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/go-proxmox/examples/term-and-vnc/website/style.css b/go-proxmox/examples/term-and-vnc/website/style.css
deleted file mode 100644
index 9b5e69f..0000000
--- a/go-proxmox/examples/term-and-vnc/website/style.css
+++ /dev/null
@@ -1,10 +0,0 @@
-body {
- margin: 0;
- padding: 0;
- height: 100vh;
- overflow: hidden;
-}
-
-.xterm {
- padding: 5px;
-}
\ No newline at end of file
diff --git a/go-proxmox/examples/term-and-vnc/website/term.html b/go-proxmox/examples/term-and-vnc/website/term.html
deleted file mode 100644
index 5276c3d..0000000
--- a/go-proxmox/examples/term-and-vnc/website/term.html
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
- Proxmox Terminal
-
-
-
-
-
-
-
-
diff --git a/go-proxmox/examples/term-and-vnc/website/term.js b/go-proxmox/examples/term-and-vnc/website/term.js
deleted file mode 100644
index 14520e5..0000000
--- a/go-proxmox/examples/term-and-vnc/website/term.js
+++ /dev/null
@@ -1,21 +0,0 @@
-import { Terminal } from "@xterm/xterm";
-import { AttachAddon } from "@xterm/addon-attach";
-
-const term = new Terminal({
- cursorBlink: true,
- theme: {
- foreground: "#00ff00",
- background: "#000000",
- cursor: "#00ff00",
- },
-});
-term.open(document.getElementById("terminal"));
-
-const url = "wss://term-and-vnc.toquinha.online/term";
-const socket = new WebSocket(url);
-const attachAddon = new AttachAddon(socket);
-term.loadAddon(attachAddon);
-
-// term.onKey(key => {
-// socket.send(key.key);
-// });
diff --git a/go-proxmox/examples/term-and-vnc/website/vite.config.js b/go-proxmox/examples/term-and-vnc/website/vite.config.js
deleted file mode 100644
index 81ffcfe..0000000
--- a/go-proxmox/examples/term-and-vnc/website/vite.config.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import basicSsl from "@vitejs/plugin-basic-ssl";
-
-export default {
- plugins: [basicSsl()],
-};
diff --git a/go-proxmox/examples/term-and-vnc/website/vnc.css b/go-proxmox/examples/term-and-vnc/website/vnc.css
deleted file mode 100644
index 7f96f68..0000000
--- a/go-proxmox/examples/term-and-vnc/website/vnc.css
+++ /dev/null
@@ -1,34 +0,0 @@
-body {
- margin: 0;
- background-color: dimgrey;
- height: 100%;
- display: flex;
- flex-direction: column;
-}
-html {
- height: 100%;
-}
-
-#top_bar {
- background-color: #6e84a3;
- color: white;
- font: bold 12px Helvetica;
- padding: 6px 5px 4px 5px;
- border-bottom: 1px outset;
-}
-#status {
- text-align: center;
-}
-#sendCtrlAltDelButton {
- position: fixed;
- top: 0px;
- right: 0px;
- border: 1px outset;
- padding: 5px 5px 4px 5px;
- cursor: pointer;
-}
-
-#screen {
- flex: 1; /* fill remaining space */
- overflow: hidden;
-}
\ No newline at end of file
diff --git a/go-proxmox/examples/term-and-vnc/website/vnc.html b/go-proxmox/examples/term-and-vnc/website/vnc.html
deleted file mode 100644
index 94977e7..0000000
--- a/go-proxmox/examples/term-and-vnc/website/vnc.html
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
- NoVNC Client
-
-
-
-
- noVNC Client
-
- Status: Desconectado
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/go-proxmox/examples/term-and-vnc/website/vnc.js b/go-proxmox/examples/term-and-vnc/website/vnc.js
deleted file mode 100644
index 23a4e40..0000000
--- a/go-proxmox/examples/term-and-vnc/website/vnc.js
+++ /dev/null
@@ -1,56 +0,0 @@
-import RFB from "@novnc/novnc";
-
-const connectButton = document.getElementById("connectButton");
-const disconnectButton = document.getElementById("disconnectButton");
-const statusElement = document.getElementById("status");
-let rfb;
-
-connectButton.addEventListener("click", () => {
- const url = "https://term-and-vnc.toquinha.online/vnc-ticket";
- const wss = "https://term-and-vnc.toquinha.online/vnc";
-
- fetch(url)
- .then((response) => response.json())
- .then((data) => {
- const ticket = data.ticket;
- connect(`${wss}?ticket=${ticket}`, atob(ticket));
- });
-
- statusElement.textContent = "Conectando ao VNC Parte 1";
-});
-
-disconnectButton.addEventListener("click", () => {
- if (rfb) {
- rfb.disconnect();
- statusElement.textContent = "Desconectado manualmente";
- }
-});
-
-function connect(url, password) {
- statusElement.textContent = "Conectando ao VNC Parte 2";
- // Inicia a conexão VNC
- rfb = new RFB(document.getElementById("vncContainer"), url, {
- shared: false,
- repeaterID: false,
- credentials: {
- password: password, // Substitua pela senha do VNC
- },
- });
-
- rfb.addEventListener("connect", () => {
- statusElement.textContent = "Conectado ao VNC";
- });
-
- rfb.addEventListener("disconnect", () => {
- statusElement.textContent = "Desconectado do VNC";
- });
-
- rfb.addEventListener("credentialsrequired", () => {
- alert("Credenciais necessárias");
- // Você pode solicitar credenciais aqui se ainda não forneceu
- });
-
- rfb.addEventListener("securityfailure", (e) => {
- statusElement.textContent = `Falha de segurança: ${e.detail.reason}`;
- });
-}
diff --git a/go-proxmox/go.mod b/go-proxmox/go.mod
deleted file mode 100644
index 25e8d69..0000000
--- a/go-proxmox/go.mod
+++ /dev/null
@@ -1,22 +0,0 @@
-module github.com/luthermonson/go-proxmox
-
-go 1.25
-
-require (
- github.com/buger/goterm v1.0.4
- github.com/diskfs/go-diskfs v1.7.0
- github.com/gorilla/websocket v1.4.2
- github.com/h2non/gock v1.2.0
- github.com/jinzhu/copier v0.3.4
- github.com/magefile/mage v1.14.0
- github.com/stretchr/testify v1.10.0
-)
-
-require (
- github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/djherbis/times v1.6.0 // indirect
- github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect
- github.com/pmezard/go-difflib v1.0.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- gopkg.in/yaml.v3 v3.0.1 // indirect
-)
diff --git a/go-proxmox/go.sum b/go-proxmox/go.sum
deleted file mode 100644
index 0883609..0000000
--- a/go-proxmox/go.sum
+++ /dev/null
@@ -1,50 +0,0 @@
-github.com/anchore/go-lzo v0.1.0 h1:NgAacnzqPeGH49Ky19QKLBZEuFRqtTG9cdaucc3Vncs=
-github.com/anchore/go-lzo v0.1.0/go.mod h1:3kLx0bve2oN1iDwgM1U5zGku1Tfbdb0No5qp1eL1fIk=
-github.com/buger/goterm v1.0.4 h1:Z9YvGmOih81P0FbVtEYTFF6YsSgxSUKEhf/f9bTMXbY=
-github.com/buger/goterm v1.0.4/go.mod h1:HiFWV3xnkolgrBV3mY8m0X0Pumt4zg4QhbdOzQtB8tE=
-github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
-github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/diskfs/go-diskfs v1.7.0 h1:vonWmt5CMowXwUc79jWyGrf2DIMeoOjkLlMnQYGVOs8=
-github.com/diskfs/go-diskfs v1.7.0/go.mod h1:LhQyXqOugWFRahYUSw47NyZJPezFzB9UELwhpszLP/k=
-github.com/djherbis/times v1.6.0 h1:w2ctJ92J8fBvWPxugmXIv7Nz7Q3iDMKNx9v5ocVH20c=
-github.com/djherbis/times v1.6.0/go.mod h1:gOHeRAz2h+VJNZ5Gmc/o7iD9k4wW7NMVqieYCY99oc0=
-github.com/elliotwutingfeng/asciiset v0.0.0-20230602022725-51bbb787efab h1:h1UgjJdAAhj+uPL68n7XASS6bU+07ZX1WJvVS2eyoeY=
-github.com/elliotwutingfeng/asciiset v0.0.0-20230602022725-51bbb787efab/go.mod h1:GLo/8fDswSAniFG+BFIaiSPcK610jyzgEhWYPQwuQdw=
-github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM=
-github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
-github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
-github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
-github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
-github.com/h2non/gock v1.2.0 h1:K6ol8rfrRkUOefooBC8elXoaNGYkpp7y2qcxGG6BzUE=
-github.com/h2non/gock v1.2.0/go.mod h1:tNhoxHYW2W42cYkYb1WqzdbYIieALC99kpYr7rH/BQk=
-github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw=
-github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI=
-github.com/jinzhu/copier v0.3.4 h1:mfU6jI9PtCeUjkjQ322dlff9ELjGDu975C2p/nrubVI=
-github.com/jinzhu/copier v0.3.4/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg=
-github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
-github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
-github.com/magefile/mage v1.14.0 h1:6QDX3g6z1YvJ4olPhT1wksUcSa/V0a1B+pJb73fBjyo=
-github.com/magefile/mage v1.14.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
-github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4=
-github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms=
-github.com/pierrec/lz4/v4 v4.1.17 h1:kV4Ip+/hUBC+8T6+2EgburRtkE9ef4nbY3f4dFhGjMc=
-github.com/pierrec/lz4/v4 v4.1.17/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
-github.com/pkg/xattr v0.4.9 h1:5883YPCtkSd8LFbs13nXplj9g9tlrwoJRjgpgMu1/fE=
-github.com/pkg/xattr v0.4.9/go.mod h1:di8WF84zAKk8jzR1UBTEWh9AUlIZZ7M/JNt8e9B6ktU=
-github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
-github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/sirupsen/logrus v1.9.4-0.20230606125235-dd1b4c2e81af h1:Sp5TG9f7K39yfB+If0vjp97vuT74F72r8hfRpP8jLU0=
-github.com/sirupsen/logrus v1.9.4-0.20230606125235-dd1b4c2e81af/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
-github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
-github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
-github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8=
-github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
-golang.org/x/sys v0.0.0-20210331175145-43e1dd70ce54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
-gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/go-proxmox/logger.go b/go-proxmox/logger.go
deleted file mode 100644
index 06b912a..0000000
--- a/go-proxmox/logger.go
+++ /dev/null
@@ -1,84 +0,0 @@
-package proxmox
-
-import (
- "fmt"
- "io"
- "os"
-)
-
-const (
- LevelError = iota + 1
- LevelWarn
- LevelInfo
- LevelDebug
-)
-
-type LeveledLoggerInterface interface {
- Debugf(format string, v ...interface{})
- Errorf(format string, v ...interface{})
- Infof(format string, v ...interface{})
- Warnf(format string, v ...interface{})
-}
-
-// It prints warnings and errors to `os.Stderr` and other messages to
-// `os.Stdout`.
-
-type LeveledLogger struct {
- // Level is the minimum logging level that will be emitted by this logger.
- //
- // For example, a Level set to LevelWarn will emit warnings and errors, but
- // not informational or debug messages.
- //
- // Always set this with a constant like LevelWarn because the individual
- // values are not guaranteed to be stable.
- Level int
-
- // Internal testing use only.
- stderrOverride io.Writer
- stdoutOverride io.Writer
-}
-
-// Debugf logs a debug message using Printf conventions.
-func (l *LeveledLogger) Debugf(format string, v ...interface{}) {
- if l.Level >= LevelDebug {
- _, _ = fmt.Fprintf(l.stdout(), "[DEBUG] "+format+"\n", v...)
- }
-}
-
-// Errorf logs a warning message using Printf conventions.
-func (l *LeveledLogger) Errorf(format string, v ...interface{}) {
- // Infof logs a debug message using Printf conventions.
- if l.Level >= LevelError {
- _, _ = fmt.Fprintf(l.stderr(), "[ERROR] "+format+"\n", v...)
- }
-}
-
-// Infof logs an informational message using Printf conventions.
-func (l *LeveledLogger) Infof(format string, v ...interface{}) {
- if l.Level >= LevelInfo {
- _, _ = fmt.Fprintf(l.stdout(), "[INFO] "+format+"\n", v...)
- }
-}
-
-// Warnf logs a warning message using Printf conventions.
-func (l *LeveledLogger) Warnf(format string, v ...interface{}) {
- if l.Level >= LevelWarn {
- _, _ = fmt.Fprintf(l.stderr(), "[WARN] "+format+"\n", v...)
- }
-}
-
-func (l *LeveledLogger) stderr() io.Writer {
- if l.stderrOverride != nil {
- return l.stderrOverride
- }
-
- return os.Stderr
-}
-
-func (l *LeveledLogger) stdout() io.Writer {
- if l.stdoutOverride != nil {
- return l.stdoutOverride
- }
-
- return os.Stdout
-}
diff --git a/go-proxmox/logger_test.go b/go-proxmox/logger_test.go
deleted file mode 100644
index ed10990..0000000
--- a/go-proxmox/logger_test.go
+++ /dev/null
@@ -1,60 +0,0 @@
-package proxmox
-
-import (
- "bytes"
- "os"
- "testing"
-
- "github.com/stretchr/testify/assert"
-)
-
-func TestLeveledLogger(t *testing.T) {
- tests := []struct {
- level int
- input string
- stdout string
- stderr string
- }{
- {
- level: LevelError,
- input: "log",
- stderr: "[ERROR] error log\n",
- stdout: "",
- },
- {
- level: LevelWarn,
- input: "log",
- stderr: "[ERROR] error log\n[WARN] warn log\n",
- stdout: "",
- },
- {
- level: LevelInfo,
- input: "log",
- stderr: "[ERROR] error log\n[WARN] warn log\n",
- stdout: "[INFO] info log\n",
- },
- {
- level: LevelDebug,
- input: "log",
- stderr: "[ERROR] error log\n[WARN] warn log\n",
- stdout: "[INFO] info log\n[DEBUG] debug log\n",
- },
- }
-
- for _, test := range tests {
- err := &bytes.Buffer{}
- out := &bytes.Buffer{}
- log := &LeveledLogger{Level: test.level, stderrOverride: err, stdoutOverride: out}
-
- log.Errorf("error %s", test.input)
- log.Warnf("warn %s", test.input)
- log.Infof("info %s", test.input)
- log.Debugf("debug %s", test.input)
- assert.Equal(t, test.stdout, out.String())
- assert.Equal(t, test.stderr, err.String())
- }
-
- log := &LeveledLogger{Level: LevelDebug}
- assert.Equal(t, os.Stderr, log.stderr())
- assert.Equal(t, os.Stdout, log.stdout())
-}
diff --git a/go-proxmox/mage/install/install.go b/go-proxmox/mage/install/install.go
deleted file mode 100644
index 3102912..0000000
--- a/go-proxmox/mage/install/install.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package install
-
-import (
- "fmt"
- "os/exec"
-
- "github.com/magefile/mage/mg"
-)
-
-const (
- GolangCILintVersion = "v2.8.0"
-)
-
-// Dependencies install all dependencies
-func Dependencies() error {
- fmt.Println("Installing Dependencies...")
- mg.Deps(Golangcilint)
-
- return nil
-}
-
-// Golangcilint install golangci-lint
-func Golangcilint() error {
- fmt.Println("Installing GolangCI Lint...")
- cmd := exec.Command("go", "install", "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@"+GolangCILintVersion)
- return cmd.Run()
-}
diff --git a/go-proxmox/mage/test/test.go b/go-proxmox/mage/test/test.go
deleted file mode 100644
index 57836f3..0000000
--- a/go-proxmox/mage/test/test.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package test
-
-import (
- "fmt"
-
- "github.com/magefile/mage/sh"
-)
-
-// Unit run all unit tests
-func Unit() error {
- fmt.Println("Running Tests...")
- return sh.RunV("go", "test")
-}
-
-// Build run a test build to confirm no compilation errors
-func Build() error {
- fmt.Println("Running Build...")
- return sh.RunV("go", "build", "-tags", "test")
-}
-
-// Coverage run all unit tests and output coverage
-func Coverage() error {
- fmt.Println("Running Tests with Coverage...")
- return sh.RunV("go", "test", "-race", "-coverprofile=coverage.txt", "-covermode=atomic")
-}
-
-// Integration run all integration tests against a pve node, see ./tests/integration
-func Integration() error {
- fmt.Println("Running Integration Tests against a PVE Cluster...")
- return sh.RunV("go", "test", "./tests/integration", "-tags", "nodes containers vms")
-}
diff --git a/go-proxmox/magefile.go b/go-proxmox/magefile.go
deleted file mode 100644
index 471a4ca..0000000
--- a/go-proxmox/magefile.go
+++ /dev/null
@@ -1,70 +0,0 @@
-//go:build mage
-// +build mage
-
-package main
-
-import (
- "fmt"
- "os"
- "strings"
-
- "github.com/magefile/mage/mg"
- "github.com/magefile/mage/sh"
-
- //mage:import install
- "github.com/luthermonson/go-proxmox/mage/install"
-
- //mage:import test
- "github.com/luthermonson/go-proxmox/mage/test"
-)
-
-var (
- envConfig = map[string]struct{}{
- "PROXMOX_URL": {},
- "PROXMOX_USERNAME": {},
- "PROXMOX_PASSWORD": {},
- "PROXMOX_OTP": {},
- "PROXMOX_TOKENID": {},
- "PROXMOX_SECRET": {},
- "PROXMOX_NODE_NAME": {},
- "PROXMOX_NODE_STORAGE": {},
- "PROXMOX_APPLIANCE_PREFIX": {},
- "PROXMOX_ISO_URL": {},
- }
-)
-
-var Aliases = map[string]interface{}{
- "test": test.Unit,
- "install": install.Dependencies,
-}
-
-// run everything for ci process (install deps, lint, coverage, build)
-func Ci() error {
- fmt.Println("Running Continuous Integration...")
- mg.Deps(
- install.Dependencies,
- Lint,
- test.Coverage,
- test.Build)
- return nil
-}
-
-// run the linter
-func Lint() error {
- mg.Deps(install.Golangcilint)
- fmt.Println("Running Linter...")
- return sh.RunV("golangci-lint", "run")
-}
-
-// validate env vars to run the testing suite
-func Env() error {
- for k := range envConfig {
- if strings.Contains(strings.ToLower(k), "password") || strings.Contains(strings.ToLower(k), "secret") {
- fmt.Printf("%s: %s\n", k, strings.Repeat("*", len(os.Getenv(k))))
- } else {
- fmt.Printf("%s: %s\n", k, os.Getenv(k))
- }
- }
-
- return nil
-}
diff --git a/go-proxmox/nodes.go b/go-proxmox/nodes.go
deleted file mode 100644
index 36f0e65..0000000
--- a/go-proxmox/nodes.go
+++ /dev/null
@@ -1,367 +0,0 @@
-package proxmox
-
-import (
- "context"
- "encoding/json"
- "fmt"
- "net/url"
- "strings"
-)
-
-func (c *Client) Nodes(ctx context.Context) (ns NodeStatuses, err error) {
- return ns, c.Get(ctx, "/nodes", &ns)
-}
-
-func (c *Client) Node(ctx context.Context, name string) (*Node, error) {
- node := &Node{
- Name: name,
- client: c,
- }
-
- // requires (/, Sys.Audit), do not error out if no access to still get the node
- if err := node.Status(ctx); !IsNotAuthorized(err) {
- return node, err
- }
-
- return node, nil
-}
-
-func (n *Node) New(c *Client, name string) *Node {
- node := &Node{
- Name: name,
- client: c,
- }
-
- return node
-}
-
-func (n *Node) Status(ctx context.Context) error {
- return n.client.Get(ctx, fmt.Sprintf("/nodes/%s/status", n.Name), n)
-}
-
-func (n *Node) Version(ctx context.Context) (version *Version, err error) {
- return version, n.client.Get(ctx, fmt.Sprintf("/nodes/%s/version", n.Name), &version)
-}
-
-func (n *Node) Report(ctx context.Context) (report string, err error) {
- return report, n.client.Get(ctx, fmt.Sprintf("/nodes/%s/report", n.Name), &report)
-}
-
-func (n *Node) TermProxy(ctx context.Context) (term *Term, err error) {
- return term, n.client.Post(ctx, fmt.Sprintf("/nodes/%s/termproxy", n.Name), nil, &term)
-}
-
-func (n *Node) TermWebSocket(term *Term) (chan []byte, chan []byte, chan error, func() error, error) {
- p := fmt.Sprintf("/nodes/%s/vncwebsocket?port=%d&vncticket=%s",
- n.Name, term.Port, url.QueryEscape(term.Ticket))
-
- return n.client.TermWebSocket(p, term)
-}
-
-// VNCWebSocket send, recv, errors, closer, error
-func (n *Node) VNCWebSocket(vnc *VNC) (chan []byte, chan []byte, chan error, func() error, error) {
- p := fmt.Sprintf("/nodes/%s/vncwebsocket?port=%d&vncticket=%s",
- n.Name, vnc.Port, url.QueryEscape(vnc.Ticket))
-
- return n.client.VNCWebSocket(p, vnc)
-}
-
-func (n *Node) VirtualMachines(ctx context.Context) (vms VirtualMachines, err error) {
- if err = n.client.Get(ctx, fmt.Sprintf("/nodes/%s/qemu", n.Name), &vms); err != nil {
- return nil, err
- }
-
- for _, v := range vms {
- v.client = n.client
- v.Node = n.Name
- }
-
- return vms, nil
-}
-
-func (n *Node) NewVirtualMachine(ctx context.Context, vmid int, options ...VirtualMachineOption) (*Task, error) {
- var upid UPID
- data := make(map[string]interface{})
- data["vmid"] = vmid
-
- for _, option := range options {
- data[option.Name] = option.Value
- }
-
- err := n.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu", n.Name), data, &upid)
- return NewTask(upid, n.client), err
-}
-
-func (n *Node) VirtualMachine(ctx context.Context, vmid int) (*VirtualMachine, error) {
- vm := &VirtualMachine{
- client: n.client,
- Node: n.Name,
- }
-
- if err := n.client.Get(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/status/current", n.Name, vmid), &vm); nil != err {
- return nil, err
- }
-
- if err := n.client.Get(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/config", n.Name, vmid), &vm.VirtualMachineConfig); err != nil {
- return nil, err
- }
-
- return vm, nil
-}
-
-func (n *Node) Containers(ctx context.Context) (c Containers, err error) {
- if err = n.client.Get(ctx, fmt.Sprintf("/nodes/%s/lxc", n.Name), &c); err != nil {
- return
- }
-
- for _, container := range c {
- container.client = n.client
- container.Node = n.Name
- }
-
- return
-}
-
-func (n *Node) Container(ctx context.Context, vmid int) (*Container, error) {
- c := &Container{
- client: n.client,
- Node: n.Name,
- }
-
- if err := n.client.Get(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/status/current", n.Name, vmid), &c); err != nil {
- return nil, err
- }
-
- if err := n.client.Get(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/config", n.Name, vmid), &c.ContainerConfig); err != nil {
- return nil, err
- }
-
- return c, nil
-}
-
-func (n *Node) NewContainer(ctx context.Context, vmid int, options ...ContainerOption) (*Task, error) {
- var upid UPID
- data := make(map[string]interface{})
- if vmid <= 0 {
- cluster, err := n.client.Cluster(ctx)
- if err != nil {
- return nil, err
- }
- vmid, err = cluster.NextID(ctx)
- if err != nil {
- return nil, err
- }
- }
- data["vmid"] = vmid
-
- for _, option := range options {
- data[option.Name] = option.Value
- }
-
- err := n.client.Post(ctx, fmt.Sprintf("/nodes/%s/lxc", n.Name), data, &upid)
- return NewTask(upid, n.client), err
-}
-
-func (n *Node) Appliances(ctx context.Context) (appliances Appliances, err error) {
- err = n.client.Get(ctx, fmt.Sprintf("/nodes/%s/aplinfo", n.Name), &appliances)
- if err != nil {
- return appliances, err
- }
-
- for _, t := range appliances {
- t.client = n.client
- t.Node = n.Name
- }
-
- return appliances, nil
-}
-
-func (n *Node) DownloadAppliance(ctx context.Context, template, storage string) (ret string, err error) {
- return ret, n.client.Post(ctx, fmt.Sprintf("/nodes/%s/aplinfo", n.Name), map[string]string{
- "template": template,
- "storage": storage,
- }, &ret)
-}
-
-func (n *Node) VzTmpls(ctx context.Context, storage string) (templates VzTmpls, err error) {
- return templates, n.client.Get(ctx, fmt.Sprintf("/nodes/%s/storage/%s/content?content=vztmpl", n.Name, storage), &templates)
-}
-
-func (n *Node) VzTmpl(ctx context.Context, template, storage string) (*VzTmpl, error) {
- templates, err := n.VzTmpls(ctx, storage)
- if err != nil {
- return nil, err
- }
-
- volid := fmt.Sprintf("%s:vztmpl/%s", storage, template)
- for _, t := range templates {
- if t.VolID == volid {
- return t, nil
- }
- }
-
- return nil, fmt.Errorf("could not find vztmpl: %s", template)
-}
-
-func (n *Node) Storages(ctx context.Context) (storages Storages, err error) {
- err = n.client.Get(ctx, fmt.Sprintf("/nodes/%s/storage", n.Name), &storages)
- if err != nil {
- return
- }
-
- for _, s := range storages {
- s.Node = n.Name
- s.client = n.client
- }
-
- return
-}
-
-func (n *Node) Storage(ctx context.Context, name string) (storage *Storage, err error) {
- err = n.client.Get(ctx, fmt.Sprintf("/nodes/%s/storage/%s/status", n.Name, name), &storage)
- if err != nil {
- return
- }
-
- storage.Node = n.Name
- storage.client = n.client
- storage.Name = name
-
- return
-}
-
-func (n *Node) StorageDownloadURL(ctx context.Context, StorageDownloadURLOptions *StorageDownloadURLOptions) (ret string, err error) {
- err = n.client.Post(ctx, fmt.Sprintf("/nodes/%s/storage/%s/download-url", n.Name, StorageDownloadURLOptions.Storage), StorageDownloadURLOptions, &ret)
- return ret, err
-}
-
-func (n *Node) StorageISO(ctx context.Context) (*Storage, error) {
- return n.findStorageByContent(ctx, "iso")
-}
-
-func (n *Node) StorageVZTmpl(ctx context.Context) (*Storage, error) {
- return n.findStorageByContent(ctx, "vztmpl")
-}
-
-func (n *Node) StorageBackup(ctx context.Context) (*Storage, error) {
- return n.findStorageByContent(ctx, "backup")
-}
-
-func (n *Node) StorageRootDir(ctx context.Context) (*Storage, error) {
- return n.findStorageByContent(ctx, "rootdir")
-}
-
-func (n *Node) StorageImages(ctx context.Context) (*Storage, error) {
- return n.findStorageByContent(ctx, "images")
-}
-
-// findStorageByContent takes iso/backup/vztmpl/rootdir/images and returns the storage that type of content should be on
-func (n *Node) findStorageByContent(ctx context.Context, content string) (storage *Storage, err error) {
- storages, err := n.Storages(ctx)
- if err != nil {
- return nil, err
- }
-
- for _, storage := range storages {
- if storage.Enabled == 0 {
- continue
- }
-
- if strings.Contains(storage.Content, content) {
- storage.Node = n.Name
- storage.client = n.client
- return storage, nil
- }
- }
-
- return nil, ErrNotFound
-}
-
-func (n *Node) FirewallOptionGet(ctx context.Context) (firewallOption *FirewallNodeOption, err error) {
- err = n.client.Get(ctx, fmt.Sprintf("/nodes/%s/firewall/options", n.Name), &firewallOption)
- return
-}
-
-func (n *Node) FirewallOptionSet(ctx context.Context, firewallOption *FirewallNodeOption) error {
- return n.client.Put(ctx, fmt.Sprintf("/nodes/%s/firewall/options", n.Name), firewallOption, nil)
-}
-
-func (n *Node) FirewallGetRules(ctx context.Context) (rules []*FirewallRule, err error) {
- err = n.client.Get(ctx, fmt.Sprintf("/nodes/%s/firewall/rules", n.Name), &rules)
- return
-}
-
-func (n *Node) FirewallRulesCreate(ctx context.Context, rule *FirewallRule) error {
- return n.client.Post(ctx, fmt.Sprintf("/nodes/%s/firewall/rules", n.Name), rule, nil)
-}
-
-func (n *Node) FirewallRulesUpdate(ctx context.Context, rule *FirewallRule) error {
- return n.client.Put(ctx, fmt.Sprintf("/nodes/%s/firewall/rules/%d", n.Name, rule.Pos), rule, nil)
-}
-
-func (n *Node) FirewallRulesDelete(ctx context.Context, rulePos int) error {
- return n.client.Delete(ctx, fmt.Sprintf("/nodes/%s/firewall/rules/%d", n.Name, rulePos), nil)
-}
-
-func (n *Node) UploadCustomCertificate(ctx context.Context, cert *CustomCertificate) error {
- return n.client.Post(ctx, fmt.Sprintf("/nodes/%s/certificates/custom", n.Name), cert, nil)
-}
-
-func (n *Node) DeleteCustomCertificate(ctx context.Context) error {
- return n.client.Delete(ctx, fmt.Sprintf("/nodes/%s/certificates/custom", n.Name), nil)
-}
-
-func (n *Node) GetCustomCertificates(ctx context.Context) (certs *NodeCertificates, err error) {
- err = n.client.Get(ctx, fmt.Sprintf("/nodes/%s/certificates/info", n.Name), &certs)
- return
-}
-
-func (n *Node) Vzdump(ctx context.Context, params *VirtualMachineBackupOptions) (task *Task, err error) {
- var upid UPID
-
- if params == nil {
- params = &VirtualMachineBackupOptions{}
- }
-
- if err = n.client.Post(ctx, fmt.Sprintf("/nodes/%s/vzdump", n.Name), params, &upid); err != nil {
- return nil, err
- }
- return NewTask(upid, n.client), nil
-}
-
-func (n *Node) VzdumpExtractConfig(ctx context.Context, volume string) (*VzdumpConfig, error) {
- var vzdumpExtractedConfig string
-
- if err := n.client.Get(ctx, fmt.Sprintf("/nodes/%s/vzdump/extractconfig?volume=%s", n.Name, volume), &vzdumpExtractedConfig); err != nil {
- return nil, err
- }
-
- return n.parseVzdumpConfig(vzdumpExtractedConfig)
-}
-
-func (n *Node) parseVzdumpConfig(vzdumpExtractedConfig string) (*VzdumpConfig, error) {
- vzdumpFields := strings.Split(vzdumpExtractedConfig, StringSeparator)
-
- configFields := make(map[string]any)
-
- for _, field := range vzdumpFields {
- if field != "" {
- newStr := strings.SplitN(field, FieldSeparator, 2)
- if len(newStr) == 2 {
- configFields[newStr[0]] = strings.Trim(newStr[1], SpaceSeparator)
- }
- }
- }
-
- jsonData, err := json.Marshal(configFields)
- if err != nil {
- return nil, fmt.Errorf("cannot present vzdump config as json string : %w", err)
- }
-
- vzdumpCfg := &VzdumpConfig{}
- if err := json.Unmarshal(jsonData, vzdumpCfg); err != nil {
- return nil, fmt.Errorf("cannot parse data for vzdump config : %w", err)
- }
-
- return vzdumpCfg, nil
-}
diff --git a/go-proxmox/nodes_network.go b/go-proxmox/nodes_network.go
deleted file mode 100644
index e6734db..0000000
--- a/go-proxmox/nodes_network.go
+++ /dev/null
@@ -1,96 +0,0 @@
-package proxmox
-
-import (
- "context"
- "errors"
- "fmt"
- "net/url"
-)
-
-func (n *Node) NewNetwork(ctx context.Context, network *NodeNetwork) (task *Task, err error) {
- err = n.client.Post(ctx, fmt.Sprintf("/nodes/%s/network", n.Name), network, network)
- if nil != err {
- return
- }
-
- network.client = n.client
- network.Node = n.Name
- network.NodeAPI = n
- return n.NetworkReload(ctx)
-}
-
-func (n *Node) Network(ctx context.Context, iface string) (network *NodeNetwork, err error) {
- err = n.client.Get(ctx, fmt.Sprintf("/nodes/%s/network/%s", n.Name, iface), &network)
- if err != nil {
- return
- }
-
- if nil != network {
- network.client = n.client
- network.Node = n.Name
- network.NodeAPI = n
- network.Iface = iface
- }
-
- return
-}
-
-func (n *Node) Networks(ctx context.Context, ifaceType ...string) (networks NodeNetworks, err error) {
- u := url.URL{Path: fmt.Sprintf("/nodes/%s/network", n.Name)}
- params := url.Values{}
-
- if len(ifaceType) > 1 {
- return nil, errors.New("only one interface type filter is allowed")
- } else if len(ifaceType) == 1 {
- params.Add("type", ifaceType[0])
- }
-
- u.RawQuery = params.Encode()
-
- err = n.client.Get(ctx, u.String(), &networks)
- if err != nil {
- return nil, err
- }
-
- for _, v := range networks {
- v.client = n.client
- v.Node = n.Name
- v.NodeAPI = n
- }
-
- return
-}
-
-func (n *Node) NetworkReload(ctx context.Context) (*Task, error) {
- var upid UPID
- err := n.client.Put(ctx, fmt.Sprintf("/nodes/%s/network", n.Name), nil, &upid)
- if err != nil {
- return nil, err
- }
-
- return NewTask(upid, n.client), nil
-}
-
-func (nw *NodeNetwork) Update(ctx context.Context) error {
- if nw.Iface == "" {
- return nil
- }
- return nw.client.Put(ctx, fmt.Sprintf("/nodes/%s/network/%s", nw.Node, nw.Iface), nw, nil)
-}
-
-func (nw *NodeNetwork) Delete(ctx context.Context) (task *Task, err error) {
- var upid UPID
- if nw.Iface == "" {
- return
- }
- err = nw.client.Delete(ctx, fmt.Sprintf("/nodes/%s/network/%s", nw.Node, nw.Iface), &upid)
- if err != nil {
- return
- }
-
- return nw.NodeAPI.NetworkReload(ctx)
-}
-func (n *Node) IPAM(ctx context.Context) (ipam []*IPAM, err error) {
- err = n.client.Get(ctx, fmt.Sprintf("/cluster/sdn/ipams/%s/status", n.Name), &ipam)
- return
-}
diff --git a/go-proxmox/nodes_network_test.go b/go-proxmox/nodes_network_test.go
deleted file mode 100644
index c4dc56a..0000000
--- a/go-proxmox/nodes_network_test.go
+++ /dev/null
@@ -1,87 +0,0 @@
-package proxmox
-
-import (
- "context"
- "testing"
-
- "github.com/luthermonson/go-proxmox/tests/mocks"
- "github.com/stretchr/testify/assert"
-)
-
-func TestNetwork(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- node := Node{
- client: client,
- Name: "node1",
- }
-
- network, err := node.Network(ctx, "vmbr0")
- assert.Nil(t, err)
- assert.Equal(t, network.Iface, "vmbr0")
-}
-
-func TestNode1Networks(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- node := Node{
- client: client,
- Name: "node1",
- }
-
- networks, err := node.Networks(ctx)
- assert.Nil(t, err)
- assert.Len(t, networks, 5)
-}
-
-func TestNode2Networks(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- node := Node{
- client: client,
- Name: "node2",
- }
-
- networks, err := node.Networks(ctx)
- assert.Nil(t, err)
- assert.Len(t, networks, 2)
-}
-
-func TestNetworksPve8(t *testing.T) {
- mocks.ProxmoxVE8x(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- node := Node{
- client: client,
- Name: "node1",
- }
-
- networks, err := node.Networks(ctx)
- assert.Nil(t, err)
- assert.Len(t, networks, 5)
-}
-
-func TestNetworksPve8NetworksOfType(t *testing.T) {
- mocks.ProxmoxVE8x(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- node := Node{
- client: client,
- Name: "node1",
- }
-
- networks, err := node.Networks(ctx, "any_bridge")
- assert.Nil(t, err)
- assert.Len(t, networks, 1)
-
- _, err = node.Networks(ctx, "any_bridge", "second_argument")
- assert.NotNil(t, err)
-}
diff --git a/go-proxmox/nodes_test.go b/go-proxmox/nodes_test.go
deleted file mode 100644
index 4a46124..0000000
--- a/go-proxmox/nodes_test.go
+++ /dev/null
@@ -1,445 +0,0 @@
-package proxmox
-
-import (
- "context"
- "testing"
-
- "github.com/luthermonson/go-proxmox/tests/mocks"
- "github.com/stretchr/testify/assert"
-)
-
-func TestClient_Nodes(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- nodes, err := client.Nodes(ctx)
- assert.Nil(t, err)
- for _, n := range nodes {
- assert.Contains(t, n.Node, "node")
- assert.Equal(t, n.Type, "node")
- }
- //assert.Equal(t, 6, len(testData))
-}
-
-func TestClient_Node(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
- assert.Equal(t, "node1", node.Name)
- assert.NotNil(t, node.client)
-
- v, err := node.Version(ctx)
- assert.Nil(t, err)
- assert.Equal(t, "9.1", v.Release)
-
- _, err = client.Node(ctx, "doesntexist")
- assert.NotNil(t, err)
-}
-
-func TestNode_Report(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- report, err := node.Report(ctx)
- assert.Nil(t, err)
- assert.NotEmpty(t, report)
- assert.Contains(t, report, "pve-manager")
- assert.Contains(t, report, "kernel")
-}
-
-func TestNode_TermProxy(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- term, err := node.TermProxy(ctx)
- assert.Nil(t, err)
- assert.NotNil(t, term)
- assert.Greater(t, term.Port, 0)
- assert.NotEmpty(t, term.Ticket)
- assert.NotEmpty(t, term.User)
-}
-
-func TestNode_Appliances(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- appliances, err := node.Appliances(ctx)
- assert.Nil(t, err)
- assert.NotEmpty(t, appliances)
- assert.GreaterOrEqual(t, len(appliances), 1)
-
- // Check first appliance
- assert.NotEmpty(t, appliances[0].Template)
- assert.NotEmpty(t, appliances[0].Type)
- assert.NotEmpty(t, appliances[0].Os)
-}
-
-func TestNode_DownloadAppliance(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- ret, err := node.DownloadAppliance(ctx, "ubuntu-22.04-standard", "local")
- assert.Nil(t, err)
- assert.NotEmpty(t, ret)
- assert.Contains(t, ret, "UPID")
-}
-
-func TestNode_Storages(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- storages, err := node.Storages(ctx)
- assert.Nil(t, err)
- assert.NotEmpty(t, storages)
- assert.GreaterOrEqual(t, len(storages), 1)
-
- // Check first storage
- storage := storages[0]
- assert.NotEmpty(t, storage.Name)
- assert.NotEmpty(t, storage.Type)
- assert.Equal(t, node.Name, storage.Node)
- assert.NotNil(t, storage.client)
-}
-
-func TestNode_Storage(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- storage, err := node.Storage(ctx, "local")
- assert.Nil(t, err)
- assert.NotNil(t, storage)
- assert.Equal(t, "local", storage.Name)
- assert.Equal(t, node.Name, storage.Node)
- assert.NotNil(t, storage.client)
-}
-
-func TestNode_VzTmpls(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- templates, err := node.VzTmpls(ctx, "local")
- assert.Nil(t, err)
- assert.NotEmpty(t, templates)
- assert.GreaterOrEqual(t, len(templates), 1)
-
- // Check first template
- assert.NotEmpty(t, templates[0].VolID)
- assert.Equal(t, "vztmpl", templates[0].Content.Content)
-}
-
-func TestNode_VzTmpl(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- template, err := node.VzTmpl(ctx, "ubuntu-22.04-standard_22.04-1_amd64.tar.zst", "local")
- assert.Nil(t, err)
- assert.NotNil(t, template)
- assert.Equal(t, "local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst", template.VolID)
-
- // Test non-existent template
- template, err = node.VzTmpl(ctx, "nonexistent.tar.zst", "local")
- assert.NotNil(t, err)
- assert.Nil(t, template)
-}
-
-func TestNode_StorageDownloadURL(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- options := &StorageDownloadURLOptions{
- Storage: "local",
- Content: "iso",
- Filename: "test.iso",
- URL: "http://example.com/test.iso",
- }
-
- ret, err := node.StorageDownloadURL(ctx, options)
- assert.Nil(t, err)
- assert.NotEmpty(t, ret)
- assert.Contains(t, ret, "UPID")
-}
-
-func TestNode_StorageByContent(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- // Test StorageISO
- storage, err := node.StorageISO(ctx)
- assert.Nil(t, err)
- assert.NotNil(t, storage)
- assert.Contains(t, storage.Content, "iso")
-
- // Test StorageVZTmpl
- storage, err = node.StorageVZTmpl(ctx)
- assert.Nil(t, err)
- assert.NotNil(t, storage)
- assert.Contains(t, storage.Content, "vztmpl")
-
- // Test StorageBackup
- storage, err = node.StorageBackup(ctx)
- assert.Nil(t, err)
- assert.NotNil(t, storage)
- assert.Contains(t, storage.Content, "backup")
-
- // Test StorageRootDir
- storage, err = node.StorageRootDir(ctx)
- assert.Nil(t, err)
- assert.NotNil(t, storage)
- assert.Contains(t, storage.Content, "rootdir")
-
- // Test StorageImages
- storage, err = node.StorageImages(ctx)
- assert.Nil(t, err)
- assert.NotNil(t, storage)
- assert.Contains(t, storage.Content, "images")
-}
-
-func TestNode_FirewallOptionGet(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- options, err := node.FirewallOptionGet(ctx)
- assert.Nil(t, err)
- assert.NotNil(t, options)
-}
-
-func TestNode_FirewallOptionSet(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- options := &FirewallNodeOption{
- Enable: true,
- }
-
- err = node.FirewallOptionSet(ctx, options)
- assert.Nil(t, err)
-}
-
-func TestNode_FirewallGetRules(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- rules, err := node.FirewallGetRules(ctx)
- assert.Nil(t, err)
- assert.NotEmpty(t, rules)
- assert.GreaterOrEqual(t, len(rules), 1)
-
- // Check first rule
- rule := rules[0]
- assert.NotNil(t, rule.Pos)
- assert.NotEmpty(t, rule.Type)
- assert.NotEmpty(t, rule.Action)
-}
-
-func TestNode_FirewallRulesCreate(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- rule := &FirewallRule{
- Type: "in",
- Action: "ACCEPT",
- Enable: 1,
- Proto: "tcp",
- Dport: "22",
- }
-
- err = node.FirewallRulesCreate(ctx, rule)
- assert.Nil(t, err)
-}
-
-func TestNode_FirewallRulesUpdate(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- rule := &FirewallRule{
- Pos: 0,
- Type: "in",
- Action: "DROP",
- Enable: 1,
- Proto: "tcp",
- Dport: "22",
- }
-
- err = node.FirewallRulesUpdate(ctx, rule)
- assert.Nil(t, err)
-}
-
-func TestNode_FirewallRulesDelete(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- err = node.FirewallRulesDelete(ctx, 0)
- assert.Nil(t, err)
-}
-
-func TestNode_GetCustomCertificates(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- certs, err := node.GetCustomCertificates(ctx)
- assert.Nil(t, err)
- assert.NotNil(t, certs)
-}
-
-func TestNode_UploadCustomCertificate(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- cert := &CustomCertificate{
- Certificates: "-----BEGIN CERTIFICATE-----\nMIIDXTCCAkWgAwIBAgIJAKZx...\n-----END CERTIFICATE-----",
- Key: "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0B...\n-----END PRIVATE KEY-----",
- }
-
- err = node.UploadCustomCertificate(ctx, cert)
- assert.Nil(t, err)
-}
-
-func TestNode_DeleteCustomCertificate(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- err = node.DeleteCustomCertificate(ctx)
- assert.Nil(t, err)
-}
-
-func TestNode_Vzdump(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- params := &VirtualMachineBackupOptions{
- VMID: 100,
- Storage: "local",
- Mode: "snapshot",
- Compress: "zstd",
- Remove: false,
- All: false,
- NotesTemplate: "",
- }
-
- task, err := node.Vzdump(ctx, params)
- assert.Nil(t, err)
- assert.NotNil(t, task)
- assert.NotEmpty(t, task.UPID)
-}
-
-func TestNode_VzdumpExtractConfig(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- node, err := client.Node(ctx, "node1")
- assert.Nil(t, err)
-
- config, err := node.VzdumpExtractConfig(ctx, "local:backup/vzdump-lxc-100-2024_01_01-00_00_00.tar.zst")
- assert.Nil(t, err)
- assert.NotNil(t, config)
- assert.Equal(t, uint64(2), config.Cores)
- assert.Equal(t, "debian", config.OsType)
-}
diff --git a/go-proxmox/options.go b/go-proxmox/options.go
deleted file mode 100644
index bc36c3c..0000000
--- a/go-proxmox/options.go
+++ /dev/null
@@ -1,61 +0,0 @@
-package proxmox
-
-import (
- "fmt"
- "net/http"
-)
-
-type Option func(*Client)
-
-// Deprecated: Use WithHTTPClient
-func WithClient(client *http.Client) Option {
- return WithHTTPClient(client)
-}
-
-func WithHTTPClient(client *http.Client) Option {
- return func(c *Client) {
- c.httpClient = client
- }
-}
-
-// Deprecated: Use WithCredential
-func WithLogins(username, password string) Option {
- return WithCredentials(&Credentials{
- Username: username,
- Password: password,
- })
-}
-
-func WithCredentials(credentials *Credentials) Option {
- return func(c *Client) {
- c.credentials = credentials
- }
-}
-
-func WithAPIToken(tokenID, secret string) Option {
- return func(c *Client) {
- c.token = fmt.Sprintf("%s=%s", tokenID, secret)
- }
-}
-
-// WithSession experimental
-func WithSession(ticket, CSRFPreventionToken string) Option {
- return func(c *Client) {
- c.session = &Session{
- Ticket: ticket,
- CSRFPreventionToken: CSRFPreventionToken,
- }
- }
-}
-
-func WithUserAgent(ua string) Option {
- return func(c *Client) {
- c.userAgent = ua
- }
-}
-
-func WithLogger(logger LeveledLoggerInterface) Option {
- return func(c *Client) {
- c.log = logger
- }
-}
diff --git a/go-proxmox/options_test.go b/go-proxmox/options_test.go
deleted file mode 100644
index 866f756..0000000
--- a/go-proxmox/options_test.go
+++ /dev/null
@@ -1,48 +0,0 @@
-package proxmox
-
-import (
- "net/http"
- "testing"
- "time"
-
- "github.com/stretchr/testify/assert"
-)
-
-func TestWithClient(t *testing.T) {
- httpClient := http.Client{Timeout: time.Second * 10}
- client := NewClient("", WithClient(&httpClient))
- assert.Equal(t, client.httpClient, &http.Client{Timeout: time.Second * 10})
-}
-
-func TestWithLogins(t *testing.T) {
- client := NewClient("", WithLogins("root@pam", "1234"))
- assert.Equal(t, client.credentials, &Credentials{Username: "root@pam", Password: "1234"})
-}
-
-func TestWithCredentials(t *testing.T) {
- client := NewClient("", WithCredentials(&Credentials{
- Username: "root@pam",
- Password: "1234",
- }))
- assert.Equal(t, client.credentials, &Credentials{Username: "root@pam", Password: "1234"})
-}
-
-func TestWithAPIToken(t *testing.T) {
- client := NewClient("", WithAPIToken("root@pam!test", "1234"))
- assert.Equal(t, client.token, "root@pam!test=1234")
-}
-
-func TestWithSession(t *testing.T) {
- client := NewClient("", WithSession("ticket", "csrf"))
- assert.Equal(t, client.session, &Session{Ticket: "ticket", CSRFPreventionToken: "csrf"})
-}
-
-func TestWithUserAgent(t *testing.T) {
- client := NewClient("", WithUserAgent("test-ua"))
- assert.Equal(t, client.userAgent, "test-ua")
-}
-
-func TestWithLogger(t *testing.T) {
- client := NewClient("", WithLogger(&LeveledLogger{Level: 1}))
- assert.Equal(t, client.log, &LeveledLogger{Level: 1})
-}
diff --git a/go-proxmox/pools.go b/go-proxmox/pools.go
deleted file mode 100644
index c37a457..0000000
--- a/go-proxmox/pools.go
+++ /dev/null
@@ -1,68 +0,0 @@
-package proxmox
-
-import (
- "context"
- "fmt"
- "net/url"
- "strings"
-)
-
-func (c *Client) NewPool(ctx context.Context, poolid, comment string) error {
- return c.Post(ctx, "/pools", map[string]string{
- "poolid": poolid,
- "comment": comment,
- }, nil)
-}
-
-func (c *Client) Pools(ctx context.Context) (pools Pools, err error) {
- err = c.Get(ctx, "/pools", &pools)
- for _, pool := range pools {
- pool.client = c
- }
- return
-}
-
-// Pool optional filter of cluster resources by type, enum can be "qemu", "lxc", "storage".
-func (c *Client) Pool(ctx context.Context, poolid string, filters ...string) (pool *Pool, err error) {
- u := url.URL{Path: "/pools/"}
-
- // /pools/{poolid} is deprecated as it does not support nested pools
- // so we're using the /pools/ endpoint with a query parameter as recommended by the API documentation
- params := url.Values{}
- params.Add("poolid", poolid)
-
- // filters are variadic because they're optional, munging everything passed into one big string to make
- // a good request and the api will error out if there's an issue
- if f := strings.ReplaceAll(strings.Join(filters, ""), " ", ""); f != "" {
- params.Add("type", f)
- }
-
- u.RawQuery = params.Encode()
-
- var pools Pools
- if err = c.Get(ctx, u.String(), &pools); err != nil {
- return nil, err
- }
-
- if len(pools) == 0 {
- // This will not hit as the API will return a 500 error if the pool does not exist
- return nil, fmt.Errorf("pool not found")
- } else if len(pools) == 1 {
- pool = pools[0]
- } else {
- // Should be impossible to have multiple pools with the same poolid
- return nil, fmt.Errorf("multiple pools found for poolid: %s", poolid)
- }
-
- pool.client = c
-
- return
-}
-
-func (p *Pool) Update(ctx context.Context, opt *PoolUpdateOption) error {
- return p.client.Put(ctx, fmt.Sprintf("/pools/%s", p.PoolID), opt, nil)
-}
-
-func (p *Pool) Delete(ctx context.Context) error {
- return p.client.Delete(ctx, fmt.Sprintf("/pools/%s", p.PoolID), nil)
-}
diff --git a/go-proxmox/pools_test.go b/go-proxmox/pools_test.go
deleted file mode 100644
index 3e725e1..0000000
--- a/go-proxmox/pools_test.go
+++ /dev/null
@@ -1,80 +0,0 @@
-package proxmox
-
-import (
- "context"
- "testing"
-
- "github.com/luthermonson/go-proxmox/tests/mocks"
- "github.com/stretchr/testify/assert"
-)
-
-func TestPools(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
-
- pools, err := client.Pools(context.Background())
- assert.Nil(t, err)
- assert.Len(t, pools, 1)
-}
-
-func TestPoolGet(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
-
- pool, err := client.Pool(context.Background(), "test-pool")
- assert.Nil(t, err)
- assert.NotNil(t, pool)
- if pool != nil {
- assert.Equal(t, "test-pool", pool.PoolID)
- assert.Equal(t, "Test pool", pool.Comment)
- assert.Len(t, pool.Members, 3)
- }
-}
-
-func TestPoolCreate(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
-
- err := client.NewPool(context.Background(), "test-pool", "Test pool")
- assert.Nil(t, err)
-}
-
-func TestPoolUpdate(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- pool, err := client.Pool(ctx, "test-pool")
-
- assert.Nil(t, err)
- assert.NotNil(t, pool)
- if pool != nil {
- err = pool.Update(ctx, &PoolUpdateOption{
- Comment: "Test pool updated",
- Delete: true,
- Storage: "local-zfs",
- VirtualMachines: "100",
- })
- assert.Nil(t, err)
- }
-}
-
-func TestPoolDelete(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- pool, err := client.Pool(ctx, "test-pool")
-
- assert.Nil(t, err)
- assert.NotNil(t, pool)
- if pool != nil {
- err = pool.Delete(ctx)
- assert.Nil(t, err)
- }
-}
diff --git a/go-proxmox/proxmox.go b/go-proxmox/proxmox.go
deleted file mode 100644
index 9286c1c..0000000
--- a/go-proxmox/proxmox.go
+++ /dev/null
@@ -1,570 +0,0 @@
-package proxmox
-
-import (
- "bytes"
- "context"
- "crypto/tls"
- "encoding/json"
- "errors"
- "fmt"
- "io"
- "mime/multipart"
- "net/http"
- "net/url"
- "os"
- "path/filepath"
- "strings"
- "sync"
- "time"
-
- "github.com/buger/goterm"
- "github.com/gorilla/websocket"
-)
-
-const (
- DefaultUserAgent = "go-proxmox/dev"
- TagFormat = "go-proxmox+%s"
-)
-
-var (
- ErrNotAuthorized = errors.New("not authorized to access endpoint")
-
- ErrSessionExists = errors.New("session already exists")
-)
-
-func IsNotAuthorized(err error) bool {
- return errors.Is(err, ErrNotAuthorized)
-}
-
-var ErrTimeout = errors.New("the operation has timed out")
-
-func IsTimeout(err error) bool {
- return errors.Is(err, ErrTimeout)
-}
-
-var ErrNotFound = errors.New("unable to find the item you are looking for")
-
-func IsNotFound(err error) bool {
- return errors.Is(err, ErrNotFound)
-}
-
-var ErrNoop = errors.New("nothing to do")
-
-func IsErrNoop(err error) bool {
- return errors.Is(err, ErrNoop)
-}
-
-func MakeTag(v string) string {
- return fmt.Sprintf(TagFormat, v)
-}
-
-type Client struct {
- httpClient *http.Client
- userAgent string
- baseURL string
- token string
- credentials *Credentials
- version *Version
- session *Session
- log LeveledLoggerInterface
-
- sessionMux sync.Mutex
-}
-
-func NewClient(baseURL string, opts ...Option) *Client {
- c := &Client{
- baseURL: baseURL,
- userAgent: DefaultUserAgent,
- log: &LeveledLogger{Level: LevelError},
- }
-
- for _, o := range opts {
- o(c)
- }
-
- if c.httpClient == nil {
- c.httpClient = http.DefaultClient
- }
-
- return c
-}
-
-func (c *Client) Version(ctx context.Context) (*Version, error) {
- return c.version, c.Get(ctx, "/version", &c.version)
-}
-
-func (c *Client) Req(ctx context.Context, method, path string, data []byte, v interface{}) error {
- if strings.HasPrefix(path, "/") {
- path = c.baseURL + path
- }
-
- c.log.Debugf("SEND: %s - %s", method, path)
-
- var body io.Reader
- if data != nil {
- if path != (c.baseURL + "/access/ticket") {
- // don't show passwords in the logs
- if len(data) < 2048 {
- c.log.Debugf("DATA: %s", string(data))
- } else {
- c.log.Debugf("DATA: %s", "truncated due to length")
- }
- }
-
- body = bytes.NewBuffer(data)
- }
-
- req, err := http.NewRequestWithContext(ctx, method, path, body)
- if err != nil {
- return err
- }
- if body != nil {
- req.Header.Add("Content-Type", "application/json")
- }
-
- c.authHeaders(&req.Header)
-
- res, err := c.httpClient.Do(req)
- if err != nil {
- return err
- }
- defer func() { _ = res.Body.Close() }()
-
- if res.StatusCode == http.StatusUnauthorized || res.StatusCode == http.StatusForbidden {
- if path == (c.baseURL + "/access/ticket") {
- // received an unauthorized while trying to create a session
- return ErrNotAuthorized
- }
-
- if c.credentials != nil {
- // credentials passed but we need to check/create session
- err = c.CreateSession(ctx)
- if err != nil {
- if errors.Is(err, ErrSessionExists) {
- return ErrNotAuthorized
- }
- return err
- }
- return c.Req(ctx, method, path, data, v)
- }
- return ErrNotAuthorized
- }
-
- return c.handleResponse(res, v)
-
-}
-
-func (c *Client) Get(ctx context.Context, p string, v interface{}) error {
- return c.Req(ctx, http.MethodGet, p, nil, v)
-}
-
-// GetWithParams is a helper function to append query parameters to the URL
-func (c *Client) GetWithParams(ctx context.Context, p string, d interface{}, v interface{}) error {
- // Parse data and append to URL
- if d != nil {
- queryString, err := dataParserForURL(d)
- if err != nil {
- return err
- }
- p = p + "?" + queryString
- }
- return c.Req(ctx, http.MethodGet, p, nil, v)
-}
-
-// dataParserForUrl parses the data and appends it to the URL as a query string
-func dataParserForURL(d interface{}) (string, error) {
- jsonBytes, err := json.Marshal(d)
- if err != nil {
- return "", err
- }
-
- var m map[string]interface{}
- err = json.Unmarshal(jsonBytes, &m)
- if err != nil {
- return "", err
- }
-
- values := url.Values{}
- for key, value := range m {
- strValue := fmt.Sprintf("%v", value)
- values.Set(key, strValue)
- }
-
- return values.Encode(), nil
-
-}
-
-func (c *Client) Post(ctx context.Context, p string, d interface{}, v interface{}) error {
- var data []byte
- if d != nil {
- var err error
- data, err = json.Marshal(d)
- if err != nil {
- return err
- }
- }
-
- return c.Req(ctx, http.MethodPost, p, data, v)
-}
-
-func (c *Client) Put(ctx context.Context, p string, d interface{}, v interface{}) error {
- var data []byte
- if d != nil {
- var err error
- data, err = json.Marshal(d)
- if err != nil {
- return err
- }
- }
-
- return c.Req(ctx, http.MethodPut, p, data, v)
-}
-
-func (c *Client) Delete(ctx context.Context, p string, v interface{}) error {
- return c.Req(ctx, http.MethodDelete, p, nil, v)
-}
-
-// Upload - There is some weird 16kb limit hardcoded in proxmox for the max POST size, hopefully in the future we make
-// a func to scp the file to the node directly as this API endpoint is kind of janky. For now big ISOs/vztmpl should
-// be put somewhere and a use DownloadUrl. code link for posterity, I think they meant to do 16mb and got the bit math wrong
-// https://git.proxmox.com/?p=pve-manager.git;a=blob;f=PVE/HTTPServer.pm;h=8a0c308ea6d6601b886b0dec2bada3d4c3da65d0;hb=HEAD#l36
-// the task returned is the imgcopy from the tmp file to where the node actually wants the iso and you should wait for that
-// to complete before using the iso
-func (c *Client) Upload(path string, fields map[string]string, file *os.File, v interface{}) error {
- if strings.HasPrefix(path, "/") {
- path = c.baseURL + path
- }
-
- var b bytes.Buffer
- w := multipart.NewWriter(&b)
-
- for name, val := range fields {
- if err := w.WriteField(name, val); err != nil {
- return err
- }
- }
-
- if _, err := w.CreateFormFile("filename", filepath.Base(file.Name())); err != nil {
- return err
- }
-
- header := b.Len()
- if err := w.Close(); err != nil {
- return err
- }
-
- body := io.MultiReader(bytes.NewReader(b.Bytes()[:header]),
- file,
- bytes.NewReader(b.Bytes()[header:]))
-
- req, err := http.NewRequest(http.MethodPost, path, body)
- if err != nil {
- return err
- }
-
- fi, err := file.Stat()
- if err != nil {
- return err
- }
-
- req.Header.Set("Content-Type", w.FormDataContentType())
- req.ContentLength = int64(b.Len()) + fi.Size()
- c.authHeaders(&req.Header)
-
- res, err := c.httpClient.Do(req)
- if err != nil {
- return err
- }
- defer func() { _ = res.Body.Close() }()
-
- return c.handleResponse(res, &v)
-}
-
-func (c *Client) authHeaders(header *http.Header) {
- header.Add("User-Agent", c.userAgent)
- header.Add("Accept", "application/json")
- if c.token != "" {
- header.Add("Authorization", "PVEAPIToken="+c.token)
- } else if c.session != nil {
- header.Add("Cookie", "PVEAuthCookie="+c.session.Ticket)
- header.Add("CSRFPreventionToken", c.session.CSRFPreventionToken)
- }
-}
-
-func (c *Client) handleResponse(res *http.Response, v interface{}) error {
- if res.StatusCode == http.StatusInternalServerError ||
- res.StatusCode == http.StatusNotImplemented {
- return errors.New(res.Status)
- }
-
- body, err := io.ReadAll(res.Body)
- if err != nil {
- return err
- }
-
- c.log.Debugf("RECV: %d - %s", res.StatusCode, res.Status)
-
- if res.Request != nil && res.Request.URL != nil {
- if res.Request.URL.String() != (c.baseURL + "/access/ticket") {
- // don't show tokens out of the logs
- c.log.Debugf("BODY: %s", string(body))
- }
- }
-
- if res.StatusCode == http.StatusBadRequest {
- var errorskey map[string]json.RawMessage
- if err := json.Unmarshal(body, &errorskey); err != nil {
- return err
- }
-
- if body, ok := errorskey["errors"]; ok {
- return fmt.Errorf("bad request: %s - %s", res.Status, body)
- }
-
- return fmt.Errorf("bad request: %s - %s", res.Status, string(body))
- }
-
- // if nil passed don't bother to do any unmarshalling
- if nil == v {
- return nil
- }
- // account for everything being in a data key
- var datakey map[string]json.RawMessage
- if err := json.Unmarshal(body, &datakey); err != nil {
- return err
- }
-
- if body, ok := datakey["data"]; ok {
- return json.Unmarshal(body, &v)
- }
-
- return json.Unmarshal(body, &v) // assume passed in type fully supports response
-}
-
-func (c *Client) TermWebSocket(path string, term *Term) (chan []byte, chan []byte, chan error, func() error, error) {
- if strings.HasPrefix(path, "/") {
- path = strings.Replace(c.baseURL, "https://", "wss://", 1) + path
- }
-
- var tlsConfig *tls.Config
- transport := c.httpClient.Transport.(*http.Transport)
- if transport != nil {
- tlsConfig = transport.TLSClientConfig
- }
- c.log.Debugf("connecting to websocket: %s", path)
- dialer := &websocket.Dialer{
- Proxy: http.ProxyFromEnvironment,
- HandshakeTimeout: 30 * time.Second,
- TLSClientConfig: tlsConfig,
- }
-
- dialerHeaders := http.Header{}
- c.authHeaders(&dialerHeaders)
-
- conn, _, err := dialer.Dial(path, dialerHeaders)
-
- if err != nil {
- return nil, nil, nil, nil, err
- }
-
- // start the session by sending user@realm:ticket
- if err := conn.WriteMessage(websocket.BinaryMessage, []byte(term.User+":"+term.Ticket+"\n")); err != nil {
- return nil, nil, nil, nil, err
- }
-
- // it sends back the same thing you just sent so catch it drop it
- _, msg, err := conn.ReadMessage()
- if err != nil || string(msg) != "OK" {
- if err := conn.Close(); err != nil {
- return nil, nil, nil, nil, fmt.Errorf("error closing websocket: %s", err.Error())
- }
- return nil, nil, nil, nil, fmt.Errorf("unable to establish websocket: %s", err.Error())
- }
-
- type size struct {
- height int
- width int
- }
- // start the session by sending user@realm:ticket
- tsize := size{
- height: goterm.Height(),
- width: goterm.Width(),
- }
-
- c.log.Debugf("sending terminal size: %d x %d", tsize.height, tsize.width)
- if err := conn.WriteMessage(websocket.BinaryMessage, []byte(fmt.Sprintf("1:%d:%d:", tsize.height, tsize.width))); err != nil {
- return nil, nil, nil, nil, err
- }
-
- send := make(chan []byte)
- recv := make(chan []byte)
- errs := make(chan error)
- done := make(chan struct{})
- ticker := time.NewTicker(30 * time.Second)
- resize := make(chan size)
-
- go func(tsize size) {
- ticker := time.NewTicker(1 * time.Second)
- defer ticker.Stop()
- for {
- select {
- case <-done:
- return
- case <-ticker.C:
- resized := size{
- height: goterm.Height(),
- width: goterm.Width(),
- }
- if tsize.height != resized.height ||
- tsize.width != resized.width {
- tsize = resized
- resize <- resized
- }
- }
- }
- }(tsize)
-
- closer := func() error {
- close(done)
- time.Sleep(1 * time.Second)
- close(send)
- close(recv)
- close(errs)
- ticker.Stop()
-
- return conn.Close()
- }
-
- go func() {
- for {
- select {
- case <-done:
- return
- default:
- _, msg, err := conn.ReadMessage()
- if err != nil {
- if strings.Contains(err.Error(), "use of closed network connection") {
- return
- }
- if !websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway, websocket.CloseAbnormalClosure) {
- return
- }
- errs <- err
- }
- recv <- msg
- }
- }
- }()
-
- go func() {
- for {
- select {
- case <-done:
- if err := conn.WriteMessage(websocket.CloseMessage, []byte{}); err != nil {
- errs <- err
- }
- return
- case <-ticker.C:
- c.log.Debugf("sending wss keep alive")
- if err := conn.WriteMessage(websocket.BinaryMessage, []byte("2")); err != nil {
- errs <- err
- }
- case resized := <-resize:
- c.log.Debugf("resizing terminal window: %d x %d", resized.height, resized.width)
- if err := conn.WriteMessage(websocket.BinaryMessage, []byte(fmt.Sprintf("1:%d:%d:", resized.height, resized.width))); err != nil {
- errs <- err
- }
- case msg := <-send:
- c.log.Debugf("sending: %s", msg)
- send := append([]byte(fmt.Sprintf("0:%d:", len(msg))), msg...)
- if err := conn.WriteMessage(websocket.BinaryMessage, send); err != nil {
- errs <- err
- }
- }
- }
- }()
-
- return send, recv, errs, closer, nil
-}
-
-func (c *Client) VNCWebSocket(path string, vnc *VNC) (chan []byte, chan []byte, chan error, func() error, error) {
- if strings.HasPrefix(path, "/") {
- path = strings.Replace(c.baseURL, "https://", "wss://", 1) + path
- }
-
- var tlsConfig *tls.Config
- transport := c.httpClient.Transport.(*http.Transport)
- if transport != nil {
- tlsConfig = transport.TLSClientConfig
- }
- c.log.Debugf("connecting to websocket: %s", path)
- dialer := &websocket.Dialer{
- Proxy: http.ProxyFromEnvironment,
- HandshakeTimeout: 30 * time.Second,
- TLSClientConfig: tlsConfig,
- }
-
- dialerHeaders := http.Header{}
- c.authHeaders(&dialerHeaders)
-
- conn, _, err := dialer.Dial(path, dialerHeaders)
-
- if err != nil {
- return nil, nil, nil, nil, err
- }
-
- send := make(chan []byte)
- recv := make(chan []byte)
- errs := make(chan error)
- done := make(chan struct{})
-
- closer := func() error {
- close(done)
- time.Sleep(1 * time.Second)
- close(send)
- close(recv)
- close(errs)
-
- return conn.Close()
- }
-
- go func() {
- for {
- select {
- case <-done:
- return
- default:
- _, msg, err := conn.ReadMessage()
- if err != nil {
- if strings.Contains(err.Error(), "use of closed network connection") {
- return
- }
- if !websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway, websocket.CloseAbnormalClosure) {
- return
- }
- errs <- err
- }
- recv <- msg
- }
- }
- }()
-
- go func() {
- for {
- select {
- case <-done:
- if err := conn.WriteMessage(websocket.CloseMessage, []byte{}); err != nil {
- errs <- err
- }
- return
- case msg := <-send:
- c.log.Debugf("sending: %s", msg)
- if err := conn.WriteMessage(websocket.BinaryMessage, msg); err != nil {
- errs <- err
- }
- }
- }
- }()
-
- return send, recv, errs, closer, nil
-}
diff --git a/go-proxmox/proxmox_test.go b/go-proxmox/proxmox_test.go
deleted file mode 100644
index f64ae8e..0000000
--- a/go-proxmox/proxmox_test.go
+++ /dev/null
@@ -1,173 +0,0 @@
-package proxmox
-
-import (
- "context"
- "io"
- "net/http"
- "strings"
- "testing"
-
- "github.com/luthermonson/go-proxmox/tests/mocks"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
- "github.com/stretchr/testify/assert"
-)
-
-const (
- TestURI = "http://test.localhost"
-)
-
-var mockConfig = config.Config{
- URI: TestURI,
-}
-
-func mockClient(options ...Option) *Client {
- return NewClient(mockConfig.URI, options...)
-}
-
-func TestMakeTag(t *testing.T) {
- assert.Equal(t, "go-proxmox+tagname", MakeTag("tagname"))
-}
-
-// options tested in options_test.go
-func TestNewClient(t *testing.T) {
- v := NewClient(TestURI)
- assert.Equal(t, http.DefaultClient, v.httpClient)
- assert.Equal(t, v.baseURL, TestURI)
- assert.Equal(t, v.userAgent, DefaultUserAgent)
-}
-
-func TestClient_authHeaders(t *testing.T) {
- cases := []struct {
- input http.Header
- expect http.Header
- client *Client
- }{
- {
- input: http.Header{},
- expect: http.Header{
- "Accept": []string{"application/json"},
- "Authorization": []string{"PVEAPIToken=root@pam!test=1234"},
- "User-Agent": []string{"go-proxmox/dev"},
- },
- client: NewClient("", WithAPIToken("root@pam!test", "1234")),
- },
- {
- input: http.Header{},
- expect: http.Header{
- "Accept": []string{"application/json"},
- "Cookie": []string{"PVEAuthCookie=ticket"},
- "Csrfpreventiontoken": []string{"csrftoken"},
- "User-Agent": []string{"go-proxmox/dev"},
- },
- client: NewClient("", WithSession("ticket", "csrftoken")),
- },
- }
-
- for _, test := range cases {
- test.client.authHeaders(&test.input)
- assert.Equal(t, test.expect, test.input)
- }
-}
-
-func TestClient_Version7(t *testing.T) {
- mocks.ProxmoxVE7x(mockConfig)
- defer mocks.Off()
-
- v, err := mockClient().Version(context.Background())
- assert.Nil(t, err)
- assert.Equal(t, "7.7-7", v.Version)
- assert.Equal(t, "777777", v.RepoID)
- assert.Equal(t, "7.7", v.Release)
-}
-
-func TestClient_Version6(t *testing.T) {
- mocks.ProxmoxVE6x(mockConfig)
- defer mocks.Off()
-
- v, err := mockClient().Version(context.Background())
- assert.Nil(t, err)
- assert.Equal(t, "6.6-6", v.Version)
- assert.Equal(t, "666666", v.RepoID)
- assert.Equal(t, "6.6", v.Release)
-}
-
-func TestClient_Version9(t *testing.T) {
- mocks.ProxmoxVE9x(mockConfig)
- defer mocks.Off()
-
- v, err := mockClient().Version(context.Background())
- assert.Nil(t, err)
- assert.Equal(t, "9.1-1", v.Version)
- assert.Equal(t, "9a1b2c3d", v.RepoID)
- assert.Equal(t, "9.1", v.Release)
-}
-
-func TestClientMethods(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- var err error
-
- var v Version
- err = client.Get(ctx, "/version", &v)
- assert.Nil(t, err)
- assert.Equal(t, "9.1", v.Release)
-
- err = client.Post(ctx, "/version", struct{}{}, &v)
- assert.Nil(t, err)
- assert.Equal(t, "9.1", v.Release)
-
- err = client.Put(ctx, "/version", struct{}{}, &v)
- assert.Nil(t, err)
- assert.Equal(t, "9.1", v.Release)
-
- err = client.Delete(ctx, "/version", &v)
- assert.Nil(t, err)
- assert.Equal(t, "9.1", v.Release)
-}
-
-func TestClient_handleResponse(t *testing.T) {
- // todo test if logs exclude /access/ticket requests
- // todo test data key vs no data key
-
- client := NewClient(TestURI)
-
- // bad json
- resp := &http.Response{
- Body: io.NopCloser(strings.NewReader("{\"data\":{\"test\": \"data\"}")),
- }
- testData := map[string]string{}
- err := client.handleResponse(resp, &testData)
- assert.NotNil(t, err)
- assert.Equal(t, "unexpected end of JSON input", err.Error())
- assert.Len(t, testData, 0)
-
- // good json
- resp = &http.Response{
- Body: io.NopCloser(strings.NewReader("{\"data\":{\"test\": \"data\"}}")),
- }
- testData = map[string]string{}
- assert.Nil(t, client.handleResponse(resp, &testData))
- assert.Equal(t, "data", testData["test"])
-
- // bad requests with error key
- resp = &http.Response{
- StatusCode: http.StatusBadRequest,
- Body: io.NopCloser(strings.NewReader("{\"errors\":\"error content\"}")),
- }
- testData = map[string]string{}
- err = client.handleResponse(resp, &testData)
- assert.NotNil(t, err)
- assert.Equal(t, "bad request: - \"error content\"", err.Error())
-
- // bad requests with no errors key
- resp = &http.Response{
- StatusCode: http.StatusBadRequest,
- Body: io.NopCloser(strings.NewReader("{\"test\":\"data\"}")),
- }
- testData = map[string]string{}
- err = client.handleResponse(resp, &testData)
- assert.NotNil(t, err)
- assert.Equal(t, "bad request: - {\"test\":\"data\"}", err.Error())
-}
diff --git a/go-proxmox/storage.go b/go-proxmox/storage.go
deleted file mode 100644
index e546c39..0000000
--- a/go-proxmox/storage.go
+++ /dev/null
@@ -1,266 +0,0 @@
-package proxmox
-
-import (
- "context"
- "fmt"
- "os"
- "path/filepath"
-)
-
-var validContent = map[string]struct{}{
- "iso": {},
- "vztmpl": {},
- "import": {},
-}
-
-func (c *Client) ClusterStorages(ctx context.Context) (storages ClusterStorages, err error) {
- err = c.Get(ctx, "/storage", &storages)
- if err != nil {
- return
- }
-
- for _, s := range storages {
- s.client = c
- }
- return
-}
-
-func (c *Client) ClusterStorage(ctx context.Context, name string) (storage *ClusterStorage, err error) {
- err = c.Get(ctx, fmt.Sprintf("/storage/%s", name), &storage)
- if err != nil {
- return
- }
-
- storage.client = c
- return
-}
-
-func (c *Client) DeleteClusterStorage(ctx context.Context, name string) (*Task, error) {
- var upid UPID
- err := c.Delete(ctx, fmt.Sprintf("/storage/%s", name), &upid)
- if err != nil {
- return nil, err
- }
- return NewTask(upid, c), nil
-}
-
-func (c *Client) NewClusterStorage(ctx context.Context, options ...ClusterStorageOptions) (*Task, error) {
- var upid UPID
-
- data := make(map[string]interface{})
- for _, option := range options {
- data[option.Name] = option.Value
- }
- err := c.Post(ctx, "/storage", data, &upid)
-
- if err != nil {
- return nil, err
- }
- return NewTask(upid, c), nil
-}
-
-func (c *Client) UpdateClusterStorage(ctx context.Context, name string, options ...ClusterStorageOptions) (*Task, error) {
- var upid UPID
- data := make(map[string]interface{})
- for _, option := range options {
- data[option.Name] = option.Value
- }
- err := c.Put(ctx, fmt.Sprintf("/storage/%s", name), data, &upid)
- if err != nil {
- return nil, err
- }
- return NewTask(upid, c), nil
-}
-
-func (s *Storage) Upload(content, file string) (*Task, error) {
- return s.upload(content, file, nil)
-}
-
-func (s *Storage) UploadWithName(content, file string, storageFilename string) (*Task, error) {
- return s.upload(content, file, &map[string]string{"filename": storageFilename})
-}
-
-func (s *Storage) UploadWithHash(content, file string, storageFilename *string, checksum, checksumAlgorithm string) (*Task, error) {
- extraArgs := map[string]string{
- "checksum": checksum,
- "checksum-algorithm": checksumAlgorithm,
- }
- if storageFilename != nil {
- extraArgs["filename"] = *storageFilename
- }
-
- if storageFilename != nil {
- return s.upload(content, file, &map[string]string{"filename": *storageFilename})
- }
-
- return s.upload(content, file, nil)
-}
-
-func (s *Storage) upload(content, file string, extraArgs *map[string]string) (*Task, error) {
- if _, ok := validContent[content]; !ok {
- return nil, fmt.Errorf("only iso, vztmpl and import allowed")
- }
-
- stat, err := os.Stat(file)
- if err != nil {
- return nil, err
- }
-
- if stat.IsDir() {
- return nil, fmt.Errorf("file is a directory %s", file)
- }
-
- f, err := os.Open(file)
- if err != nil {
- return nil, err
- }
- defer func() { _ = f.Close() }()
-
- var upid UPID
- data := map[string]string{"content": content}
- if extraArgs != nil {
- for k, v := range *extraArgs {
- data[k] = v
- }
- }
-
- if err := s.client.Upload(fmt.Sprintf("/nodes/%s/storage/%s/upload", s.Node, s.Name),
- data, f, &upid); err != nil {
- return nil, err
- }
-
- return NewTask(upid, s.client), nil
-}
-
-func (s *Storage) DownloadURL(ctx context.Context, content, filename, url string) (*Task, error) {
- return s.downloadURL(ctx, content, filename, url, nil)
-}
-
-func (s *Storage) DownloadURLWithHash(ctx context.Context, content, filename, url string, checksum, checksumAlgorithm string) (*Task, error) {
- return s.downloadURL(ctx, content, filename, url, &map[string]string{
- "checksum": checksum,
- "checksum-algorithm": checksumAlgorithm,
- })
-}
-
-func (s *Storage) downloadURL(ctx context.Context, content, filename, url string, extraArgs *map[string]string) (*Task, error) {
- if _, ok := validContent[content]; !ok {
- return nil, fmt.Errorf("only iso, vztmpl and import allowed")
- }
-
- var upid UPID
- data := map[string]string{
- "content": content,
- "filename": filename,
- "url": url,
- }
-
- if extraArgs != nil {
- for k, v := range *extraArgs {
- data[k] = v
- }
- }
- err := s.client.Post(ctx, fmt.Sprintf("/nodes/%s/storage/%s/download-url", s.Node, s.Name), data, &upid)
- if err != nil {
- return nil, err
- }
- return NewTask(upid, s.client), nil
-}
-
-func (s *Storage) GetContent(ctx context.Context) (content []*StorageContent, err error) {
- err = s.client.Get(ctx, fmt.Sprintf("/nodes/%s/storage/%s/content", s.Node, s.Name), &content)
- return content, err
-}
-
-func (s *Storage) DeleteContent(ctx context.Context, content string) (*Task, error) {
- var upid UPID
- err := s.client.Delete(ctx, fmt.Sprintf("/nodes/%s/storage/%s/content/%s", s.Node, s.Name, content), &upid)
- if err != nil {
- return nil, err
- }
- return NewTask(upid, s.client), nil
-}
-
-func (s *Storage) ISO(ctx context.Context, name string) (iso *ISO, err error) {
- err = s.client.Get(ctx, fmt.Sprintf("/nodes/%s/storage/%s/content/%s:%s/%s", s.Node, s.Name, s.Name, "iso", name), &iso)
- if err != nil {
- return nil, err
- }
-
- iso.client = s.client
- iso.Node = s.Node
- iso.Storage = s.Name
- if iso.VolID == "" {
- iso.VolID = fmt.Sprintf("%s:iso/%s", iso.Storage, name)
- }
- return
-}
-
-func (s *Storage) VzTmpl(ctx context.Context, name string) (vztmpl *VzTmpl, err error) {
- err = s.client.Get(ctx, fmt.Sprintf("/nodes/%s/storage/%s/content/%s:%s/%s", s.Node, s.Name, s.Name, "vztmpl", name), &vztmpl)
- if err != nil {
- return nil, err
- }
-
- vztmpl.client = s.client
- vztmpl.Node = s.Node
- vztmpl.Storage = s.Name
- if vztmpl.VolID == "" {
- vztmpl.VolID = fmt.Sprintf("%s:vztmpl/%s", vztmpl.Storage, name)
- }
- return
-}
-
-func (s *Storage) Import(ctx context.Context, name string) (imp *Import, err error) {
- err = s.client.Get(ctx, fmt.Sprintf("/nodes/%s/storage/%s/content/%s:%s/%s", s.Node, s.Name, s.Name, "import", name), &imp)
- if err != nil {
- return nil, err
- }
-
- imp.client = s.client
- imp.Node = s.Node
- imp.Storage = s.Name
- if imp.VolID == "" {
- imp.VolID = fmt.Sprintf("%s:import/%s", imp.Storage, name)
- }
- return
-}
-
-func (s *Storage) Backup(ctx context.Context, name string) (backup *Backup, err error) {
- err = s.client.Get(ctx, fmt.Sprintf("/nodes/%s/storage/%s/content/%s:%s/%s", s.Node, s.Name, s.Name, "backup", name), &backup)
- if err != nil {
- return nil, err
- }
-
- backup.client = s.client
- backup.Node = s.Node
- backup.Storage = s.Name
- return
-}
-
-func (v *VzTmpl) Delete(ctx context.Context) (*Task, error) {
- return deleteVolume(ctx, v.client, v.Node, v.Storage, v.VolID, v.Path, "vztmpl")
-}
-
-func (b *Backup) Delete(ctx context.Context) (*Task, error) {
- return deleteVolume(ctx, b.client, b.Node, b.Storage, b.VolID, b.Path, "backup")
-}
-
-func (i *ISO) Delete(ctx context.Context) (*Task, error) {
- return deleteVolume(ctx, i.client, i.Node, i.Storage, i.VolID, i.Path, "iso")
-}
-
-func deleteVolume(ctx context.Context, c *Client, n, s, v, p, t string) (*Task, error) {
- var upid UPID
- if v == "" && p == "" {
- return nil, fmt.Errorf("volid or path required for a delete")
- }
-
- if v == "" {
- // volid not returned in the volume endpoints, need to generate
- v = fmt.Sprintf("%s:%s/%s", s, t, filepath.Base(p))
- }
-
- err := c.Delete(ctx, fmt.Sprintf("/nodes/%s/storage/%s/content/%s", n, s, v), &upid)
- return NewTask(upid, c), err
-}
diff --git a/go-proxmox/storage_test.go b/go-proxmox/storage_test.go
deleted file mode 100644
index 5824bfe..0000000
--- a/go-proxmox/storage_test.go
+++ /dev/null
@@ -1,316 +0,0 @@
-package proxmox
-
-import (
- "context"
- "testing"
-
- "github.com/luthermonson/go-proxmox/tests/mocks"
- "github.com/stretchr/testify/assert"
-)
-
-func TestClusterStorages(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- storages, err := client.ClusterStorages(ctx)
- assert.Nil(t, err)
- assert.NotNil(t, storages)
- assert.Len(t, storages, 3)
-
- // Verify local storage
- assert.Equal(t, "local", storages[0].Storage)
- assert.Equal(t, "dir", storages[0].Type)
- assert.Equal(t, "vztmpl,iso,backup", storages[0].Content)
- assert.Equal(t, 0, storages[0].Shared)
-
- // Verify local-lvm storage
- assert.Equal(t, "local-lvm", storages[1].Storage)
- assert.Equal(t, "lvmthin", storages[1].Type)
- assert.Equal(t, "images,rootdir", storages[1].Content)
- assert.Equal(t, "data", storages[1].Thinpool)
- assert.Equal(t, "pve", storages[1].VgName)
-
- // Verify nfs storage
- assert.Equal(t, "nfs-storage", storages[2].Storage)
- assert.Equal(t, "nfs", storages[2].Type)
- assert.Equal(t, 1, storages[2].Shared)
- assert.Equal(t, "node1,node2", storages[2].Nodes)
-}
-
-func TestClusterStorage(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- storage, err := client.ClusterStorage(ctx, "local")
- assert.Nil(t, err)
- assert.NotNil(t, storage)
- assert.Equal(t, "local", storage.Storage)
- assert.Equal(t, "dir", storage.Type)
- assert.Equal(t, "vztmpl,iso,backup", storage.Content)
- assert.Equal(t, "/var/lib/vz", storage.Path)
- assert.Equal(t, 0, storage.Shared)
-}
-
-func TestClusterStorage_LVM(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- storage, err := client.ClusterStorage(ctx, "local-lvm")
- assert.Nil(t, err)
- assert.NotNil(t, storage)
- assert.Equal(t, "local-lvm", storage.Storage)
- assert.Equal(t, "lvmthin", storage.Type)
- assert.Equal(t, "data", storage.Thinpool)
- assert.Equal(t, "pve", storage.VgName)
-}
-
-func TestNewClusterStorage(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- task, err := client.NewClusterStorage(ctx,
- ClusterStorageOptions{Name: "storage", Value: "test-storage"},
- ClusterStorageOptions{Name: "type", Value: "dir"},
- ClusterStorageOptions{Name: "path", Value: "/mnt/test"},
- ClusterStorageOptions{Name: "content", Value: "iso,vztmpl"},
- )
- assert.Nil(t, err)
- assert.Nil(t, task) // Task is nil for successful operations with null data
-}
-
-func TestUpdateClusterStorage(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- task, err := client.UpdateClusterStorage(ctx, "local",
- ClusterStorageOptions{Name: "content", Value: "vztmpl,iso,backup,snippets"},
- )
- assert.Nil(t, err)
- assert.Nil(t, task)
-}
-
-func TestDeleteClusterStorage(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- task, err := client.DeleteClusterStorage(ctx, "test-storage")
- assert.Nil(t, err)
- assert.NotNil(t, task)
- assert.Equal(t, "node1", task.Node)
- assert.Equal(t, "storage", task.Type)
-}
-
-func TestStorage_GetContent(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- storage := &Storage{
- client: client,
- Node: "node1",
- Name: "local",
- }
-
- content, err := storage.GetContent(ctx)
- assert.Nil(t, err)
- assert.NotNil(t, content)
- assert.Len(t, content, 3)
-
- // Verify ISO content
- assert.Equal(t, "local:iso/debian-12.0.0-amd64-netinst.iso", content[0].Volid)
- assert.Equal(t, "iso", content[0].Format)
- assert.Equal(t, uint64(654311424), content[0].Size)
-
- // Verify vztmpl content
- assert.Equal(t, "local:vztmpl/debian-12-standard_12.0-1_amd64.tar.zst", content[1].Volid)
- assert.Equal(t, "tar.zst", content[1].Format)
- assert.Equal(t, uint64(128974848), content[1].Size)
-
- // Verify backup content
- assert.Equal(t, "local:backup/vzdump-qemu-100-2023_08_28-12_00_00.vma.zst", content[2].Volid)
- assert.Equal(t, "vma.zst", content[2].Format)
- assert.Equal(t, uint64(2147483648), content[2].Size)
- assert.Equal(t, uint64(100), content[2].VMID)
-}
-
-func TestStorage_DeleteContent(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- storage := &Storage{
- client: client,
- Node: "node1",
- Name: "local",
- }
-
- task, err := storage.DeleteContent(ctx, "local:iso/test.iso")
- assert.Nil(t, err)
- assert.NotNil(t, task)
- assert.Equal(t, "node1", task.Node)
- assert.Equal(t, "imgdel", task.Type)
-}
-
-func TestStorage_DownloadURL(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- storage := &Storage{
- client: client,
- Node: "node1",
- Name: "local",
- }
-
- task, err := storage.DownloadURL(ctx, "iso", "debian-12.iso", "https://example.com/debian-12.iso")
- assert.Nil(t, err)
- assert.NotNil(t, task)
- assert.Equal(t, "node1", task.Node)
- assert.Equal(t, "download", task.Type)
-}
-
-func TestStorage_UnmarshalJSON_LargeValues(t *testing.T) {
- // Test handling of large storage values (>1PB) that come back as floats in scientific notation
- tests := []struct {
- name string
- json string
- expected Storage
- }{
- {
- name: "Large total value in scientific notation",
- json: `{
- "storage": "large-storage",
- "enabled": 1,
- "active": 1,
- "total": 1.12589990684262e+15,
- "used": 5.5e+14,
- "avail": 5.7589990684262e+14,
- "type": "dir",
- "shared": 0
- }`,
- expected: Storage{
- Name: "large-storage",
- Storage: "large-storage",
- Enabled: 1,
- Active: 1,
- Total: uint64(1125899906842620),
- Used: uint64(550000000000000),
- Avail: uint64(575899906842620),
- Type: "dir",
- Shared: 0,
- },
- },
- {
- name: "Normal integer values",
- json: `{
- "storage": "normal-storage",
- "enabled": 1,
- "active": 1,
- "total": 1000000000,
- "used": 500000000,
- "avail": 500000000,
- "type": "lvm",
- "shared": 1
- }`,
- expected: Storage{
- Name: "normal-storage",
- Storage: "normal-storage",
- Enabled: 1,
- Active: 1,
- Total: uint64(1000000000),
- Used: uint64(500000000),
- Avail: uint64(500000000),
- Type: "lvm",
- Shared: 1,
- },
- },
- {
- name: "UsedFraction as float",
- json: `{
- "storage": "frac-storage",
- "enabled": 1,
- "active": 1,
- "total": 1000000,
- "used": 750000,
- "avail": 250000,
- "used_fraction": 0.75,
- "type": "zfs",
- "shared": 0
- }`,
- expected: Storage{
- Name: "frac-storage",
- Storage: "frac-storage",
- Enabled: 1,
- Active: 1,
- Total: uint64(1000000),
- Used: uint64(750000),
- Avail: uint64(250000),
- UsedFraction: 0.75,
- Type: "zfs",
- Shared: 0,
- },
- },
- }
-
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- var storage Storage
- err := storage.UnmarshalJSON([]byte(tt.json))
- assert.Nil(t, err)
- assert.Equal(t, tt.expected.Name, storage.Name)
- assert.Equal(t, tt.expected.Storage, storage.Storage)
- assert.Equal(t, tt.expected.Enabled, storage.Enabled)
- assert.Equal(t, tt.expected.Active, storage.Active)
- assert.Equal(t, tt.expected.Total, storage.Total)
- assert.Equal(t, tt.expected.Used, storage.Used)
- assert.Equal(t, tt.expected.Avail, storage.Avail)
- assert.Equal(t, tt.expected.UsedFraction, storage.UsedFraction)
- assert.Equal(t, tt.expected.Type, storage.Type)
- assert.Equal(t, tt.expected.Shared, storage.Shared)
- })
- }
-}
-
-func TestStorages_UnmarshalJSON(t *testing.T) {
- // Test that Storages slice unmarshaling works correctly
- json := `[
- {
- "storage": "storage1",
- "enabled": 1,
- "active": 1,
- "total": 1.5e+15,
- "type": "dir"
- },
- {
- "storage": "storage2",
- "enabled": 1,
- "active": 1,
- "total": 2000000000,
- "type": "lvm"
- }
- ]`
-
- var storages Storages
- err := storages.UnmarshalJSON([]byte(json))
- assert.Nil(t, err)
- assert.Len(t, storages, 2)
- assert.Equal(t, "storage1", storages[0].Storage)
- assert.Equal(t, uint64(1500000000000000), storages[0].Total)
- assert.Equal(t, "storage2", storages[1].Storage)
- assert.Equal(t, uint64(2000000000), storages[1].Total)
-}
diff --git a/go-proxmox/tasks.go b/go-proxmox/tasks.go
deleted file mode 100644
index 52c6065..0000000
--- a/go-proxmox/tasks.go
+++ /dev/null
@@ -1,200 +0,0 @@
-package proxmox
-
-import (
- "context"
- "fmt"
- "strings"
- "time"
-)
-
-const (
- TaskRunning = "running"
-)
-
-var DefaultWaitInterval = 1 * time.Second
-
-func NewTask(upid UPID, client *Client) *Task {
- if upid == "" {
- return nil
- }
-
- task := &Task{
- UPID: upid,
- client: client,
- }
-
- sp := strings.Split(string(task.UPID), ":")
- if len(sp) == 0 || len(sp) < 7 {
- return task
- }
-
- task.Node = sp[1]
- task.Type = sp[5]
- task.ID = sp[6]
- task.User = sp[7]
-
- return task
-}
-
-func (t *Task) Ping(ctx context.Context) error {
- tmp := NewTask(t.UPID, t.client)
- err := t.client.Get(ctx, fmt.Sprintf("/nodes/%s/tasks/%s/status", t.Node, t.UPID), t)
- if nil != err || nil == t {
- t = tmp
- }
- if nil == t.client {
- t.client = tmp.client
- }
-
- if t.Status == "stopped" {
- t.IsCompleted = true
- } else {
- t.IsRunning = true
- }
- if t.IsCompleted {
- if t.ExitStatus == "OK" {
- t.IsSuccessful = true
- } else {
- t.IsFailed = true
- }
- }
- return err
-}
-
-func (t *Task) Stop(ctx context.Context) error {
- return t.client.Delete(ctx, fmt.Sprintf("/nodes/%s/tasks/%s", t.Node, t.UPID), nil)
-}
-
-func (t *Task) Log(ctx context.Context, start, limit int) (l Log, err error) {
- return l, t.client.Get(ctx, fmt.Sprintf("/nodes/%s/tasks/%s/log?start=%d&limit=%d", t.Node, t.UPID, start, limit), &l)
-}
-
-func (t *Task) Watch(ctx context.Context, start int) (chan string, error) {
- t.client.log.Debugf("starting watcher on %s", t.UPID)
- watch := make(chan string)
-
- log, err := t.Log(ctx, start, 50)
- if err != nil {
- return watch, err
- }
-
- for i := 0; i < 3; i++ {
- // retry 3 times if the log has no entries
- t.client.log.Debugf("no logs for %s found, retrying %d of 3 times", t.UPID, i)
- if len(log) > 0 {
- break
- }
- time.Sleep(1 * time.Second)
-
- log, err = t.Log(ctx, start, 50)
- if err != nil {
- return watch, err
- }
- }
-
- if len(log) == 0 {
- return watch, fmt.Errorf("no logs available for %s", t.UPID)
- }
-
- go func() {
- t.client.log.Debugf("logs found for task %s", t.UPID)
- for _, ln := range log {
- watch <- ln
- }
- t.client.log.Debugf("watching task %s", t.UPID)
- err := tasktail(ctx, len(log), watch, t)
- if err != nil {
- t.client.log.Errorf("error watching logs: %s", err)
- }
- }()
-
- t.client.log.Debugf("returning watcher for %s", t.UPID)
- return watch, nil
-}
-
-func tasktail(ctx context.Context, start int, watch chan string, task *Task) error {
- for {
- task.client.log.Debugf("tailing log for task %s", task.UPID)
- if err := task.Ping(ctx); err != nil {
- return err
- }
-
- if task.Status != TaskRunning {
- task.client.log.Debugf("task %s is no longer running, closing down watcher", task.UPID)
- close(watch)
- return nil
- }
-
- logs, err := task.Log(ctx, start, 50)
- if err != nil {
- return err
- }
- for _, ln := range logs {
- watch <- ln
- }
- start = start + len(logs)
- time.Sleep(2 * time.Second)
- }
-}
-
-func (t *Task) WaitFor(ctx context.Context, seconds int) error {
- return t.Wait(ctx, DefaultWaitInterval, time.Duration(seconds)*time.Second)
-}
-
-func (t *Task) Wait(ctx context.Context, interval, max time.Duration) error {
- // ping it quick to fill in all the details we need in case they're not there
- err := t.Ping(ctx)
- if err != nil {
- return err
- }
- t.client.log.Debugf("waiting for %s, checking every %fs for %fs", t.UPID, interval.Seconds(), max.Seconds())
-
- timeout := time.After(max)
- for {
- select {
- case <-timeout:
- t.client.log.Debugf("timed out waiting for task %s for %fs", t.UPID, max.Seconds())
- return ErrTimeout
- default:
- if err = t.Ping(ctx); err != nil {
- return err
- }
-
- if t.Status != TaskRunning {
- t.client.log.Debugf("task %s has completed with status %s", t.UPID, t.Status)
- return nil
- }
- t.client.log.Debugf("waiting on task %s sleeping for %fs", t.UPID, interval.Seconds())
- }
- time.Sleep(interval)
- }
-}
-
-func (t *Task) WaitForCompleteStatus(ctx context.Context, timesNum int, steps ...int) (status bool, completed bool, err error) {
- step := 1
- if len(steps) > 0 && steps[0] > 1 {
- step = steps[0]
- }
- timeout := time.After(time.Duration(step*timesNum) * time.Second)
-
- for {
- select {
- case <-timeout:
- return
- default:
- err = t.Ping(ctx)
- if nil != err {
- t.client.log.Debugf("task %s ping error %+v", t.UPID, err)
- break
- }
- completed = t.IsCompleted
-
- if completed {
- status = t.IsSuccessful
- return
- }
- }
-
- time.Sleep(time.Duration(step) * time.Second)
- }
-}
diff --git a/go-proxmox/tasks_test.go b/go-proxmox/tasks_test.go
deleted file mode 100644
index 662d58a..0000000
--- a/go-proxmox/tasks_test.go
+++ /dev/null
@@ -1,126 +0,0 @@
-package proxmox
-
-import (
- "context"
- "testing"
-
- "github.com/luthermonson/go-proxmox/tests/mocks"
- "github.com/stretchr/testify/assert"
-)
-
-func TestNewTask(t *testing.T) {
- upid := NewTask("", &Client{})
- assert.Nil(t, upid)
-
- task := NewTask(UPID("UPID:nodename:00388B23:02D69651:63C4F6AF:tasktype:100:root@pam:"), &Client{})
- assert.Equal(t, "nodename", task.Node)
- assert.Equal(t, "100", task.ID)
- assert.Equal(t, "tasktype", task.Type)
- assert.Equal(t, "root@pam", task.User)
- assert.Equal(t, UPID("UPID:nodename:00388B23:02D69651:63C4F6AF:tasktype:100:root@pam:"), task.UPID)
-}
-
-func TestTask_Ping_Running(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- task := NewTask(UPID("UPID:node1:00000001:00000001:00000001:test:running:root@pam:"), client)
- err := task.Ping(ctx)
- assert.Nil(t, err)
- assert.Equal(t, "running", task.Status)
- assert.True(t, task.IsRunning)
- assert.False(t, task.IsCompleted)
- assert.False(t, task.IsSuccessful)
- assert.False(t, task.IsFailed)
-}
-
-func TestTask_Ping_Completed(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- task := NewTask(UPID("UPID:node1:00000002:00000002:00000002:test:completed:root@pam:"), client)
- err := task.Ping(ctx)
- assert.Nil(t, err)
- assert.Equal(t, "stopped", task.Status)
- assert.Equal(t, "OK", task.ExitStatus)
- assert.False(t, task.IsRunning)
- assert.True(t, task.IsCompleted)
- assert.True(t, task.IsSuccessful)
- assert.False(t, task.IsFailed)
-}
-
-func TestTask_Ping_Failed(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- task := NewTask(UPID("UPID:node1:00000003:00000003:00000003:test:failed:root@pam:"), client)
- err := task.Ping(ctx)
- assert.Nil(t, err)
- assert.Equal(t, "stopped", task.Status)
- assert.Equal(t, "some error occurred", task.ExitStatus)
- assert.False(t, task.IsRunning)
- assert.True(t, task.IsCompleted)
- assert.False(t, task.IsSuccessful)
- assert.True(t, task.IsFailed)
-}
-
-func TestTask_Stop(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- task := NewTask(UPID("UPID:node1:00000001:00000001:00000001:test:running:root@pam:"), client)
- err := task.Stop(ctx)
- assert.Nil(t, err)
-}
-
-func TestTask_Log(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- task := NewTask(UPID("UPID:node1:00000002:00000002:00000002:test:completed:root@pam:"), client)
- log, err := task.Log(ctx, 0, 50)
- assert.Nil(t, err)
- assert.NotNil(t, log)
- assert.Len(t, log, 5)
- assert.Equal(t, "task started", log[0])
- assert.Equal(t, "task completed successfully", log[4])
-}
-
-func TestTask_Log_WithOffset(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- task := NewTask(UPID("UPID:node1:00000002:00000002:00000002:test:completed:root@pam:"), client)
- log, err := task.Log(ctx, 5, 50)
- assert.Nil(t, err)
- assert.NotNil(t, log)
- assert.Len(t, log, 0) // No more logs after offset 5
-}
-
-func TestTask_Log_Running(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
-
- task := NewTask(UPID("UPID:node1:00000001:00000001:00000001:test:running:root@pam:"), client)
- log, err := task.Log(ctx, 0, 50)
- assert.Nil(t, err)
- assert.NotNil(t, log)
- assert.Len(t, log, 2)
- assert.Equal(t, "task started", log[0])
- assert.Equal(t, "processing...", log[1])
-}
-
diff --git a/go-proxmox/tests/integration/access_test.go b/go-proxmox/tests/integration/access_test.go
deleted file mode 100644
index 76ab1b7..0000000
--- a/go-proxmox/tests/integration/access_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package integration
diff --git a/go-proxmox/tests/integration/cluster_test.go b/go-proxmox/tests/integration/cluster_test.go
deleted file mode 100644
index c2e2502..0000000
--- a/go-proxmox/tests/integration/cluster_test.go
+++ /dev/null
@@ -1,78 +0,0 @@
-package integration
-
-import (
- "context"
- "fmt"
- "regexp"
- "testing"
-
- "github.com/stretchr/testify/assert"
-)
-
-func TestClient_Cluster(t *testing.T) {
- client := ClientFromLogins()
- ctx := context.Background()
- cluster, err := client.Cluster(ctx)
- assert.NoError(t, err)
- fmt.Println(cluster)
-}
-
-func TestClusterResources(t *testing.T) {
- client := ClientFromLogins()
- ctx := context.Background()
-
- // Check a call without parameters
- cluster, err := client.Cluster(ctx)
- assert.Nil(t, err)
-
- rs, err := cluster.Resources(ctx)
- assert.Nil(t, err)
- assert.GreaterOrEqual(t, len(rs), 1)
-
- re := regexp.MustCompile("^(pool|qemu|lxc|node|storage)$")
- for _, r := range rs {
- // Check types against known values
- assert.Regexp(t, re, r.Type)
- }
-
- // Check a call with all the valid filter values
- for _, rsType := range []string{"vm", "storage", "node", "sdn"} {
- rs, err = cluster.Resources(ctx, rsType)
- assert.Nil(t, err)
-
- // vm and sdn may be empty as it is absolutely not mandatory
- if rsType == "sdn" || rsType == "vm" {
- assert.GreaterOrEqual(t, len(rs), 0)
- } else {
- assert.GreaterOrEqual(t, len(rs), 1)
- }
-
- var s interface{}
- // api v2 returns type = qemu or lxc when filtering on vm
- if rsType == "vm" {
- s = []string{"qemu", "lxc"}
- } else {
- s = rsType
- }
-
- // Check that every resource returned if of the asked type
- for _, r := range rs {
- assert.Contains(t, s, r.Type)
- }
- }
-
- // Check a call with more than one parameter
- _, err = cluster.Resources(ctx, "bad", "call")
- assert.NotNil(t, err)
- assert.Contains(t, err.Error(), "value 'badcall' does not have a value in the enumeration 'vm, storage, node, sdn'")
-
- // Check a call with a string parameter which is not a single word
- _, err = cluster.Resources(ctx, "bad filter")
- assert.NotNil(t, err)
- assert.Contains(t, err.Error(), "value 'badfilter' does not have a value in the enumeration 'vm, storage, node, sdn'")
-
- // Check a call with a string parameter which is a word
- _, err = cluster.Resources(ctx, "unknownword")
- assert.NotNil(t, err)
- assert.Contains(t, err.Error(), "bad request: 400 Parameter verification failed")
-}
diff --git a/go-proxmox/tests/integration/containers_test.go b/go-proxmox/tests/integration/containers_test.go
deleted file mode 100644
index 82f62f1..0000000
--- a/go-proxmox/tests/integration/containers_test.go
+++ /dev/null
@@ -1,23 +0,0 @@
-//go:build containers
-// +build containers
-
-package integration
-
-import (
- "testing"
-)
-
-func TestStartContainer(t *testing.T) {
- //client := ClientFromLogins()
- //node, err := client.Node("")
- //assert.Nil(t, err)
- //
- //container, err := node.Container(103)
- //assert.Equal(t, "stopped", container.Status)
- //
- //_, err = container.Start()
- //assert.Nil(t, err)
- //
- //run, err := node.Container(103)
- //assert.Equal(t, "running", run.Status)
-}
diff --git a/go-proxmox/tests/integration/nodes_test.go b/go-proxmox/tests/integration/nodes_test.go
deleted file mode 100644
index 9757336..0000000
--- a/go-proxmox/tests/integration/nodes_test.go
+++ /dev/null
@@ -1,192 +0,0 @@
-package integration
-
-import (
- "bytes"
- "context"
- "fmt"
- "strings"
- "testing"
- "time"
-
- proxmox "github.com/luthermonson/go-proxmox"
-
- "github.com/stretchr/testify/assert"
- "github.com/stretchr/testify/require"
-)
-
-func TestNodes(t *testing.T) {
- client := ClientFromLogins()
- nodes, err := client.Nodes(context.TODO())
- assert.Nil(t, err)
- assert.GreaterOrEqual(t, len(nodes), 1)
- for _, n := range nodes {
- assert.NotEmpty(t, n.Node)
- var node *proxmox.Node
- t.Run("get status for node "+n.Node, func(t *testing.T) {
- var err error
- node, err = client.Node(context.TODO(), n.Node)
- assert.Nil(t, err)
- assert.Equal(t, n.MaxMem, node.Memory.Total)
- assert.Equal(t, n.Disk, node.RootFS.Used)
- })
-
- t.Run("get VMs for node "+n.Node, func(t *testing.T) {
- _, err := node.VirtualMachines(context.TODO())
- assert.Nil(t, err)
- })
-
- break // only pull status from one node
- }
-
- _, err = client.Node(context.TODO(), "doesnt-exist")
- assert.Contains(t, err.Error(), "500 hostname lookup 'doesnt-exist' failed - failed to get address info for: doesnt-exist:")
-}
-
-func TestNode(t *testing.T) {
- client := ClientFromLogins()
- node, err := client.Node(context.TODO(), td.nodeName)
- assert.Nil(t, err)
- assert.Equal(t, node.Name, td.nodeName)
-}
-
-func TestContainers(t *testing.T) {
- t.Run("get Containers for node "+td.node.Name, func(t *testing.T) {
- _, err := td.node.Containers(context.TODO())
- assert.Nil(t, err)
- })
-}
-
-func TestNode_Appliances(t *testing.T) {
- t.Run("get Containers for node "+td.node.Name, func(t *testing.T) {
- aplinfos, err := td.node.Appliances(context.TODO())
- assert.Nil(t, err)
- assert.GreaterOrEqual(t, len(aplinfos), 1)
- })
-}
-
-func TestNode_DownloadAppliance(t *testing.T) {
- var aplinfos proxmox.Appliances
- t.Run("get Containers for node "+td.node.Name, func(t *testing.T) {
- var err error
- aplinfos, err = td.node.Appliances(context.TODO())
- assert.Nil(t, err)
- assert.GreaterOrEqual(t, len(aplinfos), 1)
- })
-
- t.Run("download non existing appliance template", func(t *testing.T) {
- _, err := td.node.DownloadAppliance(context.TODO(), "doesnt-exist", td.nodeStorage)
- assert.NotNil(t, err)
- assert.True(t, strings.Contains(err.Error(), "no such template"))
- })
-
- if td.appliancePrefix == "" { // no point if no prefix to check for
- return
- }
- t.Run("download appliance "+td.appliancePrefix, func(t *testing.T) {
- for _, a := range aplinfos {
- if strings.HasPrefix(a.Template, td.appliancePrefix) {
- td.appliance = a // set to use in later tests
- ret, err := td.node.DownloadAppliance(context.TODO(), a.Template, td.nodeStorage)
- assert.Nil(t, err)
- assert.True(t, strings.HasPrefix(ret, fmt.Sprintf("UPID:%s:", td.node.Name)))
- }
- }
- })
-}
-
-func TestNode_Storages(t *testing.T) {
- storages, err := td.node.Storages(context.TODO())
- assert.Nil(t, err)
- assert.True(t, len(storages) > 0)
-
- for _, s := range storages {
- if s.Name == td.nodeStorage {
- assert.True(t, true, "storage exists: "+td.nodeStorage)
- return
- }
- }
-
- assert.True(t, false, "no storage: "+td.nodeStorage)
-}
-
-func TestNode_Storage(t *testing.T) {
- _, err := td.node.Storage(context.TODO(), "doesnt-exist")
- assert.Contains(t, err.Error(), "No such storage.")
-
- storage, err := td.node.Storage(context.TODO(), td.nodeStorage)
- assert.Nil(t, err)
- assert.Equal(t, td.nodeStorage, storage.Name)
-}
-
-func TestNode_TermProxy(t *testing.T) {
- term, err := td.node.TermProxy(context.TODO())
- assert.Nil(t, err)
- send, recv, errs, close, err := td.node.TermWebSocket(term)
- assert.Nil(t, err)
- defer func() {
- assert.NoError(t, close())
- }()
-
- go func() {
- for {
- select {
- case msg := <-recv:
- if len(msg) > 0 {
- fmt.Println("MSG: " + string(msg))
- }
- case err := <-errs:
- if err != nil {
- fmt.Println("ERROR: " + err.Error())
- return
- }
- }
- }
- }()
-
- send <- []byte("ls -la\n")
- time.Sleep(1 * time.Second)
- send <- []byte("hostname\n")
- time.Sleep(1 * time.Second)
- send <- []byte("exit\n")
- time.Sleep(1 * time.Second)
-}
-
-func TestNode_VncProxy(t *testing.T) {
- assert.NotEqual(t, 0, td.vncVmId)
-
- vm, err := td.node.VirtualMachine(context.TODO(), td.vncVmId)
- require.NoError(t, err)
-
- vnc, err := vm.VNCProxy(context.TODO(), nil)
- require.NoError(t, err)
-
- send, recv, errs, close, err := vm.VNCWebSocket(vnc)
- assert.Nil(t, err)
- defer func() {
- assert.NoError(t, close())
- }()
-
- go func() {
- for {
- select {
- case msg := <-recv:
- if len(msg) > 0 {
- fmt.Printf("MSG: %s -> %v\n", string(msg), msg)
- if strings.HasPrefix(string(msg), "RFB") {
- send <- msg
- }
- if bytes.Equal(msg, []byte{0x01, 0x02}) {
- fmt.Println("Success!")
- }
- }
- case err := <-errs:
- if err != nil {
- fmt.Println("ERROR: " + err.Error())
- return
- }
- }
- }
- }()
-
- time.Sleep(5 * time.Second)
-}
diff --git a/go-proxmox/tests/integration/proxmox_test.go b/go-proxmox/tests/integration/proxmox_test.go
deleted file mode 100644
index 055ed74..0000000
--- a/go-proxmox/tests/integration/proxmox_test.go
+++ /dev/null
@@ -1,192 +0,0 @@
-package integration
-
-import (
- "context"
- "crypto/tls"
- "encoding/json"
- "net/http"
- "os"
- "strconv"
- "testing"
-
- proxmox "github.com/luthermonson/go-proxmox"
- "github.com/stretchr/testify/assert"
-)
-
-type TestingData struct {
- client *proxmox.Client
- node *proxmox.Node
- storage *proxmox.Storage
- appliance *proxmox.Appliance
-
- username string
- password string
- tokenID string
- secret string
- otp string
- nodeName string
- nodeStorage string
- isoURL string
- appliancePrefix string
- vncVmId int
-}
-
-var (
- td TestingData
- logger = proxmox.LeveledLogger{Level: proxmox.LevelDebug}
-
- insecureHTTPClient = http.Client{
- Transport: &http.Transport{
- TLSClientConfig: &tls.Config{
- InsecureSkipVerify: true,
- },
- },
- }
-
- //tinycoreURL = "https://github.com/luthermonson/go-proxmox/releases/download/tests/tinycore.iso"
- //ubuntuURL = "https://releases.ubuntu.com/20.04.3/ubuntu-20.04.3-desktop-amd64.iso"
- //alpineAppliance = "http://download.proxmox.com/images/system/alpine-3.17-default_20221129_amd64.tar.xz"
-)
-
-func init() {
- var err error
-
- td.username = os.Getenv("PROXMOX_USERNAME")
- td.password = os.Getenv("PROXMOX_PASSWORD")
- td.otp = os.Getenv("PROXMOX_OTP")
- td.tokenID = os.Getenv("PROXMOX_TOKENID")
- td.secret = os.Getenv("PROXMOX_SECRET")
- td.nodeName = os.Getenv("PROXMOX_NODE_NAME")
- td.nodeStorage = os.Getenv("PROXMOX_NODE_STORAGE")
- td.isoURL = os.Getenv("PROXMOX_ISO_URL") // https://dl-cdn.alpinelinux.org/alpine/v3.14/releases/x86_64/alpine-virt-3.14.1-x86_64.iso
- td.appliancePrefix = "alpine-virt-3.14.1"
- vncVmId, err := strconv.Atoi(os.Getenv("PROXMOX_VNC_VMID"))
- if err == nil {
- td.vncVmId = vncVmId
- }
-
- if td.nodeName == "" {
- return
- }
-
- td.client = ClientFromLogins()
- ctx := context.Background()
-
- td.node, err = td.client.Node(ctx, td.nodeName)
- if err != nil {
- panic(err)
- }
-
- td.storage, err = td.node.Storage(ctx, td.nodeStorage)
- if err != nil {
- panic(err)
- }
-}
-
-//func nameGenerator(length int) string {
-// rand.Seed(time.Now().UnixNano())
-// b := make([]byte, length)
-// rand.Read(b)
-// rstr := fmt.Sprintf("%x", b)[:length]
-// return fmt.Sprintf("go-proxmox-%s", rstr)
-//}
-
-//func downloadFile(src, dst string) error {
-// out, err := os.Create(dst)
-// if err != nil {
-// return err
-// }
-// defer func() { _ = out.Close() }()
-//
-// resp, err := http.Get(src)
-// if err != nil {
-// return err
-// }
-// defer func() { _ = resp.Body.Close() }()
-//
-// _, err = io.Copy(out, resp.Body)
-// if err != nil {
-// return err
-// }
-//
-// return nil
-//}
-
-//func createTestISO(file string) error {
-// //making iso
-// blocksize := int64(2048)
-// iso, err := os.OpenFile(file, os.O_CREATE|os.O_RDWR, os.FileMode(0700))
-// if err != nil {
-// return err
-// }
-// defer func() { _ = iso.Close() }()
-//
-// // Wrap the *os.File in a backend.Storage
-// backend := backendfile.New(iso, false)
-// fs, err := iso9660.Create(backend, 0, 0, blocksize, "")
-// if err != nil {
-// return err
-// }
-//
-// err = fs.Mkdir("/")
-// if err != nil {
-// return err
-// }
-//
-// return fs.Finalize(iso9660.FinalizeOptions{
-// RockRidge: true,
-// VolumeIdentifier: "cidata",
-// })
-//}
-
-func ClientFromEnv() *proxmox.Client {
- return proxmox.NewClient(os.Getenv("PROXMOX_URL"),
- proxmox.WithHTTPClient(&insecureHTTPClient),
- proxmox.WithLogger(&logger),
- )
-}
-
-func ClientFromLogins() *proxmox.Client {
- client := proxmox.NewClient(os.Getenv("PROXMOX_URL"),
- proxmox.WithHTTPClient(&insecureHTTPClient),
- proxmox.WithCredentials(&proxmox.Credentials{
- Username: td.username,
- Password: td.password,
- }),
- proxmox.WithLogger(&logger),
- )
-
- return client
-}
-
-func ClientFromToken() *proxmox.Client {
- return proxmox.NewClient(os.Getenv("PROXMOX_URL"),
- proxmox.WithHTTPClient(&insecureHTTPClient),
- proxmox.WithAPIToken(td.tokenID, td.secret),
- proxmox.WithLogger(&logger),
- )
-}
-
-func ClientFromTicket() *proxmox.Client {
- return proxmox.NewClient(os.Getenv("PROXMOX_URL"),
- proxmox.WithHTTPClient(&insecureHTTPClient),
- proxmox.WithAPIToken(td.tokenID, td.secret),
- proxmox.WithLogger(&logger),
- )
-}
-
-func TestVersion(t *testing.T) {
- client := ClientFromLogins()
- ctx := context.Background()
- version, err := client.Version(ctx)
- assert.Nil(t, err)
- assert.NotEmpty(t, version.Version)
-}
-
-func TestLogUnmarshall(t *testing.T) {
- payload := `[{"t":"starting file import from: /var/tmp/pveupload-f07236b021b8decb513b8735d302b6e0","n":1},{"t":"target node: i7","n":2},{"t":"target file: /var/lib/vz/template/iso/69adc234b08d.iso","n":3},{"n":4,"t":"file size is: 43018"},{"t":"command: cp -- /var/tmp/pveupload-f07236b021b8decb513b8735d302b6e0 /var/lib/vz/template/iso/69adc234b08d.iso","n":5},{"t":"finished file import successfully","n":6},{"t":"TASK OK","n":7}]`
- var log proxmox.Log
- assert.Nil(t, json.Unmarshal([]byte(payload), &log))
- assert.Equal(t, log[0], "starting file import from: /var/tmp/pveupload-f07236b021b8decb513b8735d302b6e0")
- assert.Equal(t, log[6], "TASK OK")
-}
diff --git a/go-proxmox/tests/integration/storage_test.go b/go-proxmox/tests/integration/storage_test.go
deleted file mode 100644
index bb3efa0..0000000
--- a/go-proxmox/tests/integration/storage_test.go
+++ /dev/null
@@ -1,72 +0,0 @@
-//go:build nodes
-// +build nodes
-
-package integration
-
-import (
- "context"
- "os"
- "path/filepath"
- "strings"
- "testing"
- "time"
-
- "github.com/stretchr/testify/assert"
-)
-
-func TestStorage_ISO(t *testing.T) {
- _, err := td.storage.ISO(context.TODO(), "doesnt-exist")
- assert.Contains(t, err.Error(), "unable to parse directory volume name 'iso/doesnt-exist'")
-}
-
-func TestStorage_DownloadUrl(t *testing.T) {
- // download url
- isoName := nameGenerator(12) + ".iso"
- task, err := td.storage.DownloadURL(context.TODO(), "iso", isoName, tinycoreURL)
- assert.Nil(t, err)
- assert.Nil(t, task.Wait(context.TODO(), time.Duration(5*time.Second), time.Duration(5*time.Minute)))
-
- iso, err := td.storage.ISO(context.TODO(), isoName)
- assert.Nil(t, err)
- assert.True(t, strings.HasSuffix(iso.Path, isoName))
- task, err = iso.Delete(context.TODO())
- assert.Nil(t, err)
- task.Wait(context.TODO(), 1*time.Second, 10*time.Second)
-}
-
-func TestStorage_Upload(t *testing.T) {
- // upload from local file
- isoName := nameGenerator(12) + ".iso"
- file := filepath.Join("./", isoName)
- createTestISO(file)
- defer os.Remove(file)
-
- task, err := td.storage.Upload("iso", file)
- assert.Nil(t, err)
- task.Wait(context.TODO(), 1*time.Second, 5*time.Second)
- iso, err := td.storage.ISO(context.TODO(), isoName)
- assert.Nil(t, err)
- assert.True(t, strings.HasSuffix(iso.Path, isoName))
-
- task, err = iso.Delete(context.TODO())
- assert.Nil(t, err)
- task.Wait(context.TODO(), 1*time.Second, 15*time.Second)
-}
-
-func TestStorage_VzTmpl(t *testing.T) {
- _, err := td.storage.VzTmpl(context.TODO(), "doesnt-exist")
- assert.Contains(t, err.Error(), "unable to parse directory volume name 'vztmpl/doesnt-exist'")
-
- name := nameGenerator(12) + ".tar.xz"
- task, err := td.storage.DownloadURL(context.TODO(), "vztmpl", name, alpineAppliance)
- assert.Nil(t, err)
- task.Wait(context.TODO(), 1*time.Second, 5*time.Second)
-
- vztmpl, err := td.storage.VzTmpl(context.TODO(), name)
- assert.Nil(t, err)
- assert.True(t, strings.HasSuffix(vztmpl.Path, "tar.xz"))
-
- task, err = vztmpl.Delete(context.TODO())
- assert.Nil(t, err)
- task.Wait(context.TODO(), 1*time.Second, 15*time.Second)
-}
diff --git a/go-proxmox/tests/integration/tasks_test.go b/go-proxmox/tests/integration/tasks_test.go
deleted file mode 100644
index dad503a..0000000
--- a/go-proxmox/tests/integration/tasks_test.go
+++ /dev/null
@@ -1,93 +0,0 @@
-//go:build nodes
-// +build nodes
-
-package integration
-
-import (
- "context"
- "encoding/json"
- "testing"
- "time"
-
- "github.com/luthermonson/go-proxmox"
- "github.com/stretchr/testify/assert"
-)
-
-func TestNewTask(t *testing.T) {
- upid := proxmox.UPID("UPID:test:002F0193:09CCCA13:61CC858A:tasktype:taskid:root@pam:")
- task := proxmox.NewTask(upid, td.client)
- assert.Equal(t, task.Node, "test")
- assert.Equal(t, task.Type, "tasktype")
- assert.Equal(t, task.ID, "taskid")
- assert.Equal(t, task.User, "root@pam")
-}
-
-func TestTask_JsonUnmarshalNoEndTime(t *testing.T) {
- // no duration from a not completed task
- data := `{"pstart":165231870,"type":"testtype","status":"teststatus","id":"test.iso","node":"testnode","user":"root@pam","pid":3161937,"upid":"UPID:i7:00303F51:09D93CFE:61CCA568:download:8fd77349e9f6.iso:root@pam:","starttime":1641020400}`
- starttime := time.Date(2022, time.January, 01, 0, 0, 0, 0, time.Local)
-
- var task proxmox.Task
- assert.Nil(t, json.Unmarshal([]byte(data), &task))
- assert.Equal(t, "root@pam", task.User)
- assert.Equal(t, "teststatus", task.Status)
- assert.Equal(t, "testtype", task.Type)
- assert.Equal(t, "test.iso", task.ID)
- assert.Equal(t, "testnode", task.Node)
- assert.Equal(t, starttime, task.StartTime)
- assert.True(t, task.EndTime.IsZero()) // empty endtime
- assert.Equal(t, float64(0), task.Duration.Seconds())
-}
-
-func TestTask_JsonUnmarshalWithEndTime(t *testing.T) {
- // with an endtime from the cluster wide /cluster/tasks status log and will calc duration
- data := `{"pstart":165231870,"type":"testtype","status":"teststatus","id":"test.iso","node":"testnode","user":"root@pam","pid":3161937,"upid":"UPID:i7:00303F51:09D93CFE:61CCA568:download:8fd77349e9f6.iso:root@pam:","starttime":1641020400, "endtime":1641020460}`
- starttime := time.Date(2022, time.January, 01, 0, 0, 0, 0, time.Local)
- endtime := time.Date(2022, time.January, 01, 0, 1, 0, 0, time.Local)
-
- var task proxmox.Task
- assert.Nil(t, json.Unmarshal([]byte(data), &task))
- assert.Equal(t, "root@pam", task.User)
- assert.Equal(t, "teststatus", task.Status)
- assert.Equal(t, "testtype", task.Type)
- assert.Equal(t, "test.iso", task.ID)
- assert.Equal(t, "testnode", task.Node)
- assert.Equal(t, starttime, task.StartTime)
- assert.Equal(t, endtime, task.EndTime)
- assert.Equal(t, float64(60), task.Duration.Seconds())
-}
-
-// TestTask will start a download of a large iso, tail the logs and cancel it
-func TestTask(t *testing.T) {
- // download ubuntu iso for long-running task to test against
- isoName := nameGenerator(12) + ".iso"
- task, err := td.storage.DownloadURL(context.TODO(), "iso", isoName, ubuntuURL)
- assert.Nil(t, err)
-
- // test ping and wait, big iso should take more than 15s
- go func() {
- timeout := task.Wait(context.TODO(), time.Duration(5*time.Second), time.Duration(30*time.Second))
- assert.True(t, proxmox.IsTimeout(timeout))
- assert.Nil(t, task.Stop(context.TODO()))
- }()
-
- log, err := task.Log(context.TODO(), 0, 50)
- assert.Nil(t, err)
- assert.Contains(t, log[0], ubuntuURL)
-
- watch, err := task.Watch(context.TODO(), 0)
- assert.Nil(t, err)
- for {
- select {
- case ln, ok := <-watch:
- if !ok {
- watch = nil
- break
- }
- logger.Debugf("%s", ln)
- }
- if watch == nil {
- break
- }
- }
-}
diff --git a/go-proxmox/tests/integration/virtual_machines_test.go b/go-proxmox/tests/integration/virtual_machines_test.go
deleted file mode 100644
index 62399b6..0000000
--- a/go-proxmox/tests/integration/virtual_machines_test.go
+++ /dev/null
@@ -1,167 +0,0 @@
-//go:build nodes
-// +build nodes
-
-package integration
-
-import (
- "context"
- "fmt"
- "path/filepath"
- "strings"
- "testing"
- "time"
-
- "github.com/luthermonson/go-proxmox"
-
- "github.com/stretchr/testify/assert"
- "github.com/stretchr/testify/require"
-)
-
-// NewVirtualMachine fixture to download a tinycore iso and returns a vm, make sure you defer the cleanup if you use it
-func NewVirtualMachine(t *testing.T, name string) *proxmox.VirtualMachine {
- client := ClientFromLogins()
- node, err := client.Node(context.TODO(), td.nodeName)
- require.NoError(t, err)
-
- isoName := name + ".iso"
- task, err := td.storage.DownloadURL(context.TODO(), "iso", isoName, tinycoreURL)
- assert.Nil(t, err)
- assert.Nil(t, task.Wait(context.TODO(), time.Duration(5*time.Second), time.Duration(5*time.Minute)))
-
- iso, err := td.storage.ISO(context.TODO(), isoName)
- assert.Nil(t, err)
-
- cluster, err := client.Cluster(context.TODO())
- require.NoError(t, err)
-
- nextid, err := cluster.NextID(context.TODO())
- require.NoError(t, err)
-
- task, err = node.NewVirtualMachine(context.TODO(), nextid, proxmox.VirtualMachineOption{Name: "cdrom", Value: iso.VolID})
- require.NoError(t, err)
- require.NoError(t, task.Wait(context.TODO(), 1*time.Second, 10*time.Second))
-
- vm, err := node.VirtualMachine(context.TODO(), nextid)
- require.NoError(t, err)
- task, err = vm.Config(context.TODO(),
- proxmox.VirtualMachineOption{Name: "name", Value: name},
- proxmox.VirtualMachineOption{Name: "serial0", Value: "socket"},
- )
-
- require.NoError(t, err)
- require.NoError(t, task.Wait(context.TODO(), 1*time.Second, 10*time.Second))
-
- return vm
-}
-
-func CleanupVirtualMachine(t *testing.T, vm *proxmox.VirtualMachine) {
- task, err := vm.Stop(context.TODO())
- require.NoError(t, err)
- require.NoError(t, task.Wait(context.TODO(), 1*time.Second, 30*time.Second))
-
- if vm.VirtualMachineConfig != nil && vm.VirtualMachineConfig.IDE2 != "" {
- s := strings.Split(vm.VirtualMachineConfig.IDE2, ",")
- if len(s) > 2 {
- iso, err := td.storage.ISO(context.TODO(), filepath.Base(s[0]))
- assert.Nil(t, err)
- task, err := iso.Delete(context.TODO())
- require.NoError(t, err)
- require.NoError(t, task.Wait(context.TODO(), 1*time.Second, 10*time.Second))
- }
- }
-
- task, err = vm.Delete(context.TODO())
- require.NoError(t, err)
- require.NoError(t, task.Wait(context.TODO(), 1*time.Second, 30*time.Second))
-}
-
-func TestNode_NewVirtualMachine(t *testing.T) {
- testname := nameGenerator(12)
- vm := NewVirtualMachine(t, testname)
- require.NotNil(t, vm)
- defer CleanupVirtualMachine(t, vm)
-
- // Start
- task, err := vm.Start(context.TODO())
- require.NoError(t, err)
- require.NoError(t, task.Wait(context.TODO(), 1*time.Second, 10*time.Second))
- require.NoError(t, vm.Ping(context.TODO()))
- assert.Equal(t, proxmox.StatusVirtualMachineRunning, vm.Status)
-
- // TODO while this connects it doesn't do anything because the vm isn't setup to use the serial0 socket
- term, err := vm.TermProxy(context.TODO())
- require.NoError(t, err)
- send, recv, errs, close, err := vm.TermWebSocket(term)
- defer close()
-
- go func() {
- for {
- select {
- case msg := <-recv:
- if len(msg) > 0 {
- fmt.Println("MSG: " + string(msg))
- }
- case err := <-errs:
- if err != nil {
- fmt.Println("ERROR: " + err.Error())
- return
- }
- }
- }
- }()
-
- time.Sleep(2 * time.Second)
- send <- []byte("\n")
- time.Sleep(2 * time.Second)
- send <- []byte("ls -la\n")
- time.Sleep(2 * time.Second)
- send <- []byte("hostname\n")
- time.Sleep(2 * time.Second)
-
- // Reboot disabled for now doesn't work great w/o the guest agent installed so will uncomment when that's done
- //task, err = vm.Reboot()
- //assert.NoError(t, err)
- //assert.NoError(t, task.Wait(1*time.Second, 60*time.Second))
- //require.NoError(t, vm.Ping())
- //assert.Equal(t, StatusVirtualMachineRunning, vm.Status)
-
- // Stop
- task, err = vm.Stop(context.TODO())
- assert.NoError(t, err)
- assert.NoError(t, task.Wait(context.TODO(), 1*time.Second, 15*time.Second))
- require.NoError(t, vm.Ping(context.TODO()))
- assert.Equal(t, proxmox.StatusVirtualMachineStopped, vm.Status)
-
- // Start again to test hibernating/pause and resumse
- task, err = vm.Start(context.TODO())
- require.NoError(t, err)
- require.NoError(t, task.Wait(context.TODO(), 1*time.Second, 30*time.Second))
- require.NoError(t, vm.Ping(context.TODO()))
- assert.Equal(t, proxmox.StatusVirtualMachineRunning, vm.Status)
-
- // Hibernate
- task, err = vm.Hibernate(context.TODO())
- assert.NoError(t, err)
- assert.NoError(t, task.Wait(context.TODO(), 1*time.Second, 15*time.Second))
- require.NoError(t, vm.Ping(context.TODO()))
- assert.True(t, vm.IsHibernated())
-
- task, err = vm.Resume(context.TODO())
- assert.NoError(t, err)
- assert.NoError(t, task.Wait(context.TODO(), 1*time.Second, 15*time.Second))
- require.NoError(t, vm.Ping(context.TODO()))
- assert.Equal(t, proxmox.StatusVirtualMachineRunning, vm.Status)
-
- // Pause
- task, err = vm.Pause(context.TODO())
- assert.NoError(t, err)
- assert.NoError(t, task.Wait(context.TODO(), 1*time.Second, 15*time.Second))
- require.NoError(t, vm.Ping(context.TODO()))
- assert.True(t, vm.IsPaused())
-
- task, err = vm.Resume(context.TODO())
- assert.NoError(t, err)
- assert.NoError(t, task.Wait(context.TODO(), 1*time.Second, 15*time.Second))
- require.NoError(t, vm.Ping(context.TODO()))
- assert.Equal(t, proxmox.StatusVirtualMachineRunning, vm.Status)
-}
diff --git a/go-proxmox/tests/mocks/config/main.go b/go-proxmox/tests/mocks/config/main.go
deleted file mode 100644
index 43437ef..0000000
--- a/go-proxmox/tests/mocks/config/main.go
+++ /dev/null
@@ -1,7 +0,0 @@
-package config
-
-type Config struct {
- URI string
-}
-
-var C Config
diff --git a/go-proxmox/tests/mocks/main.go b/go-proxmox/tests/mocks/main.go
deleted file mode 100644
index 2131b49..0000000
--- a/go-proxmox/tests/mocks/main.go
+++ /dev/null
@@ -1,38 +0,0 @@
-package mocks
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
- "github.com/luthermonson/go-proxmox/tests/mocks/pve6x"
- "github.com/luthermonson/go-proxmox/tests/mocks/pve7x"
- "github.com/luthermonson/go-proxmox/tests/mocks/pve8x"
- "github.com/luthermonson/go-proxmox/tests/mocks/pve9x"
-)
-
-func On(c config.Config) {
- ProxmoxVE9x(c) // default pve9
-}
-
-func Off() {
- gock.Off()
-}
-
-func ProxmoxVE9x(c config.Config) {
- config.C = c
- pve9x.Load()
-}
-
-func ProxmoxVE8x(c config.Config) {
- config.C = c
- pve8x.Load()
-}
-
-func ProxmoxVE7x(c config.Config) {
- config.C = c
- pve7x.Load()
-}
-
-func ProxmoxVE6x(c config.Config) {
- config.C = c
- pve6x.Load()
-}
diff --git a/go-proxmox/tests/mocks/pve6x/proxmox.go b/go-proxmox/tests/mocks/pve6x/proxmox.go
deleted file mode 100644
index b80f01f..0000000
--- a/go-proxmox/tests/mocks/pve6x/proxmox.go
+++ /dev/null
@@ -1,17 +0,0 @@
-package pve6x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func Load() {
- version()
-}
-
-func version() {
- gock.New(config.C.URI).
- Get("/version").
- Reply(200).
- JSON(`{"data":{"repoid":"666666","release":"6.6","version":"6.6-6"}}`)
-}
diff --git a/go-proxmox/tests/mocks/pve7x/access.go b/go-proxmox/tests/mocks/pve7x/access.go
deleted file mode 100644
index c972796..0000000
--- a/go-proxmox/tests/mocks/pve7x/access.go
+++ /dev/null
@@ -1,955 +0,0 @@
-package pve7x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func access() {
- gock.New(config.C.URI).
- Get("^/access/acl").
- Reply(200).
- JSON(`{
- "data": [
- {
- "propagate": 1,
- "path": "/",
- "roleid": "PVEAdmin",
- "ugid": "cloud-init",
- "type": "group"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/domains$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "type": "pve",
- "realm": "pve",
- "comment": "Proxmox VE authentication server"
- },
- {
- "type": "pam",
- "realm": "pam",
- "comment": "Linux PAM standard authentication"
- },
- {
- "realm": "test",
- "type": "ldap",
- "tfa": "oath",
- "comment": "comment comment comment"
- }
- ]
-}`)
- gock.New(config.C.URI).
- Get("^/access/domains/test$").
- Reply(200).
- JSON(`{
- "data": {
- "user_attr": "userattribute",
- "sync-defaults-options": "remove-vanished=acl;entry;properties,scope=users",
- "port": 1234,
- "server1": "server1",
- "user_classes": "userclasses",
- "tfa": "digits=8,step=1234,type=oath",
- "comment": "comment comment comment",
- "group_name_attr": "groupnameattr",
- "digest": "b84e9112ebbb173fc8f5af76a057b38178f1047c",
- "secure": 1,
- "default": 0,
- "sync_attributes": "email=email@attribute.com",
- "base_dn": "CN=Users",
- "type": "ldap",
- "bind_dn": "CN=Users",
- "group_filter": "groupfilter",
- "group_classes": "groupclasses",
- "verify": 1,
- "filter": "userfilter",
- "server2": "server2"
- }
-}`)
-
- gock.New(config.C.URI).
- Get("^/access$").
- Reply(200).
- JSON(`
-{
- "data": [
- {
- "subdir": "users"
- },
- {
- "subdir": "groups"
- },
- {
- "subdir": "roles"
- },
- {
- "subdir": "acl"
- },
- {
- "subdir": "domains"
- },
- {
- "subdir": "openid"
- },
- {
- "subdir": "tfa"
- },
- {
- "subdir": "ticket"
- },
- {
- "subdir": "password"
- }
- ]
-}`)
-
- // full access user with all paths
- gock.New(config.C.URI).
- Get("^/access/permissions$").
- Reply(200).
- JSON(`{
- "data": {
- "/pools": {
- "VM.Audit": 1,
- "VM.Config.CPU": 1,
- "Datastore.Audit": 1,
- "VM.Config.CDROM": 1,
- "Group.Allocate": 1,
- "SDN.Use": 1,
- "VM.Config.HWType": 1,
- "VM.Backup": 1,
- "VM.Config.Disk": 1,
- "Sys.Incoming": 1,
- "VM.Config.Memory": 1,
- "Sys.Audit": 1,
- "VM.Monitor": 1,
- "Datastore.AllocateTemplate": 1,
- "Realm.AllocateUser": 1,
- "VM.Console": 1,
- "VM.Migrate": 1,
- "VM.Snapshot": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "VM.PowerMgmt": 1,
- "Datastore.Allocate": 1,
- "Sys.PowerMgmt": 1,
- "User.Modify": 1,
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "Realm.Allocate": 1,
- "VM.Clone": 1,
- "VM.Allocate": 1,
- "Pool.Allocate": 1,
- "Sys.Modify": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Syslog": 1,
- "VM.Config.Network": 1,
- "VM.Snapshot.Rollback": 1,
- "Sys.Console": 1,
- "SDN.Audit": 1,
- "Pool.Audit": 1
- },
- "/storage": {
- "VM.Audit": 1,
- "VM.Config.CPU": 1,
- "Datastore.Audit": 1,
- "VM.Config.CDROM": 1,
- "Group.Allocate": 1,
- "SDN.Use": 1,
- "VM.Config.HWType": 1,
- "VM.Backup": 1,
- "Sys.Incoming": 1,
- "VM.Config.Memory": 1,
- "VM.Config.Disk": 1,
- "Sys.Audit": 1,
- "VM.Monitor": 1,
- "Datastore.AllocateTemplate": 1,
- "Realm.AllocateUser": 1,
- "VM.Console": 1,
- "VM.Migrate": 1,
- "VM.Snapshot": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "VM.PowerMgmt": 1,
- "Datastore.Allocate": 1,
- "User.Modify": 1,
- "Sys.PowerMgmt": 1,
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "Realm.Allocate": 1,
- "VM.Clone": 1,
- "VM.Allocate": 1,
- "Pool.Allocate": 1,
- "Sys.Modify": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Syslog": 1,
- "VM.Config.Network": 1,
- "VM.Snapshot.Rollback": 1,
- "Sys.Console": 1,
- "SDN.Audit": 1,
- "Pool.Audit": 1
- },
- "/access": {
- "Pool.Audit": 1,
- "SDN.Audit": 1,
- "Sys.Console": 1,
- "VM.Snapshot.Rollback": 1,
- "VM.Config.Network": 1,
- "Sys.Syslog": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Modify": 1,
- "Pool.Allocate": 1,
- "VM.Allocate": 1,
- "VM.Clone": 1,
- "Realm.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "SDN.Allocate": 1,
- "Sys.PowerMgmt": 1,
- "User.Modify": 1,
- "Datastore.Allocate": 1,
- "VM.PowerMgmt": 1,
- "VM.Config.Options": 1,
- "Permissions.Modify": 1,
- "VM.Snapshot": 1,
- "VM.Migrate": 1,
- "VM.Console": 1,
- "Realm.AllocateUser": 1,
- "Datastore.AllocateTemplate": 1,
- "VM.Monitor": 1,
- "Sys.Audit": 1,
- "VM.Config.Disk": 1,
- "Sys.Incoming": 1,
- "VM.Config.Memory": 1,
- "VM.Config.HWType": 1,
- "VM.Backup": 1,
- "SDN.Use": 1,
- "Group.Allocate": 1,
- "VM.Config.CDROM": 1,
- "Datastore.Audit": 1,
- "VM.Audit": 1,
- "VM.Config.CPU": 1
- },
- "/vms": {
- "VM.Snapshot.Rollback": 1,
- "VM.Config.Network": 1,
- "Sys.Console": 1,
- "SDN.Audit": 1,
- "Pool.Audit": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Syslog": 1,
- "VM.Allocate": 1,
- "Pool.Allocate": 1,
- "Sys.Modify": 1,
- "Realm.Allocate": 1,
- "VM.Clone": 1,
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "Datastore.Allocate": 1,
- "User.Modify": 1,
- "Sys.PowerMgmt": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "VM.PowerMgmt": 1,
- "VM.Console": 1,
- "VM.Migrate": 1,
- "VM.Snapshot": 1,
- "Realm.AllocateUser": 1,
- "Datastore.AllocateTemplate": 1,
- "Sys.Audit": 1,
- "VM.Monitor": 1,
- "VM.Config.HWType": 1,
- "VM.Backup": 1,
- "Sys.Incoming": 1,
- "VM.Config.Memory": 1,
- "VM.Config.Disk": 1,
- "Group.Allocate": 1,
- "SDN.Use": 1,
- "Datastore.Audit": 1,
- "VM.Config.CDROM": 1,
- "VM.Config.CPU": 1,
- "VM.Audit": 1
- },
- "/sdn": {
- "VM.Console": 1,
- "VM.Snapshot": 1,
- "VM.Migrate": 1,
- "Realm.AllocateUser": 1,
- "Datastore.AllocateTemplate": 1,
- "Sys.Audit": 1,
- "VM.Monitor": 1,
- "VM.Config.HWType": 1,
- "VM.Backup": 1,
- "Sys.Incoming": 1,
- "VM.Config.Memory": 1,
- "VM.Config.Disk": 1,
- "SDN.Use": 1,
- "Group.Allocate": 1,
- "Datastore.Audit": 1,
- "VM.Config.CDROM": 1,
- "VM.Config.CPU": 1,
- "VM.Audit": 1,
- "VM.Snapshot.Rollback": 1,
- "VM.Config.Network": 1,
- "Pool.Audit": 1,
- "SDN.Audit": 1,
- "Sys.Console": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Syslog": 1,
- "Pool.Allocate": 1,
- "VM.Allocate": 1,
- "Sys.Modify": 1,
- "VM.Clone": 1,
- "Realm.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "SDN.Allocate": 1,
- "User.Modify": 1,
- "Sys.PowerMgmt": 1,
- "Datastore.Allocate": 1,
- "VM.Config.Options": 1,
- "Permissions.Modify": 1,
- "VM.PowerMgmt": 1
- },
- "/nodes": {
- "Datastore.Allocate": 1,
- "User.Modify": 1,
- "Sys.PowerMgmt": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "VM.PowerMgmt": 1,
- "Realm.Allocate": 1,
- "VM.Clone": 1,
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "VM.Allocate": 1,
- "Pool.Allocate": 1,
- "Sys.Modify": 1,
- "VM.Snapshot.Rollback": 1,
- "VM.Config.Network": 1,
- "Sys.Console": 1,
- "SDN.Audit": 1,
- "Pool.Audit": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Syslog": 1,
- "Datastore.Audit": 1,
- "VM.Config.CDROM": 1,
- "VM.Audit": 1,
- "VM.Config.CPU": 1,
- "VM.Config.HWType": 1,
- "VM.Backup": 1,
- "VM.Config.Memory": 1,
- "Sys.Incoming": 1,
- "VM.Config.Disk": 1,
- "Group.Allocate": 1,
- "SDN.Use": 1,
- "Datastore.AllocateTemplate": 1,
- "Realm.AllocateUser": 1,
- "Sys.Audit": 1,
- "VM.Monitor": 1,
- "VM.Console": 1,
- "VM.Migrate": 1,
- "VM.Snapshot": 1
- },
- "/": {
- "Realm.AllocateUser": 1,
- "Datastore.AllocateTemplate": 1,
- "Sys.Audit": 1,
- "VM.Monitor": 1,
- "VM.Console": 1,
- "VM.Migrate": 1,
- "VM.Snapshot": 1,
- "Datastore.Audit": 1,
- "VM.Config.CDROM": 1,
- "VM.Audit": 1,
- "VM.Config.CPU": 1,
- "VM.Backup": 1,
- "VM.Config.HWType": 1,
- "VM.Config.Disk": 1,
- "Sys.Incoming": 1,
- "VM.Config.Memory": 1,
- "Group.Allocate": 1,
- "SDN.Use": 1,
- "VM.Allocate": 1,
- "Pool.Allocate": 1,
- "Sys.Modify": 1,
- "VM.Config.Network": 1,
- "VM.Snapshot.Rollback": 1,
- "SDN.Audit": 1,
- "Sys.Console": 1,
- "Pool.Audit": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Syslog": 1,
- "Datastore.Allocate": 1,
- "User.Modify": 1,
- "Sys.PowerMgmt": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "VM.PowerMgmt": 1,
- "Realm.Allocate": 1,
- "VM.Clone": 1,
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1
- },
- "/access/groups": {
- "VM.Migrate": 1,
- "VM.Snapshot": 1,
- "VM.Console": 1,
- "VM.Monitor": 1,
- "Sys.Audit": 1,
- "Realm.AllocateUser": 1,
- "Datastore.AllocateTemplate": 1,
- "Group.Allocate": 1,
- "SDN.Use": 1,
- "Sys.Incoming": 1,
- "VM.Config.Disk": 1,
- "VM.Config.Memory": 1,
- "VM.Backup": 1,
- "VM.Config.HWType": 1,
- "VM.Config.CPU": 1,
- "VM.Audit": 1,
- "VM.Config.CDROM": 1,
- "Datastore.Audit": 1,
- "Sys.Syslog": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Console": 1,
- "SDN.Audit": 1,
- "Pool.Audit": 1,
- "VM.Snapshot.Rollback": 1,
- "VM.Config.Network": 1,
- "Sys.Modify": 1,
- "VM.Allocate": 1,
- "Pool.Allocate": 1,
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "Realm.Allocate": 1,
- "VM.Clone": 1,
- "VM.PowerMgmt": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "Datastore.Allocate": 1,
- "User.Modify": 1,
- "Sys.PowerMgmt": 1
- }
- }
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/permissions$").
- MatchParams(map[string]string{
- "path": "path",
- }).
- Reply(200).
- JSON(`{
- "data": {
- "path": {
- "permission": 1
- }
- }
-}`)
-
- // user with no access
- gock.New(config.C.URI).
- Get("^/access/permissions$").
- MatchParams(map[string]string{
- "userid": "userid",
- }).
- Reply(200).
- JSON(`{
- "data": {
- "path": {
- "permission": 1
- }
- }
-}`)
-
- // user with no access
- gock.New(config.C.URI).
- Get("^/access/permissions$").
- MatchParams(map[string]string{
- "path": "path",
- "userid": "userid",
- }).
- Reply(200).
- JSON(`{
- "data": {
- "path": {
- "permission": 1
- }
- }
-}`)
-
- gock.New(config.C.URI).
- Put("^/access/password$").
- Reply(200).
- JSON(`{"success":1,"data":null}`)
-
- gock.New(config.C.URI).
- Get("^/access/ticket$").
- Reply(200).
- JSON(`{"data": null}`)
-
- gock.New(config.C.URI).
- Post("^/access/ticket$").
- Reply(200).
- JSON(`{
- "data": {
- "username": "root@pam",
- "CSRFPreventionToken": "64E10CBA:YDNz71IKnE0sWsm1SbV1PGwz3hAyprvygQ7SBkxHVtE",
- "cap": {
- "sdn": {
- "SDN.Audit": 1,
- "SDN.Allocate": 1,
- "SDN.Use": 1,
- "Permissions.Modify": 1
- },
- "access": {
- "Group.Allocate": 1,
- "User.Modify": 1,
- "Permissions.Modify": 1
- },
- "dc": {
- "SDN.Allocate": 1,
- "SDN.Audit": 1,
- "SDN.Use": 1,
- "Sys.Audit": 1
- },
- "nodes": {
- "Sys.Modify": 1,
- "Sys.Syslog": 1,
- "Sys.Audit": 1,
- "Sys.Console": 1,
- "Permissions.Modify": 1,
- "Sys.Incoming": 1,
- "Sys.PowerMgmt": 1
- },
- "storage": {
- "Datastore.Allocate": 1,
- "Datastore.Audit": 1,
- "Datastore.AllocateTemplate": 1,
- "Datastore.AllocateSpace": 1,
- "Permissions.Modify": 1
- },
- "vms": {
- "VM.Config.CPU": 1,
- "VM.Config.HWType": 1,
- "VM.Clone": 1,
- "VM.Allocate": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "VM.Config.Memory": 1,
- "VM.Audit": 1,
- "VM.Monitor": 1,
- "VM.Snapshot.Rollback": 1,
- "VM.Config.Network": 1,
- "VM.Config.Cloudinit": 1,
- "VM.Backup": 1,
- "VM.Migrate": 1,
- "VM.Config.Disk": 1,
- "VM.PowerMgmt": 1,
- "VM.Config.CDROM": 1,
- "VM.Console": 1,
- "VM.Snapshot": 1
- }
- },
- "clustername": "pve-cluster",
- "ticket": "PVE:root@pam:64E10CBA::yTMqV7BmOXUCzb0ODceFH7F+Uy3gQTlp3sepUzIicpL2KeJ4finWjuZ9SBZg/iTz7tACDGvnX0biv6JMZvYBuqzWu0S3eF6xrLX4A3YLahhWaMJJ4Dw8hIquSO5AMQr3Ea3xdN5CcLIuW8hPOLHrPFzDC2MDk6e6VtJ9lWF5htz8nq6ge+kcwZBgB80ZABc+lIwtcB1UcJ8NY5EYGS9czcEXSse2xmG1j2F1+gMfoF+4O7wiCV0iHGabG+8n3oEBZUE89jhzjQoVCGCzVpmxYpag+5I4+W+POZm8DzQCdvPmynH9fAT6bSD8Vu+le8aHGigoKz81xNMsFxIjd1Zr2g=="
- }
-}`)
- gock.New(config.C.URI).
- Get("^/access/user$").
- Reply(200).
- JSON(`
-{
- "data": [
- {
- "lastname": "pamlast",
- "realm-type": "pam",
- "enable": 1,
- "firstname": "pamfirst",
- "userid": "root@pam",
- "expire": 0
- "email": "root@email.com",
- },
- {
- "firstname": "first1",
- "userid": "user1@pve",
- "enable": 1,
- "expire": 0,
- "email": "first1.last1@email.com",
- "lastname": "last1",
- "realm-type": "pve"
- },
- {
- "lastname": "last2",
- "realm-type": "pve",
- "email": "first2.last2@email.com",
- "expire": 0,
- "enable": 1,
- "userid": "user2@pve",
- "firstname": "first2"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/groups$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "groupid": "cloud-init",
- "users": "root@pam,user1@pve"
- },
- {
- "groupid": "test",
- "users": "root@pam,user2@pve"
- }
- ]
-}`)
- gock.New(config.C.URI).
- Get("^/access/groups/test$").
- Reply(200).
- JSON(`{
- "data": {
- "members": [
- "user2@pve",
- "root@pam"
- ]
- }
-}`)
- gock.New(config.C.URI).
- Get("^/access/users$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "expire": 0,
- "lastname": "pamlast",
- "enable": 1,
- "firstname": "pamfirst",
- "userid": "pam@pam",
- "realm-type": "pam"
- },
- {
- "expire": 0,
- "realm-type": "pam",
- "email": "root@email.com",
- "userid": "root@pam",
- "enable": 1
- },
- {
- "expire": 0,
- "lastname": "last1",
- "email": "first1.last1@email.com",
- "enable": 1,
- "firstname": "first1",
- "realm-type": "pve",
- "userid": "user1@pve"
- },
- {
- "userid": "user2@pve",
- "realm-type": "pve",
- "firstname": "first2",
- "email": "first2.last2@email.com",
- "enable": 1,
- "lastname": "last2",
- "expire": 0
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/users/root@pam$").
- Reply(200).
- JSON(`{
- "data": {
- "groups": [
- "cloud-init",
- "test"
- ],
- "expire": 0,
- "email": "root@email.com",
- "enable": 1,
- "firstname": "firstname",
- "lastname": "lastname",
- "tokens": {
- "token1": {
- "privsep": 0,
- "expire": 1000
- },
- "token2": {
- "expire": 2000,
- "privsep": 1
- }
- }
- }
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/roles/Administrator$").
- Reply(200).
- JSON(`{
- "data": {
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "Permissions.Modify": 1,
- "VM.Audit": 1,
- "VM.Snapshot": 1,
- "Datastore.Audit": 1,
- "VM.Config.Network": 1,
- "Pool.Audit": 1,
- "SDN.Use": 1,
- "Datastore.Allocate": 1,
- "VM.Allocate": 1,
- "VM.Snapshot.Rollback": 1,
- "Sys.Syslog": 1,
- "VM.Config.Disk": 1,
- "VM.Console": 1,
- "VM.Config.CDROM": 1,
- "Realm.AllocateUser": 1,
- "Sys.Audit": 1,
- "Sys.PowerMgmt": 1,
- "Sys.Modify": 1,
- "VM.Monitor": 1,
- "VM.Config.Memory": 1,
- "VM.Backup": 1,
- "Sys.Incoming": 1,
- "VM.Migrate": 1,
- "Realm.Allocate": 1,
- "VM.Config.CPU": 1,
- "User.Modify": 1,
- "VM.Config.HWType": 1,
- "VM.Clone": 1,
- "SDN.Audit": 1,
- "VM.Config.Cloudinit": 1,
- "Group.Allocate": 1,
- "VM.PowerMgmt": 1,
- "Sys.Console": 1,
- "Datastore.AllocateTemplate": 1,
- "Pool.Allocate": 1,
- "VM.Config.Options": 1
- }
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/roles/NoAccess").
- Reply(200).
- JSON(`{
- "data": {}
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/roles$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "roleid": "PVEVMAdmin",
- "privs": "VM.Allocate,VM.Audit,VM.Backup,VM.Clone,VM.Config.CDROM,VM.Config.CPU,VM.Config.Cloudinit,VM.Config.Disk,VM.Config.HWType,VM.Config.Memory,VM.Config.Network,VM.Config.Options,VM.Console,VM.Migrate,VM.Monitor,VM.PowerMgmt,VM.Snapshot,VM.Snapshot.Rollback",
- "special": 1
- },
- {
- "roleid": "PVEDatastoreAdmin",
- "special": 1,
- "privs": "Datastore.Allocate,Datastore.AllocateSpace,Datastore.AllocateTemplate,Datastore.Audit"
- },
- {
- "roleid": "PVEPoolUser",
- "privs": "Pool.Audit",
- "special": 1
- },
- {
- "special": 1,
- "privs": "",
- "roleid": "NoAccess"
- },
- {
- "roleid": "PVEAuditor",
- "privs": "Datastore.Audit,Pool.Audit,SDN.Audit,Sys.Audit,VM.Audit",
- "special": 1
- },
- {
- "privs": "Permissions.Modify,Sys.Audit,Sys.Console,Sys.Syslog",
- "special": 1,
- "roleid": "PVESysAdmin"
- },
- {
- "special": 1,
- "privs": "Datastore.AllocateSpace,Datastore.Audit",
- "roleid": "PVEDatastoreUser"
- },
- {
- "roleid": "Administrator",
- "special": 1,
- "privs": "Datastore.Allocate,Datastore.AllocateSpace,Datastore.AllocateTemplate,Datastore.Audit,Group.Allocate,Permissions.Modify,Pool.Allocate,Pool.Audit,Realm.Allocate,Realm.AllocateUser,SDN.Allocate,SDN.Audit,SDN.Use,Sys.Audit,Sys.Console,Sys.Incoming,Sys.Modify,Sys.PowerMgmt,Sys.Syslog,User.Modify,VM.Allocate,VM.Audit,VM.Backup,VM.Clone,VM.Config.CDROM,VM.Config.CPU,VM.Config.Cloudinit,VM.Config.Disk,VM.Config.HWType,VM.Config.Memory,VM.Config.Network,VM.Config.Options,VM.Console,VM.Migrate,VM.Monitor,VM.PowerMgmt,VM.Snapshot,VM.Snapshot.Rollback"
- },
- {
- "roleid": "PVETemplateUser",
- "privs": "VM.Audit,VM.Clone",
- "special": 1
- },
- {
- "privs": "SDN.Audit,SDN.Use",
- "special": 1,
- "roleid": "PVESDNUser"
- },
- {
- "special": 1,
- "privs": "Datastore.Allocate,Datastore.AllocateSpace,Datastore.AllocateTemplate,Datastore.Audit,Group.Allocate,Permissions.Modify,Pool.Allocate,Pool.Audit,Realm.AllocateUser,SDN.Allocate,SDN.Audit,SDN.Use,Sys.Audit,Sys.Console,Sys.Syslog,User.Modify,VM.Allocate,VM.Audit,VM.Backup,VM.Clone,VM.Config.CDROM,VM.Config.CPU,VM.Config.Cloudinit,VM.Config.Disk,VM.Config.HWType,VM.Config.Memory,VM.Config.Network,VM.Config.Options,VM.Console,VM.Migrate,VM.Monitor,VM.PowerMgmt,VM.Snapshot,VM.Snapshot.Rollback",
- "roleid": "PVEAdmin"
- },
- {
- "roleid": "test",
- "privs": "Pool.Audit",
- "special": 0
- },
- {
- "special": 1,
- "privs": "VM.Audit,VM.Backup,VM.Config.CDROM,VM.Config.Cloudinit,VM.Console,VM.PowerMgmt",
- "roleid": "PVEVMUser"
- },
- {
- "special": 1,
- "privs": "SDN.Allocate,SDN.Audit,SDN.Use",
- "roleid": "PVESDNAdmin"
- },
- {
- "roleid": "PVEUserAdmin",
- "privs": "Group.Allocate,Realm.AllocateUser,User.Modify",
- "special": 1
- },
- {
- "privs": "Pool.Allocate,Pool.Audit",
- "special": 1,
- "roleid": "PVEPoolAdmin"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Post("^/access/domains").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Put("^/access/domains/test$").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Delete("^/access/domains/test$").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Post("^/access/domains/test$").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Post("^/access/groups").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Put("^/access/groups/groupid").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Delete("^/access/groups/groupid").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Post("^/access/groups/groupid").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Post("^/access/users").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Post("^/access/roles").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Get("^/access/users/test/token").
- Reply(200).
- JSON(`{
- "data": [
- {
- "expire": 100,
- "privsep": 0,
- "tokenid": "test",
- "comment": "comment"
- },
- {
- "expire": 0,
- "privsep": 1,
- "tokenid": "test2",
- "comment": "comment"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/users/root@pam/token/test").
- Reply(200).
- JSON(`{
- "data": {
- "expire": 0,
- "privsep": 0,
- "comment": "comment"
- }
-}`)
-
- gock.New(config.C.URI).
- Post("^/access/users/userid/token/test").
- Reply(200).
- JSON(`{
- "data": {"full-tokenid":"userid!test","value":"tokenvalue"}
-}`)
-
- gock.New(config.C.URI).
- Delete("^/access/users/root@pam/token/test").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Get("^/access/users/userid/tfa").
- Reply(200).
- JSON(`{
- "data": {
- "realm": "pve",
- "types": [
- "oath"
- ],
- "user": "userid"
- }
-}`)
-
- gock.New(config.C.URI).
- Delete("^/access/users/userid/tfa").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Put("^/access/users/userid/token/tokenid").
- Reply(200).
- JSON(`
- "data": {
- "expire": 0,
- "privsep": 0,
- "comment": "comment"
- }
-}`)
-
-}
diff --git a/go-proxmox/tests/mocks/pve7x/cluster.go b/go-proxmox/tests/mocks/pve7x/cluster.go
deleted file mode 100644
index 6410baa..0000000
--- a/go-proxmox/tests/mocks/pve7x/cluster.go
+++ /dev/null
@@ -1,522 +0,0 @@
-package pve7x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func cluster() {
- gock.New(config.C.URI).
- Get("/cluster/nextid$").
- Reply(200).
- JSON(`{"data": "100"}`)
-
- gock.New(config.C.URI).
- Get("/cluster/nextid$").
- MatchParam("vmid", "100").
- Reply(200).
- JSON(`{"data": "100"}`)
-
- gock.New(config.C.URI).
- Get("/cluster/nextid").
- MatchParam("vmid", "200").
- Reply(400).
- JSON(`{"errors":{"vmid":"VM 200 already exists"},"data":null}`)
-
- gock.New(config.C.URI).
- Get("/cluster/status").
- Reply(200).
- JSON(`{
- "data": [
- {
- "type": "cluster",
- "version": 4,
- "quorate": 1,
- "name": "clustername",
- "id": "cluster",
- "nodes": 4
- },
- {
- "name": "node2",
- "nodeid": 2,
- "id": "node/node2",
- "online": 1,
- "type": "node",
- "ip": "192.168.1.2",
- "local": 0,
- "level": ""
- },
- {
- "name": "node3",
- "nodeid": 3,
- "type": "node",
- "ip": "192.168.1.3",
- "local": 0,
- "id": "node/node3",
- "online": 1,
- "level": ""
- },
- {
- "name": "node1",
- "nodeid": 1,
- "online": 1,
- "id": "node/node1",
- "local": 1,
- "ip": "192.168.1.1",
- "type": "node",
- "level": ""
- },
- {
- "nodeid": 4,
- "name": "node4",
- "level": "",
- "local": 0,
- "type": "node",
- "ip": "192.168.1.4",
- "online": 1,
- "id": "node/node4"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/cluster/resources$").
- MatchParams(map[string]string{
- "type": "node",
- }).
- Reply(200).
- JSON(`{
- "data": [
- {
- "type": "node",
- "id": "node1"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/cluster/resources$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "netout": 545248946,
- "type": "qemu",
- "name": "server1",
- "maxcpu": 1,
- "mem": 842551296,
- "netin": 2456116121,
- "maxmem": 1073741824,
- "disk": 0,
- "node": "node2",
- "cpu": 0.0249060195469461,
- "maxdisk": 34359738368,
- "vmid": 100,
- "diskwrite": 6059209728,
- "diskread": 4510777856,
- "status": "running",
- "template": 0,
- "id": "qemu/100",
- "uptime": 874350
- },
- {
- "id": "qemu/101",
- "diskwrite": 0,
- "status": "stopped",
- "diskread": 0,
- "template": 1,
- "uptime": 0,
- "name": "leap154",
- "maxcpu": 4,
- "mem": 0,
- "netin": 0,
- "maxmem": 16777216000,
- "netout": 0,
- "type": "qemu",
- "maxdisk": 68719476736,
- "vmid": 101,
- "disk": 0,
- "node": "node1",
- "cpu": 0
- },
- {
- "netout": 0,
- "type": "qemu",
- "maxcpu": 4,
- "name": "machine-test",
- "maxmem": 8388608000,
- "netin": 0,
- "mem": 0,
- "node": "node1",
- "disk": 0,
- "cpu": 0,
- "maxdisk": 53901000704,
- "vmid": 102,
- "status": "stopped",
- "diskwrite": 0,
- "diskread": 0,
- "template": 0,
- "id": "qemu/102",
- "uptime": 0,
- "tags": "go-proxmox+cloud-init"
- },
- {
- "type": "qemu",
- "netout": 0,
- "netin": 0,
- "mem": 0,
- "maxmem": 8388608000,
- "maxcpu": 4,
- "name": "VM 200",
- "cpu": 0,
- "node": "node1",
- "disk": 0,
- "vmid": 200,
- "maxdisk": 53901000704,
- "template": 0,
- "diskwrite": 0,
- "diskread": 0,
- "status": "stopped",
- "id": "qemu/200",
- "uptime": 0
- },
- {
- "maxdisk": 482713534464,
- "cpu": 0.0054917623564653,
- "node": "node3",
- "disk": 2983723008,
- "maxmem": 16668827648,
- "mem": 1681965056,
- "maxcpu": 4,
- "type": "node",
- "uptime": 872961,
- "level": "",
- "id": "node/node3",
- "cgroup-mode": 2,
- "status": "online"
- },
- {
- "cgroup-mode": 2,
- "status": "online",
- "id": "node/node2",
- "level": "",
- "uptime": 874373,
- "type": "node",
- "mem": 8127873024,
- "maxmem": 33567911936,
- "maxcpu": 12,
- "cpu": 0.00365387809333998,
- "node": "node2",
- "disk": 2797338624,
- "maxdisk": 940166742016
- },
- {
- "status": "online",
- "cgroup-mode": 2,
- "id": "node/node1",
- "level": "",
- "uptime": 872854,
- "type": "node",
- "maxcpu": 8,
- "mem": 2113265664,
- "maxmem": 65919459328,
- "disk": 10486546432,
- "node": "node1",
- "cpu": 0.00336910406788121,
- "maxdisk": 951055941632
- },
- {
- "cgroup-mode": 2,
- "status": "online",
- "id": "node/node4",
- "level": "",
- "uptime": 872920,
- "type": "node",
- "mem": 1698938880,
- "maxmem": 16651702272,
- "maxcpu": 4,
- "cpu": 0.00724094881398252,
- "disk": 2789867520,
- "node": "node4",
- "maxdisk": 482719825920
- },
- {
- "shared": 0,
- "type": "storage",
- "status": "available",
- "plugintype": "zfspool",
- "id": "storage/node3/local-zfs",
- "storage": "local-zfs",
- "node": "node3",
- "disk": 98304,
- "content": "images,rootdir",
- "maxdisk": 479730032640
- },
- {
- "shared": 0,
- "type": "storage",
- "status": "available",
- "id": "storage/node2/local-zfs",
- "plugintype": "zfspool",
- "content": "images,rootdir",
- "disk": 25294921728,
- "storage": "local-zfs",
- "node": "node2",
- "maxdisk": 962664386560
- },
- {
- "maxdisk": 955016175616,
- "node": "node1",
- "storage": "local-zfs",
- "content": "images,rootdir",
- "disk": 14446702592,
- "id": "storage/node1/local-zfs",
- "plugintype": "zfspool",
- "status": "available",
- "shared": 0,
- "type": "storage"
- },
- {
- "type": "storage",
- "shared": 0,
- "status": "available",
- "plugintype": "zfspool",
- "id": "storage/node4/local-zfs",
- "content": "images,rootdir",
- "disk": 98304,
- "storage": "local-zfs",
- "node": "node4",
- "maxdisk": 479930105856
- },
- {
- "maxdisk": 482713534464,
- "content": "backup,vztmpl,iso",
- "disk": 2983723008,
- "storage": "local",
- "node": "node3",
- "plugintype": "dir",
- "id": "storage/node3/local",
- "status": "available",
- "type": "storage",
- "shared": 0
- },
- {
- "maxdisk": 940166742016,
- "node": "node2",
- "storage": "local",
- "disk": 2797338624,
- "content": "backup,vztmpl,iso",
- "id": "storage/node2/local",
- "plugintype": "dir",
- "shared": 0,
- "type": "storage",
- "status": "available"
- },
- {
- "maxdisk": 951055941632,
- "disk": 10486546432,
- "content": "backup,vztmpl,iso",
- "storage": "local",
- "node": "node1",
- "id": "storage/node1/local",
- "plugintype": "dir",
- "status": "available",
- "shared": 0,
- "type": "storage"
- },
- {
- "plugintype": "dir",
- "id": "storage/node4/local",
- "status": "available",
- "shared": 0,
- "type": "storage",
- "maxdisk": 482719825920,
- "storage": "local",
- "node": "node4",
- "content": "backup,vztmpl,iso",
- "disk": 2789867520
- },
- {
- "plugintype": "dir",
- "id": "storage/node3/cloud-init",
- "status": "available",
- "type": "storage",
- "shared": 0,
- "maxdisk": 482713534464,
- "content": "snippets",
- "disk": 2983723008,
- "storage": "cloud-init",
- "node": "node3"
- },
- {
- "plugintype": "dir",
- "id": "storage/node2/cloud-init",
- "status": "available",
- "type": "storage",
- "shared": 0,
- "maxdisk": 940166742016,
- "disk": 2797338624,
- "content": "snippets",
- "node": "node2",
- "storage": "cloud-init"
- },
- {
- "disk": 10486546432,
- "content": "snippets",
- "node": "node1",
- "storage": "cloud-init",
- "maxdisk": 951055941632,
- "status": "available",
- "type": "storage",
- "shared": 0,
- "id": "storage/node1/cloud-init",
- "plugintype": "dir"
- },
- {
- "id": "storage/node4/cloud-init",
- "plugintype": "dir",
- "type": "storage",
- "shared": 0,
- "status": "available",
- "maxdisk": 482719825920,
- "content": "snippets",
- "disk": 2789867520,
- "storage": "cloud-init",
- "node": "node4"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/cluster/sdn/zones$").
- MatchParams(map[string]string{
- "type": "vxlan",
- }).
- Reply(200).
- JSON(`{
- "data": [
- {"zone":"test1","type":"vxlan","ipam":"pve"}
- ]
- }`)
-
- gock.New(config.C.URI).
- Get("^/cluster/sdn/zones$").
- Reply(200).
- JSON(`{
- "data": [
- {"zone":"test1","type":"vxlan","ipam":"pve"},
- {"zone":"test2","type":"simple","ipam":"pve"}
- ]
- }`)
-
- gock.New(config.C.URI).
- Get("^/cluster/sdn/vnets$").
- Reply(200).
- JSON(`{
- "data": [
- {"vnet":"user1","type":"vnet","zone":"test1","vlanaware":1,"tag":10},
- {"vnet":"user10","type":"vnet","zone":"test1","vlanaware":1,"tag":30},
- {"vnet":"user11","type":"vnet","zone":"test1","vlanaware":1,"tag":31},
- {"vnet":"user2","type":"vnet","zone":"test3","vlanaware":1,"tag":11},
- {"vnet":"user3","type":"vnet","zone":"test1","vlanaware":1,"tag":12}
- ]
- }`)
-
- gock.New(config.C.URI).
- Get("^/cluster/sdn/vnets/user1$").
- Reply(200).
- JSON(`{
- "data": {"vnet":"user1","type":"vnet","zone":"test1","vlanaware":1,"tag":10}
- }`)
-
- // GET /cluster/firewall/groups - List firewall security groups
- gock.New(config.C.URI).
- Persist().
- Get("^/cluster/firewall/groups$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "group": "test-group",
- "comment": "Test security group"
- },
- {
- "group": "web-servers",
- "comment": "Web server security group"
- }
- ]
- }`)
-
- // GET /cluster/firewall/groups/{group} - Get firewall group rules
- gock.New(config.C.URI).
- Persist().
- Get("^/cluster/firewall/groups/test-group$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "pos": 0,
- "type": "in",
- "action": "ACCEPT",
- "enable": 1,
- "proto": "tcp",
- "dport": "22",
- "comment": "Allow SSH"
- },
- {
- "pos": 1,
- "type": "in",
- "action": "ACCEPT",
- "enable": 1,
- "proto": "tcp",
- "dport": "80",
- "comment": "Allow HTTP"
- }
- ]
- }`)
-
- // POST /cluster/firewall/groups - Create new firewall group
- gock.New(config.C.URI).
- Persist().
- Post("^/cluster/firewall/groups$").
- Reply(200).
- JSON(`{
- "data": null
- }`)
-
- // POST /cluster/firewall/groups/{group} - Create rule in group
- gock.New(config.C.URI).
- Persist().
- Post("^/cluster/firewall/groups/test-group$").
- Reply(200).
- JSON(`{
- "data": null
- }`)
-
- // PUT /cluster/firewall/groups/{group}/{pos} - Update rule in group
- gock.New(config.C.URI).
- Persist().
- Put("^/cluster/firewall/groups/test-group/[0-9]+$").
- Reply(200).
- JSON(`{
- "data": null
- }`)
-
- // DELETE /cluster/firewall/groups/{group}/{pos} - Delete rule from group
- gock.New(config.C.URI).
- Persist().
- Delete("^/cluster/firewall/groups/test-group/[0-9]+$").
- Reply(200).
- JSON(`{
- "data": null
- }`)
-
- // DELETE /cluster/firewall/groups/{group} - Delete firewall group
- gock.New(config.C.URI).
- Persist().
- Delete("^/cluster/firewall/groups/test-group$").
- Reply(200).
- JSON(`{
- "data": null
- }`)
-}
diff --git a/go-proxmox/tests/mocks/pve7x/nodes.go b/go-proxmox/tests/mocks/pve7x/nodes.go
deleted file mode 100644
index caf3469..0000000
--- a/go-proxmox/tests/mocks/pve7x/nodes.go
+++ /dev/null
@@ -1,1407 +0,0 @@
-package pve7x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func nodes() {
- gock.New(config.C.URI).
- Get("^/nodes/node1/qemu/101/status/current$").
- Reply(200).
- JSON(`{
- "data": {
- "pid": 1563102,
- "shares": 1000,
- "agent": 1,
- "diskwrite": 1515457024,
- "cpus": 8,
- "ha": {
- "managed": 0
- },
- "maxmem": 2097152000,
- "blockstat": {
- "scsi0": {
- "rd_total_time_ns": 7089432813,
- "flush_total_time_ns": 7442045713,
- "wr_total_time_ns": 65889619830,
- "failed_rd_operations": 0,
- "rd_bytes": 649448960,
- "wr_bytes": 1515457024,
- "unmap_operations": 469,
- "failed_unmap_operations": 0,
- "failed_wr_operations": 0,
- "account_failed": true,
- "invalid_unmap_operations": 0,
- "wr_operations": 157514,
- "rd_operations": 15582,
- "failed_flush_operations": 0,
- "invalid_wr_operations": 0,
- "account_invalid": true,
- "unmap_total_time_ns": 9514953,
- "unmap_merged": 0,
- "timed_stats": [],
- "unmap_bytes": 15973687808,
- "invalid_flush_operations": 0,
- "idle_time_ns": 4427685914,
- "flush_operations": 15494,
- "invalid_rd_operations": 0,
- "wr_highest_offset": 2808696832,
- "rd_merged": 0,
- "wr_merged": 0
- },
- "ide2": {
- "unmap_merged": 0,
- "timed_stats": [],
- "unmap_bytes": 0,
- "invalid_flush_operations": 0,
- "idle_time_ns": 170803536780303,
- "flush_operations": 0,
- "invalid_rd_operations": 0,
- "wr_highest_offset": 0,
- "rd_merged": 0,
- "wr_merged": 0,
- "failed_flush_operations": 0,
- "invalid_wr_operations": 0,
- "account_invalid": true,
- "unmap_total_time_ns": 0,
- "unmap_operations": 0,
- "failed_unmap_operations": 0,
- "failed_wr_operations": 0,
- "account_failed": true,
- "invalid_unmap_operations": 0,
- "wr_operations": 0,
- "rd_operations": 98,
- "rd_total_time_ns": 10689186,
- "flush_total_time_ns": 0,
- "wr_total_time_ns": 0,
- "failed_rd_operations": 0,
- "rd_bytes": 344348,
- "wr_bytes": 0
- }
- },
- "uptime": 170815,
- "cpu": 0.0112815646165076,
- "running-machine": "pc-i440fx-8.0+pve0",
- "balloon": 2097152000,
- "qmpstatus": "running",
- "status": "running",
- "maxdisk": 18467520512,
- "diskread": 649793308,
- "freemem": 887222272,
- "ballooninfo": {
- "actual": 2097152000,
- "max_mem": 2097152000,
- "free_mem": 887222272,
- "major_page_faults": 1811,
- "minor_page_faults": 3803793,
- "mem_swapped_out": 0,
- "mem_swapped_in": 0,
- "total_mem": 2015014912,
- "last_update": 1693252591
- },
- "vmid": 101,
- "balloon_min": 2097152000,
- "mem": 1127792640,
- "proxmox-support": {
- "pbs-dirty-bitmap-savevm": true,
- "pbs-dirty-bitmap": true,
- "query-bitmap-info": true,
- "pbs-masterkey": true,
- "backup-max-workers": true,
- "pbs-dirty-bitmap-migration": true,
- "pbs-library-version": "1.4.0 (UNKNOWN)"
- },
- "running-qemu": "8.0.2",
- "name": "matt",
- "netout": 14139344,
- "netin": 547369168,
- "nics": {
- "tap1001i0": {
- "netout": 14139344,
- "netin": 547369168
- }
- },
- "disk": 0
- }
-}`)
-
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/qemu/101/rrddata$").
- MatchParams(map[string]string{
- "timeframe": "hour",
- }).
- Reply(200).
- JSON(`{
- "data": [
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693110660,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693110720,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693110780,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "time": 1693110840,
- "maxdisk": 68719476736,
- "disk": 0,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693110900
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693110960
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693111020,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "time": 1693111080,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693111140,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "time": 1693111200,
- "maxdisk": 68719476736,
- "disk": 0,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693111260,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693111320,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693111380,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693111440
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693111500,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693111560,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693111620,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693111680
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693111740,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693111800,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693111860,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693111920,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693111980,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693112040,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "time": 1693112100,
- "maxdisk": 68719476736,
- "disk": 0,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693112160,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693112220,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "time": 1693112280,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "time": 1693112340,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693112400,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693112460
- },
- {
- "time": 1693112520,
- "maxdisk": 68719476736,
- "disk": 0,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693112580,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693112640
- },
- {
- "time": 1693112700,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693112760,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693112820,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693112880,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693112940
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693113000,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113060,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693113120,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113180
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113240,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "time": 1693113300,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113360
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113420,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "time": 1693113480,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113540,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693113600,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693113660,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693113720,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113780
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693113840
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113900
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693113960,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693114020,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693114080,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693114140,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693114200
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693114260
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693114320,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "time": 1693114380,
- "maxdisk": 68719476736,
- "disk": 0,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "time": 1693114440,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693114500,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693114560,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693114620,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "time": 1693114680,
- "maxdisk": 68719476736,
- "disk": 0,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693114740,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693114800,
- "disk": 0,
- "maxdisk": 68719476736
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "uptime": 2236708,
- "level": "",
- "maxmem": 33568288768,
- "disk": 2310930432,
- "node": "node1",
- "maxdisk": 940743983104,
- "mem": 11508809728,
- "ssl_fingerprint": "80:D4:F2:DF:64:95:CD:8D:A0:82:82:AC:48:BA:C0:7A:1B:6B:87:8B:FE:B9:83:1C:95:4E:79:58:77:99:69:F5",
- "status": "online",
- "type": "node",
- "cpu": 0.00348605577689243,
- "id": "node/node1",
- "maxcpu": 12
- },
- {
- "level": "",
- "uptime": 6256882,
- "node": "node2",
- "maxdisk": 482721529856,
- "maxmem": 16651751424,
- "disk": 2303721472,
- "ssl_fingerprint": "17:F1:B6:52:8B:0C:22:4A:97:1F:B2:F2:90:3D:29:0A:D0:DF:BE:0E:76:5A:B5:EC:F6:2E:6E:8F:60:E6:C5:C0",
- "status": "online",
- "mem": 1838854144,
- "maxcpu": 4,
- "cpu": 0.00722831505483549,
- "type": "node",
- "id": "node/node2"
- },
- {
- "maxdisk": 482717728768,
- "node": "node3",
- "disk": 2315386880,
- "maxmem": 16668868608,
- "level": "",
- "uptime": 6258488,
- "maxcpu": 4,
- "id": "node/node3",
- "cpu": 0.00821557582405153,
- "type": "node",
- "status": "online",
- "ssl_fingerprint": "1D:56:94:B4:75:4B:5C:33:46:DD:14:38:6C:EC:6E:12:A8:F0:66:64:5E:F2:40:F7:60:2A:C0:9F:BF:6C:51:3C",
- "mem": 1858961408
- },
- {
- "maxmem": 65919561728,
- "disk": 9992273920,
- "node": "node4",
- "maxdisk": 951055024128,
- "uptime": 6257222,
- "level": "",
- "cpu": 0.00748876684972541,
- "type": "node",
- "id": "node/node4",
- "maxcpu": 8,
- "mem": 2268295168,
- "ssl_fingerprint": "0D:78:80:CD:64:8E:96:E5:31:87:1C:45:3C:62:93:2F:23:4C:D5:02:42:FE:C8:40:DC:AF:3D:2A:F8:B4:F6:CE",
- "status": "online"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/network$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "priority": 3,
- "method6": "manual",
- "exists": 1,
- "method": "manual",
- "active": 1,
- "families": [
- "inet"
- ],
- "type": "eth",
- "iface": "enp0s31f6"
- },
- {
- "priority": 4,
- "cidr": "192.168.5.1/24",
- "active": 1,
- "netmask": "24",
- "bridge_ports": "enp0s31f6",
- "method6": "manual",
- "autostart": 1,
- "bridge_fd": "0",
- "method": "static",
- "gateway": "192.168.1.1",
- "iface": "vmbr0",
- "type": "bridge",
- "families": [
- "inet"
- ],
- "address": "192.168.5.1",
- "bridge_stp": "off"
- }
- ]
-}`)
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/network/vmbr0$").
- Reply(200).
- JSON(`{
- "data": {
- "method6": "manual",
- "autostart": 1,
- "method": "static",
- "bridge_fd": "0",
- "gateway": "192.168.1.1",
- "type": "bridge",
- "address": "192.168.5.1",
- "bridge_stp": "off",
- "families": [
- "inet"
- ],
- "cidr": "192.168.5.1/24",
- "priority": 4,
- "netmask": "24",
- "active": 1,
- "bridge_ports": "enp0s31f6"
- }
-}`)
-
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/status$").
- Reply(200).
- JSON(`{
- "data": {
- "idle": 0,
- "cpu": 0.00260552371026576,
- "ksm": {
- "shared": 0
- },
- "swap": {
- "total": 0,
- "free": 0,
- "used": 0
- },
- "pveversion": "pve-manager/7.4-16/0f39f621",
- "wait": 0,
- "uptime": 2501631,
- "kversion": "Linux 5.15.108-1-pve #1 SMP PVE 5.15.108-2 (2023-07-20T10:06Z)",
- "cpuinfo": {
- "mhz": "3400.000",
- "model": "Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz",
- "sockets": 1,
- "flags": "fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single pti tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp",
- "hvm": "1",
- "cores": 4,
- "user_hz": 100,
- "cpus": 8
- },
- "loadavg": [
- "0.00",
- "0.00",
- "0.00"
- ],
- "memory": {
- "total": 65919459328,
- "free": 57824059392,
- "used": 8095399936
- },
- "rootfs": {
- "total": 948338819072,
- "free": 937851224064,
- "used": 10487595008,
- "avail": 937851224064
- }
- }
-}`)
-
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/doesntexist/status$").
- Reply(500).
- JSON(`{
- "data": null
-}`)
-
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/version$").
- Reply(200).
- JSON(`{
- "data": {
- "release": "7.4",
- "version": "7.4-16",
- "repoid": "0f39f621"
- }
-}`)
-
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node2/network$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "bridge_vlan_aware": 1,
- "method6": "static",
- "bridge_vids": "2-4094",
- "address": "192.168.1.10",
- "bridge_stp": "off",
- "families": [
- "inet",
- "inet6"
- ],
- "mtu": "1500",
- "bridge_ports": "enp8s0",
- "iface": "vmbr2",
- "netmask": "24",
- "method": "static",
- "type": "bridge",
- "bridge_fd": "0",
- "cidr6": "fd66:5ac3:eeaf:3200::10/64",
- "active": 1,
- "cidr": "192.168.1.10/24",
- "address6": "fd66:5ac3:eeaf:3200::10",
- "comments": "comment\n",
- "autostart": 1,
- "priority": 9,
- "netmask6": "64"
- },
- {
- "active": 1,
- "cidr6": "fd66:5ac3:eeaf::10/64",
- "address6": "fd66:5ac3:eeaf::10",
- "comments": "comment\n",
- "autostart": 1,
- "priority": 11,
- "cidr": "192.168.0.10/24",
- "netmask6": "64",
- "vlan-raw-device": "vmbr0",
- "exists": null,
- "method6": "static",
- "address": "192.168.0.10",
- "families": [
- "inet",
- "inet6"
- ],
- "iface": "vmbr0.2",
- "netmask": "24",
- "method": "static",
- "vlan-id": "2",
- "type": "vlan"
- }
- ]
-}`)
-
- // LXC
- gock.New(config.C.URI).
- Get("^/nodes/node1/lxc/101/interfaces").
- Reply(200).
- JSON(`{
- "data": [
- {
- "inet":"127.0.0.1/8",
- "hwaddr":"00:00:00:00:00:00",
- "name":"lo",
- "inet6":"::1/128"
- },
- {
- "inet6":"fe80::be24:11ff:fe89:6707/64",
- "name":"eth0",
- "hwaddr":"bc:24:11:89:67:07",
- "inet":"192.168.3.95/22"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/nodes/node1/lxc$").
- Reply(200).
- JSON(`{
-"data": [{"cpu":0,"cpus":1,"disk":640397312,"diskread":273694720,"diskwrite":200982528,"maxdisk":8350298112,"maxmem":536870912,"maxswap":536870912,"mem":34304000,"name":"test","netin":94558593,"netout":1618542,"pid":248173,"status":"running","swap":0,"type":"lxc","uptime":919760,"vmid":"106"},{"cpu":0,"cpus":1,"disk":639303680,"diskread":283123712,"diskwrite":201687040,"maxdisk":8350298112,"maxmem":536870912,"maxswap":536870912,"mem":34508800,"name":"zort","netin":94560801,"netout":1619838,"pid":248045,"status":"running","swap":0,"type":"lxc","uptime":919761,"vmid":"105"},{"cpu":0,"cpus":1,"disk":0,"diskread":0,"diskwrite":0,"maxdisk":8589934592,"maxmem":536870912,"maxswap":536870912,"mem":0,"name":"test-container","netin":0,"netout":0,"status":"stopped","swap":0,"template":1,"type":"lxc","uptime":0,"vmid":"101"}]
-}`)
-
- gock.New(config.C.URI).
- Get("^/nodes/node1/lxc/101/status/current").
- Reply(200).
- JSON(`{
- "data": {
- "cpu":0,
- "cpus":2,
- "disk":0,
- "diskread":0,
- "diskwrite":0,
- "ha":{"managed":0},
- "maxdisk":8589934592,
- "maxmem":536870912,
- "maxswap":536870912,
- "mem":0,
- "name":"test-container",
- "netin":0,
- "netout":0,
- "status":"stopped",
- "swap":0,
- "template":1,
- "tags":"tag1;tag2",
- "type":"lxc",
- "uptime":0,
- "vmid":101
- }
-}`)
-
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/clone").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- gock.New(config.C.URI).
- Delete("^/nodes/node1/lxc/101").
- Reply(200).
- JSON(`{"data": "UPID:node1:0031B740:0645340C:23E5BA99:vzdestroy:101:root@pam:"}`)
-
- gock.New(config.C.URI).
- Put("^/nodes/node1/lxc/101/config").
- Reply(200).
- JSON(`{"data": "null"}`)
-
- // Used for ContainerConfig
- gock.New(config.C.URI).
- Get("^/nodes/node1/lxc/101/config").
- Reply(200).
- JSON(`{"data":
-{
- "arch" : "amd64",
- "cores" : 2,
- "digest" : "5911baea29f4c0073fb063fd9ab29e75892832bf",
- "features" : "fuse=1,mknod=1,nesting=1",
- "hostname" : "test-container",
- "lxc" : [
- [
- "lxc.cgroup2.devices.allow",
- "c 226:0 rwm"
- ],
- [
- "lxc.cgroup2.devices.allow",
- "c 226:128 rwm"
- ],
- [
- "lxc.cgroup2.devices.allow",
- "c 29:0 rwm"
- ],
- [
- "lxc.mount.entry",
- "/dev/dri dev/dri none bind,optional,create=dir"
- ],
- [
- "lxc.mount.entry",
- "/dev/fb0 dev/fb0 none bind,optional,create=file"
- ]
- ],
- "memory" : 4096,
- "mp0" : "/mnt/foo/bar,mp=/storage",
- "net0" : "name=eth0,bridge=vmbr0,firewall=1,hwaddr=5D:CF:BD:B2:C5:39,ip=dhcp,type=veth",
- "onboot" : 1,
- "ostype" : "debian",
- "rootfs" : "vmstore:subvol-101-disk-0,size=30G",
- "swap" : 512,
- "tags" : "tag1;tag2"
-}}`)
-
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/status/start").
- Reply(200).
- JSON(`{"data": "UPID:node1:0031B740:0645340C:23E5BA99:vzstart:101:root"}`)
-
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/status/stop").
- Reply(200).
- JSON(`{"data": "UPID:node1:0031B740:0645340C:23E5BA99:vzstop:101:root"}`)
-
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/status/suspend").
- Reply(200).
- JSON(`{"data": "UPID:node1:0031B740:0645340C:23E5BA99:vzsuspend:101:root"}`)
-
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/status/reboot").
- Reply(200).
- JSON(`{"data": "UPID:node1:0031B740:0645340C:23E5BA99:vzreboot:101:root"}`)
-
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/status/resume").
- Reply(200).
- JSON(`{"data": "UPID:node1:0031B740:0645340C:23E5BA99:vzresume:101:root"}`)
-
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/status/shutdown").
- Reply(200).
- JSON(`{"data": "UPID:node1:0031B740:0645340C:23E5BA99:vzshutdown:101:root"}`)
-
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/template").
- Reply(200).
- JSON(`{"data": null}`)
-
- gock.New(config.C.URI).
- Get("^/nodes/node1/lxc/101/snapshot").
- Reply(200).
- JSON(`{
- "data": [
- {
- "description": "description1",
- "name":"snapshot1",
- "snaptime":1709753281
- },
- {
- "description":"description2",
- "name":"snapshot2",
- "parent":"parent1",
- "snaptime":1709753290
- },
- {
- "description":"You are here!",
- "digest":"e2f5f35c85b2ca35e5f9ab789436b25c1d71cbad",
- "name":"current",
- "parent":"parent2",
- "running":1
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/snapshot").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:0031B740:0645340C:23E5BA99:vzsnapshot:101:root"
-}`)
-
- gock.New(config.C.URI).
- Delete("^/nodes/node1/lxc/101/snapshot/snapshot1").
- Reply(200).
- JSON(`{"data": "UPID:node1:0031B740:0645340C:23E5BA99:vzrmsnapshot:101:root"}`)
-
- gock.New(config.C.URI).
- Get("^/nodes/node1/lxc/101/snapshot/snapshot1").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:0031B740:0645340C:23E5BA99:vzsnapshot:101:root"
-}`)
-
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/snapshot/snapshot1/rollback").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:0031B740:0645340C:23E5BA99:vzrollback:101:root"
-}`)
-
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/101/clone").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // GET /nodes/{node}/report - Get node report
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/report$").
- Reply(200).
- JSON(`{
- "data": "pve-manager: 7.7-1\nkernel: 6.5.0-1-pve\nproxmox-ve: 7.7-1\nqemu-server: 7.7-1\nlxc-pve: 5.0.0-1"
-}`)
-
- // POST /nodes/{node}/termproxy - Create terminal proxy
- gock.New(config.C.URI).
- Persist().
- Post("^/nodes/node1/termproxy$").
- Reply(200).
- JSON(`{
- "data": {
- "port": 5900,
- "ticket": "PVE:termproxy:12345678",
- "upid": "UPID:node1:00001234:00005678:12345678:termproxy:root@pam:",
- "user": "root@pam"
- }
-}`)
-
- // GET /nodes/{node}/aplinfo - List appliances
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/aplinfo$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "template": "ubuntu-22.04-standard",
- "type": "lxc",
- "package": "ubuntu-22.04-standard_22.04-1_amd64.tar.zst",
- "os": "ubuntu",
- "version": "22.04",
- "headline": "Ubuntu 22.04 LTS",
- "infopage": "https://pve.proxmox.com/wiki/Linux_Container",
- "description": "Ubuntu 22.04 LTS (Jammy Jellyfish) standard system",
- "section": "system"
- },
- {
- "template": "debian-12-standard",
- "type": "lxc",
- "package": "debian-12-standard_12.0-1_amd64.tar.zst",
- "os": "debian",
- "version": "12.0",
- "headline": "Debian 12 (Bookworm)",
- "infopage": "https://pve.proxmox.com/wiki/Linux_Container",
- "description": "Debian 12 (Bookworm) standard system",
- "section": "system"
- }
- ]
-}`)
-
- // POST /nodes/{node}/aplinfo - Download appliance
- gock.New(config.C.URI).
- Persist().
- Post("^/nodes/node1/aplinfo$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00001234:00005678:12345678:download:root@pam:"
-}`)
-
- // GET /nodes/{node}/storage - List storages
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/storage$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "storage": "local",
- "content": "images,rootdir,vztmpl,backup,iso,snippets",
- "type": "dir",
- "active": 1,
- "avail": 50000000000,
- "used": 10000000000,
- "total": 60000000000,
- "enabled": 1,
- "shared": 0
- },
- {
- "storage": "local-lvm",
- "content": "images,rootdir",
- "type": "lvmthin",
- "active": 1,
- "avail": 100000000000,
- "used": 20000000000,
- "total": 120000000000,
- "enabled": 1,
- "shared": 0
- }
- ]
-}`)
-
- // GET /nodes/{node}/storage/{storage}/status - Get storage status
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/storage/local/status$").
- Reply(200).
- JSON(`{
- "data": {
- "storage": "local",
- "content": "images,rootdir,vztmpl,backup,iso,snippets",
- "type": "dir",
- "active": 1,
- "avail": 50000000000,
- "used": 10000000000,
- "total": 60000000000,
- "enabled": 1,
- "shared": 0
- }
-}`)
-
- // GET /nodes/{node}/storage/{storage}/content - List storage content
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/storage/local/content").
- MatchParam("content", "vztmpl").
- Reply(200).
- JSON(`{
- "data": [
- {
- "volid": "local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst",
- "content": "vztmpl",
- "format": "tgz",
- "size": 123456789,
- "ctime": 1234567890
- },
- {
- "volid": "local:vztmpl/debian-12-standard_12.0-1_amd64.tar.zst",
- "content": "vztmpl",
- "format": "tgz",
- "size": 98765432,
- "ctime": 1234567890
- }
- ]
-}`)
-
- // POST /nodes/{node}/storage/{storage}/download-url - Download from URL
- gock.New(config.C.URI).
- Persist().
- Post("^/nodes/node1/storage/local/download-url$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00001234:00005678:12345678:download:root@pam:"
-}`)
-
- // GET /nodes/{node}/firewall/options - Get firewall options
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/firewall/options$").
- Reply(200).
- JSON(`{
- "data": {
- "enable": true,
- "log_level_in": "info",
- "log_level_out": "info",
- "ndp": true,
- "nf_conntrack_allow_invalid": false,
- "nf_conntrack_max": 262144,
- "nf_conntrack_tcp_timeout_established": 432000,
- "nosmurfs": true,
- "protection_synflood": false,
- "protection_synflood_burst": 1000,
- "protection_synflood_rate": 200,
- "smurf_log_level": "info",
- "tcp_flags_log_level": "nolog",
- "tcpflags": false
- }
-}`)
-
- // PUT /nodes/{node}/firewall/options - Update firewall options
- gock.New(config.C.URI).
- Persist().
- Put("^/nodes/node1/firewall/options$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // GET /nodes/{node}/firewall/rules - Get firewall rules
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/firewall/rules$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "pos": 0,
- "type": "in",
- "action": "ACCEPT",
- "enable": 1,
- "iface": "vmbr0",
- "source": "192.168.1.0/24",
- "dest": "192.168.1.100",
- "proto": "tcp",
- "dport": "22",
- "comment": "Allow SSH from LAN"
- },
- {
- "pos": 1,
- "type": "in",
- "action": "DROP",
- "enable": 1,
- "proto": "tcp",
- "dport": "22",
- "comment": "Block all other SSH"
- }
- ]
-}`)
-
- // POST /nodes/{node}/firewall/rules - Create firewall rule
- gock.New(config.C.URI).
- Persist().
- Post("^/nodes/node1/firewall/rules$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // PUT /nodes/{node}/firewall/rules/{pos} - Update firewall rule
- gock.New(config.C.URI).
- Persist().
- Put("^/nodes/node1/firewall/rules/[0-9]+$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // DELETE /nodes/{node}/firewall/rules/{pos} - Delete firewall rule
- gock.New(config.C.URI).
- Persist().
- Delete("^/nodes/node1/firewall/rules/[0-9]+$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // GET /nodes/{node}/certificates/info - Get certificates
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/certificates/info$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "filename": "/etc/pve/nodes/node1/pve-ssl.pem",
- "fingerprint": "80:D4:F2:DF:64:95:CD:8D:A0:82:82:AC:48:BA:C0:7A:1B:6B:87:8B:FE:B9:83:1C:95:4E:79:58:77:99:69:F5",
- "issuer": "Proxmox Virtual Environment",
- "notafter": 1735689600,
- "notbefore": 1704153600,
- "subject": "node1.example.com",
- "san": [
- "DNS:node1",
- "DNS:node1.example.com",
- "IP:192.168.1.100"
- ],
- "pem": "-----BEGIN CERTIFICATE-----\nMIIDXTCCAkWgAwIBAgIJAKZx...\n-----END CERTIFICATE-----"
- }
- ]
-}`)
-
- // POST /nodes/{node}/certificates/custom - Upload custom certificate
- gock.New(config.C.URI).
- Persist().
- Post("^/nodes/node1/certificates/custom$").
- Reply(200).
- JSON(`{
- "data": {
- "filename": "/etc/pve/nodes/node1/pve-ssl.pem",
- "fingerprint": "AB:CD:EF:12:34:56:78:90:AB:CD:EF:12:34:56:78:90:AB:CD:EF:12:34:56:78:90:AB:CD:EF:12:34:56:78:90",
- "issuer": "Custom CA",
- "notafter": 1767225600,
- "notbefore": 1735689600,
- "subject": "node1.example.com"
- }
-}`)
-
- // DELETE /nodes/{node}/certificates/custom - Delete custom certificate
- gock.New(config.C.URI).
- Persist().
- Delete("^/nodes/node1/certificates/custom$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // POST /nodes/{node}/vzdump - Backup VMs
- gock.New(config.C.URI).
- Persist().
- Post("^/nodes/node1/vzdump$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00001234:00005678:12345678:vzdump:root@pam:"
-}`)
-
- // GET /nodes/{node}/vzdump/extractconfig - Extract backup config
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/vzdump/extractconfig").
- Reply(200).
- JSON(`{
- "data": "cores: 2\nmemory: 2048\nostype: debian\nrootfs: local-lvm:vm-100-disk-0,size=8G\nnet0: name=eth0,bridge=vmbr0,ip=dhcp"
-}`)
-}
diff --git a/go-proxmox/tests/mocks/pve7x/pools.go b/go-proxmox/tests/mocks/pve7x/pools.go
deleted file mode 100644
index 7fae3d0..0000000
--- a/go-proxmox/tests/mocks/pve7x/pools.go
+++ /dev/null
@@ -1,164 +0,0 @@
-package pve7x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func pool() {
- gock.New(config.C.URI).
- Get("^/pools$").
- Reply(200).
- JSON(`{"data": [
- {
- "poolid": "test-pool",
- "comment": "Test pool"
- }
- ]
-}`)
-
- // Mock for the new /pools/?poolid=test-pool endpoint (returns array)
- gock.New(config.C.URI).
- Get("^/pools/$").
- MatchParam("poolid", "test-pool").
- Reply(200).
- JSON(`{"data": [
- {
- "poolid": "test-pool",
- "comment": "Test pool",
- "members": [
- {
- "disk": 0,
- "uptime": 88341,
- "diskwrite": 7389189632,
- "netout": 73088105,
- "maxmem": 17179869184,
- "maxdisk": 10737418240,
- "type": "qemu",
- "vmid": 100,
- "template": 0,
- "cpu": 0.0378721079577321,
- "name": "test-vm",
- "node": "pve1",
- "id": "qemu/100",
- "diskread": 500085248,
- "netin": 485707842,
- "maxcpu": 4,
- "mem": 3650678784,
- "status": "running"
- },
- {
- "diskread": 486947840,
- "id": "qemu/106",
- "cpu": 0.02889417191544,
- "template": 0,
- "name": "test-vm2",
- "node": "pve2",
- "maxcpu": 1,
- "netin": 337525157,
- "status": "running",
- "mem": 1744027648,
- "disk": 0,
- "diskwrite": 1382547968,
- "uptime": 88204,
- "netout": 21769689,
- "type": "qemu",
- "vmid": 106,
- "maxdisk": 10737418240,
- "maxmem": 2147483648
- },
- {
- "node": "node1",
- "maxdisk": 948340654080,
- "type": "storage",
- "id": "storage/node1/local",
- "status": "available",
- "storage": "local",
- "content": "backup,vztmpl,iso",
- "plugintype": "dir",
- "disk": 10486939648,
- "shared": 0
- }
- ]
- }
- ]
-}`)
-
- // Mock for the deprecated /pools/test-pool endpoint (kept for backwards compatibility)
- gock.New(config.C.URI).
- Get("^/pools/test-pool$").
- Reply(200).
- JSON(`{"data": {
- "comment": "Test pool",
- "members": [
- {
- "disk": 0,
- "uptime": 88341,
- "diskwrite": 7389189632,
- "netout": 73088105,
- "maxmem": 17179869184,
- "maxdisk": 10737418240,
- "type": "qemu",
- "vmid": 100,
- "template": 0,
- "cpu": 0.0378721079577321,
- "name": "test-vm",
- "node": "pve1",
- "id": "qemu/100",
- "diskread": 500085248,
- "netin": 485707842,
- "maxcpu": 4,
- "mem": 3650678784,
- "status": "running"
- },
- {
- "diskread": 486947840,
- "id": "qemu/106",
- "cpu": 0.02889417191544,
- "template": 0,
- "name": "test-vm2",
- "node": "pve2",
- "maxcpu": 1,
- "netin": 337525157,
- "status": "running",
- "mem": 1744027648,
- "disk": 0,
- "diskwrite": 1382547968,
- "uptime": 88204,
- "netout": 21769689,
- "type": "qemu",
- "vmid": 106,
- "maxdisk": 10737418240,
- "maxmem": 2147483648
- },
- {
- "node": "node1",
- "maxdisk": 948340654080,
- "type": "storage",
- "id": "storage/node1/local",
- "status": "available",
- "storage": "local",
- "content": "backup,vztmpl,iso",
- "plugintype": "dir",
- "disk": 10486939648,
- "shared": 0
- }
- ]
- }
-}`)
-
- gock.New(config.C.URI).
- Post("^/pools$").
- Reply(200).
- JSON(`{"data": null}`)
-
- gock.New(config.C.URI).
- Put("^/pools/test-pool$").
- Reply(200).
- JSON(`{"data": null}`)
-
- gock.New(config.C.URI).
- Delete("^/pools/test-pool$").
- Reply(200).
- JSON(`{"data": null}`)
-}
diff --git a/go-proxmox/tests/mocks/pve7x/proxmox.go b/go-proxmox/tests/mocks/pve7x/proxmox.go
deleted file mode 100644
index 36fd7f2..0000000
--- a/go-proxmox/tests/mocks/pve7x/proxmox.go
+++ /dev/null
@@ -1,11 +0,0 @@
-package pve7x
-
-func Load() {
- version()
- access()
- nodes()
- cluster()
- pool()
- storage()
- tasks()
-}
diff --git a/go-proxmox/tests/mocks/pve7x/storage.go b/go-proxmox/tests/mocks/pve7x/storage.go
deleted file mode 100644
index 04ff3eb..0000000
--- a/go-proxmox/tests/mocks/pve7x/storage.go
+++ /dev/null
@@ -1,147 +0,0 @@
-package pve7x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func storage() {
- // GET /storage - List all cluster storages
- gock.New(config.C.URI).
- Persist().
- Get("^/storage$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "content": "vztmpl,iso,backup",
- "digest": "1234567890abcdef1234567890abcdef12345678",
- "storage": "local",
- "type": "dir",
- "shared": 0,
- "path": "/var/lib/vz"
- },
- {
- "content": "images,rootdir",
- "digest": "abcdef1234567890abcdef1234567890abcdef12",
- "storage": "local-lvm",
- "type": "lvmthin",
- "shared": 0,
- "thinpool": "data",
- "vgname": "pve"
- },
- {
- "content": "images,rootdir",
- "digest": "fedcba0987654321fedcba0987654321fedcba09",
- "storage": "nfs-storage",
- "type": "nfs",
- "shared": 1,
- "path": "/mnt/pve/nfs-storage",
- "nodes": "node1,node2"
- }
- ]
-}`)
-
- // GET /storage/{storage} - Get specific storage
- gock.New(config.C.URI).
- Persist().
- Get("^/storage/local$").
- Reply(200).
- JSON(`{
- "data": {
- "content": "vztmpl,iso,backup",
- "digest": "1234567890abcdef1234567890abcdef12345678",
- "storage": "local",
- "type": "dir",
- "shared": 0,
- "path": "/var/lib/vz"
- }
-}`)
-
- gock.New(config.C.URI).
- Persist().
- Get("^/storage/local-lvm$").
- Reply(200).
- JSON(`{
- "data": {
- "content": "images,rootdir",
- "digest": "abcdef1234567890abcdef1234567890abcdef12",
- "storage": "local-lvm",
- "type": "lvmthin",
- "shared": 0,
- "thinpool": "data",
- "vgname": "pve"
- }
-}`)
-
- // POST /storage - Create new storage
- gock.New(config.C.URI).
- Post("^/storage$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // PUT /storage/{storage} - Update storage
- gock.New(config.C.URI).
- Put("^/storage/local$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // DELETE /storage/{storage} - Delete storage
- gock.New(config.C.URI).
- Delete("^/storage/test-storage$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000001:00000001:00000001:storage:delete:root@pam:"
-}`)
-
- // GET /nodes/{node}/storage/{storage}/content - Get storage content
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/storage/local/content$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "volid": "local:iso/debian-12.0.0-amd64-netinst.iso",
- "content": "iso",
- "format": "iso",
- "size": 654311424,
- "ctime": 1693252591
- },
- {
- "volid": "local:vztmpl/debian-12-standard_12.0-1_amd64.tar.zst",
- "content": "vztmpl",
- "format": "tar.zst",
- "size": 128974848,
- "ctime": 1693252600
- },
- {
- "volid": "local:backup/vzdump-qemu-100-2023_08_28-12_00_00.vma.zst",
- "content": "backup",
- "format": "vma.zst",
- "size": 2147483648,
- "ctime": 1693252800
- }
- ]
-}`)
-
- // DELETE /nodes/{node}/storage/{storage}/content/{volume} - Delete storage content
- gock.New(config.C.URI).
- Delete("^/nodes/node1/storage/local/content/local:iso/test.iso$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000002:00000002:00000002:imgdel:delete:root@pam:"
-}`)
-
- // POST /nodes/{node}/storage/{storage}/download-url - Download from URL
- gock.New(config.C.URI).
- Post("^/nodes/node1/storage/local/download-url$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000003:00000003:00000003:download:iso:root@pam:"
-}`)
-}
diff --git a/go-proxmox/tests/mocks/pve7x/tasks.go b/go-proxmox/tests/mocks/pve7x/tasks.go
deleted file mode 100644
index 6145128..0000000
--- a/go-proxmox/tests/mocks/pve7x/tasks.go
+++ /dev/null
@@ -1,117 +0,0 @@
-package pve7x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func tasks() {
- // GET /nodes/{node}/tasks/{upid}/status - Get task status (running)
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/tasks/UPID:node1:00000001:00000001:00000001:test:running:root@pam:/status$").
- Reply(200).
- JSON(`{
- "data": {
- "status": "running",
- "upid": "UPID:node1:00000001:00000001:00000001:test:running:root@pam:",
- "type": "test",
- "id": "running",
- "user": "root@pam",
- "node": "node1",
- "pid": 1,
- "pstart": 1,
- "starttime": 1693252591
- }
-}`)
-
- // GET /nodes/{node}/tasks/{upid}/status - Get task status (stopped/completed)
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/tasks/UPID:node1:00000002:00000002:00000002:test:completed:root@pam:/status$").
- Reply(200).
- JSON(`{
- "data": {
- "status": "stopped",
- "exitstatus": "OK",
- "upid": "UPID:node1:00000002:00000002:00000002:test:completed:root@pam:",
- "type": "test",
- "id": "completed",
- "user": "root@pam",
- "node": "node1",
- "pid": 2,
- "pstart": 2,
- "starttime": 1693252591,
- "endtime": 1693252600
- }
-}`)
-
- // GET /nodes/{node}/tasks/{upid}/status - Get task status (failed)
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/tasks/UPID:node1:00000003:00000003:00000003:test:failed:root@pam:/status$").
- Reply(200).
- JSON(`{
- "data": {
- "status": "stopped",
- "exitstatus": "some error occurred",
- "upid": "UPID:node1:00000003:00000003:00000003:test:failed:root@pam:",
- "type": "test",
- "id": "failed",
- "user": "root@pam",
- "node": "node1",
- "pid": 3,
- "pstart": 3,
- "starttime": 1693252591,
- "endtime": 1693252600
- }
-}`)
-
- // DELETE /nodes/{node}/tasks/{upid} - Stop task
- gock.New(config.C.URI).
- Delete("^/nodes/node1/tasks/UPID:node1:00000001:00000001:00000001:test:running:root@pam:$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // GET /nodes/{node}/tasks/{upid}/log - Get task log
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/tasks/UPID:node1:00000002:00000002:00000002:test:completed:root@pam:/log$").
- MatchParam("start", "0").
- MatchParam("limit", "50").
- Reply(200).
- JSON(`{
- "data": [
- {"n": 1, "t": "task started"},
- {"n": 2, "t": "processing step 1"},
- {"n": 3, "t": "processing step 2"},
- {"n": 4, "t": "processing step 3"},
- {"n": 5, "t": "task completed successfully"}
- ]
-}`)
-
- // GET /nodes/{node}/tasks/{upid}/log - Get task log with offset
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/tasks/UPID:node1:00000002:00000002:00000002:test:completed:root@pam:/log$").
- MatchParam("start", "5").
- MatchParam("limit", "50").
- Reply(200).
- JSON(`{
- "data": []
-}`)
-
- // GET /nodes/{node}/tasks/{upid}/log - Get task log for running task
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/tasks/UPID:node1:00000001:00000001:00000001:test:running:root@pam:/log$").
- Reply(200).
- JSON(`{
- "data": [
- {"n": 1, "t": "task started"},
- {"n": 2, "t": "processing..."}
- ]
-}`)
-}
diff --git a/go-proxmox/tests/mocks/pve7x/version.go b/go-proxmox/tests/mocks/pve7x/version.go
deleted file mode 100644
index 7db700f..0000000
--- a/go-proxmox/tests/mocks/pve7x/version.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package pve7x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func version() {
- versionJSON := `
-{
- "data": {
- "repoid": "777777",
- "release": "7.7",
- "version": "7.7-7"
- }
-}`
- gock.New(config.C.URI).
- Get("^/version$").
- Reply(200).
- JSON(versionJSON)
-
- gock.New(config.C.URI).
- Post("^/version$"). // fake to test client Post method
- Reply(200).
- JSON(versionJSON)
-
- gock.New(config.C.URI).
- Put("^/version$"). // fake to test client Put method
- Reply(200).
- JSON(versionJSON)
-
- gock.New(config.C.URI).
- Delete("^/version$"). // fake to test client Delete method
- Reply(200).
- JSON(versionJSON)
-}
diff --git a/go-proxmox/tests/mocks/pve8x/access.go b/go-proxmox/tests/mocks/pve8x/access.go
deleted file mode 100644
index da08a9c..0000000
--- a/go-proxmox/tests/mocks/pve8x/access.go
+++ /dev/null
@@ -1,955 +0,0 @@
-package pve8x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func access() {
- gock.New(config.C.URI).
- Get("^/access/acl").
- Reply(200).
- JSON(`{
- "data": [
- {
- "propagate": 1,
- "path": "/",
- "roleid": "PVEAdmin",
- "ugid": "cloud-init",
- "type": "group"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/domains$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "type": "pve",
- "realm": "pve",
- "comment": "Proxmox VE authentication server"
- },
- {
- "type": "pam",
- "realm": "pam",
- "comment": "Linux PAM standard authentication"
- },
- {
- "realm": "test",
- "type": "ldap",
- "tfa": "oath",
- "comment": "comment comment comment"
- }
- ]
-}`)
- gock.New(config.C.URI).
- Get("^/access/domains/test$").
- Reply(200).
- JSON(`{
- "data": {
- "user_attr": "userattribute",
- "sync-defaults-options": "remove-vanished=acl;entry;properties,scope=users",
- "port": 1234,
- "server1": "server1",
- "user_classes": "userclasses",
- "tfa": "digits=8,step=1234,type=oath",
- "comment": "comment comment comment",
- "group_name_attr": "groupnameattr",
- "digest": "b84e9112ebbb173fc8f5af76a057b38178f1047c",
- "secure": 1,
- "default": 0,
- "sync_attributes": "email=email@attribute.com",
- "base_dn": "CN=Users",
- "type": "ldap",
- "bind_dn": "CN=Users",
- "group_filter": "groupfilter",
- "group_classes": "groupclasses",
- "verify": 1,
- "filter": "userfilter",
- "server2": "server2"
- }
-}`)
-
- gock.New(config.C.URI).
- Get("^/access$").
- Reply(200).
- JSON(`
-{
- "data": [
- {
- "subdir": "users"
- },
- {
- "subdir": "groups"
- },
- {
- "subdir": "roles"
- },
- {
- "subdir": "acl"
- },
- {
- "subdir": "domains"
- },
- {
- "subdir": "openid"
- },
- {
- "subdir": "tfa"
- },
- {
- "subdir": "ticket"
- },
- {
- "subdir": "password"
- }
- ]
-}`)
-
- // full access user with all paths
- gock.New(config.C.URI).
- Get("^/access/permissions$").
- Reply(200).
- JSON(`{
- "data": {
- "/pools": {
- "VM.Audit": 1,
- "VM.Config.CPU": 1,
- "Datastore.Audit": 1,
- "VM.Config.CDROM": 1,
- "Group.Allocate": 1,
- "SDN.Use": 1,
- "VM.Config.HWType": 1,
- "VM.Backup": 1,
- "VM.Config.Disk": 1,
- "Sys.Incoming": 1,
- "VM.Config.Memory": 1,
- "Sys.Audit": 1,
- "VM.Monitor": 1,
- "Datastore.AllocateTemplate": 1,
- "Realm.AllocateUser": 1,
- "VM.Console": 1,
- "VM.Migrate": 1,
- "VM.Snapshot": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "VM.PowerMgmt": 1,
- "Datastore.Allocate": 1,
- "Sys.PowerMgmt": 1,
- "User.Modify": 1,
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "Realm.Allocate": 1,
- "VM.Clone": 1,
- "VM.Allocate": 1,
- "Pool.Allocate": 1,
- "Sys.Modify": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Syslog": 1,
- "VM.Config.Network": 1,
- "VM.Snapshot.Rollback": 1,
- "Sys.Console": 1,
- "SDN.Audit": 1,
- "Pool.Audit": 1
- },
- "/storage": {
- "VM.Audit": 1,
- "VM.Config.CPU": 1,
- "Datastore.Audit": 1,
- "VM.Config.CDROM": 1,
- "Group.Allocate": 1,
- "SDN.Use": 1,
- "VM.Config.HWType": 1,
- "VM.Backup": 1,
- "Sys.Incoming": 1,
- "VM.Config.Memory": 1,
- "VM.Config.Disk": 1,
- "Sys.Audit": 1,
- "VM.Monitor": 1,
- "Datastore.AllocateTemplate": 1,
- "Realm.AllocateUser": 1,
- "VM.Console": 1,
- "VM.Migrate": 1,
- "VM.Snapshot": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "VM.PowerMgmt": 1,
- "Datastore.Allocate": 1,
- "User.Modify": 1,
- "Sys.PowerMgmt": 1,
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "Realm.Allocate": 1,
- "VM.Clone": 1,
- "VM.Allocate": 1,
- "Pool.Allocate": 1,
- "Sys.Modify": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Syslog": 1,
- "VM.Config.Network": 1,
- "VM.Snapshot.Rollback": 1,
- "Sys.Console": 1,
- "SDN.Audit": 1,
- "Pool.Audit": 1
- },
- "/access": {
- "Pool.Audit": 1,
- "SDN.Audit": 1,
- "Sys.Console": 1,
- "VM.Snapshot.Rollback": 1,
- "VM.Config.Network": 1,
- "Sys.Syslog": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Modify": 1,
- "Pool.Allocate": 1,
- "VM.Allocate": 1,
- "VM.Clone": 1,
- "Realm.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "SDN.Allocate": 1,
- "Sys.PowerMgmt": 1,
- "User.Modify": 1,
- "Datastore.Allocate": 1,
- "VM.PowerMgmt": 1,
- "VM.Config.Options": 1,
- "Permissions.Modify": 1,
- "VM.Snapshot": 1,
- "VM.Migrate": 1,
- "VM.Console": 1,
- "Realm.AllocateUser": 1,
- "Datastore.AllocateTemplate": 1,
- "VM.Monitor": 1,
- "Sys.Audit": 1,
- "VM.Config.Disk": 1,
- "Sys.Incoming": 1,
- "VM.Config.Memory": 1,
- "VM.Config.HWType": 1,
- "VM.Backup": 1,
- "SDN.Use": 1,
- "Group.Allocate": 1,
- "VM.Config.CDROM": 1,
- "Datastore.Audit": 1,
- "VM.Audit": 1,
- "VM.Config.CPU": 1
- },
- "/vms": {
- "VM.Snapshot.Rollback": 1,
- "VM.Config.Network": 1,
- "Sys.Console": 1,
- "SDN.Audit": 1,
- "Pool.Audit": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Syslog": 1,
- "VM.Allocate": 1,
- "Pool.Allocate": 1,
- "Sys.Modify": 1,
- "Realm.Allocate": 1,
- "VM.Clone": 1,
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "Datastore.Allocate": 1,
- "User.Modify": 1,
- "Sys.PowerMgmt": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "VM.PowerMgmt": 1,
- "VM.Console": 1,
- "VM.Migrate": 1,
- "VM.Snapshot": 1,
- "Realm.AllocateUser": 1,
- "Datastore.AllocateTemplate": 1,
- "Sys.Audit": 1,
- "VM.Monitor": 1,
- "VM.Config.HWType": 1,
- "VM.Backup": 1,
- "Sys.Incoming": 1,
- "VM.Config.Memory": 1,
- "VM.Config.Disk": 1,
- "Group.Allocate": 1,
- "SDN.Use": 1,
- "Datastore.Audit": 1,
- "VM.Config.CDROM": 1,
- "VM.Config.CPU": 1,
- "VM.Audit": 1
- },
- "/sdn": {
- "VM.Console": 1,
- "VM.Snapshot": 1,
- "VM.Migrate": 1,
- "Realm.AllocateUser": 1,
- "Datastore.AllocateTemplate": 1,
- "Sys.Audit": 1,
- "VM.Monitor": 1,
- "VM.Config.HWType": 1,
- "VM.Backup": 1,
- "Sys.Incoming": 1,
- "VM.Config.Memory": 1,
- "VM.Config.Disk": 1,
- "SDN.Use": 1,
- "Group.Allocate": 1,
- "Datastore.Audit": 1,
- "VM.Config.CDROM": 1,
- "VM.Config.CPU": 1,
- "VM.Audit": 1,
- "VM.Snapshot.Rollback": 1,
- "VM.Config.Network": 1,
- "Pool.Audit": 1,
- "SDN.Audit": 1,
- "Sys.Console": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Syslog": 1,
- "Pool.Allocate": 1,
- "VM.Allocate": 1,
- "Sys.Modify": 1,
- "VM.Clone": 1,
- "Realm.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "SDN.Allocate": 1,
- "User.Modify": 1,
- "Sys.PowerMgmt": 1,
- "Datastore.Allocate": 1,
- "VM.Config.Options": 1,
- "Permissions.Modify": 1,
- "VM.PowerMgmt": 1
- },
- "/nodes": {
- "Datastore.Allocate": 1,
- "User.Modify": 1,
- "Sys.PowerMgmt": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "VM.PowerMgmt": 1,
- "Realm.Allocate": 1,
- "VM.Clone": 1,
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "VM.Allocate": 1,
- "Pool.Allocate": 1,
- "Sys.Modify": 1,
- "VM.Snapshot.Rollback": 1,
- "VM.Config.Network": 1,
- "Sys.Console": 1,
- "SDN.Audit": 1,
- "Pool.Audit": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Syslog": 1,
- "Datastore.Audit": 1,
- "VM.Config.CDROM": 1,
- "VM.Audit": 1,
- "VM.Config.CPU": 1,
- "VM.Config.HWType": 1,
- "VM.Backup": 1,
- "VM.Config.Memory": 1,
- "Sys.Incoming": 1,
- "VM.Config.Disk": 1,
- "Group.Allocate": 1,
- "SDN.Use": 1,
- "Datastore.AllocateTemplate": 1,
- "Realm.AllocateUser": 1,
- "Sys.Audit": 1,
- "VM.Monitor": 1,
- "VM.Console": 1,
- "VM.Migrate": 1,
- "VM.Snapshot": 1
- },
- "/": {
- "Realm.AllocateUser": 1,
- "Datastore.AllocateTemplate": 1,
- "Sys.Audit": 1,
- "VM.Monitor": 1,
- "VM.Console": 1,
- "VM.Migrate": 1,
- "VM.Snapshot": 1,
- "Datastore.Audit": 1,
- "VM.Config.CDROM": 1,
- "VM.Audit": 1,
- "VM.Config.CPU": 1,
- "VM.Backup": 1,
- "VM.Config.HWType": 1,
- "VM.Config.Disk": 1,
- "Sys.Incoming": 1,
- "VM.Config.Memory": 1,
- "Group.Allocate": 1,
- "SDN.Use": 1,
- "VM.Allocate": 1,
- "Pool.Allocate": 1,
- "Sys.Modify": 1,
- "VM.Config.Network": 1,
- "VM.Snapshot.Rollback": 1,
- "SDN.Audit": 1,
- "Sys.Console": 1,
- "Pool.Audit": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Syslog": 1,
- "Datastore.Allocate": 1,
- "User.Modify": 1,
- "Sys.PowerMgmt": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "VM.PowerMgmt": 1,
- "Realm.Allocate": 1,
- "VM.Clone": 1,
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1
- },
- "/access/groups": {
- "VM.Migrate": 1,
- "VM.Snapshot": 1,
- "VM.Console": 1,
- "VM.Monitor": 1,
- "Sys.Audit": 1,
- "Realm.AllocateUser": 1,
- "Datastore.AllocateTemplate": 1,
- "Group.Allocate": 1,
- "SDN.Use": 1,
- "Sys.Incoming": 1,
- "VM.Config.Disk": 1,
- "VM.Config.Memory": 1,
- "VM.Backup": 1,
- "VM.Config.HWType": 1,
- "VM.Config.CPU": 1,
- "VM.Audit": 1,
- "VM.Config.CDROM": 1,
- "Datastore.Audit": 1,
- "Sys.Syslog": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Console": 1,
- "SDN.Audit": 1,
- "Pool.Audit": 1,
- "VM.Snapshot.Rollback": 1,
- "VM.Config.Network": 1,
- "Sys.Modify": 1,
- "VM.Allocate": 1,
- "Pool.Allocate": 1,
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "Realm.Allocate": 1,
- "VM.Clone": 1,
- "VM.PowerMgmt": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "Datastore.Allocate": 1,
- "User.Modify": 1,
- "Sys.PowerMgmt": 1
- }
- }
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/permissions$").
- MatchParams(map[string]string{
- "path": "path",
- }).
- Reply(200).
- JSON(`{
- "data": {
- "path": {
- "permission": 1
- }
- }
-}`)
-
- // user with no access
- gock.New(config.C.URI).
- Get("^/access/permissions$").
- MatchParams(map[string]string{
- "userid": "userid",
- }).
- Reply(200).
- JSON(`{
- "data": {
- "path": {
- "permission": 1
- }
- }
-}`)
-
- // user with no access
- gock.New(config.C.URI).
- Get("^/access/permissions$").
- MatchParams(map[string]string{
- "path": "path",
- "userid": "userid",
- }).
- Reply(200).
- JSON(`{
- "data": {
- "path": {
- "permission": 1
- }
- }
-}`)
-
- gock.New(config.C.URI).
- Put("^/access/password$").
- Reply(200).
- JSON(`{"success":1,"data":null}`)
-
- gock.New(config.C.URI).
- Get("^/access/ticket$").
- Reply(200).
- JSON(`{"data": null}`)
-
- gock.New(config.C.URI).
- Post("^/access/ticket$").
- Reply(200).
- JSON(`{
- "data": {
- "username": "root@pam",
- "CSRFPreventionToken": "64E10CBA:YDNz71IKnE0sWsm1SbV1PGwz3hAyprvygQ7SBkxHVtE",
- "cap": {
- "sdn": {
- "SDN.Audit": 1,
- "SDN.Allocate": 1,
- "SDN.Use": 1,
- "Permissions.Modify": 1
- },
- "access": {
- "Group.Allocate": 1,
- "User.Modify": 1,
- "Permissions.Modify": 1
- },
- "dc": {
- "SDN.Allocate": 1,
- "SDN.Audit": 1,
- "SDN.Use": 1,
- "Sys.Audit": 1
- },
- "nodes": {
- "Sys.Modify": 1,
- "Sys.Syslog": 1,
- "Sys.Audit": 1,
- "Sys.Console": 1,
- "Permissions.Modify": 1,
- "Sys.Incoming": 1,
- "Sys.PowerMgmt": 1
- },
- "storage": {
- "Datastore.Allocate": 1,
- "Datastore.Audit": 1,
- "Datastore.AllocateTemplate": 1,
- "Datastore.AllocateSpace": 1,
- "Permissions.Modify": 1
- },
- "vms": {
- "VM.Config.CPU": 1,
- "VM.Config.HWType": 1,
- "VM.Clone": 1,
- "VM.Allocate": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "VM.Config.Memory": 1,
- "VM.Audit": 1,
- "VM.Monitor": 1,
- "VM.Snapshot.Rollback": 1,
- "VM.Config.Network": 1,
- "VM.Config.Cloudinit": 1,
- "VM.Backup": 1,
- "VM.Migrate": 1,
- "VM.Config.Disk": 1,
- "VM.PowerMgmt": 1,
- "VM.Config.CDROM": 1,
- "VM.Console": 1,
- "VM.Snapshot": 1
- }
- },
- "clustername": "pve-cluster",
- "ticket": "PVE:root@pam:64E10CBA::yTMqV7BmOXUCzb0ODceFH7F+Uy3gQTlp3sepUzIicpL2KeJ4finWjuZ9SBZg/iTz7tACDGvnX0biv6JMZvYBuqzWu0S3eF6xrLX4A3YLahhWaMJJ4Dw8hIquSO5AMQr3Ea3xdN5CcLIuW8hPOLHrPFzDC2MDk6e6VtJ9lWF5htz8nq6ge+kcwZBgB80ZABc+lIwtcB1UcJ8NY5EYGS9czcEXSse2xmG1j2F1+gMfoF+4O7wiCV0iHGabG+8n3oEBZUE89jhzjQoVCGCzVpmxYpag+5I4+W+POZm8DzQCdvPmynH9fAT6bSD8Vu+le8aHGigoKz81xNMsFxIjd1Zr2g=="
- }
-}`)
- gock.New(config.C.URI).
- Get("^/access/user$").
- Reply(200).
- JSON(`
-{
- "data": [
- {
- "lastname": "pamlast",
- "realm-type": "pam",
- "enable": 1,
- "firstname": "pamfirst",
- "userid": "root@pam",
- "expire": 0
- "email": "root@email.com",
- },
- {
- "firstname": "first1",
- "userid": "user1@pve",
- "enable": 1,
- "expire": 0,
- "email": "first1.last1@email.com",
- "lastname": "last1",
- "realm-type": "pve"
- },
- {
- "lastname": "last2",
- "realm-type": "pve",
- "email": "first2.last2@email.com",
- "expire": 0,
- "enable": 1,
- "userid": "user2@pve",
- "firstname": "first2"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/groups$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "groupid": "cloud-init",
- "users": "root@pam,user1@pve"
- },
- {
- "groupid": "test",
- "users": "root@pam,user2@pve"
- }
- ]
-}`)
- gock.New(config.C.URI).
- Get("^/access/groups/test$").
- Reply(200).
- JSON(`{
- "data": {
- "members": [
- "user2@pve",
- "root@pam"
- ]
- }
-}`)
- gock.New(config.C.URI).
- Get("^/access/users$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "expire": 0,
- "lastname": "pamlast",
- "enable": 1,
- "firstname": "pamfirst",
- "userid": "pam@pam",
- "realm-type": "pam"
- },
- {
- "expire": 0,
- "realm-type": "pam",
- "email": "root@email.com",
- "userid": "root@pam",
- "enable": 1
- },
- {
- "expire": 0,
- "lastname": "last1",
- "email": "first1.last1@email.com",
- "enable": 1,
- "firstname": "first1",
- "realm-type": "pve",
- "userid": "user1@pve"
- },
- {
- "userid": "user2@pve",
- "realm-type": "pve",
- "firstname": "first2",
- "email": "first2.last2@email.com",
- "enable": 1,
- "lastname": "last2",
- "expire": 0
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/users/root@pam$").
- Reply(200).
- JSON(`{
- "data": {
- "groups": [
- "cloud-init",
- "test"
- ],
- "expire": 0,
- "email": "root@email.com",
- "enable": 1,
- "firstname": "firstname",
- "lastname": "lastname",
- "tokens": {
- "token1": {
- "privsep": 0,
- "expire": 1000
- },
- "token2": {
- "expire": 2000,
- "privsep": 1
- }
- }
- }
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/roles/Administrator$").
- Reply(200).
- JSON(`{
- "data": {
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "Permissions.Modify": 1,
- "VM.Audit": 1,
- "VM.Snapshot": 1,
- "Datastore.Audit": 1,
- "VM.Config.Network": 1,
- "Pool.Audit": 1,
- "SDN.Use": 1,
- "Datastore.Allocate": 1,
- "VM.Allocate": 1,
- "VM.Snapshot.Rollback": 1,
- "Sys.Syslog": 1,
- "VM.Config.Disk": 1,
- "VM.Console": 1,
- "VM.Config.CDROM": 1,
- "Realm.AllocateUser": 1,
- "Sys.Audit": 1,
- "Sys.PowerMgmt": 1,
- "Sys.Modify": 1,
- "VM.Monitor": 1,
- "VM.Config.Memory": 1,
- "VM.Backup": 1,
- "Sys.Incoming": 1,
- "VM.Migrate": 1,
- "Realm.Allocate": 1,
- "VM.Config.CPU": 1,
- "User.Modify": 1,
- "VM.Config.HWType": 1,
- "VM.Clone": 1,
- "SDN.Audit": 1,
- "VM.Config.Cloudinit": 1,
- "Group.Allocate": 1,
- "VM.PowerMgmt": 1,
- "Sys.Console": 1,
- "Datastore.AllocateTemplate": 1,
- "Pool.Allocate": 1,
- "VM.Config.Options": 1
- }
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/roles/NoAccess").
- Reply(200).
- JSON(`{
- "data": {}
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/roles$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "roleid": "PVEVMAdmin",
- "privs": "VM.Allocate,VM.Audit,VM.Backup,VM.Clone,VM.Config.CDROM,VM.Config.CPU,VM.Config.Cloudinit,VM.Config.Disk,VM.Config.HWType,VM.Config.Memory,VM.Config.Network,VM.Config.Options,VM.Console,VM.Migrate,VM.Monitor,VM.PowerMgmt,VM.Snapshot,VM.Snapshot.Rollback",
- "special": 1
- },
- {
- "roleid": "PVEDatastoreAdmin",
- "special": 1,
- "privs": "Datastore.Allocate,Datastore.AllocateSpace,Datastore.AllocateTemplate,Datastore.Audit"
- },
- {
- "roleid": "PVEPoolUser",
- "privs": "Pool.Audit",
- "special": 1
- },
- {
- "special": 1,
- "privs": "",
- "roleid": "NoAccess"
- },
- {
- "roleid": "PVEAuditor",
- "privs": "Datastore.Audit,Pool.Audit,SDN.Audit,Sys.Audit,VM.Audit",
- "special": 1
- },
- {
- "privs": "Permissions.Modify,Sys.Audit,Sys.Console,Sys.Syslog",
- "special": 1,
- "roleid": "PVESysAdmin"
- },
- {
- "special": 1,
- "privs": "Datastore.AllocateSpace,Datastore.Audit",
- "roleid": "PVEDatastoreUser"
- },
- {
- "roleid": "Administrator",
- "special": 1,
- "privs": "Datastore.Allocate,Datastore.AllocateSpace,Datastore.AllocateTemplate,Datastore.Audit,Group.Allocate,Permissions.Modify,Pool.Allocate,Pool.Audit,Realm.Allocate,Realm.AllocateUser,SDN.Allocate,SDN.Audit,SDN.Use,Sys.Audit,Sys.Console,Sys.Incoming,Sys.Modify,Sys.PowerMgmt,Sys.Syslog,User.Modify,VM.Allocate,VM.Audit,VM.Backup,VM.Clone,VM.Config.CDROM,VM.Config.CPU,VM.Config.Cloudinit,VM.Config.Disk,VM.Config.HWType,VM.Config.Memory,VM.Config.Network,VM.Config.Options,VM.Console,VM.Migrate,VM.Monitor,VM.PowerMgmt,VM.Snapshot,VM.Snapshot.Rollback"
- },
- {
- "roleid": "PVETemplateUser",
- "privs": "VM.Audit,VM.Clone",
- "special": 1
- },
- {
- "privs": "SDN.Audit,SDN.Use",
- "special": 1,
- "roleid": "PVESDNUser"
- },
- {
- "special": 1,
- "privs": "Datastore.Allocate,Datastore.AllocateSpace,Datastore.AllocateTemplate,Datastore.Audit,Group.Allocate,Permissions.Modify,Pool.Allocate,Pool.Audit,Realm.AllocateUser,SDN.Allocate,SDN.Audit,SDN.Use,Sys.Audit,Sys.Console,Sys.Syslog,User.Modify,VM.Allocate,VM.Audit,VM.Backup,VM.Clone,VM.Config.CDROM,VM.Config.CPU,VM.Config.Cloudinit,VM.Config.Disk,VM.Config.HWType,VM.Config.Memory,VM.Config.Network,VM.Config.Options,VM.Console,VM.Migrate,VM.Monitor,VM.PowerMgmt,VM.Snapshot,VM.Snapshot.Rollback",
- "roleid": "PVEAdmin"
- },
- {
- "roleid": "test",
- "privs": "Pool.Audit",
- "special": 0
- },
- {
- "special": 1,
- "privs": "VM.Audit,VM.Backup,VM.Config.CDROM,VM.Config.Cloudinit,VM.Console,VM.PowerMgmt",
- "roleid": "PVEVMUser"
- },
- {
- "special": 1,
- "privs": "SDN.Allocate,SDN.Audit,SDN.Use",
- "roleid": "PVESDNAdmin"
- },
- {
- "roleid": "PVEUserAdmin",
- "privs": "Group.Allocate,Realm.AllocateUser,User.Modify",
- "special": 1
- },
- {
- "privs": "Pool.Allocate,Pool.Audit",
- "special": 1,
- "roleid": "PVEPoolAdmin"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Post("^/access/domains").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Put("^/access/domains/test$").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Delete("^/access/domains/test$").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Post("^/access/domains/test$").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Post("^/access/groups").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Put("^/access/groups/groupid").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Delete("^/access/groups/groupid").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Post("^/access/groups/groupid").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Post("^/access/users").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Post("^/access/roles").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Get("^/access/users/test/token").
- Reply(200).
- JSON(`{
- "data": [
- {
- "expire": 100,
- "privsep": 0,
- "tokenid": "test",
- "comment": "comment"
- },
- {
- "expire": 0,
- "privsep": 1,
- "tokenid": "test2",
- "comment": "comment"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/users/root@pam/token/test").
- Reply(200).
- JSON(`{
- "data": {
- "expire": 0,
- "privsep": 0,
- "comment": "comment"
- }
-}`)
-
- gock.New(config.C.URI).
- Post("^/access/users/userid/token/test").
- Reply(200).
- JSON(`{
- "data": {"full-tokenid":"userid!test","value":"tokenvalue"}
-}`)
-
- gock.New(config.C.URI).
- Delete("^/access/users/root@pam/token/test").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Get("^/access/users/userid/tfa").
- Reply(200).
- JSON(`{
- "data": {
- "realm": "pve",
- "types": [
- "oath"
- ],
- "user": "userid"
- }
-}`)
-
- gock.New(config.C.URI).
- Delete("^/access/users/userid/tfa").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Put("^/access/users/userid/token/tokenid").
- Reply(200).
- JSON(`
- "data": {
- "expire": 0,
- "privsep": 0,
- "comment": "comment"
- }
-}`)
-
-}
diff --git a/go-proxmox/tests/mocks/pve8x/ceph.go b/go-proxmox/tests/mocks/pve8x/ceph.go
deleted file mode 100644
index dd20b01..0000000
--- a/go-proxmox/tests/mocks/pve8x/ceph.go
+++ /dev/null
@@ -1,14111 +0,0 @@
-package pve8x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func ceph() {
- gock.New(config.C.URI).
- Get("^/cluster/ceph/status$").
- Reply(200).
- JSON(`{
- "data": {
- "osdmap": {
- "epoch": 33867,
- "num_in_osds": 21,
- "num_osds": 21,
- "osd_up_since": 1739293535,
- "osd_in_since": 1739293526,
- "num_up_osds": 21,
- "num_remapped_pgs": 0
- },
- "pgmap": {
- "bytes_total": 51850204151808,
- "pgs_by_state": [
- {
- "count": 577,
- "state_name": "active+clean"
- }
- ],
- "bytes_used": 31663826219008,
- "write_bytes_sec": 2697932,
- "num_objects": 3059395,
- "read_bytes_sec": 50660,
- "num_pgs": 577,
- "bytes_avail": 20186377932800,
- "read_op_per_sec": 3,
- "write_op_per_sec": 211,
- "num_pools": 4,
- "data_bytes": 10589439042005
- },
- "quorum_names": [
- "proxmox-node01",
- "proxmox-node03",
- "proxmox-node02"
- ],
- "fsmap": {
- "by_rank": [
- {
- "gid": 179774420,
- "filesystem_id": 2,
- "rank": 0,
- "status": "up:active",
- "name": "proxmox-node03"
- }
- ],
- "up": 1,
- "id": 2,
- "max": 1,
- "up:standby": 2,
- "in": 1,
- "epoch": 921
- },
- "quorum_age": 2408307,
- "monmap": {
- "min_mon_release": 18,
- "tiebreaker_mon": "",
- "min_mon_release_name": "reef",
- "quorum": [
- 0,
- 1,
- 2
- ],
- "election_strategy": 1,
- "disallowed_leaders: ": "",
- "modified": "2024-10-11T11:47:35.121704Z",
- "features": {
- "persistent": [
- "kraken",
- "luminous",
- "mimic",
- "osdmap-prune",
- "nautilus",
- "octopus",
- "pacific",
- "elector-pinging",
- "quincy",
- "reef"
- ],
- "optional": []
- },
- "fsid": "d11c6ea1-7ab2-41fa-99c5-b85f4d7ffd49",
- "mons": [
- {
- "addr": "192.168.105.90:6789/0",
- "rank": 0,
- "crush_location": "{}",
- "priority": 0,
- "name": "proxmox-node01",
- "weight": 0,
- "public_addrs": {
- "addrvec": [
- {
- "addr": "192.168.105.90:3300",
- "type": "v2",
- "nonce": 0
- },
- {
- "addr": "192.168.105.90:6789",
- "type": "v1",
- "nonce": 0
- }
- ]
- },
- "public_addr": "192.168.105.90:6789/0"
- },
- {
- "rank": 1,
- "addr": "192.168.105.92:6789/0",
- "crush_location": "{}",
- "priority": 0,
- "name": "proxmox-node03",
- "public_addr": "192.168.105.92:6789/0",
- "public_addrs": {
- "addrvec": [
- {
- "addr": "192.168.105.92:3300",
- "nonce": 0,
- "type": "v2"
- },
- {
- "addr": "192.168.105.92:6789",
- "nonce": 0,
- "type": "v1"
- }
- ]
- },
- "weight": 0
- },
- {
- "rank": 2,
- "addr": "192.168.105.101:6789/0",
- "public_addrs": {
- "addrvec": [
- {
- "addr": "192.168.105.101:3300",
- "type": "v2",
- "nonce": 0
- },
- {
- "type": "v1",
- "nonce": 0,
- "addr": "192.168.105.101:6789"
- }
- ]
- },
- "public_addr": "192.168.105.101:6789/0",
- "weight": 0,
- "name": "proxmox-node02",
- "priority": 0,
- "crush_location": "{}"
- }
- ],
- "stretch_mode": false,
- "removed_ranks: ": "",
- "epoch": 7,
- "created": "2021-09-14T09:08:27.544584Z"
- },
- "servicemap": {
- "modified": "2025-03-11T14:51:38.014476+0100",
- "epoch": 1255207,
- "services": {}
- },
- "progress_events": {},
- "fsid": "d11c6ea1-7ab2-41fa-99c5-b85f4d7ffd49",
- "election_epoch": 5412,
- "quorum": [
- 0,
- 1,
- 2
- ],
- "mgrmap": {
- "active_addr": "192.168.105.101:6859/2343",
- "last_failure_osd_epoch": 32503,
- "standbys": [
- {
- "mgr_features": 4540138322906710015,
- "available_modules": [
- {
- "error_string": "",
- "module_options": {
- "smtp_password": {
- "type": "str",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "Password to authenticate with",
- "name": "smtp_password",
- "max": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "bool",
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced"
- },
- "smtp_host": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "smtp_host",
- "desc": "SMTP server",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "str"
- },
- "smtp_ssl": {
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "Use SSL to connect to SMTP server",
- "name": "smtp_ssl",
- "max": "",
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": []
- },
- "smtp_port": {
- "type": "int",
- "max": "",
- "name": "smtp_port",
- "desc": "SMTP port",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "465"
- },
- "log_to_cluster_level": {
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info"
- },
- "log_to_file": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool"
- },
- "interval": {
- "type": "secs",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "How frequently to reexamine health status",
- "name": "interval",
- "max": "",
- "level": "advanced",
- "default_value": "60",
- "long_desc": "",
- "tags": []
- },
- "smtp_from_name": {
- "type": "str",
- "max": "",
- "name": "smtp_from_name",
- "desc": "Email From: name",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "Ceph"
- },
- "smtp_user": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "name": "smtp_user",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "User to authenticate as",
- "type": "str"
- },
- "smtp_destination": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "smtp_destination",
- "desc": "Email address to send alerts to",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "type": "str"
- },
- "smtp_sender": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "smtp_sender",
- "desc": "SMTP envelope sender",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "str"
- },
- "log_level": {
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- }
- },
- "name": "alerts",
- "can_run": true
- },
- {
- "error_string": "",
- "module_options": {
- "mode": {
- "type": "str",
- "max": "",
- "name": "mode",
- "desc": "Balancer mode",
- "enum_allowed": [
- "crush-compat",
- "none",
- "upmap"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "upmap",
- "level": "advanced"
- },
- "upmap_max_deviation": {
- "default_value": "5",
- "long_desc": "If the number of PGs are within this count then no optimization is attempted",
- "level": "advanced",
- "tags": [],
- "type": "int",
- "name": "upmap_max_deviation",
- "max": "",
- "enum_allowed": [],
- "min": "1",
- "see_also": [],
- "flags": 1,
- "desc": "deviation below which no optimization is attempted"
- },
- "active": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "name": "active",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "automatically balance PGs across cluster",
- "type": "bool"
- },
- "crush_compat_metrics": {
- "tags": [],
- "long_desc": "Value is a list of one or more of \"pgs\", \"objects\", or \"bytes\", and indicates which metrics to use to balance utilization.",
- "default_value": "pgs,objects,bytes",
- "level": "advanced",
- "max": "",
- "name": "crush_compat_metrics",
- "desc": "metrics with which to calculate OSD utilization",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "type": "str"
- },
- "log_to_cluster_level": {
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": "",
- "tags": [],
- "default_value": "info",
- "long_desc": "",
- "level": "advanced"
- },
- "crush_compat_step": {
- "tags": [],
- "level": "advanced",
- "long_desc": ".99 is very aggressive, .01 is less aggressive",
- "default_value": "0.5",
- "max": "0.999",
- "name": "crush_compat_step",
- "desc": "aggressiveness of optimization",
- "flags": 1,
- "min": "0.001",
- "see_also": [],
- "enum_allowed": [],
- "type": "float"
- },
- "crush_compat_max_iterations": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "25",
- "max": "250",
- "name": "crush_compat_max_iterations",
- "desc": "maximum number of iterations to attempt optimization",
- "flags": 1,
- "see_also": [],
- "min": "1",
- "enum_allowed": [],
- "type": "uint"
- },
- "log_to_cluster": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "type": "bool"
- },
- "min_score": {
- "long_desc": "",
- "default_value": "0",
- "level": "advanced",
- "tags": [],
- "name": "min_score",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "minimum score, below which no optimization is attempted",
- "type": "float"
- },
- "sleep_interval": {
- "name": "sleep_interval",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "how frequently to wake up and attempt optimization",
- "type": "secs",
- "long_desc": "",
- "default_value": "60",
- "level": "advanced",
- "tags": []
- },
- "end_time": {
- "max": "",
- "name": "end_time",
- "desc": "ending time of day to automatically balance",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "This is a time of day in the format HHMM.",
- "default_value": "2359"
- },
- "end_weekday": {
- "see_also": [],
- "flags": 1,
- "min": "0",
- "enum_allowed": [],
- "desc": "Restrict automatic balancing to days of the week earlier than this",
- "name": "end_weekday",
- "max": "6",
- "type": "uint",
- "level": "advanced",
- "long_desc": "0 = Sunday, 1 = Monday, etc.",
- "default_value": "0",
- "tags": []
- },
- "log_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "name": "log_level",
- "max": "",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "type": "str"
- },
- "log_to_file": {
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "upmap_max_optimizations": {
- "type": "uint",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "maximum upmap optimizations to make per attempt",
- "name": "upmap_max_optimizations",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "10",
- "tags": []
- },
- "pool_ids": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "max": "",
- "name": "pool_ids",
- "desc": "pools which the automatic balancing will be limited to",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": []
- },
- "begin_time": {
- "type": "str",
- "name": "begin_time",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "beginning time of day to automatically balance",
- "long_desc": "This is a time of day in the format HHMM.",
- "default_value": "0000",
- "level": "advanced",
- "tags": []
- },
- "begin_weekday": {
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "0",
- "desc": "Restrict automatic balancing to this day of the week or later",
- "name": "begin_weekday",
- "max": "6",
- "type": "uint",
- "default_value": "0",
- "long_desc": "0 = Sunday, 1 = Monday, etc.",
- "level": "advanced",
- "tags": []
- }
- },
- "can_run": true,
- "name": "balancer"
- },
- {
- "name": "crash",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "log_level": {
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "log_to_cluster_level": {
- "type": "str",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "default_value": "info",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "warn_recent_interval": {
- "long_desc": "",
- "default_value": "1209600",
- "level": "advanced",
- "tags": [],
- "name": "warn_recent_interval",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "time interval in which to warn about recent crashes",
- "type": "secs"
- },
- "retain_interval": {
- "tags": [],
- "long_desc": "",
- "default_value": "31536000",
- "level": "advanced",
- "type": "secs",
- "desc": "how long to retain crashes before pruning them",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "retain_interval"
- },
- "log_to_cluster": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool"
- },
- "log_to_file": {
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "log_to_file",
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- }
- }
- },
- {
- "module_options": {
- "PWD_POLICY_CHECK_LENGTH_ENABLED": {
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "max": "",
- "name": "PWD_POLICY_CHECK_LENGTH_ENABLED",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "type": "bool"
- },
- "redirect_resolve_ip_addr": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "type": "bool",
- "name": "redirect_resolve_ip_addr",
- "max": "",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": ""
- },
- "server_port": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "8080",
- "type": "int",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "server_port"
- },
- "PWD_POLICY_MIN_COMPLEXITY": {
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "PWD_POLICY_MIN_COMPLEXITY",
- "type": "int",
- "tags": [],
- "long_desc": "",
- "default_value": "10",
- "level": "advanced"
- },
- "FEATURE_TOGGLE_RGW": {
- "type": "bool",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "FEATURE_TOGGLE_RGW",
- "tags": [],
- "level": "advanced",
- "default_value": "True",
- "long_desc": ""
- },
- "jwt_token_ttl": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "28800",
- "tags": [],
- "name": "jwt_token_ttl",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "int"
- },
- "motd": {
- "desc": "The message of the day",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "motd",
- "type": "str",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "url_prefix": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "name": "url_prefix",
- "max": ""
- },
- "USER_PWD_EXPIRATION_WARNING_2": {
- "name": "USER_PWD_EXPIRATION_WARNING_2",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "int",
- "level": "advanced",
- "long_desc": "",
- "default_value": "5",
- "tags": []
- },
- "server_addr": {
- "name": "server_addr",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "type": "str",
- "long_desc": "",
- "default_value": "::",
- "level": "advanced",
- "tags": []
- },
- "GRAFANA_API_SSL_VERIFY": {
- "level": "advanced",
- "default_value": "True",
- "long_desc": "",
- "tags": [],
- "type": "bool",
- "name": "GRAFANA_API_SSL_VERIFY",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": ""
- },
- "PROMETHEUS_API_HOST": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "name": "PROMETHEUS_API_HOST",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "type": "str"
- },
- "ISCSI_API_SSL_VERIFICATION": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "tags": [],
- "type": "bool",
- "name": "ISCSI_API_SSL_VERIFICATION",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": ""
- },
- "ENABLE_BROWSABLE_API": {
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "ENABLE_BROWSABLE_API",
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced"
- },
- "UNSAFE_TLS_v1_2": {
- "type": "bool",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "UNSAFE_TLS_v1_2",
- "max": "",
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": []
- },
- "GRAFANA_API_USERNAME": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "admin",
- "tags": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "GRAFANA_API_USERNAME",
- "max": "",
- "type": "str"
- },
- "ALERTMANAGER_API_HOST": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "ALERTMANAGER_API_HOST"
- },
- "FEATURE_TOGGLE_ISCSI": {
- "max": "",
- "name": "FEATURE_TOGGLE_ISCSI",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "type": "bool",
- "tags": [],
- "default_value": "True",
- "long_desc": "",
- "level": "advanced"
- },
- "USER_PWD_EXPIRATION_SPAN": {
- "long_desc": "",
- "default_value": "0",
- "level": "advanced",
- "tags": [],
- "name": "USER_PWD_EXPIRATION_SPAN",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "type": "int"
- },
- "RGW_API_SECRET_KEY": {
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": [],
- "type": "str",
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "name": "RGW_API_SECRET_KEY",
- "max": ""
- },
- "USER_PWD_EXPIRATION_WARNING_1": {
- "default_value": "10",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "name": "USER_PWD_EXPIRATION_WARNING_1",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "type": "int"
- },
- "RGW_API_ADMIN_RESOURCE": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "admin",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "max": "",
- "name": "RGW_API_ADMIN_RESOURCE",
- "type": "str"
- },
- "RGW_API_SSL_VERIFY": {
- "default_value": "True",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "name": "RGW_API_SSL_VERIFY",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "type": "bool"
- },
- "FEATURE_TOGGLE_MIRRORING": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "name": "FEATURE_TOGGLE_MIRRORING",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "desc": "",
- "type": "bool"
- },
- "cross_origin_url": {
- "name": "cross_origin_url",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "AUDIT_API_ENABLED": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "AUDIT_API_ENABLED",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0
- },
- "GRAFANA_FRONTEND_API_URL": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "GRAFANA_FRONTEND_API_URL",
- "max": "",
- "type": "str"
- },
- "standby_behaviour": {
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "error",
- "redirect"
- ],
- "flags": 0,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "standby_behaviour",
- "tags": [],
- "long_desc": "",
- "default_value": "redirect",
- "level": "advanced"
- },
- "GANESHA_CLUSTERS_RADOS_POOL_NAMESPACE": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "GANESHA_CLUSTERS_RADOS_POOL_NAMESPACE",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "type": "str"
- },
- "log_to_file": {
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "ACCOUNT_LOCKOUT_ATTEMPTS": {
- "level": "advanced",
- "default_value": "10",
- "long_desc": "",
- "tags": [],
- "type": "int",
- "name": "ACCOUNT_LOCKOUT_ATTEMPTS",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": ""
- },
- "GRAFANA_API_PASSWORD": {
- "type": "str",
- "name": "GRAFANA_API_PASSWORD",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "desc": "",
- "long_desc": "",
- "default_value": "admin",
- "level": "advanced",
- "tags": []
- },
- "AUDIT_API_LOG_PAYLOAD": {
- "tags": [],
- "default_value": "True",
- "long_desc": "",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "AUDIT_API_LOG_PAYLOAD",
- "type": "bool"
- },
- "log_to_cluster_level": {
- "name": "log_to_cluster_level",
- "max": "",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- },
- "GRAFANA_API_URL": {
- "type": "str",
- "name": "GRAFANA_API_URL",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "PWD_POLICY_CHECK_OLDPWD_ENABLED": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "name": "PWD_POLICY_CHECK_OLDPWD_ENABLED",
- "max": "",
- "type": "bool"
- },
- "debug": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "debug",
- "desc": "Enable/disable debug options",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": []
- },
- "ALERTMANAGER_API_SSL_VERIFY": {
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "ALERTMANAGER_API_SSL_VERIFY",
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced"
- },
- "FEATURE_TOGGLE_DASHBOARD": {
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "max": "",
- "name": "FEATURE_TOGGLE_DASHBOARD",
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced"
- },
- "PWD_POLICY_CHECK_EXCLUSION_LIST_ENABLED": {
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "PWD_POLICY_CHECK_EXCLUSION_LIST_ENABLED",
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": ""
- },
- "PWD_POLICY_CHECK_REPETITIVE_CHARS_ENABLED": {
- "type": "bool",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "PWD_POLICY_CHECK_REPETITIVE_CHARS_ENABLED",
- "max": "",
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": []
- },
- "log_level": {
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "PWD_POLICY_EXCLUSION_LIST": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "osd,host,dashboard,pool,block,nfs,ceph,monitors,gateway,logs,crush,maps",
- "type": "str",
- "max": "",
- "name": "PWD_POLICY_EXCLUSION_LIST",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": []
- },
- "FEATURE_TOGGLE_CEPHFS": {
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "max": "",
- "name": "FEATURE_TOGGLE_CEPHFS"
- },
- "PWD_POLICY_MIN_LENGTH": {
- "max": "",
- "name": "PWD_POLICY_MIN_LENGTH",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "type": "int",
- "tags": [],
- "long_desc": "",
- "default_value": "8",
- "level": "advanced"
- },
- "REST_REQUESTS_TIMEOUT": {
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "REST_REQUESTS_TIMEOUT",
- "type": "int",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "45"
- },
- "ISSUE_TRACKER_API_KEY": {
- "type": "str",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "ISSUE_TRACKER_API_KEY",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "crt_file": {
- "type": "str",
- "max": "",
- "name": "crt_file",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "standby_error_status_code": {
- "name": "standby_error_status_code",
- "max": "599",
- "flags": 0,
- "min": "400",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "int",
- "level": "advanced",
- "long_desc": "",
- "default_value": "500",
- "tags": []
- },
- "PWD_POLICY_ENABLED": {
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "max": "",
- "name": "PWD_POLICY_ENABLED",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "type": "bool"
- },
- "PROMETHEUS_API_SSL_VERIFY": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "name": "PROMETHEUS_API_SSL_VERIFY",
- "max": "",
- "type": "bool"
- },
- "PWD_POLICY_CHECK_COMPLEXITY_ENABLED": {
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "max": "",
- "name": "PWD_POLICY_CHECK_COMPLEXITY_ENABLED",
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "PWD_POLICY_CHECK_USERNAME_ENABLED": {
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "PWD_POLICY_CHECK_USERNAME_ENABLED",
- "type": "bool"
- },
- "RGW_API_ACCESS_KEY": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "RGW_API_ACCESS_KEY",
- "type": "str"
- },
- "GRAFANA_UPDATE_DASHBOARDS": {
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": [],
- "type": "bool",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "name": "GRAFANA_UPDATE_DASHBOARDS",
- "max": ""
- },
- "ssl_server_port": {
- "type": "int",
- "name": "ssl_server_port",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "long_desc": "",
- "default_value": "8443",
- "level": "advanced",
- "tags": []
- },
- "ssl": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "ssl",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": ""
- },
- "PWD_POLICY_CHECK_SEQUENTIAL_CHARS_ENABLED": {
- "type": "bool",
- "max": "",
- "name": "PWD_POLICY_CHECK_SEQUENTIAL_CHARS_ENABLED",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "FEATURE_TOGGLE_RBD": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "max": "",
- "name": "FEATURE_TOGGLE_RBD",
- "desc": "",
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "type": "bool"
- },
- "FEATURE_TOGGLE_NFS": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "type": "bool",
- "max": "",
- "name": "FEATURE_TOGGLE_NFS",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": []
- },
- "key_file": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "desc": "",
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "key_file",
- "type": "str"
- },
- "log_to_cluster": {
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "max": "",
- "name": "log_to_cluster",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- }
- },
- "error_string": "",
- "name": "dashboard",
- "can_run": true
- },
- {
- "module_options": {
- "enable_monitoring": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "tags": [],
- "type": "bool",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "desc": "monitor device health metrics",
- "name": "enable_monitoring",
- "max": ""
- },
- "retention_period": {
- "type": "secs",
- "max": "",
- "name": "retention_period",
- "desc": "how long to retain device health metrics",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "15552000"
- },
- "scrape_frequency": {
- "tags": [],
- "long_desc": "",
- "default_value": "86400",
- "level": "advanced",
- "desc": "how frequently to scrape device health metrics",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "scrape_frequency",
- "type": "secs"
- },
- "self_heal": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "preemptively heal cluster around devices that may fail",
- "name": "self_heal",
- "max": "",
- "type": "bool"
- },
- "pool_name": {
- "max": "",
- "name": "pool_name",
- "desc": "name of pool in which to store device health metrics",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "default_value": "device_health_metrics",
- "long_desc": ""
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "default_value": "info",
- "long_desc": "",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ]
- },
- "log_level": {
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "log_level",
- "max": "",
- "type": "str",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_file": {
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "mark_out_threshold": {
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "automatically mark OSD if it may fail before this long",
- "name": "mark_out_threshold",
- "max": "",
- "type": "secs",
- "long_desc": "",
- "default_value": "2419200",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "warn_threshold": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "7257600",
- "max": "",
- "name": "warn_threshold",
- "desc": "raise health warning if OSD may fail before this long",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "type": "secs"
- },
- "sleep_interval": {
- "tags": [],
- "long_desc": "",
- "default_value": "600",
- "level": "advanced",
- "desc": "how frequently to wake up and check device health",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "sleep_interval",
- "type": "secs"
- }
- },
- "error_string": "",
- "name": "devicehealth",
- "can_run": true
- },
- {
- "error_string": "influxdb python module not found",
- "module_options": {
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "type": "str"
- },
- "password": {
- "desc": "password of InfluxDB server user",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "password",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "verify_ssl": {
- "long_desc": "",
- "default_value": "true",
- "level": "advanced",
- "tags": [],
- "name": "verify_ssl",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "Verify https cert for InfluxDB server. Use \"true\" or \"false\".",
- "type": "str"
- },
- "username": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "username of InfluxDB server user",
- "name": "username",
- "max": "",
- "type": "str"
- },
- "port": {
- "type": "int",
- "name": "port",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "InfluxDB server port",
- "level": "advanced",
- "default_value": "8086",
- "long_desc": "",
- "tags": []
- },
- "hostname": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "max": "",
- "name": "hostname",
- "desc": "InfluxDB server hostname",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": []
- },
- "ssl": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "false",
- "tags": [],
- "name": "ssl",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "Use https connection for InfluxDB server. Use \"true\" or \"false\".",
- "type": "str"
- },
- "batch_size": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "5000",
- "desc": "How big batches of data points should be when sending to InfluxDB.",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "batch_size",
- "type": "int"
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_cluster",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": ""
- },
- "threads": {
- "long_desc": "",
- "default_value": "5",
- "level": "advanced",
- "tags": [],
- "name": "threads",
- "max": "32",
- "enum_allowed": [],
- "min": "1",
- "see_also": [],
- "flags": 0,
- "desc": "How many worker threads should be spawned for sending data to InfluxDB.",
- "type": "int"
- },
- "log_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "log_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "type": "str"
- },
- "database": {
- "tags": [],
- "long_desc": "",
- "default_value": "ceph",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "database",
- "desc": "InfluxDB database name. You will need to create this database and grant write privileges to the configured username or the username must have admin privileges to create it.",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0
- },
- "interval": {
- "long_desc": "",
- "default_value": "30",
- "level": "advanced",
- "tags": [],
- "name": "interval",
- "max": "",
- "enum_allowed": [],
- "min": "5",
- "flags": 0,
- "see_also": [],
- "desc": "Time between reports to InfluxDB. Default 30 seconds.",
- "type": "secs"
- },
- "log_to_file": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": []
- }
- },
- "name": "influx",
- "can_run": false
- },
- {
- "can_run": true,
- "name": "insights",
- "error_string": "",
- "module_options": {
- "log_level": {
- "type": "str",
- "max": "",
- "name": "log_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "log_to_cluster_level": {
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "default_value": "info",
- "long_desc": ""
- },
- "log_to_cluster": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "type": "bool",
- "name": "log_to_cluster",
- "max": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": ""
- },
- "log_to_file": {
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "bool",
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced"
- }
- }
- },
- {
- "module_options": {
- "log_to_cluster": {
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "type": "bool"
- },
- "log_to_file": {
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "log_level": {
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "",
- "type": "str",
- "default_value": "",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster_level": {
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "",
- "name": "log_to_cluster_level",
- "max": ""
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "iostat"
- },
- {
- "module_options": {
- "pg_num": {
- "type": "int",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "default pg_num for any created local pool",
- "name": "pg_num",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "128",
- "tags": []
- },
- "min_size": {
- "max": "",
- "name": "min_size",
- "desc": "default min_size for any created local pool",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "type": "int",
- "tags": [],
- "long_desc": "value to set min_size to (unchanged from Ceph's default if this option is not set)",
- "default_value": "",
- "level": "advanced"
- },
- "num_rep": {
- "name": "num_rep",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "desc": "default replica count for any created local pool",
- "type": "int",
- "level": "advanced",
- "default_value": "3",
- "long_desc": "",
- "tags": []
- },
- "failure_domain": {
- "max": "",
- "name": "failure_domain",
- "desc": "failure domain for any created local pool",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "default_value": "host",
- "long_desc": "what failure domain we should separate data replicas across."
- },
- "log_to_cluster": {
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": ""
- },
- "log_to_file": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": ""
- },
- "log_level": {
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "log_level",
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "prefix": {
- "type": "str",
- "desc": "name prefix for any created local pool",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "prefix",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str"
- },
- "subtree": {
- "tags": [],
- "level": "advanced",
- "long_desc": "which CRUSH subtree type the module should create a pool for.",
- "default_value": "rack",
- "desc": "CRUSH level for which to create a local pool",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "subtree",
- "type": "str"
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "localpool"
- },
- {
- "module_options": {
- "log_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "log_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": "",
- "type": "str"
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": ""
- },
- "log_to_cluster": {
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "log_to_file": {
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- }
- },
- "error_string": "",
- "name": "mirroring",
- "can_run": true
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_file": {
- "type": "bool",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": [],
- "type": "bool",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": ""
- },
- "log_to_cluster_level": {
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- },
- "log_level": {
- "default_value": "",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "",
- "type": "str"
- }
- },
- "name": "nfs",
- "can_run": true
- },
- {
- "module_options": {
- "log_level": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": ""
- },
- "fail_fs": {
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "type": "bool",
- "max": "",
- "name": "fail_fs",
- "desc": "Fail filesystem for rapid multi-rank mds upgrade",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": []
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "default_value": "info",
- "long_desc": "",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ]
- },
- "orchestrator": {
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [
- "cephadm",
- "rook",
- "test_orchestrator"
- ],
- "desc": "Orchestrator backend",
- "name": "orchestrator",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "log_to_file": {
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "orchestrator"
- },
- {
- "name": "osd_perf_query",
- "can_run": true,
- "module_options": {
- "log_to_cluster_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": [],
- "type": "str",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": ""
- },
- "log_level": {
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced",
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "log_level"
- },
- "log_to_file": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "log_to_file",
- "type": "bool"
- },
- "log_to_cluster": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "log_to_cluster"
- }
- },
- "error_string": ""
- },
- {
- "name": "osd_support",
- "can_run": true,
- "module_options": {
- "log_level": {
- "max": "",
- "name": "log_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1,
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "log_to_cluster_level": {
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "name": "log_to_cluster_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": ""
- },
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "log_to_file": {
- "name": "log_to_file",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": "",
- "type": "bool",
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": []
- }
- },
- "error_string": ""
- },
- {
- "name": "pg_autoscaler",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "sleep_interval": {
- "name": "sleep_interval",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "type": "secs",
- "long_desc": "",
- "default_value": "60",
- "level": "advanced",
- "tags": []
- },
- "threshold": {
- "type": "float",
- "enum_allowed": [],
- "min": "1.0",
- "see_also": [],
- "flags": 0,
- "desc": "scaling threshold",
- "name": "threshold",
- "max": "",
- "long_desc": "The factor by which the 'NEW PG_NUM' must vary from the current 'PG_NUM' before being accepted. Cannot be less than 1.0",
- "default_value": "3.0",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "name": "log_to_cluster",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "type": "bool"
- },
- "log_to_file": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": ""
- },
- "log_level": {
- "type": "str",
- "max": "",
- "name": "log_level",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "log_to_cluster_level": {
- "type": "str",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- }
- }
- },
- {
- "name": "progress",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "sleep_interval": {
- "max": "",
- "name": "sleep_interval",
- "desc": "how long the module is going to sleep",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "type": "secs",
- "tags": [],
- "default_value": "5",
- "long_desc": "",
- "level": "advanced"
- },
- "max_completed_events": {
- "max": "",
- "name": "max_completed_events",
- "desc": "number of past completed events to remember",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "int",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "50"
- },
- "log_to_cluster": {
- "type": "bool",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "enabled": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "enabled",
- "max": ""
- },
- "allow_pg_recovery_event": {
- "max": "",
- "name": "allow_pg_recovery_event",
- "desc": "allow the module to show pg recovery progress",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": ""
- },
- "log_to_file": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool"
- },
- "log_level": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_level",
- "max": ""
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "type": "str",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level"
- }
- }
- },
- {
- "can_run": true,
- "name": "prometheus",
- "module_options": {
- "cache": {
- "tags": [],
- "default_value": "True",
- "long_desc": "",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "cache",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0
- },
- "stale_cache_strategy": {
- "name": "stale_cache_strategy",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "log",
- "tags": []
- },
- "server_port": {
- "long_desc": "",
- "default_value": "9283",
- "level": "advanced",
- "tags": [],
- "type": "int",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "the port on which the module listens for HTTP requests",
- "name": "server_port",
- "max": ""
- },
- "log_to_file": {
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "standby_error_status_code": {
- "type": "int",
- "flags": 1,
- "min": "400",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "standby_error_status_code",
- "max": "599",
- "level": "advanced",
- "default_value": "500",
- "long_desc": "",
- "tags": []
- },
- "scrape_interval": {
- "type": "float",
- "name": "scrape_interval",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "default_value": "15.0",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "log_level": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "type": "str"
- },
- "standby_behaviour": {
- "desc": "",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [
- "default",
- "error"
- ],
- "max": "",
- "name": "standby_behaviour",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "default"
- },
- "server_addr": {
- "tags": [],
- "long_desc": "",
- "default_value": "::",
- "level": "advanced",
- "type": "str",
- "desc": "the IPv4 or IPv6 address on which the module listens for HTTP requests",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "server_addr"
- },
- "log_to_cluster": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "max": "",
- "name": "log_to_cluster"
- },
- "rbd_stats_pools": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "rbd_stats_pools",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "type": "str"
- },
- "log_to_cluster_level": {
- "type": "str",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "default_value": "info",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "rbd_stats_pools_refresh_interval": {
- "type": "int",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "rbd_stats_pools_refresh_interval",
- "max": "",
- "level": "advanced",
- "default_value": "300",
- "long_desc": "",
- "tags": []
- },
- "exclude_perf_counters": {
- "type": "bool",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [],
- "desc": "Do not include perf-counters in the metrics output",
- "name": "exclude_perf_counters",
- "max": "",
- "level": "advanced",
- "long_desc": "Gathering perf-counters from a single Prometheus exporter can degrade ceph-mgr performance, especially in large clusters. Instead, Ceph-exporter daemons are now used by default for perf-counter gathering. This should only be disabled when no ceph-exporters are deployed.",
- "default_value": "True",
- "tags": []
- }
- },
- "error_string": ""
- },
- {
- "can_run": true,
- "name": "rbd_support",
- "error_string": "",
- "module_options": {
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1,
- "type": "str"
- },
- "mirror_snapshot_schedule": {
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "mirror_snapshot_schedule",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": ""
- },
- "trash_purge_schedule": {
- "type": "str",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "trash_purge_schedule",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "log_level": {
- "max": "",
- "name": "log_level",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "max_concurrent_snap_create": {
- "tags": [],
- "long_desc": "",
- "default_value": "10",
- "level": "advanced",
- "type": "int",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "max_concurrent_snap_create"
- },
- "log_to_file": {
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "log_to_file",
- "type": "bool"
- },
- "log_to_cluster": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "max": "",
- "name": "log_to_cluster"
- }
- }
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "desc": "",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str"
- },
- "log_level": {
- "type": "str",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_level",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "enable_auth": {
- "type": "bool",
- "name": "enable_auth",
- "max": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "tags": []
- },
- "server_port": {
- "max": "",
- "name": "server_port",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "type": "str",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "log_to_file": {
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool"
- },
- "server_addr": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "server_addr",
- "type": "str"
- },
- "log_to_cluster": {
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "key_file": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "type": "str",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "key_file",
- "max": ""
- }
- },
- "can_run": true,
- "name": "restful"
- },
- {
- "can_run": true,
- "name": "selftest",
- "module_options": {
- "rwoption5": {
- "max": "",
- "name": "rwoption5",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "testkey": {
- "name": "testkey",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "roption2": {
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "roption2",
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "xyz",
- "level": "advanced"
- },
- "testnewline": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "type": "str",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "testnewline"
- },
- "rwoption4": {
- "type": "str",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "name": "rwoption4",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "log_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1,
- "max": "",
- "name": "log_level"
- },
- "log_to_file": {
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool",
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "testlkey": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "testlkey",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "type": "str"
- },
- "roption1": {
- "type": "str",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "max": "",
- "name": "roption1",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "rwoption2": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "type": "int",
- "max": "",
- "name": "rwoption2",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": []
- },
- "rwoption3": {
- "type": "float",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "name": "rwoption3",
- "max": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "rwoption1": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "desc": "",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "rwoption1"
- },
- "log_to_cluster_level": {
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced"
- },
- "rwoption6": {
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "max": "",
- "name": "rwoption6",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "type": "bool"
- },
- "rwoption7": {
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": [],
- "type": "int",
- "name": "rwoption7",
- "max": "42",
- "see_also": [],
- "min": "1",
- "flags": 0,
- "enum_allowed": [],
- "desc": ""
- },
- "log_to_cluster": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "name": "log_to_cluster",
- "max": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "bool"
- }
- },
- "error_string": ""
- },
- {
- "module_options": {
- "dump_on_update": {
- "type": "bool",
- "desc": "dump database to debug log on update",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "max": "",
- "name": "dump_on_update",
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced"
- },
- "log_level": {
- "max": "",
- "name": "log_level",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": ""
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": []
- },
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "allow_m_granularity": {
- "type": "bool",
- "desc": "allow minute scheduled snapshots",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "max": "",
- "name": "allow_m_granularity",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "log_to_file": {
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "snap_schedule"
- },
- {
- "module_options": {
- "log_level": {
- "type": "str",
- "max": "",
- "name": "log_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "log_to_cluster_level": {
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1,
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced"
- },
- "log_to_cluster": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool"
- },
- "log_to_file": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "log_to_file"
- }
- },
- "error_string": "",
- "name": "stats",
- "can_run": true
- },
- {
- "name": "status",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "log_to_file": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool"
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_cluster",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": ""
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": []
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "max": "",
- "name": "log_level",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str"
- }
- }
- },
- {
- "module_options": {
- "log_level": {
- "type": "str",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "log_to_cluster_level": {
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- },
- "log_to_cluster": {
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "log_to_file": {
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "interval": {
- "tags": [],
- "level": "advanced",
- "default_value": "15",
- "long_desc": "",
- "type": "secs",
- "max": "",
- "name": "interval",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": []
- },
- "address": {
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "name": "address",
- "max": "",
- "type": "str",
- "level": "advanced",
- "default_value": "unixgram:///tmp/telegraf.sock",
- "long_desc": "",
- "tags": []
- }
- },
- "error_string": "",
- "name": "telegraf",
- "can_run": true
- },
- {
- "name": "telemetry",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "channel_device": {
- "level": "advanced",
- "default_value": "True",
- "long_desc": "",
- "tags": [],
- "type": "bool",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "Share device health metrics (e.g., SMART data, minus potentially identifying info like serial numbers)",
- "name": "channel_device",
- "max": ""
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": []
- },
- "leaderboard_description": {
- "type": "str",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "leaderboard_description",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "channel_perf": {
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": [],
- "type": "bool",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "Share various performance metrics of a cluster",
- "name": "channel_perf",
- "max": ""
- },
- "log_to_cluster": {
- "type": "bool",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "log_to_cluster",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "channel_basic": {
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "Share basic cluster information (size, version)",
- "name": "channel_basic",
- "max": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": []
- },
- "organization": {
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "organization",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "last_opt_revision": {
- "max": "",
- "name": "last_opt_revision",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "int",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "1"
- },
- "device_url": {
- "tags": [],
- "long_desc": "",
- "default_value": "https://telemetry.ceph.com/device",
- "level": "advanced",
- "max": "",
- "name": "device_url",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "type": "str"
- },
- "proxy": {
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "desc": "",
- "name": "proxy",
- "max": "",
- "type": "str",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "leaderboard": {
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": [],
- "name": "leaderboard",
- "max": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "bool"
- },
- "channel_ident": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "type": "bool",
- "max": "",
- "name": "channel_ident",
- "desc": "Share a user-provided description and/or contact email for the cluster",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": []
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "max": "",
- "name": "log_level",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ]
- },
- "log_to_file": {
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "interval": {
- "long_desc": "",
- "default_value": "24",
- "level": "advanced",
- "tags": [],
- "type": "int",
- "name": "interval",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "8",
- "see_also": [],
- "desc": ""
- },
- "contact": {
- "desc": "",
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "contact",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "enabled": {
- "type": "bool",
- "name": "enabled",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "desc": "",
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "url": {
- "max": "",
- "name": "url",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "type": "str",
- "tags": [],
- "default_value": "https://telemetry.ceph.com/report",
- "long_desc": "",
- "level": "advanced"
- },
- "description": {
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "description",
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "channel_crash": {
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "channel_crash",
- "desc": "Share metadata about Ceph daemon crashes (version, stack straces, etc)",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": []
- }
- }
- },
- {
- "name": "test_orchestrator",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "log_to_file": {
- "type": "bool",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": []
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "max": "",
- "name": "log_level",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ]
- },
- "log_to_cluster_level": {
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "name": "log_to_cluster_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": ""
- }
- }
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_file": {
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool"
- },
- "max_concurrent_clones": {
- "type": "int",
- "name": "max_concurrent_clones",
- "max": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "Number of asynchronous cloner threads",
- "level": "advanced",
- "default_value": "4",
- "long_desc": "",
- "tags": []
- },
- "log_to_cluster_level": {
- "name": "log_to_cluster_level",
- "max": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- },
- "snapshot_clone_delay": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "0",
- "type": "int",
- "desc": "Delay clone begin operation by snapshot_clone_delay seconds",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "snapshot_clone_delay"
- },
- "log_level": {
- "type": "str",
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- }
- },
- "name": "volumes",
- "can_run": true
- },
- {
- "error_string": "",
- "module_options": {
- "log_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "type": "str",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_level",
- "max": ""
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": []
- },
- "discovery_interval": {
- "level": "advanced",
- "default_value": "100",
- "long_desc": "",
- "tags": [],
- "type": "uint",
- "name": "discovery_interval",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": ""
- },
- "zabbix_port": {
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "zabbix_port",
- "max": "",
- "type": "int",
- "level": "advanced",
- "default_value": "10051",
- "long_desc": "",
- "tags": []
- },
- "identifier": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "desc": "",
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "identifier",
- "type": "str"
- },
- "zabbix_host": {
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced",
- "max": "",
- "name": "zabbix_host",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "type": "str"
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool"
- },
- "zabbix_sender": {
- "default_value": "/usr/bin/zabbix_sender",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "name": "zabbix_sender",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "desc": ""
- },
- "log_to_file": {
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "interval": {
- "tags": [],
- "long_desc": "",
- "default_value": "60",
- "level": "advanced",
- "type": "secs",
- "max": "",
- "name": "interval",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": []
- }
- },
- "can_run": true,
- "name": "zabbix"
- }
- ],
- "gid": 179843533,
- "name": "proxmox-node03"
- },
- {
- "name": "proxmox-node01",
- "mgr_features": 4540138322906710015,
- "gid": 179864286,
- "available_modules": [
- {
- "name": "alerts",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "max": "",
- "name": "log_to_cluster_level"
- },
- "smtp_port": {
- "level": "advanced",
- "default_value": "465",
- "long_desc": "",
- "tags": [],
- "name": "smtp_port",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": "SMTP port",
- "type": "int"
- },
- "smtp_ssl": {
- "level": "advanced",
- "default_value": "True",
- "long_desc": "",
- "tags": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "Use SSL to connect to SMTP server",
- "name": "smtp_ssl",
- "max": "",
- "type": "bool"
- },
- "smtp_host": {
- "type": "str",
- "desc": "SMTP server",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "smtp_host",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool"
- },
- "smtp_password": {
- "type": "str",
- "desc": "Password to authenticate with",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "smtp_password",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "max": "",
- "name": "log_level",
- "desc": "",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str"
- },
- "smtp_sender": {
- "max": "",
- "name": "smtp_sender",
- "desc": "SMTP envelope sender",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "smtp_destination": {
- "desc": "Email address to send alerts to",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "smtp_destination",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "smtp_user": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "max": "",
- "name": "smtp_user",
- "desc": "User to authenticate as",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": []
- },
- "smtp_from_name": {
- "type": "str",
- "max": "",
- "name": "smtp_from_name",
- "desc": "Email From: name",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "default_value": "Ceph",
- "long_desc": ""
- },
- "interval": {
- "max": "",
- "name": "interval",
- "desc": "How frequently to reexamine health status",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "secs",
- "tags": [],
- "long_desc": "",
- "default_value": "60",
- "level": "advanced"
- },
- "log_to_file": {
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- }
- }
- },
- {
- "can_run": true,
- "name": "balancer",
- "error_string": "",
- "module_options": {
- "end_time": {
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [],
- "desc": "ending time of day to automatically balance",
- "name": "end_time",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "This is a time of day in the format HHMM.",
- "default_value": "2359",
- "tags": []
- },
- "end_weekday": {
- "level": "advanced",
- "long_desc": "0 = Sunday, 1 = Monday, etc.",
- "default_value": "0",
- "tags": [],
- "name": "end_weekday",
- "max": "6",
- "min": "0",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "Restrict automatic balancing to days of the week earlier than this",
- "type": "uint"
- },
- "log_level": {
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "type": "str",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_file": {
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "upmap_max_optimizations": {
- "type": "uint",
- "name": "upmap_max_optimizations",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": "maximum upmap optimizations to make per attempt",
- "level": "advanced",
- "default_value": "10",
- "long_desc": "",
- "tags": []
- },
- "begin_time": {
- "type": "str",
- "name": "begin_time",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "beginning time of day to automatically balance",
- "long_desc": "This is a time of day in the format HHMM.",
- "default_value": "0000",
- "level": "advanced",
- "tags": []
- },
- "begin_weekday": {
- "default_value": "0",
- "long_desc": "0 = Sunday, 1 = Monday, etc.",
- "level": "advanced",
- "tags": [],
- "type": "uint",
- "enum_allowed": [],
- "min": "0",
- "see_also": [],
- "flags": 1,
- "desc": "Restrict automatic balancing to this day of the week or later",
- "name": "begin_weekday",
- "max": "6"
- },
- "pool_ids": {
- "max": "",
- "name": "pool_ids",
- "desc": "pools which the automatic balancing will be limited to",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "type": "str",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "upmap_max_deviation": {
- "tags": [],
- "long_desc": "If the number of PGs are within this count then no optimization is attempted",
- "default_value": "5",
- "level": "advanced",
- "max": "",
- "name": "upmap_max_deviation",
- "desc": "deviation below which no optimization is attempted",
- "enum_allowed": [],
- "min": "1",
- "flags": 1,
- "see_also": [],
- "type": "int"
- },
- "active": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "tags": [],
- "type": "bool",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [],
- "desc": "automatically balance PGs across cluster",
- "name": "active",
- "max": ""
- },
- "mode": {
- "name": "mode",
- "max": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "crush-compat",
- "none",
- "upmap"
- ],
- "desc": "Balancer mode",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "upmap",
- "tags": []
- },
- "crush_compat_metrics": {
- "type": "str",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "metrics with which to calculate OSD utilization",
- "name": "crush_compat_metrics",
- "max": "",
- "long_desc": "Value is a list of one or more of \"pgs\", \"objects\", or \"bytes\", and indicates which metrics to use to balance utilization.",
- "default_value": "pgs,objects,bytes",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster_level": {
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "max": "",
- "name": "log_to_cluster_level",
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced"
- },
- "log_to_cluster": {
- "type": "bool",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": ""
- },
- "min_score": {
- "type": "float",
- "desc": "minimum score, below which no optimization is attempted",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "min_score",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "0"
- },
- "crush_compat_max_iterations": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "25",
- "type": "uint",
- "desc": "maximum number of iterations to attempt optimization",
- "flags": 1,
- "see_also": [],
- "min": "1",
- "enum_allowed": [],
- "max": "250",
- "name": "crush_compat_max_iterations"
- },
- "crush_compat_step": {
- "default_value": "0.5",
- "long_desc": ".99 is very aggressive, .01 is less aggressive",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "0.001",
- "desc": "aggressiveness of optimization",
- "name": "crush_compat_step",
- "max": "0.999",
- "type": "float"
- },
- "sleep_interval": {
- "tags": [],
- "long_desc": "",
- "default_value": "60",
- "level": "advanced",
- "desc": "how frequently to wake up and attempt optimization",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "max": "",
- "name": "sleep_interval",
- "type": "secs"
- }
- }
- },
- {
- "module_options": {
- "log_to_file": {
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_cluster",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": ""
- },
- "retain_interval": {
- "default_value": "31536000",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "type": "secs",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "how long to retain crashes before pruning them",
- "name": "retain_interval",
- "max": ""
- },
- "warn_recent_interval": {
- "max": "",
- "name": "warn_recent_interval",
- "desc": "time interval in which to warn about recent crashes",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "type": "secs",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "1209600"
- },
- "log_to_cluster_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "type": "str"
- },
- "log_level": {
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "log_level",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "crash"
- },
- {
- "error_string": "",
- "module_options": {
- "PWD_POLICY_CHECK_REPETITIVE_CHARS_ENABLED": {
- "name": "PWD_POLICY_CHECK_REPETITIVE_CHARS_ENABLED",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "type": "bool",
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "PWD_POLICY_CHECK_EXCLUSION_LIST_ENABLED": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "PWD_POLICY_CHECK_EXCLUSION_LIST_ENABLED",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "desc": ""
- },
- "log_level": {
- "type": "str",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "",
- "name": "log_level",
- "max": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "PWD_POLICY_EXCLUSION_LIST": {
- "long_desc": "",
- "default_value": "osd,host,dashboard,pool,block,nfs,ceph,monitors,gateway,logs,crush,maps",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "name": "PWD_POLICY_EXCLUSION_LIST",
- "max": "",
- "type": "str"
- },
- "FEATURE_TOGGLE_CEPHFS": {
- "type": "bool",
- "name": "FEATURE_TOGGLE_CEPHFS",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": []
- },
- "PWD_POLICY_MIN_LENGTH": {
- "type": "int",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "PWD_POLICY_MIN_LENGTH",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "8",
- "tags": []
- },
- "REST_REQUESTS_TIMEOUT": {
- "type": "int",
- "name": "REST_REQUESTS_TIMEOUT",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "long_desc": "",
- "default_value": "45",
- "level": "advanced",
- "tags": []
- },
- "crt_file": {
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "crt_file",
- "type": "str",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "ISSUE_TRACKER_API_KEY": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "max": "",
- "name": "ISSUE_TRACKER_API_KEY",
- "desc": "",
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "type": "str"
- },
- "standby_error_status_code": {
- "enum_allowed": [],
- "flags": 0,
- "min": "400",
- "see_also": [],
- "desc": "",
- "name": "standby_error_status_code",
- "max": "599",
- "type": "int",
- "long_desc": "",
- "default_value": "500",
- "level": "advanced",
- "tags": []
- },
- "PWD_POLICY_ENABLED": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "tags": [],
- "type": "bool",
- "name": "PWD_POLICY_ENABLED",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": ""
- },
- "PROMETHEUS_API_SSL_VERIFY": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "PROMETHEUS_API_SSL_VERIFY",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "desc": ""
- },
- "PWD_POLICY_CHECK_COMPLEXITY_ENABLED": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "PWD_POLICY_CHECK_COMPLEXITY_ENABLED",
- "max": ""
- },
- "PWD_POLICY_CHECK_USERNAME_ENABLED": {
- "type": "bool",
- "desc": "",
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "PWD_POLICY_CHECK_USERNAME_ENABLED",
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": ""
- },
- "RGW_API_ACCESS_KEY": {
- "type": "str",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "RGW_API_ACCESS_KEY",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "GRAFANA_UPDATE_DASHBOARDS": {
- "type": "bool",
- "max": "",
- "name": "GRAFANA_UPDATE_DASHBOARDS",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "ssl_server_port": {
- "type": "int",
- "max": "",
- "name": "ssl_server_port",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "8443"
- },
- "ssl": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "ssl",
- "type": "bool"
- },
- "PWD_POLICY_CHECK_SEQUENTIAL_CHARS_ENABLED": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "PWD_POLICY_CHECK_SEQUENTIAL_CHARS_ENABLED",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": ""
- },
- "FEATURE_TOGGLE_RBD": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "name": "FEATURE_TOGGLE_RBD",
- "max": ""
- },
- "FEATURE_TOGGLE_NFS": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "FEATURE_TOGGLE_NFS",
- "max": "",
- "type": "bool"
- },
- "key_file": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "name": "key_file",
- "max": "",
- "type": "str"
- },
- "log_to_cluster": {
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "log_to_cluster",
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced"
- },
- "AUDIT_API_ENABLED": {
- "max": "",
- "name": "AUDIT_API_ENABLED",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "cross_origin_url": {
- "type": "str",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "cross_origin_url",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "FEATURE_TOGGLE_MIRRORING": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "type": "bool",
- "max": "",
- "name": "FEATURE_TOGGLE_MIRRORING",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": []
- },
- "GRAFANA_FRONTEND_API_URL": {
- "type": "str",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "name": "GRAFANA_FRONTEND_API_URL",
- "max": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "standby_behaviour": {
- "type": "str",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [
- "error",
- "redirect"
- ],
- "max": "",
- "name": "standby_behaviour",
- "tags": [],
- "level": "advanced",
- "default_value": "redirect",
- "long_desc": ""
- },
- "GANESHA_CLUSTERS_RADOS_POOL_NAMESPACE": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "name": "GANESHA_CLUSTERS_RADOS_POOL_NAMESPACE",
- "max": "",
- "type": "str"
- },
- "log_to_file": {
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "",
- "type": "bool"
- },
- "ACCOUNT_LOCKOUT_ATTEMPTS": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "10",
- "max": "",
- "name": "ACCOUNT_LOCKOUT_ATTEMPTS",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "type": "int"
- },
- "GRAFANA_API_PASSWORD": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "admin",
- "tags": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "name": "GRAFANA_API_PASSWORD",
- "max": "",
- "type": "str"
- },
- "GRAFANA_API_URL": {
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "name": "GRAFANA_API_URL",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "log_to_cluster_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": [],
- "type": "str",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": ""
- },
- "AUDIT_API_LOG_PAYLOAD": {
- "type": "bool",
- "max": "",
- "name": "AUDIT_API_LOG_PAYLOAD",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True"
- },
- "PWD_POLICY_CHECK_OLDPWD_ENABLED": {
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "max": "",
- "name": "PWD_POLICY_CHECK_OLDPWD_ENABLED",
- "tags": [],
- "default_value": "True",
- "long_desc": "",
- "level": "advanced"
- },
- "ALERTMANAGER_API_SSL_VERIFY": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "max": "",
- "name": "ALERTMANAGER_API_SSL_VERIFY",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "bool"
- },
- "debug": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "Enable/disable debug options",
- "name": "debug",
- "max": "",
- "type": "bool"
- },
- "FEATURE_TOGGLE_DASHBOARD": {
- "type": "bool",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "FEATURE_TOGGLE_DASHBOARD",
- "max": "",
- "default_value": "True",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "GRAFANA_API_SSL_VERIFY": {
- "tags": [],
- "default_value": "True",
- "long_desc": "",
- "level": "advanced",
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "GRAFANA_API_SSL_VERIFY"
- },
- "PROMETHEUS_API_HOST": {
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": [],
- "name": "PROMETHEUS_API_HOST",
- "max": "",
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "type": "str"
- },
- "ISCSI_API_SSL_VERIFICATION": {
- "type": "bool",
- "max": "",
- "name": "ISCSI_API_SSL_VERIFICATION",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "tags": [],
- "default_value": "True",
- "long_desc": "",
- "level": "advanced"
- },
- "ENABLE_BROWSABLE_API": {
- "level": "advanced",
- "default_value": "True",
- "long_desc": "",
- "tags": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "ENABLE_BROWSABLE_API",
- "max": "",
- "type": "bool"
- },
- "UNSAFE_TLS_v1_2": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "UNSAFE_TLS_v1_2",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": ""
- },
- "ALERTMANAGER_API_HOST": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "max": "",
- "name": "ALERTMANAGER_API_HOST",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "type": "str"
- },
- "GRAFANA_API_USERNAME": {
- "max": "",
- "name": "GRAFANA_API_USERNAME",
- "desc": "",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "admin"
- },
- "FEATURE_TOGGLE_ISCSI": {
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "FEATURE_TOGGLE_ISCSI",
- "max": "",
- "type": "bool",
- "default_value": "True",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "USER_PWD_EXPIRATION_SPAN": {
- "max": "",
- "name": "USER_PWD_EXPIRATION_SPAN",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "type": "int",
- "tags": [],
- "level": "advanced",
- "default_value": "0",
- "long_desc": ""
- },
- "RGW_API_SECRET_KEY": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "max": "",
- "name": "RGW_API_SECRET_KEY",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": []
- },
- "USER_PWD_EXPIRATION_WARNING_1": {
- "type": "int",
- "name": "USER_PWD_EXPIRATION_WARNING_1",
- "max": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "10",
- "tags": []
- },
- "RGW_API_ADMIN_RESOURCE": {
- "tags": [],
- "long_desc": "",
- "default_value": "admin",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "RGW_API_ADMIN_RESOURCE",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0
- },
- "RGW_API_SSL_VERIFY": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "type": "bool",
- "max": "",
- "name": "RGW_API_SSL_VERIFY",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": []
- },
- "PWD_POLICY_CHECK_LENGTH_ENABLED": {
- "type": "bool",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "PWD_POLICY_CHECK_LENGTH_ENABLED",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True"
- },
- "server_port": {
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "max": "",
- "name": "server_port",
- "type": "int",
- "tags": [],
- "long_desc": "",
- "default_value": "8080",
- "level": "advanced"
- },
- "redirect_resolve_ip_addr": {
- "type": "bool",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "redirect_resolve_ip_addr",
- "max": "",
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": []
- },
- "PWD_POLICY_MIN_COMPLEXITY": {
- "name": "PWD_POLICY_MIN_COMPLEXITY",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "int",
- "level": "advanced",
- "default_value": "10",
- "long_desc": "",
- "tags": []
- },
- "FEATURE_TOGGLE_RGW": {
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "max": "",
- "name": "FEATURE_TOGGLE_RGW",
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True"
- },
- "motd": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "max": "",
- "name": "motd",
- "desc": "The message of the day",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "str"
- },
- "jwt_token_ttl": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "28800",
- "tags": [],
- "type": "int",
- "name": "jwt_token_ttl",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": ""
- },
- "url_prefix": {
- "name": "url_prefix",
- "max": "",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": []
- },
- "USER_PWD_EXPIRATION_WARNING_2": {
- "long_desc": "",
- "default_value": "5",
- "level": "advanced",
- "tags": [],
- "type": "int",
- "name": "USER_PWD_EXPIRATION_WARNING_2",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": ""
- },
- "server_addr": {
- "name": "server_addr",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "::",
- "tags": []
- }
- },
- "can_run": true,
- "name": "dashboard"
- },
- {
- "module_options": {
- "log_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "name": "log_level",
- "max": "",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "type": "str"
- },
- "self_heal": {
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "preemptively heal cluster around devices that may fail",
- "name": "self_heal",
- "max": "",
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": []
- },
- "pool_name": {
- "default_value": "device_health_metrics",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "name": "pool_name",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "name of pool in which to store device health metrics",
- "type": "str"
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "log_to_cluster_level"
- },
- "scrape_frequency": {
- "default_value": "86400",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "type": "secs",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "how frequently to scrape device health metrics",
- "name": "scrape_frequency",
- "max": ""
- },
- "enable_monitoring": {
- "default_value": "True",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "monitor device health metrics",
- "name": "enable_monitoring",
- "max": ""
- },
- "retention_period": {
- "type": "secs",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "how long to retain device health metrics",
- "name": "retention_period",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "15552000",
- "tags": []
- },
- "sleep_interval": {
- "name": "sleep_interval",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "how frequently to wake up and check device health",
- "type": "secs",
- "long_desc": "",
- "default_value": "600",
- "level": "advanced",
- "tags": []
- },
- "warn_threshold": {
- "type": "secs",
- "desc": "raise health warning if OSD may fail before this long",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "warn_threshold",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "7257600"
- },
- "log_to_cluster": {
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "log_to_cluster",
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced"
- },
- "mark_out_threshold": {
- "type": "secs",
- "name": "mark_out_threshold",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "automatically mark OSD if it may fail before this long",
- "long_desc": "",
- "default_value": "2419200",
- "level": "advanced",
- "tags": []
- },
- "log_to_file": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "",
- "type": "bool"
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "devicehealth"
- },
- {
- "name": "influx",
- "can_run": false,
- "module_options": {
- "log_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "type": "str",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_level",
- "max": ""
- },
- "threads": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "5",
- "tags": [],
- "type": "int",
- "name": "threads",
- "max": "32",
- "see_also": [],
- "min": "1",
- "flags": 0,
- "enum_allowed": [],
- "desc": "How many worker threads should be spawned for sending data to InfluxDB."
- },
- "database": {
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "InfluxDB database name. You will need to create this database and grant write privileges to the configured username or the username must have admin privileges to create it.",
- "name": "database",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "ceph",
- "tags": []
- },
- "interval": {
- "long_desc": "",
- "default_value": "30",
- "level": "advanced",
- "tags": [],
- "type": "secs",
- "name": "interval",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "5",
- "flags": 0,
- "desc": "Time between reports to InfluxDB. Default 30 seconds."
- },
- "log_to_file": {
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "password": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "password",
- "desc": "password of InfluxDB server user",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "type": "str"
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "log_to_cluster_level"
- },
- "batch_size": {
- "long_desc": "",
- "default_value": "5000",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "desc": "How big batches of data points should be when sending to InfluxDB.",
- "name": "batch_size",
- "max": "",
- "type": "int"
- },
- "log_to_cluster": {
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "username": {
- "type": "str",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "username of InfluxDB server user",
- "name": "username",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "verify_ssl": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "true",
- "type": "str",
- "max": "",
- "name": "verify_ssl",
- "desc": "Verify https cert for InfluxDB server. Use \"true\" or \"false\".",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": []
- },
- "port": {
- "type": "int",
- "name": "port",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "desc": "InfluxDB server port",
- "long_desc": "",
- "default_value": "8086",
- "level": "advanced",
- "tags": []
- },
- "ssl": {
- "desc": "Use https connection for InfluxDB server. Use \"true\" or \"false\".",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "max": "",
- "name": "ssl",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "default_value": "false",
- "long_desc": ""
- },
- "hostname": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "type": "str",
- "name": "hostname",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "InfluxDB server hostname"
- }
- },
- "error_string": "influxdb python module not found"
- },
- {
- "module_options": {
- "log_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level"
- },
- "log_to_cluster_level": {
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "tags": [],
- "name": "log_to_cluster_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "type": "str"
- },
- "log_to_cluster": {
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "log_to_file": {
- "type": "bool",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "insights"
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_cluster": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "type": "bool",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "log_to_cluster"
- },
- "log_to_file": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": []
- },
- "log_level": {
- "type": "str",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level",
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": ""
- },
- "log_to_cluster_level": {
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "type": "str",
- "default_value": "info",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- }
- },
- "can_run": true,
- "name": "iostat"
- },
- {
- "can_run": true,
- "name": "localpool",
- "error_string": "",
- "module_options": {
- "num_rep": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "3",
- "type": "int",
- "desc": "default replica count for any created local pool",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "num_rep"
- },
- "failure_domain": {
- "level": "advanced",
- "long_desc": "what failure domain we should separate data replicas across.",
- "default_value": "host",
- "tags": [],
- "type": "str",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "desc": "failure domain for any created local pool",
- "name": "failure_domain",
- "max": ""
- },
- "log_to_cluster": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "log_to_cluster",
- "type": "bool"
- },
- "log_to_file": {
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "pg_num": {
- "tags": [],
- "default_value": "128",
- "long_desc": "",
- "level": "advanced",
- "type": "int",
- "max": "",
- "name": "pg_num",
- "desc": "default pg_num for any created local pool",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": []
- },
- "min_size": {
- "type": "int",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "default min_size for any created local pool",
- "name": "min_size",
- "max": "",
- "long_desc": "value to set min_size to (unchanged from Ceph's default if this option is not set)",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "log_level": {
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "max": "",
- "name": "log_level",
- "type": "str"
- },
- "prefix": {
- "type": "str",
- "name": "prefix",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "name prefix for any created local pool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "subtree": {
- "level": "advanced",
- "long_desc": "which CRUSH subtree type the module should create a pool for.",
- "default_value": "rack",
- "tags": [],
- "name": "subtree",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "CRUSH level for which to create a local pool",
- "type": "str"
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str"
- }
- }
- },
- {
- "name": "mirroring",
- "can_run": true,
- "module_options": {
- "log_to_file": {
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool"
- },
- "log_to_cluster": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "type": "bool",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": []
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1,
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str"
- },
- "log_level": {
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "log_level",
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- }
- },
- "error_string": ""
- },
- {
- "module_options": {
- "log_to_file": {
- "name": "log_to_file",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "log_to_cluster": {
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "log_to_cluster_level": {
- "tags": [],
- "default_value": "info",
- "long_desc": "",
- "level": "advanced",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": "",
- "type": "str"
- },
- "log_level": {
- "type": "str",
- "max": "",
- "name": "log_level",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "nfs"
- },
- {
- "can_run": true,
- "name": "orchestrator",
- "module_options": {
- "fail_fs": {
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "Fail filesystem for rapid multi-rank mds upgrade",
- "name": "fail_fs",
- "max": ""
- },
- "log_to_cluster_level": {
- "type": "str",
- "name": "log_to_cluster_level",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- },
- "log_level": {
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "log_to_file": {
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": [],
- "type": "bool",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_file",
- "max": ""
- },
- "log_to_cluster": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": ""
- },
- "orchestrator": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "orchestrator",
- "desc": "Orchestrator backend",
- "enum_allowed": [
- "cephadm",
- "rook",
- "test_orchestrator"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "type": "str"
- }
- },
- "error_string": ""
- },
- {
- "can_run": true,
- "name": "osd_perf_query",
- "module_options": {
- "log_to_cluster_level": {
- "name": "log_to_cluster_level",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- },
- "log_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "type": "str",
- "name": "log_level",
- "max": "",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": ""
- },
- "log_to_file": {
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1
- }
- },
- "error_string": ""
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_cluster": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "max": "",
- "name": "log_to_cluster",
- "type": "bool"
- },
- "log_to_file": {
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": []
- },
- "log_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "type": "str",
- "name": "log_level",
- "max": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": ""
- },
- "log_to_cluster_level": {
- "level": "advanced",
- "default_value": "info",
- "long_desc": "",
- "tags": [],
- "name": "log_to_cluster_level",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "type": "str"
- }
- },
- "can_run": true,
- "name": "osd_support"
- },
- {
- "name": "pg_autoscaler",
- "can_run": true,
- "module_options": {
- "sleep_interval": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "60",
- "type": "secs",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "sleep_interval"
- },
- "threshold": {
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "1.0",
- "desc": "scaling threshold",
- "name": "threshold",
- "max": "",
- "type": "float",
- "long_desc": "The factor by which the 'NEW PG_NUM' must vary from the current 'PG_NUM' before being accepted. Cannot be less than 1.0",
- "default_value": "3.0",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "log_to_file": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": []
- },
- "log_level": {
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "",
- "type": "str",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster_level": {
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info"
- }
- },
- "error_string": ""
- },
- {
- "error_string": "",
- "module_options": {
- "enabled": {
- "max": "",
- "name": "enabled",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True"
- },
- "log_to_cluster": {
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "log_to_file": {
- "type": "bool",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "log_to_file",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "allow_pg_recovery_event": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "name": "allow_pg_recovery_event",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "desc": "allow the module to show pg recovery progress",
- "type": "bool"
- },
- "max_completed_events": {
- "type": "int",
- "name": "max_completed_events",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "number of past completed events to remember",
- "level": "advanced",
- "long_desc": "",
- "default_value": "50",
- "tags": []
- },
- "sleep_interval": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "5",
- "tags": [],
- "name": "sleep_interval",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "how long the module is going to sleep",
- "type": "secs"
- },
- "log_level": {
- "type": "str",
- "max": "",
- "name": "log_level",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "log_to_cluster_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": [],
- "type": "str",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": ""
- }
- },
- "can_run": true,
- "name": "progress"
- },
- {
- "module_options": {
- "rbd_stats_pools_refresh_interval": {
- "tags": [],
- "level": "advanced",
- "default_value": "300",
- "long_desc": "",
- "max": "",
- "name": "rbd_stats_pools_refresh_interval",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "int"
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": []
- },
- "exclude_perf_counters": {
- "long_desc": "Gathering perf-counters from a single Prometheus exporter can degrade ceph-mgr performance, especially in large clusters. Instead, Ceph-exporter daemons are now used by default for perf-counter gathering. This should only be disabled when no ceph-exporters are deployed.",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "name": "exclude_perf_counters",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "Do not include perf-counters in the metrics output",
- "type": "bool"
- },
- "rbd_stats_pools": {
- "max": "",
- "name": "rbd_stats_pools",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "type": "str",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "log_to_cluster": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "max": "",
- "name": "log_to_cluster"
- },
- "server_addr": {
- "tags": [],
- "long_desc": "",
- "default_value": "::",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "server_addr",
- "desc": "the IPv4 or IPv6 address on which the module listens for HTTP requests",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": []
- },
- "log_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_level",
- "max": "",
- "type": "str"
- },
- "standby_behaviour": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "default",
- "max": "",
- "name": "standby_behaviour",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "default",
- "error"
- ],
- "type": "str"
- },
- "server_port": {
- "long_desc": "",
- "default_value": "9283",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "the port on which the module listens for HTTP requests",
- "name": "server_port",
- "max": "",
- "type": "int"
- },
- "cache": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "cache",
- "max": "",
- "type": "bool"
- },
- "stale_cache_strategy": {
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "stale_cache_strategy",
- "max": "",
- "type": "str",
- "long_desc": "",
- "default_value": "log",
- "level": "advanced",
- "tags": []
- },
- "scrape_interval": {
- "max": "",
- "name": "scrape_interval",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "type": "float",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "15.0"
- },
- "log_to_file": {
- "desc": "",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "log_to_file",
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": ""
- },
- "standby_error_status_code": {
- "type": "int",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "400",
- "see_also": [],
- "max": "599",
- "name": "standby_error_status_code",
- "tags": [],
- "long_desc": "",
- "default_value": "500",
- "level": "advanced"
- }
- },
- "error_string": "",
- "name": "prometheus",
- "can_run": true
- },
- {
- "error_string": "",
- "module_options": {
- "max_concurrent_snap_create": {
- "tags": [],
- "level": "advanced",
- "default_value": "10",
- "long_desc": "",
- "type": "int",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "max_concurrent_snap_create"
- },
- "log_to_file": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "type": "bool",
- "name": "log_to_file",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "desc": ""
- },
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "bool",
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": []
- },
- "mirror_snapshot_schedule": {
- "type": "str",
- "name": "mirror_snapshot_schedule",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "log_to_cluster_level": {
- "type": "str",
- "name": "log_to_cluster_level",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- },
- "trash_purge_schedule": {
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "trash_purge_schedule",
- "max": "",
- "type": "str",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "log_level": {
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "",
- "type": "str",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- }
- },
- "name": "rbd_support",
- "can_run": true
- },
- {
- "module_options": {
- "server_port": {
- "type": "str",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "server_port",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "server_addr": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "name": "server_addr",
- "max": "",
- "type": "str"
- },
- "log_to_file": {
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "log_to_file",
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "key_file": {
- "name": "key_file",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "type": "str",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "type": "bool"
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "default_value": "info",
- "long_desc": "",
- "type": "str",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level"
- },
- "log_level": {
- "max": "",
- "name": "log_level",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": ""
- },
- "enable_auth": {
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "max": "",
- "name": "enable_auth",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "type": "bool"
- }
- },
- "error_string": "",
- "name": "restful",
- "can_run": true
- },
- {
- "name": "selftest",
- "can_run": true,
- "module_options": {
- "rwoption5": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "rwoption5",
- "type": "bool"
- },
- "testkey": {
- "type": "str",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "testkey",
- "max": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "testnewline": {
- "type": "str",
- "max": "",
- "name": "testnewline",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "roption2": {
- "type": "str",
- "name": "roption2",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "long_desc": "",
- "default_value": "xyz",
- "level": "advanced",
- "tags": []
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "max": "",
- "name": "log_level",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str"
- },
- "rwoption4": {
- "name": "rwoption4",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "testlkey": {
- "default_value": "",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "name": "testlkey",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "type": "str"
- },
- "log_to_file": {
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "roption1": {
- "max": "",
- "name": "roption1",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "type": "str",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "rwoption2": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "name": "rwoption2",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "type": "int"
- },
- "rwoption1": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "max": "",
- "name": "rwoption1",
- "type": "str"
- },
- "rwoption3": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "type": "float",
- "name": "rwoption3",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": ""
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str"
- },
- "rwoption6": {
- "tags": [],
- "level": "advanced",
- "default_value": "True",
- "long_desc": "",
- "type": "bool",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "rwoption6"
- },
- "rwoption7": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "type": "int",
- "name": "rwoption7",
- "max": "42",
- "see_also": [],
- "flags": 0,
- "min": "1",
- "enum_allowed": [],
- "desc": ""
- },
- "log_to_cluster": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool"
- }
- },
- "error_string": ""
- },
- {
- "can_run": true,
- "name": "snap_schedule",
- "module_options": {
- "allow_m_granularity": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "name": "allow_m_granularity",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "allow minute scheduled snapshots",
- "type": "bool"
- },
- "log_to_cluster": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": ""
- },
- "log_to_file": {
- "type": "bool",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "log_level": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "type": "str"
- },
- "dump_on_update": {
- "type": "bool",
- "name": "dump_on_update",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "dump database to debug log on update",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster_level": {
- "level": "advanced",
- "default_value": "info",
- "long_desc": "",
- "tags": [],
- "name": "log_to_cluster_level",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "type": "str"
- }
- },
- "error_string": ""
- },
- {
- "can_run": true,
- "name": "stats",
- "error_string": "",
- "module_options": {
- "log_level": {
- "type": "str",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_level",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "log_to_cluster_level": {
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced"
- },
- "log_to_cluster": {
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool"
- },
- "log_to_file": {
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- }
- }
- },
- {
- "can_run": true,
- "name": "status",
- "module_options": {
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "type": "str",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level"
- },
- "log_level": {
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": ""
- },
- "log_to_file": {
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": [],
- "type": "bool",
- "name": "log_to_file",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "desc": ""
- },
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- }
- },
- "error_string": ""
- },
- {
- "can_run": true,
- "name": "telegraf",
- "error_string": "",
- "module_options": {
- "address": {
- "tags": [],
- "long_desc": "",
- "default_value": "unixgram:///tmp/telegraf.sock",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "max": "",
- "name": "address",
- "type": "str"
- },
- "interval": {
- "long_desc": "",
- "default_value": "15",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "interval",
- "max": "",
- "type": "secs"
- },
- "log_to_file": {
- "type": "bool",
- "name": "log_to_file",
- "max": "",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "log_to_cluster_level": {
- "name": "log_to_cluster_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "",
- "type": "str",
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "tags": []
- },
- "log_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "name": "log_level",
- "max": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "type": "str"
- }
- }
- },
- {
- "can_run": true,
- "name": "telemetry",
- "module_options": {
- "leaderboard_description": {
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "leaderboard_description",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1
- },
- "channel_device": {
- "desc": "Share device health metrics (e.g., SMART data, minus potentially identifying info like serial numbers)",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "channel_device",
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced"
- },
- "last_opt_revision": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "1",
- "tags": [],
- "type": "int",
- "name": "last_opt_revision",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": ""
- },
- "organization": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "organization",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "type": "str"
- },
- "channel_basic": {
- "type": "bool",
- "desc": "Share basic cluster information (size, version)",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "channel_basic",
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced"
- },
- "channel_perf": {
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "Share various performance metrics of a cluster",
- "name": "channel_perf",
- "max": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "log_to_cluster": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "type": "bool"
- },
- "log_level": {
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "",
- "type": "str",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "channel_ident": {
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "Share a user-provided description and/or contact email for the cluster",
- "name": "channel_ident",
- "max": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "leaderboard": {
- "max": "",
- "name": "leaderboard",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "proxy": {
- "type": "str",
- "desc": "",
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "proxy",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "device_url": {
- "name": "device_url",
- "max": "",
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "https://telemetry.ceph.com/device",
- "tags": []
- },
- "channel_crash": {
- "type": "bool",
- "max": "",
- "name": "channel_crash",
- "desc": "Share metadata about Ceph daemon crashes (version, stack straces, etc)",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced"
- },
- "description": {
- "max": "",
- "name": "description",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "enabled": {
- "max": "",
- "name": "enabled",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": ""
- },
- "url": {
- "name": "url",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "type": "str",
- "long_desc": "",
- "default_value": "https://telemetry.ceph.com/report",
- "level": "advanced",
- "tags": []
- },
- "log_to_file": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "max": "",
- "name": "log_to_file"
- },
- "interval": {
- "tags": [],
- "long_desc": "",
- "default_value": "24",
- "level": "advanced",
- "type": "int",
- "max": "",
- "name": "interval",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "8",
- "flags": 0
- },
- "contact": {
- "max": "",
- "name": "contact",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- }
- },
- "error_string": ""
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "default_value": "info",
- "long_desc": "",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str"
- },
- "log_level": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "",
- "type": "str"
- },
- "log_to_file": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": ""
- },
- "log_to_cluster": {
- "type": "bool",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- }
- },
- "can_run": true,
- "name": "test_orchestrator"
- },
- {
- "module_options": {
- "snapshot_clone_delay": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "0",
- "tags": [],
- "type": "int",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "Delay clone begin operation by snapshot_clone_delay seconds",
- "name": "snapshot_clone_delay",
- "max": ""
- },
- "log_to_cluster_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": [],
- "type": "str",
- "name": "log_to_cluster_level",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": ""
- },
- "log_level": {
- "type": "str",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_level",
- "max": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_file": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "type": "bool"
- },
- "max_concurrent_clones": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "4",
- "tags": [],
- "type": "int",
- "name": "max_concurrent_clones",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "Number of asynchronous cloner threads"
- },
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "volumes"
- },
- {
- "module_options": {
- "log_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "log_level"
- },
- "discovery_interval": {
- "type": "uint",
- "name": "discovery_interval",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "desc": "",
- "default_value": "100",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster_level": {
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "str",
- "tags": [],
- "default_value": "info",
- "long_desc": "",
- "level": "advanced"
- },
- "zabbix_port": {
- "tags": [],
- "long_desc": "",
- "default_value": "10051",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "max": "",
- "name": "zabbix_port",
- "type": "int"
- },
- "identifier": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "identifier",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "type": "str"
- },
- "zabbix_host": {
- "type": "str",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "zabbix_host",
- "max": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool"
- },
- "zabbix_sender": {
- "type": "str",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "zabbix_sender",
- "tags": [],
- "long_desc": "",
- "default_value": "/usr/bin/zabbix_sender",
- "level": "advanced"
- },
- "log_to_file": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "log_to_file",
- "type": "bool"
- },
- "interval": {
- "type": "secs",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "max": "",
- "name": "interval",
- "tags": [],
- "default_value": "60",
- "long_desc": "",
- "level": "advanced"
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "zabbix"
- }
- ]
- }
- ],
- "epoch": 1508,
- "services": {
- "prometheus": "http://192.168.105.101:9283/",
- "dashboard": "http://192.168.105.101:9080/"
- },
- "active_name": "proxmox-node02",
- "modules": [
- "alerts",
- "dashboard",
- "iostat",
- "nfs",
- "prometheus",
- "restful"
- ],
- "active_addrs": {
- "addrvec": [
- {
- "nonce": 2343,
- "type": "v2",
- "addr": "192.168.105.101:6858"
- },
- {
- "addr": "192.168.105.101:6859",
- "type": "v1",
- "nonce": 2343
- }
- ]
- },
- "active_change": "2025-02-11T18:04:25.050119+0100",
- "active_clients": [
- {
- "name": "devicehealth",
- "addrvec": [
- {
- "addr": "192.168.105.101:0",
- "nonce": 1649438157,
- "type": "v2"
- }
- ]
- },
- {
- "addrvec": [
- {
- "type": "v2",
- "nonce": 1624070457,
- "addr": "192.168.105.101:0"
- }
- ],
- "name": "libcephsqlite"
- },
- {
- "name": "rbd_support",
- "addrvec": [
- {
- "nonce": 3467365716,
- "type": "v2",
- "addr": "192.168.105.101:0"
- }
- ]
- },
- {
- "addrvec": [
- {
- "nonce": 3357636400,
- "type": "v2",
- "addr": "192.168.105.101:0"
- }
- ],
- "name": "volumes"
- }
- ],
- "active_mgr_features": 4540138322906710015,
- "always_on_modules": {
- "quincy": [
- "balancer",
- "crash",
- "devicehealth",
- "orchestrator",
- "pg_autoscaler",
- "progress",
- "rbd_support",
- "status",
- "telemetry",
- "volumes"
- ],
- "pacific": [
- "balancer",
- "crash",
- "devicehealth",
- "orchestrator",
- "pg_autoscaler",
- "progress",
- "rbd_support",
- "status",
- "telemetry",
- "volumes"
- ],
- "octopus": [
- "balancer",
- "crash",
- "devicehealth",
- "orchestrator",
- "pg_autoscaler",
- "progress",
- "rbd_support",
- "status",
- "telemetry",
- "volumes"
- ],
- "reef": [
- "balancer",
- "crash",
- "devicehealth",
- "orchestrator",
- "pg_autoscaler",
- "progress",
- "rbd_support",
- "status",
- "telemetry",
- "volumes"
- ]
- },
- "available": true,
- "active_gid": 179832486,
- "available_modules": [
- {
- "can_run": true,
- "name": "alerts",
- "module_options": {
- "log_level": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "type": "str",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level"
- },
- "smtp_sender": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "smtp_sender",
- "desc": "SMTP envelope sender",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "str"
- },
- "smtp_destination": {
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [],
- "desc": "Email address to send alerts to",
- "name": "smtp_destination",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "smtp_user": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "name": "smtp_user",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "User to authenticate as",
- "type": "str"
- },
- "smtp_from_name": {
- "type": "str",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": "Email From: name",
- "name": "smtp_from_name",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "Ceph",
- "tags": []
- },
- "interval": {
- "type": "secs",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "How frequently to reexamine health status",
- "name": "interval",
- "max": "",
- "long_desc": "",
- "default_value": "60",
- "level": "advanced",
- "tags": []
- },
- "log_to_file": {
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "type": "str",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level"
- },
- "smtp_ssl": {
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "desc": "Use SSL to connect to SMTP server",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "smtp_ssl",
- "type": "bool"
- },
- "smtp_port": {
- "type": "int",
- "desc": "SMTP port",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "smtp_port",
- "tags": [],
- "level": "advanced",
- "default_value": "465",
- "long_desc": ""
- },
- "smtp_host": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "SMTP server",
- "name": "smtp_host",
- "max": "",
- "type": "str"
- },
- "log_to_cluster": {
- "type": "bool",
- "name": "log_to_cluster",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "smtp_password": {
- "type": "str",
- "name": "smtp_password",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "Password to authenticate with",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- }
- },
- "error_string": ""
- },
- {
- "can_run": true,
- "name": "balancer",
- "module_options": {
- "begin_weekday": {
- "type": "uint",
- "name": "begin_weekday",
- "max": "6",
- "enum_allowed": [],
- "min": "0",
- "see_also": [],
- "flags": 1,
- "desc": "Restrict automatic balancing to this day of the week or later",
- "long_desc": "0 = Sunday, 1 = Monday, etc.",
- "default_value": "0",
- "level": "advanced",
- "tags": []
- },
- "begin_time": {
- "long_desc": "This is a time of day in the format HHMM.",
- "default_value": "0000",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "beginning time of day to automatically balance",
- "name": "begin_time",
- "max": ""
- },
- "pool_ids": {
- "max": "",
- "name": "pool_ids",
- "desc": "pools which the automatic balancing will be limited to",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "upmap_max_optimizations": {
- "type": "uint",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": "maximum upmap optimizations to make per attempt",
- "name": "upmap_max_optimizations",
- "max": "",
- "level": "advanced",
- "default_value": "10",
- "long_desc": "",
- "tags": []
- },
- "log_to_file": {
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "max": "",
- "name": "log_to_file",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "log_level": {
- "name": "log_level",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "end_weekday": {
- "type": "uint",
- "name": "end_weekday",
- "max": "6",
- "see_also": [],
- "min": "0",
- "flags": 1,
- "enum_allowed": [],
- "desc": "Restrict automatic balancing to days of the week earlier than this",
- "level": "advanced",
- "long_desc": "0 = Sunday, 1 = Monday, etc.",
- "default_value": "0",
- "tags": []
- },
- "end_time": {
- "default_value": "2359",
- "long_desc": "This is a time of day in the format HHMM.",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "ending time of day to automatically balance",
- "name": "end_time",
- "max": ""
- },
- "sleep_interval": {
- "type": "secs",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "how frequently to wake up and attempt optimization",
- "name": "sleep_interval",
- "max": "",
- "long_desc": "",
- "default_value": "60",
- "level": "advanced",
- "tags": []
- },
- "min_score": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "0",
- "tags": [],
- "type": "float",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "minimum score, below which no optimization is attempted",
- "name": "min_score",
- "max": ""
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": ""
- },
- "crush_compat_step": {
- "tags": [],
- "long_desc": ".99 is very aggressive, .01 is less aggressive",
- "default_value": "0.5",
- "level": "advanced",
- "type": "float",
- "max": "0.999",
- "name": "crush_compat_step",
- "desc": "aggressiveness of optimization",
- "enum_allowed": [],
- "min": "0.001",
- "flags": 1,
- "see_also": []
- },
- "crush_compat_max_iterations": {
- "enum_allowed": [],
- "min": "1",
- "flags": 1,
- "see_also": [],
- "desc": "maximum number of iterations to attempt optimization",
- "name": "crush_compat_max_iterations",
- "max": "250",
- "type": "uint",
- "long_desc": "",
- "default_value": "25",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster_level": {
- "level": "advanced",
- "default_value": "info",
- "long_desc": "",
- "tags": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "type": "str"
- },
- "crush_compat_metrics": {
- "tags": [],
- "level": "advanced",
- "long_desc": "Value is a list of one or more of \"pgs\", \"objects\", or \"bytes\", and indicates which metrics to use to balance utilization.",
- "default_value": "pgs,objects,bytes",
- "type": "str",
- "max": "",
- "name": "crush_compat_metrics",
- "desc": "metrics with which to calculate OSD utilization",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": []
- },
- "active": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "tags": [],
- "type": "bool",
- "name": "active",
- "max": "",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "automatically balance PGs across cluster"
- },
- "upmap_max_deviation": {
- "enum_allowed": [],
- "min": "1",
- "flags": 1,
- "see_also": [],
- "desc": "deviation below which no optimization is attempted",
- "name": "upmap_max_deviation",
- "max": "",
- "type": "int",
- "long_desc": "If the number of PGs are within this count then no optimization is attempted",
- "default_value": "5",
- "level": "advanced",
- "tags": []
- },
- "mode": {
- "tags": [],
- "long_desc": "",
- "default_value": "upmap",
- "level": "advanced",
- "type": "str",
- "desc": "Balancer mode",
- "enum_allowed": [
- "crush-compat",
- "none",
- "upmap"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "mode"
- }
- },
- "error_string": ""
- },
- {
- "error_string": "",
- "module_options": {
- "warn_recent_interval": {
- "tags": [],
- "long_desc": "",
- "default_value": "1209600",
- "level": "advanced",
- "type": "secs",
- "desc": "time interval in which to warn about recent crashes",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "max": "",
- "name": "warn_recent_interval"
- },
- "log_level": {
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": [],
- "type": "str",
- "name": "log_level",
- "max": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": ""
- },
- "log_to_cluster_level": {
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "type": "str",
- "level": "advanced",
- "default_value": "info",
- "long_desc": "",
- "tags": []
- },
- "log_to_cluster": {
- "type": "bool",
- "name": "log_to_cluster",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "log_to_file": {
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "log_to_file",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "retain_interval": {
- "tags": [],
- "long_desc": "",
- "default_value": "31536000",
- "level": "advanced",
- "desc": "how long to retain crashes before pruning them",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "retain_interval",
- "type": "secs"
- }
- },
- "can_run": true,
- "name": "crash"
- },
- {
- "name": "dashboard",
- "can_run": true,
- "module_options": {
- "PWD_POLICY_EXCLUSION_LIST": {
- "type": "str",
- "max": "",
- "name": "PWD_POLICY_EXCLUSION_LIST",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "osd,host,dashboard,pool,block,nfs,ceph,monitors,gateway,logs,crush,maps"
- },
- "FEATURE_TOGGLE_CEPHFS": {
- "tags": [],
- "level": "advanced",
- "default_value": "True",
- "long_desc": "",
- "max": "",
- "name": "FEATURE_TOGGLE_CEPHFS",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "type": "bool"
- },
- "PWD_POLICY_CHECK_REPETITIVE_CHARS_ENABLED": {
- "max": "",
- "name": "PWD_POLICY_CHECK_REPETITIVE_CHARS_ENABLED",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "PWD_POLICY_CHECK_EXCLUSION_LIST_ENABLED": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "type": "bool",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "PWD_POLICY_CHECK_EXCLUSION_LIST_ENABLED",
- "max": ""
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "max": "",
- "name": "log_level",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str"
- },
- "standby_error_status_code": {
- "long_desc": "",
- "default_value": "500",
- "level": "advanced",
- "tags": [],
- "name": "standby_error_status_code",
- "max": "599",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "400",
- "desc": "",
- "type": "int"
- },
- "PWD_POLICY_ENABLED": {
- "type": "bool",
- "max": "",
- "name": "PWD_POLICY_ENABLED",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced"
- },
- "PWD_POLICY_MIN_LENGTH": {
- "max": "",
- "name": "PWD_POLICY_MIN_LENGTH",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "type": "int",
- "tags": [],
- "long_desc": "",
- "default_value": "8",
- "level": "advanced"
- },
- "crt_file": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "desc": "",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "crt_file",
- "type": "str"
- },
- "ISSUE_TRACKER_API_KEY": {
- "type": "str",
- "max": "",
- "name": "ISSUE_TRACKER_API_KEY",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "REST_REQUESTS_TIMEOUT": {
- "type": "int",
- "max": "",
- "name": "REST_REQUESTS_TIMEOUT",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "45",
- "level": "advanced"
- },
- "GRAFANA_UPDATE_DASHBOARDS": {
- "type": "bool",
- "max": "",
- "name": "GRAFANA_UPDATE_DASHBOARDS",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "RGW_API_ACCESS_KEY": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "RGW_API_ACCESS_KEY",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": ""
- },
- "ssl_server_port": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "8443",
- "type": "int",
- "max": "",
- "name": "ssl_server_port",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": []
- },
- "PWD_POLICY_CHECK_USERNAME_ENABLED": {
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "PWD_POLICY_CHECK_USERNAME_ENABLED",
- "max": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "PWD_POLICY_CHECK_COMPLEXITY_ENABLED": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "name": "PWD_POLICY_CHECK_COMPLEXITY_ENABLED",
- "max": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "bool"
- },
- "PROMETHEUS_API_SSL_VERIFY": {
- "level": "advanced",
- "default_value": "True",
- "long_desc": "",
- "tags": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "name": "PROMETHEUS_API_SSL_VERIFY",
- "max": "",
- "type": "bool"
- },
- "FEATURE_TOGGLE_RBD": {
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "name": "FEATURE_TOGGLE_RBD",
- "max": "",
- "type": "bool",
- "default_value": "True",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "type": "bool",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": ""
- },
- "FEATURE_TOGGLE_NFS": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "tags": [],
- "type": "bool",
- "name": "FEATURE_TOGGLE_NFS",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": ""
- },
- "key_file": {
- "type": "str",
- "max": "",
- "name": "key_file",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "ssl": {
- "max": "",
- "name": "ssl",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True"
- },
- "PWD_POLICY_CHECK_SEQUENTIAL_CHARS_ENABLED": {
- "type": "bool",
- "max": "",
- "name": "PWD_POLICY_CHECK_SEQUENTIAL_CHARS_ENABLED",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "standby_behaviour": {
- "level": "advanced",
- "default_value": "redirect",
- "long_desc": "",
- "tags": [],
- "type": "str",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [
- "error",
- "redirect"
- ],
- "desc": "",
- "name": "standby_behaviour",
- "max": ""
- },
- "cross_origin_url": {
- "name": "cross_origin_url",
- "max": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "AUDIT_API_ENABLED": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "type": "bool",
- "max": "",
- "name": "AUDIT_API_ENABLED",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": []
- },
- "FEATURE_TOGGLE_MIRRORING": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "FEATURE_TOGGLE_MIRRORING",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": ""
- },
- "GRAFANA_FRONTEND_API_URL": {
- "type": "str",
- "name": "GRAFANA_FRONTEND_API_URL",
- "max": "",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "ACCOUNT_LOCKOUT_ATTEMPTS": {
- "type": "int",
- "max": "",
- "name": "ACCOUNT_LOCKOUT_ATTEMPTS",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "tags": [],
- "default_value": "10",
- "long_desc": "",
- "level": "advanced"
- },
- "log_to_file": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "type": "bool"
- },
- "GRAFANA_API_PASSWORD": {
- "type": "str",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "GRAFANA_API_PASSWORD",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "admin"
- },
- "GANESHA_CLUSTERS_RADOS_POOL_NAMESPACE": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "GANESHA_CLUSTERS_RADOS_POOL_NAMESPACE",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": []
- },
- "AUDIT_API_LOG_PAYLOAD": {
- "default_value": "True",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "AUDIT_API_LOG_PAYLOAD",
- "max": ""
- },
- "log_to_cluster_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": [],
- "type": "str",
- "name": "log_to_cluster_level",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": ""
- },
- "GRAFANA_API_URL": {
- "type": "str",
- "name": "GRAFANA_API_URL",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "PWD_POLICY_CHECK_OLDPWD_ENABLED": {
- "type": "bool",
- "desc": "",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "PWD_POLICY_CHECK_OLDPWD_ENABLED",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True"
- },
- "ALERTMANAGER_API_SSL_VERIFY": {
- "type": "bool",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "ALERTMANAGER_API_SSL_VERIFY",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "tags": []
- },
- "debug": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "type": "bool",
- "desc": "Enable/disable debug options",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "max": "",
- "name": "debug"
- },
- "FEATURE_TOGGLE_DASHBOARD": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "name": "FEATURE_TOGGLE_DASHBOARD",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "type": "bool"
- },
- "ISCSI_API_SSL_VERIFICATION": {
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "ISCSI_API_SSL_VERIFICATION",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": []
- },
- "UNSAFE_TLS_v1_2": {
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "UNSAFE_TLS_v1_2",
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "ENABLE_BROWSABLE_API": {
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "max": "",
- "name": "ENABLE_BROWSABLE_API"
- },
- "PROMETHEUS_API_HOST": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "max": "",
- "name": "PROMETHEUS_API_HOST",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "type": "str"
- },
- "GRAFANA_API_SSL_VERIFY": {
- "type": "bool",
- "name": "GRAFANA_API_SSL_VERIFY",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "default_value": "True",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "GRAFANA_API_USERNAME": {
- "type": "str",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "GRAFANA_API_USERNAME",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "admin"
- },
- "ALERTMANAGER_API_HOST": {
- "name": "ALERTMANAGER_API_HOST",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "RGW_API_SECRET_KEY": {
- "type": "str",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "RGW_API_SECRET_KEY",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "USER_PWD_EXPIRATION_SPAN": {
- "long_desc": "",
- "default_value": "0",
- "level": "advanced",
- "tags": [],
- "type": "int",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "USER_PWD_EXPIRATION_SPAN",
- "max": ""
- },
- "FEATURE_TOGGLE_ISCSI": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "name": "FEATURE_TOGGLE_ISCSI",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "type": "bool"
- },
- "USER_PWD_EXPIRATION_WARNING_1": {
- "name": "USER_PWD_EXPIRATION_WARNING_1",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "desc": "",
- "type": "int",
- "long_desc": "",
- "default_value": "10",
- "level": "advanced",
- "tags": []
- },
- "RGW_API_ADMIN_RESOURCE": {
- "long_desc": "",
- "default_value": "admin",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "name": "RGW_API_ADMIN_RESOURCE",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": ""
- },
- "RGW_API_SSL_VERIFY": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "name": "RGW_API_SSL_VERIFY",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "type": "bool"
- },
- "PWD_POLICY_CHECK_LENGTH_ENABLED": {
- "max": "",
- "name": "PWD_POLICY_CHECK_LENGTH_ENABLED",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True"
- },
- "PWD_POLICY_MIN_COMPLEXITY": {
- "tags": [],
- "long_desc": "",
- "default_value": "10",
- "level": "advanced",
- "type": "int",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "PWD_POLICY_MIN_COMPLEXITY"
- },
- "redirect_resolve_ip_addr": {
- "type": "bool",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "redirect_resolve_ip_addr",
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": ""
- },
- "server_port": {
- "level": "advanced",
- "default_value": "8080",
- "long_desc": "",
- "tags": [],
- "type": "int",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "name": "server_port",
- "max": ""
- },
- "jwt_token_ttl": {
- "tags": [],
- "default_value": "28800",
- "long_desc": "",
- "level": "advanced",
- "type": "int",
- "max": "",
- "name": "jwt_token_ttl",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0
- },
- "motd": {
- "name": "motd",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "The message of the day",
- "type": "str",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "FEATURE_TOGGLE_RGW": {
- "tags": [],
- "level": "advanced",
- "default_value": "True",
- "long_desc": "",
- "type": "bool",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "FEATURE_TOGGLE_RGW"
- },
- "server_addr": {
- "type": "str",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "server_addr",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "::",
- "tags": []
- },
- "USER_PWD_EXPIRATION_WARNING_2": {
- "long_desc": "",
- "default_value": "5",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "desc": "",
- "name": "USER_PWD_EXPIRATION_WARNING_2",
- "max": "",
- "type": "int"
- },
- "url_prefix": {
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "url_prefix",
- "max": "",
- "type": "str",
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": []
- }
- },
- "error_string": ""
- },
- {
- "name": "devicehealth",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "pool_name": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "device_health_metrics",
- "tags": [],
- "type": "str",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "name of pool in which to store device health metrics",
- "name": "pool_name",
- "max": ""
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": []
- },
- "self_heal": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "tags": [],
- "type": "bool",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "preemptively heal cluster around devices that may fail",
- "name": "self_heal",
- "max": ""
- },
- "log_level": {
- "type": "str",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "retention_period": {
- "type": "secs",
- "max": "",
- "name": "retention_period",
- "desc": "how long to retain device health metrics",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "15552000",
- "level": "advanced"
- },
- "enable_monitoring": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "monitor device health metrics",
- "name": "enable_monitoring",
- "max": ""
- },
- "scrape_frequency": {
- "type": "secs",
- "max": "",
- "name": "scrape_frequency",
- "desc": "how frequently to scrape device health metrics",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "86400"
- },
- "warn_threshold": {
- "tags": [],
- "long_desc": "",
- "default_value": "7257600",
- "level": "advanced",
- "max": "",
- "name": "warn_threshold",
- "desc": "raise health warning if OSD may fail before this long",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "type": "secs"
- },
- "sleep_interval": {
- "max": "",
- "name": "sleep_interval",
- "desc": "how frequently to wake up and check device health",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [],
- "type": "secs",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "600"
- },
- "log_to_file": {
- "type": "bool",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "mark_out_threshold": {
- "name": "mark_out_threshold",
- "max": "",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "automatically mark OSD if it may fail before this long",
- "type": "secs",
- "level": "advanced",
- "long_desc": "",
- "default_value": "2419200",
- "tags": []
- },
- "log_to_cluster": {
- "type": "bool",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- }
- }
- },
- {
- "error_string": "influxdb python module not found",
- "module_options": {
- "log_to_file": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "log_to_file",
- "type": "bool"
- },
- "interval": {
- "default_value": "30",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "type": "secs",
- "enum_allowed": [],
- "min": "5",
- "flags": 0,
- "see_also": [],
- "desc": "Time between reports to InfluxDB. Default 30 seconds.",
- "name": "interval",
- "max": ""
- },
- "database": {
- "max": "",
- "name": "database",
- "desc": "InfluxDB database name. You will need to create this database and grant write privileges to the configured username or the username must have admin privileges to create it.",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "default_value": "ceph",
- "long_desc": ""
- },
- "threads": {
- "desc": "How many worker threads should be spawned for sending data to InfluxDB.",
- "enum_allowed": [],
- "min": "1",
- "see_also": [],
- "flags": 0,
- "max": "32",
- "name": "threads",
- "type": "int",
- "tags": [],
- "long_desc": "",
- "default_value": "5",
- "level": "advanced"
- },
- "log_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "log_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": "",
- "type": "str"
- },
- "log_to_cluster": {
- "type": "bool",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "batch_size": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "5000",
- "type": "int",
- "desc": "How big batches of data points should be when sending to InfluxDB.",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "batch_size"
- },
- "ssl": {
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "Use https connection for InfluxDB server. Use \"true\" or \"false\".",
- "name": "ssl",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "false",
- "tags": []
- },
- "hostname": {
- "type": "str",
- "name": "hostname",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "InfluxDB server hostname",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "port": {
- "type": "int",
- "max": "",
- "name": "port",
- "desc": "InfluxDB server port",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "tags": [],
- "long_desc": "",
- "default_value": "8086",
- "level": "advanced"
- },
- "verify_ssl": {
- "desc": "Verify https cert for InfluxDB server. Use \"true\" or \"false\".",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "verify_ssl",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "true"
- },
- "username": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "desc": "username of InfluxDB server user",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "max": "",
- "name": "username",
- "type": "str"
- },
- "password": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "type": "str",
- "max": "",
- "name": "password",
- "desc": "password of InfluxDB server user",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": []
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str"
- }
- },
- "can_run": false,
- "name": "influx"
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_cluster": {
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "log_to_file": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": ""
- },
- "log_level": {
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "",
- "type": "str",
- "default_value": "",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster_level": {
- "type": "str",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- }
- },
- "can_run": true,
- "name": "insights"
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_file": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1
- },
- "log_to_cluster": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "max": "",
- "name": "log_to_cluster",
- "type": "bool"
- },
- "log_to_cluster_level": {
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info"
- },
- "log_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "log_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "str"
- }
- },
- "name": "iostat",
- "can_run": true
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_cluster_level": {
- "type": "str",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "default_value": "info",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "subtree": {
- "max": "",
- "name": "subtree",
- "desc": "CRUSH level for which to create a local pool",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "str",
- "tags": [],
- "long_desc": "which CRUSH subtree type the module should create a pool for.",
- "default_value": "rack",
- "level": "advanced"
- },
- "prefix": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "name prefix for any created local pool",
- "name": "prefix",
- "max": "",
- "type": "str"
- },
- "log_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "max": "",
- "name": "log_level",
- "type": "str"
- },
- "log_to_file": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool"
- },
- "num_rep": {
- "tags": [],
- "long_desc": "",
- "default_value": "3",
- "level": "advanced",
- "desc": "default replica count for any created local pool",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "num_rep",
- "type": "int"
- },
- "failure_domain": {
- "tags": [],
- "level": "advanced",
- "default_value": "host",
- "long_desc": "what failure domain we should separate data replicas across.",
- "type": "str",
- "max": "",
- "name": "failure_domain",
- "desc": "failure domain for any created local pool",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": []
- },
- "log_to_cluster": {
- "type": "bool",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "pg_num": {
- "tags": [],
- "default_value": "128",
- "long_desc": "",
- "level": "advanced",
- "desc": "default pg_num for any created local pool",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "max": "",
- "name": "pg_num",
- "type": "int"
- },
- "min_size": {
- "type": "int",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "default min_size for any created local pool",
- "name": "min_size",
- "max": "",
- "level": "advanced",
- "long_desc": "value to set min_size to (unchanged from Ceph's default if this option is not set)",
- "default_value": "",
- "tags": []
- }
- },
- "can_run": true,
- "name": "localpool"
- },
- {
- "name": "mirroring",
- "can_run": true,
- "module_options": {
- "log_to_file": {
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": ""
- },
- "log_to_cluster": {
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "log_to_cluster_level": {
- "name": "log_to_cluster_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "",
- "type": "str",
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "tags": []
- },
- "log_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "log_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "type": "str"
- }
- },
- "error_string": ""
- },
- {
- "name": "nfs",
- "can_run": true,
- "module_options": {
- "log_to_cluster": {
- "type": "bool",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "log_to_cluster",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "log_to_file": {
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "type": "bool"
- },
- "log_level": {
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "log_level",
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "log_to_cluster_level": {
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced"
- }
- },
- "error_string": ""
- },
- {
- "name": "orchestrator",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "log_to_file": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": ""
- },
- "orchestrator": {
- "type": "str",
- "desc": "Orchestrator backend",
- "enum_allowed": [
- "cephadm",
- "rook",
- "test_orchestrator"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "max": "",
- "name": "orchestrator",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "fail_fs": {
- "desc": "Fail filesystem for rapid multi-rank mds upgrade",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "max": "",
- "name": "fail_fs",
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "log_to_cluster_level": {
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info"
- },
- "log_level": {
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_level",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- }
- }
- },
- {
- "can_run": true,
- "name": "osd_perf_query",
- "error_string": "",
- "module_options": {
- "log_to_file": {
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool"
- },
- "log_to_cluster": {
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "log_to_cluster",
- "type": "bool",
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced"
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str"
- },
- "log_level": {
- "max": "",
- "name": "log_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "type": "str",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- }
- }
- },
- {
- "error_string": "",
- "module_options": {
- "log_level": {
- "type": "str",
- "name": "log_level",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "log_to_cluster_level": {
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_cluster",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": ""
- },
- "log_to_file": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "",
- "type": "bool"
- }
- },
- "can_run": true,
- "name": "osd_support"
- },
- {
- "can_run": true,
- "name": "pg_autoscaler",
- "module_options": {
- "log_to_cluster_level": {
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info"
- },
- "log_level": {
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "log_level",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "threshold": {
- "long_desc": "The factor by which the 'NEW PG_NUM' must vary from the current 'PG_NUM' before being accepted. Cannot be less than 1.0",
- "default_value": "3.0",
- "level": "advanced",
- "tags": [],
- "type": "float",
- "enum_allowed": [],
- "flags": 0,
- "min": "1.0",
- "see_also": [],
- "desc": "scaling threshold",
- "name": "threshold",
- "max": ""
- },
- "sleep_interval": {
- "long_desc": "",
- "default_value": "60",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "sleep_interval",
- "max": "",
- "type": "secs"
- },
- "log_to_file": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": ""
- },
- "log_to_cluster": {
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool",
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- }
- },
- "error_string": ""
- },
- {
- "error_string": "",
- "module_options": {
- "log_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "type": "str",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_level",
- "max": ""
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": []
- },
- "sleep_interval": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "5",
- "desc": "how long the module is going to sleep",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "sleep_interval",
- "type": "secs"
- },
- "max_completed_events": {
- "long_desc": "",
- "default_value": "50",
- "level": "advanced",
- "tags": [],
- "type": "int",
- "name": "max_completed_events",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "number of past completed events to remember"
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_cluster",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": ""
- },
- "enabled": {
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "enabled",
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True"
- },
- "allow_pg_recovery_event": {
- "max": "",
- "name": "allow_pg_recovery_event",
- "desc": "allow the module to show pg recovery progress",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "log_to_file": {
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "log_to_file",
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": ""
- }
- },
- "can_run": true,
- "name": "progress"
- },
- {
- "error_string": "",
- "module_options": {
- "server_port": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "9283",
- "type": "int",
- "max": "",
- "name": "server_port",
- "desc": "the port on which the module listens for HTTP requests",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": []
- },
- "stale_cache_strategy": {
- "type": "str",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "stale_cache_strategy",
- "tags": [],
- "long_desc": "",
- "default_value": "log",
- "level": "advanced"
- },
- "cache": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "tags": [],
- "name": "cache",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "type": "bool"
- },
- "scrape_interval": {
- "type": "float",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "max": "",
- "name": "scrape_interval",
- "tags": [],
- "long_desc": "",
- "default_value": "15.0",
- "level": "advanced"
- },
- "standby_error_status_code": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "500",
- "tags": [],
- "type": "int",
- "name": "standby_error_status_code",
- "max": "599",
- "see_also": [],
- "flags": 1,
- "min": "400",
- "enum_allowed": [],
- "desc": ""
- },
- "log_to_file": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool"
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level"
- },
- "standby_behaviour": {
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "default",
- "error"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "standby_behaviour",
- "tags": [],
- "long_desc": "",
- "default_value": "default",
- "level": "advanced"
- },
- "log_to_cluster": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "max": "",
- "name": "log_to_cluster",
- "type": "bool"
- },
- "rbd_stats_pools": {
- "max": "",
- "name": "rbd_stats_pools",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "server_addr": {
- "type": "str",
- "max": "",
- "name": "server_addr",
- "desc": "the IPv4 or IPv6 address on which the module listens for HTTP requests",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "tags": [],
- "default_value": "::",
- "long_desc": "",
- "level": "advanced"
- },
- "rbd_stats_pools_refresh_interval": {
- "tags": [],
- "long_desc": "",
- "default_value": "300",
- "level": "advanced",
- "type": "int",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "rbd_stats_pools_refresh_interval"
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "default_value": "info",
- "long_desc": "",
- "desc": "",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str"
- },
- "exclude_perf_counters": {
- "tags": [],
- "long_desc": "Gathering perf-counters from a single Prometheus exporter can degrade ceph-mgr performance, especially in large clusters. Instead, Ceph-exporter daemons are now used by default for perf-counter gathering. This should only be disabled when no ceph-exporters are deployed.",
- "default_value": "True",
- "level": "advanced",
- "max": "",
- "name": "exclude_perf_counters",
- "desc": "Do not include perf-counters in the metrics output",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "bool"
- }
- },
- "name": "prometheus",
- "can_run": true
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_cluster": {
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "log_to_file": {
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": ""
- },
- "max_concurrent_snap_create": {
- "type": "int",
- "max": "",
- "name": "max_concurrent_snap_create",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "tags": [],
- "long_desc": "",
- "default_value": "10",
- "level": "advanced"
- },
- "trash_purge_schedule": {
- "type": "str",
- "max": "",
- "name": "trash_purge_schedule",
- "desc": "",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "type": "str",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level"
- },
- "log_to_cluster_level": {
- "type": "str",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info"
- },
- "mirror_snapshot_schedule": {
- "type": "str",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "name": "mirror_snapshot_schedule",
- "max": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- }
- },
- "can_run": true,
- "name": "rbd_support"
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_cluster_level": {
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "type": "str"
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level"
- },
- "enable_auth": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "name": "enable_auth",
- "max": "",
- "type": "bool"
- },
- "server_port": {
- "name": "server_port",
- "max": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": []
- },
- "log_to_file": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "type": "bool",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_file",
- "max": ""
- },
- "server_addr": {
- "type": "str",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "desc": "",
- "name": "server_addr",
- "max": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "key_file": {
- "max": "",
- "name": "key_file",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "log_to_cluster": {
- "type": "bool",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- }
- },
- "name": "restful",
- "can_run": true
- },
- {
- "can_run": true,
- "name": "selftest",
- "module_options": {
- "rwoption3": {
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "rwoption3",
- "type": "float",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "rwoption1": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "rwoption1",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": []
- },
- "log_to_cluster_level": {
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info"
- },
- "rwoption6": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "name": "rwoption6",
- "max": ""
- },
- "rwoption7": {
- "min": "1",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "rwoption7",
- "max": "42",
- "type": "int",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "rwoption5": {
- "type": "bool",
- "name": "rwoption5",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "testkey": {
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": [],
- "type": "str",
- "name": "testkey",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": ""
- },
- "roption2": {
- "long_desc": "",
- "default_value": "xyz",
- "level": "advanced",
- "tags": [],
- "name": "roption2",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "type": "str"
- },
- "testnewline": {
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "testnewline",
- "max": "",
- "type": "str",
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": []
- },
- "rwoption4": {
- "type": "str",
- "desc": "",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "rwoption4",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "log_level": {
- "type": "str",
- "name": "log_level",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": []
- },
- "log_to_file": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "max": "",
- "name": "log_to_file",
- "type": "bool"
- },
- "testlkey": {
- "max": "",
- "name": "testlkey",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "rwoption2": {
- "name": "rwoption2",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "type": "int",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "roption1": {
- "type": "str",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "max": "",
- "name": "roption1",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- }
- },
- "error_string": ""
- },
- {
- "name": "snap_schedule",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "log_level": {
- "type": "str",
- "name": "log_level",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "dump_on_update": {
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "dump database to debug log on update",
- "name": "dump_on_update",
- "max": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster_level": {
- "name": "log_to_cluster_level",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- },
- "allow_m_granularity": {
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "allow minute scheduled snapshots",
- "name": "allow_m_granularity",
- "max": ""
- },
- "log_to_cluster": {
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": [],
- "type": "bool",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": ""
- },
- "log_to_file": {
- "type": "bool",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- }
- }
- },
- {
- "name": "stats",
- "can_run": true,
- "module_options": {
- "log_to_file": {
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "type": "bool"
- },
- "log_to_cluster_level": {
- "tags": [],
- "default_value": "info",
- "long_desc": "",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level"
- }
- },
- "error_string": ""
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_file": {
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "max": "",
- "name": "log_to_file",
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "log_to_cluster": {
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool",
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": []
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str"
- },
- "log_level": {
- "type": "str",
- "max": "",
- "name": "log_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- }
- },
- "can_run": true,
- "name": "status"
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_cluster": {
- "type": "bool",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced"
- },
- "log_to_file": {
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "log_to_file",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "address": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "unixgram:///tmp/telegraf.sock",
- "tags": [],
- "type": "str",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "address",
- "max": ""
- },
- "interval": {
- "max": "",
- "name": "interval",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "type": "secs",
- "tags": [],
- "long_desc": "",
- "default_value": "15",
- "level": "advanced"
- },
- "log_level": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "",
- "type": "str"
- },
- "log_to_cluster_level": {
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": ""
- }
- },
- "name": "telegraf",
- "can_run": true
- },
- {
- "name": "telemetry",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "last_opt_revision": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "1",
- "type": "int",
- "desc": "",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "last_opt_revision"
- },
- "organization": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "type": "str",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "organization"
- },
- "channel_basic": {
- "max": "",
- "name": "channel_basic",
- "desc": "Share basic cluster information (size, version)",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced"
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_cluster",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": ""
- },
- "channel_perf": {
- "type": "bool",
- "desc": "Share various performance metrics of a cluster",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "channel_perf",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "leaderboard_description": {
- "default_value": "",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "name": "leaderboard_description",
- "max": "",
- "type": "str"
- },
- "log_to_cluster_level": {
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1,
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced"
- },
- "channel_device": {
- "desc": "Share device health metrics (e.g., SMART data, minus potentially identifying info like serial numbers)",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "channel_device",
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True"
- },
- "channel_crash": {
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "type": "bool",
- "desc": "Share metadata about Ceph daemon crashes (version, stack straces, etc)",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "channel_crash"
- },
- "description": {
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "name": "description",
- "max": "",
- "type": "str",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "enabled": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "type": "bool",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "enabled"
- },
- "url": {
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "url",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "https://telemetry.ceph.com/report"
- },
- "contact": {
- "type": "str",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "contact",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "interval": {
- "min": "8",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "interval",
- "max": "",
- "type": "int",
- "level": "advanced",
- "long_desc": "",
- "default_value": "24",
- "tags": []
- },
- "log_to_file": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "log_to_file"
- },
- "log_level": {
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_level",
- "max": "",
- "type": "str",
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": []
- },
- "channel_ident": {
- "desc": "Share a user-provided description and/or contact email for the cluster",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "max": "",
- "name": "channel_ident",
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": ""
- },
- "leaderboard": {
- "type": "bool",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "desc": "",
- "name": "leaderboard",
- "max": "",
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "proxy": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "max": "",
- "name": "proxy",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": []
- },
- "device_url": {
- "tags": [],
- "default_value": "https://telemetry.ceph.com/device",
- "long_desc": "",
- "level": "advanced",
- "type": "str",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "max": "",
- "name": "device_url"
- }
- }
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_cluster_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "type": "str"
- },
- "log_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "log_level"
- },
- "log_to_file": {
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool"
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool"
- }
- },
- "can_run": true,
- "name": "test_orchestrator"
- },
- {
- "name": "volumes",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "log_to_cluster": {
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "max_concurrent_clones": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "4",
- "type": "int",
- "desc": "Number of asynchronous cloner threads",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "max_concurrent_clones"
- },
- "log_to_file": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": []
- },
- "log_level": {
- "max": "",
- "name": "log_level",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": ""
- },
- "log_to_cluster_level": {
- "type": "str",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info"
- },
- "snapshot_clone_delay": {
- "type": "int",
- "name": "snapshot_clone_delay",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "Delay clone begin operation by snapshot_clone_delay seconds",
- "long_desc": "",
- "default_value": "0",
- "level": "advanced",
- "tags": []
- }
- }
- },
- {
- "module_options": {
- "zabbix_host": {
- "max": "",
- "name": "zabbix_host",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "zabbix_sender": {
- "tags": [],
- "long_desc": "",
- "default_value": "/usr/bin/zabbix_sender",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "zabbix_sender",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0
- },
- "log_to_file": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "type": "bool"
- },
- "interval": {
- "type": "secs",
- "name": "interval",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "desc": "",
- "long_desc": "",
- "default_value": "60",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "type": "bool",
- "name": "log_to_cluster",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": ""
- },
- "discovery_interval": {
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "max": "",
- "name": "discovery_interval",
- "type": "uint",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "100"
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ]
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "max": "",
- "name": "log_level",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str"
- },
- "identifier": {
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "max": "",
- "name": "identifier",
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "zabbix_port": {
- "long_desc": "",
- "default_value": "10051",
- "level": "advanced",
- "tags": [],
- "type": "int",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "name": "zabbix_port",
- "max": ""
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "zabbix"
- }
- ]
- },
- "health": {
- "checks": {
- "POOL_NEARFULL": {
- "detail": [
- {
- "message": "pool '.mgr' is nearfull"
- },
- {
- "message": "pool 'vm_nvme' is nearfull"
- },
- {
- "message": "pool 'cephfs_data' is nearfull"
- },
- {
- "message": "pool 'cephfs_metadata' is nearfull"
- }
- ],
- "summary": {
- "count": 4,
- "message": "4 pool(s) nearfull"
- },
- "severity": "HEALTH_WARN",
- "muted": false
- },
- "OSD_NEARFULL": {
- "severity": "HEALTH_WARN",
- "detail": [
- {
- "message": "osd.3 is near full"
- },
- {
- "message": "osd.8 is near full"
- },
- {
- "message": "osd.9 is near full"
- }
- ],
- "summary": {
- "message": "3 nearfull osd(s)",
- "count": 3
- },
- "muted": false
- }
- },
- "status": "HEALTH_WARN",
- "mutes": []
- }
- }
-}`)
-}
diff --git a/go-proxmox/tests/mocks/pve8x/cluster.go b/go-proxmox/tests/mocks/pve8x/cluster.go
deleted file mode 100644
index 11f94fe..0000000
--- a/go-proxmox/tests/mocks/pve8x/cluster.go
+++ /dev/null
@@ -1,522 +0,0 @@
-package pve8x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func cluster() {
- gock.New(config.C.URI).
- Get("/cluster/nextid$").
- Reply(200).
- JSON(`{"data": "100"}`)
-
- gock.New(config.C.URI).
- Get("/cluster/nextid$").
- MatchParam("vmid", "100").
- Reply(200).
- JSON(`{"data": "100"}`)
-
- gock.New(config.C.URI).
- Get("/cluster/nextid").
- MatchParam("vmid", "200").
- Reply(400).
- JSON(`{"errors":{"vmid":"VM 200 already exists"},"data":null}`)
-
- gock.New(config.C.URI).
- Get("/cluster/status").
- Reply(200).
- JSON(`{
- "data": [
- {
- "type": "cluster",
- "version": 4,
- "quorate": 1,
- "name": "clustername",
- "id": "cluster",
- "nodes": 4
- },
- {
- "name": "node2",
- "nodeid": 2,
- "id": "node/node2",
- "online": 1,
- "type": "node",
- "ip": "192.168.1.2",
- "local": 0,
- "level": ""
- },
- {
- "name": "node3",
- "nodeid": 3,
- "type": "node",
- "ip": "192.168.1.3",
- "local": 0,
- "id": "node/node3",
- "online": 1,
- "level": ""
- },
- {
- "name": "node1",
- "nodeid": 1,
- "online": 1,
- "id": "node/node1",
- "local": 1,
- "ip": "192.168.1.1",
- "type": "node",
- "level": ""
- },
- {
- "nodeid": 4,
- "name": "node4",
- "level": "",
- "local": 0,
- "type": "node",
- "ip": "192.168.1.4",
- "online": 1,
- "id": "node/node4"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/cluster/resources$").
- MatchParams(map[string]string{
- "type": "node",
- }).
- Reply(200).
- JSON(`{
- "data": [
- {
- "type": "node",
- "id": "node1"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/cluster/resources$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "netout": 545248946,
- "type": "qemu",
- "name": "server1",
- "maxcpu": 1,
- "mem": 842551296,
- "netin": 2456116121,
- "maxmem": 1073741824,
- "disk": 0,
- "node": "node2",
- "cpu": 0.0249060195469461,
- "maxdisk": 34359738368,
- "vmid": 100,
- "diskwrite": 6059209728,
- "diskread": 4510777856,
- "status": "running",
- "template": 0,
- "id": "qemu/100",
- "uptime": 874350
- },
- {
- "id": "qemu/101",
- "diskwrite": 0,
- "status": "stopped",
- "diskread": 0,
- "template": 1,
- "uptime": 0,
- "name": "leap154",
- "maxcpu": 4,
- "mem": 0,
- "netin": 0,
- "maxmem": 16777216000,
- "netout": 0,
- "type": "qemu",
- "maxdisk": 68719476736,
- "vmid": 101,
- "disk": 0,
- "node": "node1",
- "cpu": 0
- },
- {
- "netout": 0,
- "type": "qemu",
- "maxcpu": 4,
- "name": "machine-test",
- "maxmem": 8388608000,
- "netin": 0,
- "mem": 0,
- "node": "node1",
- "disk": 0,
- "cpu": 0,
- "maxdisk": 53901000704,
- "vmid": 102,
- "status": "stopped",
- "diskwrite": 0,
- "diskread": 0,
- "template": 0,
- "id": "qemu/102",
- "uptime": 0,
- "tags": "go-proxmox+cloud-init"
- },
- {
- "type": "qemu",
- "netout": 0,
- "netin": 0,
- "mem": 0,
- "maxmem": 8388608000,
- "maxcpu": 4,
- "name": "VM 200",
- "cpu": 0,
- "node": "node1",
- "disk": 0,
- "vmid": 200,
- "maxdisk": 53901000704,
- "template": 0,
- "diskwrite": 0,
- "diskread": 0,
- "status": "stopped",
- "id": "qemu/200",
- "uptime": 0
- },
- {
- "maxdisk": 482713534464,
- "cpu": 0.0054917623564653,
- "node": "node3",
- "disk": 2983723008,
- "maxmem": 16668827648,
- "mem": 1681965056,
- "maxcpu": 4,
- "type": "node",
- "uptime": 872961,
- "level": "",
- "id": "node/node3",
- "cgroup-mode": 2,
- "status": "online"
- },
- {
- "cgroup-mode": 2,
- "status": "online",
- "id": "node/node2",
- "level": "",
- "uptime": 874373,
- "type": "node",
- "mem": 8127873024,
- "maxmem": 33567911936,
- "maxcpu": 12,
- "cpu": 0.00365387809333998,
- "node": "node2",
- "disk": 2797338624,
- "maxdisk": 940166742016
- },
- {
- "status": "online",
- "cgroup-mode": 2,
- "id": "node/node1",
- "level": "",
- "uptime": 872854,
- "type": "node",
- "maxcpu": 8,
- "mem": 2113265664,
- "maxmem": 65919459328,
- "disk": 10486546432,
- "node": "node1",
- "cpu": 0.00336910406788121,
- "maxdisk": 951055941632
- },
- {
- "cgroup-mode": 2,
- "status": "online",
- "id": "node/node4",
- "level": "",
- "uptime": 872920,
- "type": "node",
- "mem": 1698938880,
- "maxmem": 16651702272,
- "maxcpu": 4,
- "cpu": 0.00724094881398252,
- "disk": 2789867520,
- "node": "node4",
- "maxdisk": 482719825920
- },
- {
- "shared": 0,
- "type": "storage",
- "status": "available",
- "plugintype": "zfspool",
- "id": "storage/node3/local-zfs",
- "storage": "local-zfs",
- "node": "node3",
- "disk": 98304,
- "content": "images,rootdir",
- "maxdisk": 479730032640
- },
- {
- "shared": 0,
- "type": "storage",
- "status": "available",
- "id": "storage/node2/local-zfs",
- "plugintype": "zfspool",
- "content": "images,rootdir",
- "disk": 25294921728,
- "storage": "local-zfs",
- "node": "node2",
- "maxdisk": 962664386560
- },
- {
- "maxdisk": 955016175616,
- "node": "node1",
- "storage": "local-zfs",
- "content": "images,rootdir",
- "disk": 14446702592,
- "id": "storage/node1/local-zfs",
- "plugintype": "zfspool",
- "status": "available",
- "shared": 0,
- "type": "storage"
- },
- {
- "type": "storage",
- "shared": 0,
- "status": "available",
- "plugintype": "zfspool",
- "id": "storage/node4/local-zfs",
- "content": "images,rootdir",
- "disk": 98304,
- "storage": "local-zfs",
- "node": "node4",
- "maxdisk": 479930105856
- },
- {
- "maxdisk": 482713534464,
- "content": "backup,vztmpl,iso",
- "disk": 2983723008,
- "storage": "local",
- "node": "node3",
- "plugintype": "dir",
- "id": "storage/node3/local",
- "status": "available",
- "type": "storage",
- "shared": 0
- },
- {
- "maxdisk": 940166742016,
- "node": "node2",
- "storage": "local",
- "disk": 2797338624,
- "content": "backup,vztmpl,iso",
- "id": "storage/node2/local",
- "plugintype": "dir",
- "shared": 0,
- "type": "storage",
- "status": "available"
- },
- {
- "maxdisk": 951055941632,
- "disk": 10486546432,
- "content": "backup,vztmpl,iso",
- "storage": "local",
- "node": "node1",
- "id": "storage/node1/local",
- "plugintype": "dir",
- "status": "available",
- "shared": 0,
- "type": "storage"
- },
- {
- "plugintype": "dir",
- "id": "storage/node4/local",
- "status": "available",
- "shared": 0,
- "type": "storage",
- "maxdisk": 482719825920,
- "storage": "local",
- "node": "node4",
- "content": "backup,vztmpl,iso",
- "disk": 2789867520
- },
- {
- "plugintype": "dir",
- "id": "storage/node3/cloud-init",
- "status": "available",
- "type": "storage",
- "shared": 0,
- "maxdisk": 482713534464,
- "content": "snippets",
- "disk": 2983723008,
- "storage": "cloud-init",
- "node": "node3"
- },
- {
- "plugintype": "dir",
- "id": "storage/node2/cloud-init",
- "status": "available",
- "type": "storage",
- "shared": 0,
- "maxdisk": 940166742016,
- "disk": 2797338624,
- "content": "snippets",
- "node": "node2",
- "storage": "cloud-init"
- },
- {
- "disk": 10486546432,
- "content": "snippets",
- "node": "node1",
- "storage": "cloud-init",
- "maxdisk": 951055941632,
- "status": "available",
- "type": "storage",
- "shared": 0,
- "id": "storage/node1/cloud-init",
- "plugintype": "dir"
- },
- {
- "id": "storage/node4/cloud-init",
- "plugintype": "dir",
- "type": "storage",
- "shared": 0,
- "status": "available",
- "maxdisk": 482719825920,
- "content": "snippets",
- "disk": 2789867520,
- "storage": "cloud-init",
- "node": "node4"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/cluster/sdn/zones$").
- MatchParams(map[string]string{
- "type": "vxlan",
- }).
- Reply(200).
- JSON(`{
- "data": [
- {"zone":"test1","type":"vxlan","ipam":"pve"}
- ]
- }`)
-
- gock.New(config.C.URI).
- Get("^/cluster/sdn/zones$").
- Reply(200).
- JSON(`{
- "data": [
- {"zone":"test1","type":"vxlan","ipam":"pve"},
- {"zone":"test2","type":"simple","ipam":"pve"}
- ]
- }`)
-
- gock.New(config.C.URI).
- Get("^/cluster/sdn/vnets$").
- Reply(200).
- JSON(`{
- "data": [
- {"vnet":"user1","type":"vnet","zone":"test1","vlanaware":1,"tag":10},
- {"vnet":"user10","type":"vnet","zone":"test1","vlanaware":1,"tag":30},
- {"vnet":"user11","type":"vnet","zone":"test1","vlanaware":1,"tag":31},
- {"vnet":"user2","type":"vnet","zone":"test3","vlanaware":1,"tag":11},
- {"vnet":"user3","type":"vnet","zone":"test1","vlanaware":1,"tag":12}
- ]
- }`)
-
- gock.New(config.C.URI).
- Get("^/cluster/sdn/vnets/user1$").
- Reply(200).
- JSON(`{
- "data": {"vnet":"user1","type":"vnet","zone":"test1","vlanaware":1,"tag":10}
- }`)
-
- // GET /cluster/firewall/groups - List firewall security groups
- gock.New(config.C.URI).
- Persist().
- Get("^/cluster/firewall/groups$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "group": "test-group",
- "comment": "Test security group"
- },
- {
- "group": "web-servers",
- "comment": "Web server security group"
- }
- ]
- }`)
-
- // GET /cluster/firewall/groups/{group} - Get firewall group rules
- gock.New(config.C.URI).
- Persist().
- Get("^/cluster/firewall/groups/test-group$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "pos": 0,
- "type": "in",
- "action": "ACCEPT",
- "enable": 1,
- "proto": "tcp",
- "dport": "22",
- "comment": "Allow SSH"
- },
- {
- "pos": 1,
- "type": "in",
- "action": "ACCEPT",
- "enable": 1,
- "proto": "tcp",
- "dport": "80",
- "comment": "Allow HTTP"
- }
- ]
- }`)
-
- // POST /cluster/firewall/groups - Create new firewall group
- gock.New(config.C.URI).
- Persist().
- Post("^/cluster/firewall/groups$").
- Reply(200).
- JSON(`{
- "data": null
- }`)
-
- // POST /cluster/firewall/groups/{group} - Create rule in group
- gock.New(config.C.URI).
- Persist().
- Post("^/cluster/firewall/groups/test-group$").
- Reply(200).
- JSON(`{
- "data": null
- }`)
-
- // PUT /cluster/firewall/groups/{group}/{pos} - Update rule in group
- gock.New(config.C.URI).
- Persist().
- Put("^/cluster/firewall/groups/test-group/[0-9]+$").
- Reply(200).
- JSON(`{
- "data": null
- }`)
-
- // DELETE /cluster/firewall/groups/{group}/{pos} - Delete rule from group
- gock.New(config.C.URI).
- Persist().
- Delete("^/cluster/firewall/groups/test-group/[0-9]+$").
- Reply(200).
- JSON(`{
- "data": null
- }`)
-
- // DELETE /cluster/firewall/groups/{group} - Delete firewall group
- gock.New(config.C.URI).
- Persist().
- Delete("^/cluster/firewall/groups/test-group$").
- Reply(200).
- JSON(`{
- "data": null
- }`)
-}
diff --git a/go-proxmox/tests/mocks/pve8x/containers.go b/go-proxmox/tests/mocks/pve8x/containers.go
deleted file mode 100644
index 817fc36..0000000
--- a/go-proxmox/tests/mocks/pve8x/containers.go
+++ /dev/null
@@ -1,224 +0,0 @@
-package pve8x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func containers() {
- // GET /nodes/{node}/lxc - List containers
- gock.New(config.C.URI).
- Get("^/nodes/node1/lxc$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "vmid": 100,
- "status": "running",
- "name": "ct-test-1",
- "cpus": 2,
- "maxmem": 2147483648,
- "maxdisk": 10737418240,
- "maxswap": 536870912,
- "uptime": 12345,
- "tags": "prod;web"
- },
- {
- "vmid": 101,
- "status": "stopped",
- "name": "ct-test-2",
- "cpus": 1,
- "maxmem": 1073741824,
- "maxdisk": 8589934592,
- "maxswap": 268435456,
- "uptime": 0,
- "tags": "tag1;tag2"
- },
- {
- "vmid": 102,
- "status": "running",
- "name": "ct-test-3",
- "cpus": 4,
- "maxmem": 4294967296,
- "maxdisk": 21474836480,
- "maxswap": 1073741824,
- "uptime": 54321,
- "tags": ""
- }
- ]
-}`)
-
- // GET /nodes/{node}/lxc/{vmid}/status/current - Get container current status
- gock.New(config.C.URI).
- Get("^/nodes/node1/lxc/101/status/current$").
- Reply(200).
- JSON(`{
- "data": {
- "vmid": 101,
- "status": "stopped",
- "name": "ct-test-2",
- "cpus": 1,
- "maxmem": 1073741824,
- "maxdisk": 8589934592,
- "maxswap": 268435456,
- "uptime": 0,
- "tags": "tag1;tag2"
- }
-}`)
-
- // GET /nodes/{node}/lxc/{vmid}/config - Get container configuration
- gock.New(config.C.URI).
- Get("^/nodes/node1/lxc/101/config$").
- Reply(200).
- JSON(`{
- "data": {
- "arch": "amd64",
- "cores": 1,
- "hostname": "ct-test-2",
- "memory": 1024,
- "net0": "name=eth0,bridge=vmbr0,firewall=1,hwaddr=BC:24:11:2E:C5:7E,ip=dhcp,type=veth",
- "ostype": "ubuntu",
- "rootfs": "local-lvm:vm-101-disk-0,size=8G",
- "swap": 256,
- "tags": "tag1;tag2",
- "digest": "abcdef1234567890"
- }
-}`)
-
- // POST /nodes/{node}/lxc/{vmid}/clone - Clone container
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/clone$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzmigrate:101:root@pam:"}`)
-
- // DELETE /nodes/{node}/lxc/{vmid} - Delete container
- gock.New(config.C.URI).
- Delete("^/nodes/node1/lxc/101$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzdestroy:101:root@pam:"}`)
-
- // PUT /nodes/{node}/lxc/{vmid}/config - Update container config
- gock.New(config.C.URI).
- Put("^/nodes/node1/lxc/101/config$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzconfig:101:root@pam:"}`)
-
- // POST /nodes/{node}/lxc/{vmid}/status/start - Start container
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/status/start$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzstart:101:root@pam:"}`)
-
- // POST /nodes/{node}/lxc/{vmid}/status/stop - Stop container
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/status/stop$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzstop:101:root@pam:"}`)
-
- // POST /nodes/{node}/lxc/{vmid}/status/suspend - Suspend container
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/status/suspend$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzsuspend:101:root@pam:"}`)
-
- // POST /nodes/{node}/lxc/{vmid}/status/reboot - Reboot container
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/status/reboot$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzreboot:101:root@pam:"}`)
-
- // POST /nodes/{node}/lxc/{vmid}/status/resume - Resume container
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/status/resume$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzresume:101:root@pam:"}`)
-
- // POST /nodes/{node}/lxc/{vmid}/status/shutdown - Shutdown container
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/status/shutdown$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzshutdown:101:root@pam:"}`)
-
- // POST /nodes/{node}/lxc/{vmid}/template - Convert to template
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/template$").
- Reply(200).
- JSON(`{"data": null}`)
-
- // GET /nodes/{node}/lxc/{vmid}/snapshot - List snapshots
- gock.New(config.C.URI).
- Get("^/nodes/node1/lxc/101/snapshot$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "name": "snapshot1",
- "description": "First snapshot",
- "snaptime": 1609459200
- },
- {
- "name": "snapshot2",
- "description": "Second snapshot",
- "snaptime": 1609545600
- },
- {
- "name": "snapshot3",
- "description": "Third snapshot",
- "snaptime": 1609632000
- }
- ]
-}`)
-
- // POST /nodes/{node}/lxc/{vmid}/snapshot - Create snapshot
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/snapshot$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzsnapshot:101:root@pam:"}`)
-
- // GET /nodes/{node}/lxc/{vmid}/snapshot/{snapname} - Get snapshot
- gock.New(config.C.URI).
- Get("^/nodes/node1/lxc/101/snapshot/snapshot1$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "name": "snapshot1",
- "description": "First snapshot",
- "snaptime": 1609459200
- }
- ]
-}`)
-
- // DELETE /nodes/{node}/lxc/{vmid}/snapshot/{snapname} - Delete snapshot
- gock.New(config.C.URI).
- Delete("^/nodes/node1/lxc/101/snapshot/snapshot1$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzdelsnapshot:101:root@pam:"}`)
-
- // POST /nodes/{node}/lxc/{vmid}/snapshot/{snapname}/rollback - Rollback snapshot
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/snapshot/snapshot1/rollback$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzrollback:101:root@pam:"}`)
-
- // GET /nodes/{node}/lxc/{vmid}/interfaces - Get network interfaces
- gock.New(config.C.URI).
- Get("^/nodes/node1/lxc/101/interfaces$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "hwaddr": "00:00:00:00:00:00",
- "inet": "127.0.0.1/8",
- "inet6": "::1/128",
- "name": "lo"
- },
- {
- "hwaddr": "bc:24:11:89:67:07",
- "inet": "192.168.3.95/22",
- "inet6": "fe80::be24:11ff:fe89:6707/64",
- "name": "eth0"
- }
- ]
-}`)
-}
diff --git a/go-proxmox/tests/mocks/pve8x/nodes.go b/go-proxmox/tests/mocks/pve8x/nodes.go
deleted file mode 100644
index 3f40e76..0000000
--- a/go-proxmox/tests/mocks/pve8x/nodes.go
+++ /dev/null
@@ -1,645 +0,0 @@
-package pve8x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func nodes() {
- // GET /nodes - List all nodes
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "uptime": 2236708,
- "level": "",
- "maxmem": 33568288768,
- "disk": 2310930432,
- "node": "node1",
- "maxdisk": 940743983104,
- "mem": 11508809728,
- "ssl_fingerprint": "80:D4:F2:DF:64:95:CD:8D:A0:82:82:AC:48:BA:C0:7A:1B:6B:87:8B:FE:B9:83:1C:95:4E:79:58:77:99:69:F5",
- "status": "online",
- "type": "node",
- "cpu": 0.00348605577689243,
- "id": "node/node1",
- "maxcpu": 12
- },
- {
- "level": "",
- "uptime": 6256882,
- "node": "node2",
- "maxdisk": 482721529856,
- "maxmem": 16651751424,
- "disk": 2303721472,
- "ssl_fingerprint": "17:F1:B6:52:8B:0C:22:4A:97:1F:B2:F2:90:3D:29:0A:D0:DF:BE:0E:76:5A:B5:EC:F6:2E:6E:8F:60:E6:C5:C0",
- "status": "online",
- "mem": 1838854144,
- "maxcpu": 4,
- "cpu": 0.00722831505483549,
- "type": "node",
- "id": "node/node2"
- },
- {
- "maxdisk": 482717728768,
- "node": "node3",
- "disk": 2315386880,
- "maxmem": 16668868608,
- "level": "",
- "uptime": 6258488,
- "maxcpu": 4,
- "id": "node/node3",
- "cpu": 0.00821557582405153,
- "type": "node",
- "status": "online",
- "ssl_fingerprint": "1D:56:94:B4:75:4B:5C:33:46:DD:14:38:6C:EC:6E:12:A8:F0:66:64:5E:F2:40:F7:60:2A:C0:9F:BF:6C:51:3C",
- "mem": 1858961408
- },
- {
- "maxmem": 65919561728,
- "disk": 9992273920,
- "node": "node4",
- "maxdisk": 951055024128,
- "uptime": 6257222,
- "level": "",
- "cpu": 0.00748876684972541,
- "type": "node",
- "id": "node/node4",
- "maxcpu": 8,
- "mem": 2268295168,
- "ssl_fingerprint": "0D:78:80:CD:64:8E:96:E5:31:87:1C:45:3C:62:93:2F:23:4C:D5:02:42:FE:C8:40:DC:AF:3D:2A:F8:B4:F6:CE",
- "status": "online"
- }
- ]
-}`)
-
- // GET /nodes/node1/version - Node version
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/version$").
- Reply(200).
- JSON(`{
- "data": {
- "release": "8.4",
- "version": "8.4-1",
- "repoid": "761609f7"
- }
-}`)
-
- // GET /nodes/doesntexist/status - Error case for non-existent node
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/doesntexist/status$").
- Reply(500).
- JSON(`{
- "data": null
-}`)
-
- // GET /nodes/node1/status - Node status
- gock.New(config.C.URI).
- Get("^/nodes/node1/status$").
- Reply(200).
- JSON(`{
- "data": {
- "cpu": 0.0123456789,
- "memory": {
- "used": 2147483648,
- "total": 8589934592,
- "free": 6442450944
- },
- "uptime": 86400,
- "loadavg": ["0.15", "0.25", "0.30"],
- "kversion": "Linux 6.8.12-4-pve",
- "pveversion": "pve-manager/8.4-1/761609f7",
- "cpuinfo": {
- "model": "Intel(R) Xeon(R) CPU E5-2680 v4",
- "cores": 4,
- "cpus": 8,
- "sockets": 1
- }
- }
-}`)
-
- // GET /nodes/node2/status - Node status for node2
- gock.New(config.C.URI).
- Get("^/nodes/node2/status$").
- Reply(200).
- JSON(`{
- "data": {
- "cpu": 0.0234567890,
- "memory": {
- "used": 4294967296,
- "total": 17179869184,
- "free": 12884901888
- },
- "uptime": 172800,
- "loadavg": ["0.25", "0.35", "0.40"],
- "kversion": "Linux 6.8.12-4-pve",
- "pveversion": "pve-manager/8.4-1/761609f7",
- "cpuinfo": {
- "model": "Intel(R) Xeon(R) CPU E5-2680 v4",
- "cores": 8,
- "cpus": 16,
- "sockets": 2
- }
- }
-}`)
-
- // GET /nodes/{node}/network/{iface} - Get specific network interface
- gock.New(config.C.URI).
- Get("^/nodes/node1/network/vmbr0$").
- Reply(200).
- JSON(`{
- "data": {
- "iface": "vmbr0",
- "type": "bridge",
- "method": "static",
- "method6": "manual",
- "address": "192.168.1.100",
- "netmask": "24",
- "cidr": "192.168.1.100/24",
- "gateway": "192.168.1.1",
- "bridge_ports": "eno1",
- "bridge_stp": "off",
- "bridge_fd": "0",
- "autostart": 1,
- "active": 1,
- "priority": 10,
- "families": ["inet"]
- }
-}`)
-
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/network").
- ParamPresent("type").
- Reply(200).
- JSON(`{
- "data": [
- {
- "iface": "vmbr1",
- "bridge_fd": "0",
- "autostart": 1,
- "bridge_ports": "eno1.2 vmbr2.10",
- "priority": 31,
- "families": [
- "inet"
- ],
- "bridge_vids": "2-4094",
- "active": "1",
- "bridge_stp": "off",
- "bridge_vlan_aware": 1,
- "type": "bridge",
- "comments": "some comment\n",
- "method6": "manual",
- "method": "manual"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/network$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "method": "manual",
- "method6": "manual",
- "priority": 20,
- "families": [
- "inet"
- ],
- "type": "eth",
- "exists": 1,
- "iface": "eno1"
- },
- {
- "netmask": "32",
- "priority": 16,
- "families": [
- "inet"
- ],
- "address": "192.168.2.50",
- "cidr": "192.168.2.50/32",
- "vlan-raw-device": "eno1",
- "vlan-id": "2",
- "iface": "eno1.2",
- "autostart": 1,
- "exists": 1,
- "options": [
- "metric 200"
- ],
- "method6": "manual",
- "method": "static",
- "type": "vlan",
- "comments": "Some Comment\n",
- "active": 1
- },
- {
- "iface": "vmbr1",
- "bridge_fd": "0",
- "autostart": 1,
- "bridge_ports": "eno1.2 vmbr2.10",
- "priority": 31,
- "families": [
- "inet"
- ],
- "bridge_vids": "2-4094",
- "active": 1,
- "bridge_stp": "off",
- "bridge_vlan_aware": 1,
- "type": "bridge",
- "comments": "some comment\n",
- "method6": "manual",
- "method": "manual"
- },
- {
- "options": [
- "metric 100"
- ],
- "exists": null,
- "iface": "vmbr2.2",
- "autostart": 1,
- "vlan-id": "2",
- "vlan-raw-device": "vmbr2",
- "cidr": "192.168.22.31/24",
- "address": "192.168.22.31",
- "priority": 33,
- "families": [
- "inet"
- ],
- "netmask": "24",
- "active": 1,
- "type": "vlan",
- "method": "static",
- "method6": "manual"
- },
- {
- "families": [
- "inet"
- ],
- "priority": 35,
- "netmask": "24",
- "cidr": "172.16.20.1/24",
- "vlan-raw-device": "vmbr2",
- "address": "172.20.0.1",
- "iface": "vmbr2.8",
- "exists": null,
- "autostart": 1,
- "vlan-id": "8",
- "method": "static",
- "method6": "manual",
- "comments": "Some Network\n",
- "type": "vlan",
- "active": 1
- }
- ]
-}`)
-
- // GET /nodes/node2/network - Node2 network interfaces (should return 2 per test)
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node2/network$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "iface": "eno1",
- "type": "eth",
- "method": "manual",
- "method6": "manual",
- "priority": 20,
- "families": ["inet"],
- "exists": 1
- },
- {
- "iface": "vmbr0",
- "type": "bridge",
- "method": "static",
- "method6": "manual",
- "address": "192.168.1.101",
- "netmask": "24",
- "cidr": "192.168.1.101/24",
- "gateway": "192.168.1.1",
- "bridge_ports": "eno1",
- "bridge_stp": "off",
- "bridge_fd": "0",
- "autostart": 1,
- "active": 1,
- "priority": 10,
- "families": ["inet"]
- }
- ]
-}`)
-
- // GET /nodes/{node}/report - Get node report
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/report$").
- Reply(200).
- JSON(`{
- "data": "pve-manager: 8.4-1\nkernel: 6.8.0-1-pve\nproxmox-ve: 8.4-1\nqemu-server: 8.4-1\nlxc-pve: 5.0.0-1"
-}`)
-
- // POST /nodes/{node}/termproxy - Create terminal proxy
- gock.New(config.C.URI).
- Persist().
- Post("^/nodes/node1/termproxy$").
- Reply(200).
- JSON(`{
- "data": {
- "port": 5900,
- "ticket": "PVE:termproxy:12345678",
- "upid": "UPID:node1:00001234:00005678:12345678:termproxy:root@pam:",
- "user": "root@pam"
- }
-}`)
-
- // GET /nodes/{node}/aplinfo - List appliances
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/aplinfo$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "template": "ubuntu-22.04-standard",
- "type": "lxc",
- "package": "ubuntu-22.04-standard_22.04-1_amd64.tar.zst",
- "os": "ubuntu",
- "version": "22.04",
- "headline": "Ubuntu 22.04 LTS",
- "infopage": "https://pve.proxmox.com/wiki/Linux_Container",
- "description": "Ubuntu 22.04 LTS (Jammy Jellyfish) standard system",
- "section": "system"
- },
- {
- "template": "debian-12-standard",
- "type": "lxc",
- "package": "debian-12-standard_12.0-1_amd64.tar.zst",
- "os": "debian",
- "version": "12.0",
- "headline": "Debian 12 (Bookworm)",
- "infopage": "https://pve.proxmox.com/wiki/Linux_Container",
- "description": "Debian 12 (Bookworm) standard system",
- "section": "system"
- }
- ]
-}`)
-
- // POST /nodes/{node}/aplinfo - Download appliance
- gock.New(config.C.URI).
- Persist().
- Post("^/nodes/node1/aplinfo$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00001234:00005678:12345678:download:root@pam:"
-}`)
-
- // GET /nodes/{node}/storage - List storages
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/storage$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "storage": "local",
- "content": "images,rootdir,vztmpl,backup,iso,snippets",
- "type": "dir",
- "active": 1,
- "avail": 50000000000,
- "used": 10000000000,
- "total": 60000000000,
- "enabled": 1,
- "shared": 0
- },
- {
- "storage": "local-lvm",
- "content": "images,rootdir",
- "type": "lvmthin",
- "active": 1,
- "avail": 100000000000,
- "used": 20000000000,
- "total": 120000000000,
- "enabled": 1,
- "shared": 0
- }
- ]
-}`)
-
- // GET /nodes/{node}/storage/{storage}/status - Get storage status
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/storage/local/status$").
- Reply(200).
- JSON(`{
- "data": {
- "storage": "local",
- "content": "images,rootdir,vztmpl,backup,iso,snippets",
- "type": "dir",
- "active": 1,
- "avail": 50000000000,
- "used": 10000000000,
- "total": 60000000000,
- "enabled": 1,
- "shared": 0
- }
-}`)
-
- // GET /nodes/{node}/storage/{storage}/content - List storage content
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/storage/local/content").
- MatchParam("content", "vztmpl").
- Reply(200).
- JSON(`{
- "data": [
- {
- "volid": "local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst",
- "content": "vztmpl",
- "format": "tgz",
- "size": 123456789,
- "ctime": 1234567890
- },
- {
- "volid": "local:vztmpl/debian-12-standard_12.0-1_amd64.tar.zst",
- "content": "vztmpl",
- "format": "tgz",
- "size": 98765432,
- "ctime": 1234567890
- }
- ]
-}`)
-
- // POST /nodes/{node}/storage/{storage}/download-url - Download from URL
- gock.New(config.C.URI).
- Persist().
- Post("^/nodes/node1/storage/local/download-url$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00001234:00005678:12345678:download:root@pam:"
-}`)
-
- // GET /nodes/{node}/firewall/options - Get firewall options
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/firewall/options$").
- Reply(200).
- JSON(`{
- "data": {
- "enable": true,
- "log_level_in": "info",
- "log_level_out": "info",
- "ndp": true,
- "nf_conntrack_allow_invalid": false,
- "nf_conntrack_max": 262144,
- "nf_conntrack_tcp_timeout_established": 432000,
- "nosmurfs": true,
- "protection_synflood": false,
- "protection_synflood_burst": 1000,
- "protection_synflood_rate": 200,
- "smurf_log_level": "info",
- "tcp_flags_log_level": "nolog",
- "tcpflags": false
- }
-}`)
-
- // PUT /nodes/{node}/firewall/options - Update firewall options
- gock.New(config.C.URI).
- Persist().
- Put("^/nodes/node1/firewall/options$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // GET /nodes/{node}/firewall/rules - Get firewall rules
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/firewall/rules$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "pos": 0,
- "type": "in",
- "action": "ACCEPT",
- "enable": 1,
- "iface": "vmbr0",
- "source": "192.168.1.0/24",
- "dest": "192.168.1.100",
- "proto": "tcp",
- "dport": "22",
- "comment": "Allow SSH from LAN"
- },
- {
- "pos": 1,
- "type": "in",
- "action": "DROP",
- "enable": 1,
- "proto": "tcp",
- "dport": "22",
- "comment": "Block all other SSH"
- }
- ]
-}`)
-
- // POST /nodes/{node}/firewall/rules - Create firewall rule
- gock.New(config.C.URI).
- Persist().
- Post("^/nodes/node1/firewall/rules$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // PUT /nodes/{node}/firewall/rules/{pos} - Update firewall rule
- gock.New(config.C.URI).
- Persist().
- Put("^/nodes/node1/firewall/rules/[0-9]+$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // DELETE /nodes/{node}/firewall/rules/{pos} - Delete firewall rule
- gock.New(config.C.URI).
- Persist().
- Delete("^/nodes/node1/firewall/rules/[0-9]+$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // GET /nodes/{node}/certificates/info - Get certificates
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/certificates/info$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "filename": "/etc/pve/nodes/node1/pve-ssl.pem",
- "fingerprint": "80:D4:F2:DF:64:95:CD:8D:A0:82:82:AC:48:BA:C0:7A:1B:6B:87:8B:FE:B9:83:1C:95:4E:79:58:77:99:69:F5",
- "issuer": "Proxmox Virtual Environment",
- "notafter": 1735689600,
- "notbefore": 1704153600,
- "subject": "node1.example.com",
- "san": [
- "DNS:node1",
- "DNS:node1.example.com",
- "IP:192.168.1.100"
- ],
- "pem": "-----BEGIN CERTIFICATE-----\nMIIDXTCCAkWgAwIBAgIJAKZx...\n-----END CERTIFICATE-----"
- }
- ]
-}`)
-
- // POST /nodes/{node}/certificates/custom - Upload custom certificate
- gock.New(config.C.URI).
- Persist().
- Post("^/nodes/node1/certificates/custom$").
- Reply(200).
- JSON(`{
- "data": {
- "filename": "/etc/pve/nodes/node1/pve-ssl.pem",
- "fingerprint": "AB:CD:EF:12:34:56:78:90:AB:CD:EF:12:34:56:78:90:AB:CD:EF:12:34:56:78:90:AB:CD:EF:12:34:56:78:90",
- "issuer": "Custom CA",
- "notafter": 1767225600,
- "notbefore": 1735689600,
- "subject": "node1.example.com"
- }
-}`)
-
- // DELETE /nodes/{node}/certificates/custom - Delete custom certificate
- gock.New(config.C.URI).
- Persist().
- Delete("^/nodes/node1/certificates/custom$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // POST /nodes/{node}/vzdump - Backup VMs
- gock.New(config.C.URI).
- Persist().
- Post("^/nodes/node1/vzdump$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00001234:00005678:12345678:vzdump:root@pam:"
-}`)
-
- // GET /nodes/{node}/vzdump/extractconfig - Extract backup config
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/vzdump/extractconfig").
- Reply(200).
- JSON(`{
- "data": "cores: 2\nmemory: 2048\nostype: debian\nrootfs: local-lvm:vm-100-disk-0,size=8G\nnet0: name=eth0,bridge=vmbr0,ip=dhcp"
-}`)
-}
diff --git a/go-proxmox/tests/mocks/pve8x/pools.go b/go-proxmox/tests/mocks/pve8x/pools.go
deleted file mode 100644
index 5a5c82b..0000000
--- a/go-proxmox/tests/mocks/pve8x/pools.go
+++ /dev/null
@@ -1,164 +0,0 @@
-package pve8x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func pool() {
- gock.New(config.C.URI).
- Get("^/pools$").
- Reply(200).
- JSON(`{"data": [
- {
- "poolid": "test-pool",
- "comment": "Test pool"
- }
- ]
-}`)
-
- // Mock for the new /pools/?poolid=test-pool endpoint (returns array)
- gock.New(config.C.URI).
- Get("^/pools/$").
- MatchParam("poolid", "test-pool").
- Reply(200).
- JSON(`{"data": [
- {
- "poolid": "test-pool",
- "comment": "Test pool",
- "members": [
- {
- "disk": 0,
- "uptime": 88341,
- "diskwrite": 7389189632,
- "netout": 73088105,
- "maxmem": 17179869184,
- "maxdisk": 10737418240,
- "type": "qemu",
- "vmid": 100,
- "template": 0,
- "cpu": 0.0378721079577321,
- "name": "test-vm",
- "node": "pve1",
- "id": "qemu/100",
- "diskread": 500085248,
- "netin": 485707842,
- "maxcpu": 4,
- "mem": 3650678784,
- "status": "running"
- },
- {
- "diskread": 486947840,
- "id": "qemu/106",
- "cpu": 0.02889417191544,
- "template": 0,
- "name": "test-vm2",
- "node": "pve2",
- "maxcpu": 1,
- "netin": 337525157,
- "status": "running",
- "mem": 1744027648,
- "disk": 0,
- "diskwrite": 1382547968,
- "uptime": 88204,
- "netout": 21769689,
- "type": "qemu",
- "vmid": 106,
- "maxdisk": 10737418240,
- "maxmem": 2147483648
- },
- {
- "node": "node1",
- "maxdisk": 948340654080,
- "type": "storage",
- "id": "storage/node1/local",
- "status": "available",
- "storage": "local",
- "content": "backup,vztmpl,iso",
- "plugintype": "dir",
- "disk": 10486939648,
- "shared": 0
- }
- ]
- }
- ]
-}`)
-
- // Mock for the deprecated /pools/test-pool endpoint (kept for backwards compatibility)
- gock.New(config.C.URI).
- Get("^/pools/test-pool$").
- Reply(200).
- JSON(`{"data": {
- "comment": "Test pool",
- "members": [
- {
- "disk": 0,
- "uptime": 88341,
- "diskwrite": 7389189632,
- "netout": 73088105,
- "maxmem": 17179869184,
- "maxdisk": 10737418240,
- "type": "qemu",
- "vmid": 100,
- "template": 0,
- "cpu": 0.0378721079577321,
- "name": "test-vm",
- "node": "pve1",
- "id": "qemu/100",
- "diskread": 500085248,
- "netin": 485707842,
- "maxcpu": 4,
- "mem": 3650678784,
- "status": "running"
- },
- {
- "diskread": 486947840,
- "id": "qemu/106",
- "cpu": 0.02889417191544,
- "template": 0,
- "name": "test-vm2",
- "node": "pve2",
- "maxcpu": 1,
- "netin": 337525157,
- "status": "running",
- "mem": 1744027648,
- "disk": 0,
- "diskwrite": 1382547968,
- "uptime": 88204,
- "netout": 21769689,
- "type": "qemu",
- "vmid": 106,
- "maxdisk": 10737418240,
- "maxmem": 2147483648
- },
- {
- "node": "node1",
- "maxdisk": 948340654080,
- "type": "storage",
- "id": "storage/node1/local",
- "status": "available",
- "storage": "local",
- "content": "backup,vztmpl,iso",
- "plugintype": "dir",
- "disk": 10486939648,
- "shared": 0
- }
- ]
- }
-}`)
-
- gock.New(config.C.URI).
- Post("^/pools$").
- Reply(200).
- JSON(`{"data": null}`)
-
- gock.New(config.C.URI).
- Put("^/pools/test-pool$").
- Reply(200).
- JSON(`{"data": null}`)
-
- gock.New(config.C.URI).
- Delete("^/pools/test-pool$").
- Reply(200).
- JSON(`{"data": null}`)
-}
diff --git a/go-proxmox/tests/mocks/pve8x/proxmox.go b/go-proxmox/tests/mocks/pve8x/proxmox.go
deleted file mode 100644
index 2196a2b..0000000
--- a/go-proxmox/tests/mocks/pve8x/proxmox.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package pve8x
-
-func Load() {
- version()
- access()
- nodes()
- cluster()
- pool()
- ceph()
- containers()
- virtualMachines()
- storage()
- tasks()
-}
diff --git a/go-proxmox/tests/mocks/pve8x/storage.go b/go-proxmox/tests/mocks/pve8x/storage.go
deleted file mode 100644
index 543b6c0..0000000
--- a/go-proxmox/tests/mocks/pve8x/storage.go
+++ /dev/null
@@ -1,147 +0,0 @@
-package pve8x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func storage() {
- // GET /storage - List all cluster storages
- gock.New(config.C.URI).
- Persist().
- Get("^/storage$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "content": "vztmpl,iso,backup",
- "digest": "1234567890abcdef1234567890abcdef12345678",
- "storage": "local",
- "type": "dir",
- "shared": 0,
- "path": "/var/lib/vz"
- },
- {
- "content": "images,rootdir",
- "digest": "abcdef1234567890abcdef1234567890abcdef12",
- "storage": "local-lvm",
- "type": "lvmthin",
- "shared": 0,
- "thinpool": "data",
- "vgname": "pve"
- },
- {
- "content": "images,rootdir",
- "digest": "fedcba0987654321fedcba0987654321fedcba09",
- "storage": "nfs-storage",
- "type": "nfs",
- "shared": 1,
- "path": "/mnt/pve/nfs-storage",
- "nodes": "node1,node2"
- }
- ]
-}`)
-
- // GET /storage/{storage} - Get specific storage
- gock.New(config.C.URI).
- Persist().
- Get("^/storage/local$").
- Reply(200).
- JSON(`{
- "data": {
- "content": "vztmpl,iso,backup",
- "digest": "1234567890abcdef1234567890abcdef12345678",
- "storage": "local",
- "type": "dir",
- "shared": 0,
- "path": "/var/lib/vz"
- }
-}`)
-
- gock.New(config.C.URI).
- Persist().
- Get("^/storage/local-lvm$").
- Reply(200).
- JSON(`{
- "data": {
- "content": "images,rootdir",
- "digest": "abcdef1234567890abcdef1234567890abcdef12",
- "storage": "local-lvm",
- "type": "lvmthin",
- "shared": 0,
- "thinpool": "data",
- "vgname": "pve"
- }
-}`)
-
- // POST /storage - Create new storage
- gock.New(config.C.URI).
- Post("^/storage$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // PUT /storage/{storage} - Update storage
- gock.New(config.C.URI).
- Put("^/storage/local$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // DELETE /storage/{storage} - Delete storage
- gock.New(config.C.URI).
- Delete("^/storage/test-storage$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000001:00000001:00000001:storage:delete:root@pam:"
-}`)
-
- // GET /nodes/{node}/storage/{storage}/content - Get storage content
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/storage/local/content$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "volid": "local:iso/debian-12.0.0-amd64-netinst.iso",
- "content": "iso",
- "format": "iso",
- "size": 654311424,
- "ctime": 1693252591
- },
- {
- "volid": "local:vztmpl/debian-12-standard_12.0-1_amd64.tar.zst",
- "content": "vztmpl",
- "format": "tar.zst",
- "size": 128974848,
- "ctime": 1693252600
- },
- {
- "volid": "local:backup/vzdump-qemu-100-2023_08_28-12_00_00.vma.zst",
- "content": "backup",
- "format": "vma.zst",
- "size": 2147483648,
- "ctime": 1693252800
- }
- ]
-}`)
-
- // DELETE /nodes/{node}/storage/{storage}/content/{volume} - Delete storage content
- gock.New(config.C.URI).
- Delete("^/nodes/node1/storage/local/content/local:iso/test.iso$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000002:00000002:00000002:imgdel:delete:root@pam:"
-}`)
-
- // POST /nodes/{node}/storage/{storage}/download-url - Download from URL
- gock.New(config.C.URI).
- Post("^/nodes/node1/storage/local/download-url$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000003:00000003:00000003:download:iso:root@pam:"
-}`)
-}
diff --git a/go-proxmox/tests/mocks/pve8x/tasks.go b/go-proxmox/tests/mocks/pve8x/tasks.go
deleted file mode 100644
index ca5da43..0000000
--- a/go-proxmox/tests/mocks/pve8x/tasks.go
+++ /dev/null
@@ -1,117 +0,0 @@
-package pve8x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func tasks() {
- // GET /nodes/{node}/tasks/{upid}/status - Get task status (running)
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/tasks/UPID:node1:00000001:00000001:00000001:test:running:root@pam:/status$").
- Reply(200).
- JSON(`{
- "data": {
- "status": "running",
- "upid": "UPID:node1:00000001:00000001:00000001:test:running:root@pam:",
- "type": "test",
- "id": "running",
- "user": "root@pam",
- "node": "node1",
- "pid": 1,
- "pstart": 1,
- "starttime": 1693252591
- }
-}`)
-
- // GET /nodes/{node}/tasks/{upid}/status - Get task status (stopped/completed)
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/tasks/UPID:node1:00000002:00000002:00000002:test:completed:root@pam:/status$").
- Reply(200).
- JSON(`{
- "data": {
- "status": "stopped",
- "exitstatus": "OK",
- "upid": "UPID:node1:00000002:00000002:00000002:test:completed:root@pam:",
- "type": "test",
- "id": "completed",
- "user": "root@pam",
- "node": "node1",
- "pid": 2,
- "pstart": 2,
- "starttime": 1693252591,
- "endtime": 1693252600
- }
-}`)
-
- // GET /nodes/{node}/tasks/{upid}/status - Get task status (failed)
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/tasks/UPID:node1:00000003:00000003:00000003:test:failed:root@pam:/status$").
- Reply(200).
- JSON(`{
- "data": {
- "status": "stopped",
- "exitstatus": "some error occurred",
- "upid": "UPID:node1:00000003:00000003:00000003:test:failed:root@pam:",
- "type": "test",
- "id": "failed",
- "user": "root@pam",
- "node": "node1",
- "pid": 3,
- "pstart": 3,
- "starttime": 1693252591,
- "endtime": 1693252600
- }
-}`)
-
- // DELETE /nodes/{node}/tasks/{upid} - Stop task
- gock.New(config.C.URI).
- Delete("^/nodes/node1/tasks/UPID:node1:00000001:00000001:00000001:test:running:root@pam:$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // GET /nodes/{node}/tasks/{upid}/log - Get task log
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/tasks/UPID:node1:00000002:00000002:00000002:test:completed:root@pam:/log$").
- MatchParam("start", "0").
- MatchParam("limit", "50").
- Reply(200).
- JSON(`{
- "data": [
- {"n": 1, "t": "task started"},
- {"n": 2, "t": "processing step 1"},
- {"n": 3, "t": "processing step 2"},
- {"n": 4, "t": "processing step 3"},
- {"n": 5, "t": "task completed successfully"}
- ]
-}`)
-
- // GET /nodes/{node}/tasks/{upid}/log - Get task log with offset
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/tasks/UPID:node1:00000002:00000002:00000002:test:completed:root@pam:/log$").
- MatchParam("start", "5").
- MatchParam("limit", "50").
- Reply(200).
- JSON(`{
- "data": []
-}`)
-
- // GET /nodes/{node}/tasks/{upid}/log - Get task log for running task
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/tasks/UPID:node1:00000001:00000001:00000001:test:running:root@pam:/log$").
- Reply(200).
- JSON(`{
- "data": [
- {"n": 1, "t": "task started"},
- {"n": 2, "t": "processing..."}
- ]
-}`)
-}
diff --git a/go-proxmox/tests/mocks/pve8x/version.go b/go-proxmox/tests/mocks/pve8x/version.go
deleted file mode 100644
index c94456b..0000000
--- a/go-proxmox/tests/mocks/pve8x/version.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package pve8x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func version() {
- versionJSON := `
-{
- "data": {
- "repoid": "761609f7",
- "release": "8.4",
- "version": "8.4-1"
- }
-}`
- gock.New(config.C.URI).
- Get("^/version$").
- Reply(200).
- JSON(versionJSON)
-
- gock.New(config.C.URI).
- Post("^/version$"). // fake to test client Post method
- Reply(200).
- JSON(versionJSON)
-
- gock.New(config.C.URI).
- Put("^/version$"). // fake to test client Put method
- Reply(200).
- JSON(versionJSON)
-
- gock.New(config.C.URI).
- Delete("^/version$"). // fake to test client Delete method
- Reply(200).
- JSON(versionJSON)
-}
diff --git a/go-proxmox/tests/mocks/pve8x/virtual_machines.go b/go-proxmox/tests/mocks/pve8x/virtual_machines.go
deleted file mode 100644
index 5356cbb..0000000
--- a/go-proxmox/tests/mocks/pve8x/virtual_machines.go
+++ /dev/null
@@ -1,787 +0,0 @@
-package pve8x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func virtualMachines() {
- // GET /nodes/{node}/qemu/{vmid}/status/current - VM status
- gock.New(config.C.URI).
- Get("^/nodes/node1/qemu/101/status/current$").
- Reply(200).
- JSON(`{
- "data": {
- "pid": 1563102,
- "shares": 1000,
- "agent": 1,
- "diskwrite": 1515457024,
- "cpus": 8,
- "ha": {
- "managed": 0
- },
- "maxmem": 2097152000,
- "blockstat": {
- "scsi0": {
- "rd_total_time_ns": 7089432813,
- "flush_total_time_ns": 7442045713,
- "wr_total_time_ns": 65889619830,
- "failed_rd_operations": 0,
- "rd_bytes": 649448960,
- "wr_bytes": 1515457024,
- "unmap_operations": 469,
- "failed_unmap_operations": 0,
- "failed_wr_operations": 0,
- "account_failed": true,
- "invalid_unmap_operations": 0,
- "wr_operations": 157514,
- "rd_operations": 15582,
- "failed_flush_operations": 0,
- "invalid_wr_operations": 0,
- "account_invalid": true,
- "unmap_total_time_ns": 9514953,
- "unmap_merged": 0,
- "timed_stats": [],
- "unmap_bytes": 15973687808,
- "invalid_flush_operations": 0,
- "idle_time_ns": 4427685914,
- "flush_operations": 15494,
- "invalid_rd_operations": 0,
- "wr_highest_offset": 2808696832,
- "rd_merged": 0,
- "wr_merged": 0
- },
- "ide2": {
- "unmap_merged": 0,
- "timed_stats": [],
- "unmap_bytes": 0,
- "invalid_flush_operations": 0,
- "idle_time_ns": 170803536780303,
- "flush_operations": 0,
- "invalid_rd_operations": 0,
- "wr_highest_offset": 0,
- "rd_merged": 0,
- "wr_merged": 0,
- "failed_flush_operations": 0,
- "invalid_wr_operations": 0,
- "account_invalid": true,
- "unmap_total_time_ns": 0,
- "unmap_operations": 0,
- "failed_unmap_operations": 0,
- "failed_wr_operations": 0,
- "account_failed": true,
- "invalid_unmap_operations": 0,
- "wr_operations": 0,
- "rd_operations": 98,
- "rd_total_time_ns": 10689186,
- "flush_total_time_ns": 0,
- "wr_total_time_ns": 0,
- "failed_rd_operations": 0,
- "rd_bytes": 344348,
- "wr_bytes": 0
- }
- },
- "uptime": 170815,
- "cpu": 0.0112815646165076,
- "running-machine": "pc-i440fx-8.0+pve0",
- "balloon": 2097152000,
- "qmpstatus": "running",
- "status": "running",
- "maxdisk": 18467520512,
- "diskread": 649793308,
- "freemem": 887222272,
- "ballooninfo": {
- "actual": 2097152000,
- "max_mem": 2097152000,
- "free_mem": 887222272,
- "major_page_faults": 1811,
- "minor_page_faults": 3803793,
- "mem_swapped_out": 0,
- "mem_swapped_in": 0,
- "total_mem": 2015014912,
- "last_update": 1693252591
- },
- "vmid": 101,
- "balloon_min": 2097152000,
- "mem": 1127792640,
- "proxmox-support": {
- "pbs-dirty-bitmap-savevm": true,
- "pbs-dirty-bitmap": true,
- "query-bitmap-info": true,
- "pbs-masterkey": true,
- "backup-max-workers": true,
- "pbs-dirty-bitmap-migration": true,
- "pbs-library-version": "1.4.0 (UNKNOWN)"
- },
- "running-qemu": "8.0.2",
- "name": "matt",
- "netout": 14139344,
- "netin": 547369168,
- "nics": {
- "tap1001i0": {
- "netout": 14139344,
- "netin": 547369168
- }
- },
- "disk": 0
- }
-}`)
-
- // GET /nodes/{node}/qemu/{vmid}/rrddata - VM RRD data
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/qemu/101/rrddata$").
- MatchParams(map[string]string{
- "timeframe": "hour",
- }).
- Reply(200).
- JSON(`{
- "data": [
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693110660,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693110720,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693110780,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "time": 1693110840,
- "maxdisk": 68719476736,
- "disk": 0,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693110900
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693110960
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693111020,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "time": 1693111080,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693111140,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "time": 1693111200,
- "maxdisk": 68719476736,
- "disk": 0,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693111260,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693111320,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693111380,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693111440
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693111500,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693111560,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693111620,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693111680
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693111740,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693111800,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693111860,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693111920,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693111980,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693112040,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "time": 1693112100,
- "maxdisk": 68719476736,
- "disk": 0,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693112160,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693112220,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "time": 1693112280,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "time": 1693112340,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693112400,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693112460
- },
- {
- "time": 1693112520,
- "maxdisk": 68719476736,
- "disk": 0,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693112580,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693112640
- },
- {
- "time": 1693112700,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693112760,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693112820,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693112880,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693112940
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693113000,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113060,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693113120,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113180
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113240,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "time": 1693113300,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113360
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113420,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "time": 1693113480,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113540,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693113600,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693113660,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693113720,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113780
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693113840
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113900
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693113960,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693114020,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693114080,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693114140,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693114200
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693114260
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693114320,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "time": 1693114380,
- "maxdisk": 68719476736,
- "disk": 0,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "time": 1693114440,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693114500,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693114560,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693114620,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "time": 1693114680,
- "maxdisk": 68719476736,
- "disk": 0,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693114740,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693114800,
- "disk": 0,
- "maxdisk": 68719476736
- }
- ]
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/clone - Clone VM
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/101/clone").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // GET /nodes/{node}/qemu/{vmid}/config - Get VM config
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/qemu/100/config$").
- Reply(200).
- JSON(`{
- "data": {
- "digest": "abc123def456",
- "name": "test-vm",
- "vmid": 100,
- "cores": 2,
- "memory": 2048,
- "sockets": 1,
- "ostype": "l26",
- "boot": "order=scsi0;ide2;net0",
- "scsi0": "local-lvm:vm-100-disk-0,size=32G",
- "ide2": "local:iso/debian-12.iso,media=cdrom",
- "net0": "virtio=BC:24:11:2E:C5:4A,bridge=vmbr0",
- "scsihw": "virtio-scsi-pci",
- "tags": "production;webserver"
- }
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/config - Update VM config (for tag management)
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/100/config$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000004:00000004:00000004:qmconfig:100:root@pam:"
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/status/start - Start VM
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/100/status/start$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000005:00000005:00000005:qmstart:100:root@pam:"
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/status/stop - Stop VM
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/100/status/stop$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000006:00000006:00000006:qmstop:100:root@pam:"
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/status/shutdown - Shutdown VM
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/100/status/shutdown$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000007:00000007:00000007:qmshutdown:100:root@pam:"
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/status/reboot - Reboot VM
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/100/status/reboot$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000008:00000008:00000008:qmreboot:100:root@pam:"
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/status/reset - Reset VM
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/100/status/reset$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000009:00000009:00000009:qmreset:100:root@pam:"
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/status/suspend - Pause VM
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/100/status/suspend$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:0000000A:0000000A:0000000A:qmsuspend:100:root@pam:"
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/status/resume - Resume VM
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/100/status/resume$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:0000000B:0000000B:0000000B:qmresume:100:root@pam:"
-}`)
-
- // DELETE /nodes/{node}/qemu/{vmid} - Delete VM
- gock.New(config.C.URI).
- Delete("^/nodes/node1/qemu/999$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:0000000C:0000000C:0000000C:qmdestroy:999:root@pam:"
-}`)
-
- // GET /nodes/{node}/qemu/{vmid}/snapshot - List VM snapshots
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/qemu/100/snapshot$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "name": "current",
- "description": "You are here!",
- "snaptime": 0
- },
- {
- "name": "snap1",
- "description": "Before upgrade",
- "snaptime": 1693252591,
- "vmstate": 1,
- "parent": "current"
- },
- {
- "name": "snap2",
- "description": "After upgrade",
- "snaptime": 1693252600,
- "parent": "snap1"
- }
- ]
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/snapshot - Create VM snapshot
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/100/snapshot$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:0000000D:0000000D:0000000D:qmsnapshot:100:root@pam:"
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/snapshot/{snapname}/rollback - Rollback snapshot
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/100/snapshot/snap1/rollback$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:0000000E:0000000E:0000000E:qmrollback:100:root@pam:"
-}`)
-
- // DELETE /nodes/{node}/qemu/{vmid}/snapshot/{snapname} - Delete snapshot
- gock.New(config.C.URI).
- Delete("^/nodes/node1/qemu/100/snapshot/snap2$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:0000000F:0000000F:0000000F:qmdelsnapshot:100:root@pam:"
-}`)
-}
diff --git a/go-proxmox/tests/mocks/pve9x/access.go b/go-proxmox/tests/mocks/pve9x/access.go
deleted file mode 100644
index 78f8914..0000000
--- a/go-proxmox/tests/mocks/pve9x/access.go
+++ /dev/null
@@ -1,955 +0,0 @@
-package pve9x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func access() {
- gock.New(config.C.URI).
- Get("^/access/acl").
- Reply(200).
- JSON(`{
- "data": [
- {
- "propagate": 1,
- "path": "/",
- "roleid": "PVEAdmin",
- "ugid": "cloud-init",
- "type": "group"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/domains$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "type": "pve",
- "realm": "pve",
- "comment": "Proxmox VE authentication server"
- },
- {
- "type": "pam",
- "realm": "pam",
- "comment": "Linux PAM standard authentication"
- },
- {
- "realm": "test",
- "type": "ldap",
- "tfa": "oath",
- "comment": "comment comment comment"
- }
- ]
-}`)
- gock.New(config.C.URI).
- Get("^/access/domains/test$").
- Reply(200).
- JSON(`{
- "data": {
- "user_attr": "userattribute",
- "sync-defaults-options": "remove-vanished=acl;entry;properties,scope=users",
- "port": 1234,
- "server1": "server1",
- "user_classes": "userclasses",
- "tfa": "digits=8,step=1234,type=oath",
- "comment": "comment comment comment",
- "group_name_attr": "groupnameattr",
- "digest": "b84e9112ebbb173fc8f5af76a057b38178f1047c",
- "secure": 1,
- "default": 0,
- "sync_attributes": "email=email@attribute.com",
- "base_dn": "CN=Users",
- "type": "ldap",
- "bind_dn": "CN=Users",
- "group_filter": "groupfilter",
- "group_classes": "groupclasses",
- "verify": 1,
- "filter": "userfilter",
- "server2": "server2"
- }
-}`)
-
- gock.New(config.C.URI).
- Get("^/access$").
- Reply(200).
- JSON(`
-{
- "data": [
- {
- "subdir": "users"
- },
- {
- "subdir": "groups"
- },
- {
- "subdir": "roles"
- },
- {
- "subdir": "acl"
- },
- {
- "subdir": "domains"
- },
- {
- "subdir": "openid"
- },
- {
- "subdir": "tfa"
- },
- {
- "subdir": "ticket"
- },
- {
- "subdir": "password"
- }
- ]
-}`)
-
- // full access user with all paths
- gock.New(config.C.URI).
- Get("^/access/permissions$").
- Reply(200).
- JSON(`{
- "data": {
- "/pools": {
- "VM.Audit": 1,
- "VM.Config.CPU": 1,
- "Datastore.Audit": 1,
- "VM.Config.CDROM": 1,
- "Group.Allocate": 1,
- "SDN.Use": 1,
- "VM.Config.HWType": 1,
- "VM.Backup": 1,
- "VM.Config.Disk": 1,
- "Sys.Incoming": 1,
- "VM.Config.Memory": 1,
- "Sys.Audit": 1,
- "VM.Monitor": 1,
- "Datastore.AllocateTemplate": 1,
- "Realm.AllocateUser": 1,
- "VM.Console": 1,
- "VM.Migrate": 1,
- "VM.Snapshot": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "VM.PowerMgmt": 1,
- "Datastore.Allocate": 1,
- "Sys.PowerMgmt": 1,
- "User.Modify": 1,
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "Realm.Allocate": 1,
- "VM.Clone": 1,
- "VM.Allocate": 1,
- "Pool.Allocate": 1,
- "Sys.Modify": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Syslog": 1,
- "VM.Config.Network": 1,
- "VM.Snapshot.Rollback": 1,
- "Sys.Console": 1,
- "SDN.Audit": 1,
- "Pool.Audit": 1
- },
- "/storage": {
- "VM.Audit": 1,
- "VM.Config.CPU": 1,
- "Datastore.Audit": 1,
- "VM.Config.CDROM": 1,
- "Group.Allocate": 1,
- "SDN.Use": 1,
- "VM.Config.HWType": 1,
- "VM.Backup": 1,
- "Sys.Incoming": 1,
- "VM.Config.Memory": 1,
- "VM.Config.Disk": 1,
- "Sys.Audit": 1,
- "VM.Monitor": 1,
- "Datastore.AllocateTemplate": 1,
- "Realm.AllocateUser": 1,
- "VM.Console": 1,
- "VM.Migrate": 1,
- "VM.Snapshot": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "VM.PowerMgmt": 1,
- "Datastore.Allocate": 1,
- "User.Modify": 1,
- "Sys.PowerMgmt": 1,
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "Realm.Allocate": 1,
- "VM.Clone": 1,
- "VM.Allocate": 1,
- "Pool.Allocate": 1,
- "Sys.Modify": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Syslog": 1,
- "VM.Config.Network": 1,
- "VM.Snapshot.Rollback": 1,
- "Sys.Console": 1,
- "SDN.Audit": 1,
- "Pool.Audit": 1
- },
- "/access": {
- "Pool.Audit": 1,
- "SDN.Audit": 1,
- "Sys.Console": 1,
- "VM.Snapshot.Rollback": 1,
- "VM.Config.Network": 1,
- "Sys.Syslog": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Modify": 1,
- "Pool.Allocate": 1,
- "VM.Allocate": 1,
- "VM.Clone": 1,
- "Realm.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "SDN.Allocate": 1,
- "Sys.PowerMgmt": 1,
- "User.Modify": 1,
- "Datastore.Allocate": 1,
- "VM.PowerMgmt": 1,
- "VM.Config.Options": 1,
- "Permissions.Modify": 1,
- "VM.Snapshot": 1,
- "VM.Migrate": 1,
- "VM.Console": 1,
- "Realm.AllocateUser": 1,
- "Datastore.AllocateTemplate": 1,
- "VM.Monitor": 1,
- "Sys.Audit": 1,
- "VM.Config.Disk": 1,
- "Sys.Incoming": 1,
- "VM.Config.Memory": 1,
- "VM.Config.HWType": 1,
- "VM.Backup": 1,
- "SDN.Use": 1,
- "Group.Allocate": 1,
- "VM.Config.CDROM": 1,
- "Datastore.Audit": 1,
- "VM.Audit": 1,
- "VM.Config.CPU": 1
- },
- "/vms": {
- "VM.Snapshot.Rollback": 1,
- "VM.Config.Network": 1,
- "Sys.Console": 1,
- "SDN.Audit": 1,
- "Pool.Audit": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Syslog": 1,
- "VM.Allocate": 1,
- "Pool.Allocate": 1,
- "Sys.Modify": 1,
- "Realm.Allocate": 1,
- "VM.Clone": 1,
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "Datastore.Allocate": 1,
- "User.Modify": 1,
- "Sys.PowerMgmt": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "VM.PowerMgmt": 1,
- "VM.Console": 1,
- "VM.Migrate": 1,
- "VM.Snapshot": 1,
- "Realm.AllocateUser": 1,
- "Datastore.AllocateTemplate": 1,
- "Sys.Audit": 1,
- "VM.Monitor": 1,
- "VM.Config.HWType": 1,
- "VM.Backup": 1,
- "Sys.Incoming": 1,
- "VM.Config.Memory": 1,
- "VM.Config.Disk": 1,
- "Group.Allocate": 1,
- "SDN.Use": 1,
- "Datastore.Audit": 1,
- "VM.Config.CDROM": 1,
- "VM.Config.CPU": 1,
- "VM.Audit": 1
- },
- "/sdn": {
- "VM.Console": 1,
- "VM.Snapshot": 1,
- "VM.Migrate": 1,
- "Realm.AllocateUser": 1,
- "Datastore.AllocateTemplate": 1,
- "Sys.Audit": 1,
- "VM.Monitor": 1,
- "VM.Config.HWType": 1,
- "VM.Backup": 1,
- "Sys.Incoming": 1,
- "VM.Config.Memory": 1,
- "VM.Config.Disk": 1,
- "SDN.Use": 1,
- "Group.Allocate": 1,
- "Datastore.Audit": 1,
- "VM.Config.CDROM": 1,
- "VM.Config.CPU": 1,
- "VM.Audit": 1,
- "VM.Snapshot.Rollback": 1,
- "VM.Config.Network": 1,
- "Pool.Audit": 1,
- "SDN.Audit": 1,
- "Sys.Console": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Syslog": 1,
- "Pool.Allocate": 1,
- "VM.Allocate": 1,
- "Sys.Modify": 1,
- "VM.Clone": 1,
- "Realm.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "SDN.Allocate": 1,
- "User.Modify": 1,
- "Sys.PowerMgmt": 1,
- "Datastore.Allocate": 1,
- "VM.Config.Options": 1,
- "Permissions.Modify": 1,
- "VM.PowerMgmt": 1
- },
- "/nodes": {
- "Datastore.Allocate": 1,
- "User.Modify": 1,
- "Sys.PowerMgmt": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "VM.PowerMgmt": 1,
- "Realm.Allocate": 1,
- "VM.Clone": 1,
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "VM.Allocate": 1,
- "Pool.Allocate": 1,
- "Sys.Modify": 1,
- "VM.Snapshot.Rollback": 1,
- "VM.Config.Network": 1,
- "Sys.Console": 1,
- "SDN.Audit": 1,
- "Pool.Audit": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Syslog": 1,
- "Datastore.Audit": 1,
- "VM.Config.CDROM": 1,
- "VM.Audit": 1,
- "VM.Config.CPU": 1,
- "VM.Config.HWType": 1,
- "VM.Backup": 1,
- "VM.Config.Memory": 1,
- "Sys.Incoming": 1,
- "VM.Config.Disk": 1,
- "Group.Allocate": 1,
- "SDN.Use": 1,
- "Datastore.AllocateTemplate": 1,
- "Realm.AllocateUser": 1,
- "Sys.Audit": 1,
- "VM.Monitor": 1,
- "VM.Console": 1,
- "VM.Migrate": 1,
- "VM.Snapshot": 1
- },
- "/": {
- "Realm.AllocateUser": 1,
- "Datastore.AllocateTemplate": 1,
- "Sys.Audit": 1,
- "VM.Monitor": 1,
- "VM.Console": 1,
- "VM.Migrate": 1,
- "VM.Snapshot": 1,
- "Datastore.Audit": 1,
- "VM.Config.CDROM": 1,
- "VM.Audit": 1,
- "VM.Config.CPU": 1,
- "VM.Backup": 1,
- "VM.Config.HWType": 1,
- "VM.Config.Disk": 1,
- "Sys.Incoming": 1,
- "VM.Config.Memory": 1,
- "Group.Allocate": 1,
- "SDN.Use": 1,
- "VM.Allocate": 1,
- "Pool.Allocate": 1,
- "Sys.Modify": 1,
- "VM.Config.Network": 1,
- "VM.Snapshot.Rollback": 1,
- "SDN.Audit": 1,
- "Sys.Console": 1,
- "Pool.Audit": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Syslog": 1,
- "Datastore.Allocate": 1,
- "User.Modify": 1,
- "Sys.PowerMgmt": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "VM.PowerMgmt": 1,
- "Realm.Allocate": 1,
- "VM.Clone": 1,
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1
- },
- "/access/groups": {
- "VM.Migrate": 1,
- "VM.Snapshot": 1,
- "VM.Console": 1,
- "VM.Monitor": 1,
- "Sys.Audit": 1,
- "Realm.AllocateUser": 1,
- "Datastore.AllocateTemplate": 1,
- "Group.Allocate": 1,
- "SDN.Use": 1,
- "Sys.Incoming": 1,
- "VM.Config.Disk": 1,
- "VM.Config.Memory": 1,
- "VM.Backup": 1,
- "VM.Config.HWType": 1,
- "VM.Config.CPU": 1,
- "VM.Audit": 1,
- "VM.Config.CDROM": 1,
- "Datastore.Audit": 1,
- "Sys.Syslog": 1,
- "VM.Config.Cloudinit": 1,
- "Sys.Console": 1,
- "SDN.Audit": 1,
- "Pool.Audit": 1,
- "VM.Snapshot.Rollback": 1,
- "VM.Config.Network": 1,
- "Sys.Modify": 1,
- "VM.Allocate": 1,
- "Pool.Allocate": 1,
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "Realm.Allocate": 1,
- "VM.Clone": 1,
- "VM.PowerMgmt": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "Datastore.Allocate": 1,
- "User.Modify": 1,
- "Sys.PowerMgmt": 1
- }
- }
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/permissions$").
- MatchParams(map[string]string{
- "path": "path",
- }).
- Reply(200).
- JSON(`{
- "data": {
- "path": {
- "permission": 1
- }
- }
-}`)
-
- // user with no access
- gock.New(config.C.URI).
- Get("^/access/permissions$").
- MatchParams(map[string]string{
- "userid": "userid",
- }).
- Reply(200).
- JSON(`{
- "data": {
- "path": {
- "permission": 1
- }
- }
-}`)
-
- // user with no access
- gock.New(config.C.URI).
- Get("^/access/permissions$").
- MatchParams(map[string]string{
- "path": "path",
- "userid": "userid",
- }).
- Reply(200).
- JSON(`{
- "data": {
- "path": {
- "permission": 1
- }
- }
-}`)
-
- gock.New(config.C.URI).
- Put("^/access/password$").
- Reply(200).
- JSON(`{"success":1,"data":null}`)
-
- gock.New(config.C.URI).
- Get("^/access/ticket$").
- Reply(200).
- JSON(`{"data": null}`)
-
- gock.New(config.C.URI).
- Post("^/access/ticket$").
- Reply(200).
- JSON(`{
- "data": {
- "username": "root@pam",
- "CSRFPreventionToken": "64E10CBA:YDNz71IKnE0sWsm1SbV1PGwz3hAyprvygQ7SBkxHVtE",
- "cap": {
- "sdn": {
- "SDN.Audit": 1,
- "SDN.Allocate": 1,
- "SDN.Use": 1,
- "Permissions.Modify": 1
- },
- "access": {
- "Group.Allocate": 1,
- "User.Modify": 1,
- "Permissions.Modify": 1
- },
- "dc": {
- "SDN.Allocate": 1,
- "SDN.Audit": 1,
- "SDN.Use": 1,
- "Sys.Audit": 1
- },
- "nodes": {
- "Sys.Modify": 1,
- "Sys.Syslog": 1,
- "Sys.Audit": 1,
- "Sys.Console": 1,
- "Permissions.Modify": 1,
- "Sys.Incoming": 1,
- "Sys.PowerMgmt": 1
- },
- "storage": {
- "Datastore.Allocate": 1,
- "Datastore.Audit": 1,
- "Datastore.AllocateTemplate": 1,
- "Datastore.AllocateSpace": 1,
- "Permissions.Modify": 1
- },
- "vms": {
- "VM.Config.CPU": 1,
- "VM.Config.HWType": 1,
- "VM.Clone": 1,
- "VM.Allocate": 1,
- "Permissions.Modify": 1,
- "VM.Config.Options": 1,
- "VM.Config.Memory": 1,
- "VM.Audit": 1,
- "VM.Monitor": 1,
- "VM.Snapshot.Rollback": 1,
- "VM.Config.Network": 1,
- "VM.Config.Cloudinit": 1,
- "VM.Backup": 1,
- "VM.Migrate": 1,
- "VM.Config.Disk": 1,
- "VM.PowerMgmt": 1,
- "VM.Config.CDROM": 1,
- "VM.Console": 1,
- "VM.Snapshot": 1
- }
- },
- "clustername": "pve-cluster",
- "ticket": "PVE:root@pam:64E10CBA::yTMqV7BmOXUCzb0ODceFH7F+Uy3gQTlp3sepUzIicpL2KeJ4finWjuZ9SBZg/iTz7tACDGvnX0biv6JMZvYBuqzWu0S3eF6xrLX4A3YLahhWaMJJ4Dw8hIquSO5AMQr3Ea3xdN5CcLIuW8hPOLHrPFzDC2MDk6e6VtJ9lWF5htz8nq6ge+kcwZBgB80ZABc+lIwtcB1UcJ8NY5EYGS9czcEXSse2xmG1j2F1+gMfoF+4O7wiCV0iHGabG+8n3oEBZUE89jhzjQoVCGCzVpmxYpag+5I4+W+POZm8DzQCdvPmynH9fAT6bSD8Vu+le8aHGigoKz81xNMsFxIjd1Zr2g=="
- }
-}`)
- gock.New(config.C.URI).
- Get("^/access/user$").
- Reply(200).
- JSON(`
-{
- "data": [
- {
- "lastname": "pamlast",
- "realm-type": "pam",
- "enable": 1,
- "firstname": "pamfirst",
- "userid": "root@pam",
- "expire": 0
- "email": "root@email.com",
- },
- {
- "firstname": "first1",
- "userid": "user1@pve",
- "enable": 1,
- "expire": 0,
- "email": "first1.last1@email.com",
- "lastname": "last1",
- "realm-type": "pve"
- },
- {
- "lastname": "last2",
- "realm-type": "pve",
- "email": "first2.last2@email.com",
- "expire": 0,
- "enable": 1,
- "userid": "user2@pve",
- "firstname": "first2"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/groups$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "groupid": "cloud-init",
- "users": "root@pam,user1@pve"
- },
- {
- "groupid": "test",
- "users": "root@pam,user2@pve"
- }
- ]
-}`)
- gock.New(config.C.URI).
- Get("^/access/groups/test$").
- Reply(200).
- JSON(`{
- "data": {
- "members": [
- "user2@pve",
- "root@pam"
- ]
- }
-}`)
- gock.New(config.C.URI).
- Get("^/access/users$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "expire": 0,
- "lastname": "pamlast",
- "enable": 1,
- "firstname": "pamfirst",
- "userid": "pam@pam",
- "realm-type": "pam"
- },
- {
- "expire": 0,
- "realm-type": "pam",
- "email": "root@email.com",
- "userid": "root@pam",
- "enable": 1
- },
- {
- "expire": 0,
- "lastname": "last1",
- "email": "first1.last1@email.com",
- "enable": 1,
- "firstname": "first1",
- "realm-type": "pve",
- "userid": "user1@pve"
- },
- {
- "userid": "user2@pve",
- "realm-type": "pve",
- "firstname": "first2",
- "email": "first2.last2@email.com",
- "enable": 1,
- "lastname": "last2",
- "expire": 0
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/users/root@pam$").
- Reply(200).
- JSON(`{
- "data": {
- "groups": [
- "cloud-init",
- "test"
- ],
- "expire": 0,
- "email": "root@email.com",
- "enable": 1,
- "firstname": "firstname",
- "lastname": "lastname",
- "tokens": {
- "token1": {
- "privsep": 0,
- "expire": 1000
- },
- "token2": {
- "expire": 2000,
- "privsep": 1
- }
- }
- }
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/roles/Administrator$").
- Reply(200).
- JSON(`{
- "data": {
- "SDN.Allocate": 1,
- "Datastore.AllocateSpace": 1,
- "Permissions.Modify": 1,
- "VM.Audit": 1,
- "VM.Snapshot": 1,
- "Datastore.Audit": 1,
- "VM.Config.Network": 1,
- "Pool.Audit": 1,
- "SDN.Use": 1,
- "Datastore.Allocate": 1,
- "VM.Allocate": 1,
- "VM.Snapshot.Rollback": 1,
- "Sys.Syslog": 1,
- "VM.Config.Disk": 1,
- "VM.Console": 1,
- "VM.Config.CDROM": 1,
- "Realm.AllocateUser": 1,
- "Sys.Audit": 1,
- "Sys.PowerMgmt": 1,
- "Sys.Modify": 1,
- "VM.Monitor": 1,
- "VM.Config.Memory": 1,
- "VM.Backup": 1,
- "Sys.Incoming": 1,
- "VM.Migrate": 1,
- "Realm.Allocate": 1,
- "VM.Config.CPU": 1,
- "User.Modify": 1,
- "VM.Config.HWType": 1,
- "VM.Clone": 1,
- "SDN.Audit": 1,
- "VM.Config.Cloudinit": 1,
- "Group.Allocate": 1,
- "VM.PowerMgmt": 1,
- "Sys.Console": 1,
- "Datastore.AllocateTemplate": 1,
- "Pool.Allocate": 1,
- "VM.Config.Options": 1
- }
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/roles/NoAccess").
- Reply(200).
- JSON(`{
- "data": {}
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/roles$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "roleid": "PVEVMAdmin",
- "privs": "VM.Allocate,VM.Audit,VM.Backup,VM.Clone,VM.Config.CDROM,VM.Config.CPU,VM.Config.Cloudinit,VM.Config.Disk,VM.Config.HWType,VM.Config.Memory,VM.Config.Network,VM.Config.Options,VM.Console,VM.Migrate,VM.Monitor,VM.PowerMgmt,VM.Snapshot,VM.Snapshot.Rollback",
- "special": 1
- },
- {
- "roleid": "PVEDatastoreAdmin",
- "special": 1,
- "privs": "Datastore.Allocate,Datastore.AllocateSpace,Datastore.AllocateTemplate,Datastore.Audit"
- },
- {
- "roleid": "PVEPoolUser",
- "privs": "Pool.Audit",
- "special": 1
- },
- {
- "special": 1,
- "privs": "",
- "roleid": "NoAccess"
- },
- {
- "roleid": "PVEAuditor",
- "privs": "Datastore.Audit,Pool.Audit,SDN.Audit,Sys.Audit,VM.Audit",
- "special": 1
- },
- {
- "privs": "Permissions.Modify,Sys.Audit,Sys.Console,Sys.Syslog",
- "special": 1,
- "roleid": "PVESysAdmin"
- },
- {
- "special": 1,
- "privs": "Datastore.AllocateSpace,Datastore.Audit",
- "roleid": "PVEDatastoreUser"
- },
- {
- "roleid": "Administrator",
- "special": 1,
- "privs": "Datastore.Allocate,Datastore.AllocateSpace,Datastore.AllocateTemplate,Datastore.Audit,Group.Allocate,Permissions.Modify,Pool.Allocate,Pool.Audit,Realm.Allocate,Realm.AllocateUser,SDN.Allocate,SDN.Audit,SDN.Use,Sys.Audit,Sys.Console,Sys.Incoming,Sys.Modify,Sys.PowerMgmt,Sys.Syslog,User.Modify,VM.Allocate,VM.Audit,VM.Backup,VM.Clone,VM.Config.CDROM,VM.Config.CPU,VM.Config.Cloudinit,VM.Config.Disk,VM.Config.HWType,VM.Config.Memory,VM.Config.Network,VM.Config.Options,VM.Console,VM.Migrate,VM.Monitor,VM.PowerMgmt,VM.Snapshot,VM.Snapshot.Rollback"
- },
- {
- "roleid": "PVETemplateUser",
- "privs": "VM.Audit,VM.Clone",
- "special": 1
- },
- {
- "privs": "SDN.Audit,SDN.Use",
- "special": 1,
- "roleid": "PVESDNUser"
- },
- {
- "special": 1,
- "privs": "Datastore.Allocate,Datastore.AllocateSpace,Datastore.AllocateTemplate,Datastore.Audit,Group.Allocate,Permissions.Modify,Pool.Allocate,Pool.Audit,Realm.AllocateUser,SDN.Allocate,SDN.Audit,SDN.Use,Sys.Audit,Sys.Console,Sys.Syslog,User.Modify,VM.Allocate,VM.Audit,VM.Backup,VM.Clone,VM.Config.CDROM,VM.Config.CPU,VM.Config.Cloudinit,VM.Config.Disk,VM.Config.HWType,VM.Config.Memory,VM.Config.Network,VM.Config.Options,VM.Console,VM.Migrate,VM.Monitor,VM.PowerMgmt,VM.Snapshot,VM.Snapshot.Rollback",
- "roleid": "PVEAdmin"
- },
- {
- "roleid": "test",
- "privs": "Pool.Audit",
- "special": 0
- },
- {
- "special": 1,
- "privs": "VM.Audit,VM.Backup,VM.Config.CDROM,VM.Config.Cloudinit,VM.Console,VM.PowerMgmt",
- "roleid": "PVEVMUser"
- },
- {
- "special": 1,
- "privs": "SDN.Allocate,SDN.Audit,SDN.Use",
- "roleid": "PVESDNAdmin"
- },
- {
- "roleid": "PVEUserAdmin",
- "privs": "Group.Allocate,Realm.AllocateUser,User.Modify",
- "special": 1
- },
- {
- "privs": "Pool.Allocate,Pool.Audit",
- "special": 1,
- "roleid": "PVEPoolAdmin"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Post("^/access/domains").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Put("^/access/domains/test$").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Delete("^/access/domains/test$").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Post("^/access/domains/test$").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Post("^/access/groups").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Put("^/access/groups/groupid").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Delete("^/access/groups/groupid").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Post("^/access/groups/groupid").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Post("^/access/users").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Post("^/access/roles").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Get("^/access/users/test/token").
- Reply(200).
- JSON(`{
- "data": [
- {
- "expire": 100,
- "privsep": 0,
- "tokenid": "test",
- "comment": "comment"
- },
- {
- "expire": 0,
- "privsep": 1,
- "tokenid": "test2",
- "comment": "comment"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/access/users/root@pam/token/test").
- Reply(200).
- JSON(`{
- "data": {
- "expire": 0,
- "privsep": 0,
- "comment": "comment"
- }
-}`)
-
- gock.New(config.C.URI).
- Post("^/access/users/userid/token/test").
- Reply(200).
- JSON(`{
- "data": {"full-tokenid":"userid!test","value":"tokenvalue"}
-}`)
-
- gock.New(config.C.URI).
- Delete("^/access/users/root@pam/token/test").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Get("^/access/users/userid/tfa").
- Reply(200).
- JSON(`{
- "data": {
- "realm": "pve",
- "types": [
- "oath"
- ],
- "user": "userid"
- }
-}`)
-
- gock.New(config.C.URI).
- Delete("^/access/users/userid/tfa").
- Reply(200).
- JSON(``)
-
- gock.New(config.C.URI).
- Put("^/access/users/userid/token/tokenid").
- Reply(200).
- JSON(`
- "data": {
- "expire": 0,
- "privsep": 0,
- "comment": "comment"
- }
-}`)
-
-}
diff --git a/go-proxmox/tests/mocks/pve9x/ceph.go b/go-proxmox/tests/mocks/pve9x/ceph.go
deleted file mode 100644
index 7727d51..0000000
--- a/go-proxmox/tests/mocks/pve9x/ceph.go
+++ /dev/null
@@ -1,14111 +0,0 @@
-package pve9x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func ceph() {
- gock.New(config.C.URI).
- Get("^/cluster/ceph/status$").
- Reply(200).
- JSON(`{
- "data": {
- "osdmap": {
- "epoch": 33867,
- "num_in_osds": 21,
- "num_osds": 21,
- "osd_up_since": 1739293535,
- "osd_in_since": 1739293526,
- "num_up_osds": 21,
- "num_remapped_pgs": 0
- },
- "pgmap": {
- "bytes_total": 51850204151808,
- "pgs_by_state": [
- {
- "count": 577,
- "state_name": "active+clean"
- }
- ],
- "bytes_used": 31663826219008,
- "write_bytes_sec": 2697932,
- "num_objects": 3059395,
- "read_bytes_sec": 50660,
- "num_pgs": 577,
- "bytes_avail": 20186377932800,
- "read_op_per_sec": 3,
- "write_op_per_sec": 211,
- "num_pools": 4,
- "data_bytes": 10589439042005
- },
- "quorum_names": [
- "proxmox-node01",
- "proxmox-node03",
- "proxmox-node02"
- ],
- "fsmap": {
- "by_rank": [
- {
- "gid": 179774420,
- "filesystem_id": 2,
- "rank": 0,
- "status": "up:active",
- "name": "proxmox-node03"
- }
- ],
- "up": 1,
- "id": 2,
- "max": 1,
- "up:standby": 2,
- "in": 1,
- "epoch": 921
- },
- "quorum_age": 2408307,
- "monmap": {
- "min_mon_release": 18,
- "tiebreaker_mon": "",
- "min_mon_release_name": "reef",
- "quorum": [
- 0,
- 1,
- 2
- ],
- "election_strategy": 1,
- "disallowed_leaders: ": "",
- "modified": "2024-10-11T11:47:35.121704Z",
- "features": {
- "persistent": [
- "kraken",
- "luminous",
- "mimic",
- "osdmap-prune",
- "nautilus",
- "octopus",
- "pacific",
- "elector-pinging",
- "quincy",
- "reef"
- ],
- "optional": []
- },
- "fsid": "d11c6ea1-7ab2-41fa-99c5-b85f4d7ffd49",
- "mons": [
- {
- "addr": "192.168.105.90:6789/0",
- "rank": 0,
- "crush_location": "{}",
- "priority": 0,
- "name": "proxmox-node01",
- "weight": 0,
- "public_addrs": {
- "addrvec": [
- {
- "addr": "192.168.105.90:3300",
- "type": "v2",
- "nonce": 0
- },
- {
- "addr": "192.168.105.90:6789",
- "type": "v1",
- "nonce": 0
- }
- ]
- },
- "public_addr": "192.168.105.90:6789/0"
- },
- {
- "rank": 1,
- "addr": "192.168.105.92:6789/0",
- "crush_location": "{}",
- "priority": 0,
- "name": "proxmox-node03",
- "public_addr": "192.168.105.92:6789/0",
- "public_addrs": {
- "addrvec": [
- {
- "addr": "192.168.105.92:3300",
- "nonce": 0,
- "type": "v2"
- },
- {
- "addr": "192.168.105.92:6789",
- "nonce": 0,
- "type": "v1"
- }
- ]
- },
- "weight": 0
- },
- {
- "rank": 2,
- "addr": "192.168.105.101:6789/0",
- "public_addrs": {
- "addrvec": [
- {
- "addr": "192.168.105.101:3300",
- "type": "v2",
- "nonce": 0
- },
- {
- "type": "v1",
- "nonce": 0,
- "addr": "192.168.105.101:6789"
- }
- ]
- },
- "public_addr": "192.168.105.101:6789/0",
- "weight": 0,
- "name": "proxmox-node02",
- "priority": 0,
- "crush_location": "{}"
- }
- ],
- "stretch_mode": false,
- "removed_ranks: ": "",
- "epoch": 7,
- "created": "2021-09-14T09:08:27.544584Z"
- },
- "servicemap": {
- "modified": "2025-03-11T14:51:38.014476+0100",
- "epoch": 1255207,
- "services": {}
- },
- "progress_events": {},
- "fsid": "d11c6ea1-7ab2-41fa-99c5-b85f4d7ffd49",
- "election_epoch": 5412,
- "quorum": [
- 0,
- 1,
- 2
- ],
- "mgrmap": {
- "active_addr": "192.168.105.101:6859/2343",
- "last_failure_osd_epoch": 32503,
- "standbys": [
- {
- "mgr_features": 4540138322906710015,
- "available_modules": [
- {
- "error_string": "",
- "module_options": {
- "smtp_password": {
- "type": "str",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "Password to authenticate with",
- "name": "smtp_password",
- "max": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "bool",
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced"
- },
- "smtp_host": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "smtp_host",
- "desc": "SMTP server",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "str"
- },
- "smtp_ssl": {
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "Use SSL to connect to SMTP server",
- "name": "smtp_ssl",
- "max": "",
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": []
- },
- "smtp_port": {
- "type": "int",
- "max": "",
- "name": "smtp_port",
- "desc": "SMTP port",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "465"
- },
- "log_to_cluster_level": {
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info"
- },
- "log_to_file": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool"
- },
- "interval": {
- "type": "secs",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "How frequently to reexamine health status",
- "name": "interval",
- "max": "",
- "level": "advanced",
- "default_value": "60",
- "long_desc": "",
- "tags": []
- },
- "smtp_from_name": {
- "type": "str",
- "max": "",
- "name": "smtp_from_name",
- "desc": "Email From: name",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "Ceph"
- },
- "smtp_user": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "name": "smtp_user",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "User to authenticate as",
- "type": "str"
- },
- "smtp_destination": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "smtp_destination",
- "desc": "Email address to send alerts to",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "type": "str"
- },
- "smtp_sender": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "smtp_sender",
- "desc": "SMTP envelope sender",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "str"
- },
- "log_level": {
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- }
- },
- "name": "alerts",
- "can_run": true
- },
- {
- "error_string": "",
- "module_options": {
- "mode": {
- "type": "str",
- "max": "",
- "name": "mode",
- "desc": "Balancer mode",
- "enum_allowed": [
- "crush-compat",
- "none",
- "upmap"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "upmap",
- "level": "advanced"
- },
- "upmap_max_deviation": {
- "default_value": "5",
- "long_desc": "If the number of PGs are within this count then no optimization is attempted",
- "level": "advanced",
- "tags": [],
- "type": "int",
- "name": "upmap_max_deviation",
- "max": "",
- "enum_allowed": [],
- "min": "1",
- "see_also": [],
- "flags": 1,
- "desc": "deviation below which no optimization is attempted"
- },
- "active": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "name": "active",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "automatically balance PGs across cluster",
- "type": "bool"
- },
- "crush_compat_metrics": {
- "tags": [],
- "long_desc": "Value is a list of one or more of \"pgs\", \"objects\", or \"bytes\", and indicates which metrics to use to balance utilization.",
- "default_value": "pgs,objects,bytes",
- "level": "advanced",
- "max": "",
- "name": "crush_compat_metrics",
- "desc": "metrics with which to calculate OSD utilization",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "type": "str"
- },
- "log_to_cluster_level": {
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": "",
- "tags": [],
- "default_value": "info",
- "long_desc": "",
- "level": "advanced"
- },
- "crush_compat_step": {
- "tags": [],
- "level": "advanced",
- "long_desc": ".99 is very aggressive, .01 is less aggressive",
- "default_value": "0.5",
- "max": "0.999",
- "name": "crush_compat_step",
- "desc": "aggressiveness of optimization",
- "flags": 1,
- "min": "0.001",
- "see_also": [],
- "enum_allowed": [],
- "type": "float"
- },
- "crush_compat_max_iterations": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "25",
- "max": "250",
- "name": "crush_compat_max_iterations",
- "desc": "maximum number of iterations to attempt optimization",
- "flags": 1,
- "see_also": [],
- "min": "1",
- "enum_allowed": [],
- "type": "uint"
- },
- "log_to_cluster": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "type": "bool"
- },
- "min_score": {
- "long_desc": "",
- "default_value": "0",
- "level": "advanced",
- "tags": [],
- "name": "min_score",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "minimum score, below which no optimization is attempted",
- "type": "float"
- },
- "sleep_interval": {
- "name": "sleep_interval",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "how frequently to wake up and attempt optimization",
- "type": "secs",
- "long_desc": "",
- "default_value": "60",
- "level": "advanced",
- "tags": []
- },
- "end_time": {
- "max": "",
- "name": "end_time",
- "desc": "ending time of day to automatically balance",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "This is a time of day in the format HHMM.",
- "default_value": "2359"
- },
- "end_weekday": {
- "see_also": [],
- "flags": 1,
- "min": "0",
- "enum_allowed": [],
- "desc": "Restrict automatic balancing to days of the week earlier than this",
- "name": "end_weekday",
- "max": "6",
- "type": "uint",
- "level": "advanced",
- "long_desc": "0 = Sunday, 1 = Monday, etc.",
- "default_value": "0",
- "tags": []
- },
- "log_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "name": "log_level",
- "max": "",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "type": "str"
- },
- "log_to_file": {
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "upmap_max_optimizations": {
- "type": "uint",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "maximum upmap optimizations to make per attempt",
- "name": "upmap_max_optimizations",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "10",
- "tags": []
- },
- "pool_ids": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "max": "",
- "name": "pool_ids",
- "desc": "pools which the automatic balancing will be limited to",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": []
- },
- "begin_time": {
- "type": "str",
- "name": "begin_time",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "beginning time of day to automatically balance",
- "long_desc": "This is a time of day in the format HHMM.",
- "default_value": "0000",
- "level": "advanced",
- "tags": []
- },
- "begin_weekday": {
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "0",
- "desc": "Restrict automatic balancing to this day of the week or later",
- "name": "begin_weekday",
- "max": "6",
- "type": "uint",
- "default_value": "0",
- "long_desc": "0 = Sunday, 1 = Monday, etc.",
- "level": "advanced",
- "tags": []
- }
- },
- "can_run": true,
- "name": "balancer"
- },
- {
- "name": "crash",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "log_level": {
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "log_to_cluster_level": {
- "type": "str",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "default_value": "info",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "warn_recent_interval": {
- "long_desc": "",
- "default_value": "1209600",
- "level": "advanced",
- "tags": [],
- "name": "warn_recent_interval",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "time interval in which to warn about recent crashes",
- "type": "secs"
- },
- "retain_interval": {
- "tags": [],
- "long_desc": "",
- "default_value": "31536000",
- "level": "advanced",
- "type": "secs",
- "desc": "how long to retain crashes before pruning them",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "retain_interval"
- },
- "log_to_cluster": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool"
- },
- "log_to_file": {
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "log_to_file",
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- }
- }
- },
- {
- "module_options": {
- "PWD_POLICY_CHECK_LENGTH_ENABLED": {
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "max": "",
- "name": "PWD_POLICY_CHECK_LENGTH_ENABLED",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "type": "bool"
- },
- "redirect_resolve_ip_addr": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "type": "bool",
- "name": "redirect_resolve_ip_addr",
- "max": "",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": ""
- },
- "server_port": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "8080",
- "type": "int",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "server_port"
- },
- "PWD_POLICY_MIN_COMPLEXITY": {
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "PWD_POLICY_MIN_COMPLEXITY",
- "type": "int",
- "tags": [],
- "long_desc": "",
- "default_value": "10",
- "level": "advanced"
- },
- "FEATURE_TOGGLE_RGW": {
- "type": "bool",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "FEATURE_TOGGLE_RGW",
- "tags": [],
- "level": "advanced",
- "default_value": "True",
- "long_desc": ""
- },
- "jwt_token_ttl": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "28800",
- "tags": [],
- "name": "jwt_token_ttl",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "int"
- },
- "motd": {
- "desc": "The message of the day",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "motd",
- "type": "str",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "url_prefix": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "name": "url_prefix",
- "max": ""
- },
- "USER_PWD_EXPIRATION_WARNING_2": {
- "name": "USER_PWD_EXPIRATION_WARNING_2",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "int",
- "level": "advanced",
- "long_desc": "",
- "default_value": "5",
- "tags": []
- },
- "server_addr": {
- "name": "server_addr",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "type": "str",
- "long_desc": "",
- "default_value": "::",
- "level": "advanced",
- "tags": []
- },
- "GRAFANA_API_SSL_VERIFY": {
- "level": "advanced",
- "default_value": "True",
- "long_desc": "",
- "tags": [],
- "type": "bool",
- "name": "GRAFANA_API_SSL_VERIFY",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": ""
- },
- "PROMETHEUS_API_HOST": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "name": "PROMETHEUS_API_HOST",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "type": "str"
- },
- "ISCSI_API_SSL_VERIFICATION": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "tags": [],
- "type": "bool",
- "name": "ISCSI_API_SSL_VERIFICATION",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": ""
- },
- "ENABLE_BROWSABLE_API": {
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "ENABLE_BROWSABLE_API",
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced"
- },
- "UNSAFE_TLS_v1_2": {
- "type": "bool",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "UNSAFE_TLS_v1_2",
- "max": "",
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": []
- },
- "GRAFANA_API_USERNAME": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "admin",
- "tags": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "GRAFANA_API_USERNAME",
- "max": "",
- "type": "str"
- },
- "ALERTMANAGER_API_HOST": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "ALERTMANAGER_API_HOST"
- },
- "FEATURE_TOGGLE_ISCSI": {
- "max": "",
- "name": "FEATURE_TOGGLE_ISCSI",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "type": "bool",
- "tags": [],
- "default_value": "True",
- "long_desc": "",
- "level": "advanced"
- },
- "USER_PWD_EXPIRATION_SPAN": {
- "long_desc": "",
- "default_value": "0",
- "level": "advanced",
- "tags": [],
- "name": "USER_PWD_EXPIRATION_SPAN",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "type": "int"
- },
- "RGW_API_SECRET_KEY": {
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": [],
- "type": "str",
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "name": "RGW_API_SECRET_KEY",
- "max": ""
- },
- "USER_PWD_EXPIRATION_WARNING_1": {
- "default_value": "10",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "name": "USER_PWD_EXPIRATION_WARNING_1",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "type": "int"
- },
- "RGW_API_ADMIN_RESOURCE": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "admin",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "max": "",
- "name": "RGW_API_ADMIN_RESOURCE",
- "type": "str"
- },
- "RGW_API_SSL_VERIFY": {
- "default_value": "True",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "name": "RGW_API_SSL_VERIFY",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "type": "bool"
- },
- "FEATURE_TOGGLE_MIRRORING": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "name": "FEATURE_TOGGLE_MIRRORING",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "desc": "",
- "type": "bool"
- },
- "cross_origin_url": {
- "name": "cross_origin_url",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "AUDIT_API_ENABLED": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "AUDIT_API_ENABLED",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0
- },
- "GRAFANA_FRONTEND_API_URL": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "GRAFANA_FRONTEND_API_URL",
- "max": "",
- "type": "str"
- },
- "standby_behaviour": {
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "error",
- "redirect"
- ],
- "flags": 0,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "standby_behaviour",
- "tags": [],
- "long_desc": "",
- "default_value": "redirect",
- "level": "advanced"
- },
- "GANESHA_CLUSTERS_RADOS_POOL_NAMESPACE": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "GANESHA_CLUSTERS_RADOS_POOL_NAMESPACE",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "type": "str"
- },
- "log_to_file": {
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "ACCOUNT_LOCKOUT_ATTEMPTS": {
- "level": "advanced",
- "default_value": "10",
- "long_desc": "",
- "tags": [],
- "type": "int",
- "name": "ACCOUNT_LOCKOUT_ATTEMPTS",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": ""
- },
- "GRAFANA_API_PASSWORD": {
- "type": "str",
- "name": "GRAFANA_API_PASSWORD",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "desc": "",
- "long_desc": "",
- "default_value": "admin",
- "level": "advanced",
- "tags": []
- },
- "AUDIT_API_LOG_PAYLOAD": {
- "tags": [],
- "default_value": "True",
- "long_desc": "",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "AUDIT_API_LOG_PAYLOAD",
- "type": "bool"
- },
- "log_to_cluster_level": {
- "name": "log_to_cluster_level",
- "max": "",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- },
- "GRAFANA_API_URL": {
- "type": "str",
- "name": "GRAFANA_API_URL",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "PWD_POLICY_CHECK_OLDPWD_ENABLED": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "name": "PWD_POLICY_CHECK_OLDPWD_ENABLED",
- "max": "",
- "type": "bool"
- },
- "debug": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "debug",
- "desc": "Enable/disable debug options",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": []
- },
- "ALERTMANAGER_API_SSL_VERIFY": {
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "ALERTMANAGER_API_SSL_VERIFY",
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced"
- },
- "FEATURE_TOGGLE_DASHBOARD": {
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "max": "",
- "name": "FEATURE_TOGGLE_DASHBOARD",
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced"
- },
- "PWD_POLICY_CHECK_EXCLUSION_LIST_ENABLED": {
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "PWD_POLICY_CHECK_EXCLUSION_LIST_ENABLED",
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": ""
- },
- "PWD_POLICY_CHECK_REPETITIVE_CHARS_ENABLED": {
- "type": "bool",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "PWD_POLICY_CHECK_REPETITIVE_CHARS_ENABLED",
- "max": "",
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": []
- },
- "log_level": {
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "PWD_POLICY_EXCLUSION_LIST": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "osd,host,dashboard,pool,block,nfs,ceph,monitors,gateway,logs,crush,maps",
- "type": "str",
- "max": "",
- "name": "PWD_POLICY_EXCLUSION_LIST",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": []
- },
- "FEATURE_TOGGLE_CEPHFS": {
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "max": "",
- "name": "FEATURE_TOGGLE_CEPHFS"
- },
- "PWD_POLICY_MIN_LENGTH": {
- "max": "",
- "name": "PWD_POLICY_MIN_LENGTH",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "type": "int",
- "tags": [],
- "long_desc": "",
- "default_value": "8",
- "level": "advanced"
- },
- "REST_REQUESTS_TIMEOUT": {
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "REST_REQUESTS_TIMEOUT",
- "type": "int",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "45"
- },
- "ISSUE_TRACKER_API_KEY": {
- "type": "str",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "ISSUE_TRACKER_API_KEY",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "crt_file": {
- "type": "str",
- "max": "",
- "name": "crt_file",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "standby_error_status_code": {
- "name": "standby_error_status_code",
- "max": "599",
- "flags": 0,
- "min": "400",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "int",
- "level": "advanced",
- "long_desc": "",
- "default_value": "500",
- "tags": []
- },
- "PWD_POLICY_ENABLED": {
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "max": "",
- "name": "PWD_POLICY_ENABLED",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "type": "bool"
- },
- "PROMETHEUS_API_SSL_VERIFY": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "name": "PROMETHEUS_API_SSL_VERIFY",
- "max": "",
- "type": "bool"
- },
- "PWD_POLICY_CHECK_COMPLEXITY_ENABLED": {
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "max": "",
- "name": "PWD_POLICY_CHECK_COMPLEXITY_ENABLED",
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "PWD_POLICY_CHECK_USERNAME_ENABLED": {
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "PWD_POLICY_CHECK_USERNAME_ENABLED",
- "type": "bool"
- },
- "RGW_API_ACCESS_KEY": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "RGW_API_ACCESS_KEY",
- "type": "str"
- },
- "GRAFANA_UPDATE_DASHBOARDS": {
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": [],
- "type": "bool",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "name": "GRAFANA_UPDATE_DASHBOARDS",
- "max": ""
- },
- "ssl_server_port": {
- "type": "int",
- "name": "ssl_server_port",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "long_desc": "",
- "default_value": "8443",
- "level": "advanced",
- "tags": []
- },
- "ssl": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "ssl",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": ""
- },
- "PWD_POLICY_CHECK_SEQUENTIAL_CHARS_ENABLED": {
- "type": "bool",
- "max": "",
- "name": "PWD_POLICY_CHECK_SEQUENTIAL_CHARS_ENABLED",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "FEATURE_TOGGLE_RBD": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "max": "",
- "name": "FEATURE_TOGGLE_RBD",
- "desc": "",
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "type": "bool"
- },
- "FEATURE_TOGGLE_NFS": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "type": "bool",
- "max": "",
- "name": "FEATURE_TOGGLE_NFS",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": []
- },
- "key_file": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "desc": "",
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "key_file",
- "type": "str"
- },
- "log_to_cluster": {
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "max": "",
- "name": "log_to_cluster",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- }
- },
- "error_string": "",
- "name": "dashboard",
- "can_run": true
- },
- {
- "module_options": {
- "enable_monitoring": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "tags": [],
- "type": "bool",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "desc": "monitor device health metrics",
- "name": "enable_monitoring",
- "max": ""
- },
- "retention_period": {
- "type": "secs",
- "max": "",
- "name": "retention_period",
- "desc": "how long to retain device health metrics",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "15552000"
- },
- "scrape_frequency": {
- "tags": [],
- "long_desc": "",
- "default_value": "86400",
- "level": "advanced",
- "desc": "how frequently to scrape device health metrics",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "scrape_frequency",
- "type": "secs"
- },
- "self_heal": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "preemptively heal cluster around devices that may fail",
- "name": "self_heal",
- "max": "",
- "type": "bool"
- },
- "pool_name": {
- "max": "",
- "name": "pool_name",
- "desc": "name of pool in which to store device health metrics",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "default_value": "device_health_metrics",
- "long_desc": ""
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "default_value": "info",
- "long_desc": "",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ]
- },
- "log_level": {
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "log_level",
- "max": "",
- "type": "str",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_file": {
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "mark_out_threshold": {
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "automatically mark OSD if it may fail before this long",
- "name": "mark_out_threshold",
- "max": "",
- "type": "secs",
- "long_desc": "",
- "default_value": "2419200",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "warn_threshold": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "7257600",
- "max": "",
- "name": "warn_threshold",
- "desc": "raise health warning if OSD may fail before this long",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "type": "secs"
- },
- "sleep_interval": {
- "tags": [],
- "long_desc": "",
- "default_value": "600",
- "level": "advanced",
- "desc": "how frequently to wake up and check device health",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "sleep_interval",
- "type": "secs"
- }
- },
- "error_string": "",
- "name": "devicehealth",
- "can_run": true
- },
- {
- "error_string": "influxdb python module not found",
- "module_options": {
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "type": "str"
- },
- "password": {
- "desc": "password of InfluxDB server user",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "password",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "verify_ssl": {
- "long_desc": "",
- "default_value": "true",
- "level": "advanced",
- "tags": [],
- "name": "verify_ssl",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "Verify https cert for InfluxDB server. Use \"true\" or \"false\".",
- "type": "str"
- },
- "username": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "username of InfluxDB server user",
- "name": "username",
- "max": "",
- "type": "str"
- },
- "port": {
- "type": "int",
- "name": "port",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "InfluxDB server port",
- "level": "advanced",
- "default_value": "8086",
- "long_desc": "",
- "tags": []
- },
- "hostname": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "max": "",
- "name": "hostname",
- "desc": "InfluxDB server hostname",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": []
- },
- "ssl": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "false",
- "tags": [],
- "name": "ssl",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "Use https connection for InfluxDB server. Use \"true\" or \"false\".",
- "type": "str"
- },
- "batch_size": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "5000",
- "desc": "How big batches of data points should be when sending to InfluxDB.",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "batch_size",
- "type": "int"
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_cluster",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": ""
- },
- "threads": {
- "long_desc": "",
- "default_value": "5",
- "level": "advanced",
- "tags": [],
- "name": "threads",
- "max": "32",
- "enum_allowed": [],
- "min": "1",
- "see_also": [],
- "flags": 0,
- "desc": "How many worker threads should be spawned for sending data to InfluxDB.",
- "type": "int"
- },
- "log_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "log_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "type": "str"
- },
- "database": {
- "tags": [],
- "long_desc": "",
- "default_value": "ceph",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "database",
- "desc": "InfluxDB database name. You will need to create this database and grant write privileges to the configured username or the username must have admin privileges to create it.",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0
- },
- "interval": {
- "long_desc": "",
- "default_value": "30",
- "level": "advanced",
- "tags": [],
- "name": "interval",
- "max": "",
- "enum_allowed": [],
- "min": "5",
- "flags": 0,
- "see_also": [],
- "desc": "Time between reports to InfluxDB. Default 30 seconds.",
- "type": "secs"
- },
- "log_to_file": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": []
- }
- },
- "name": "influx",
- "can_run": false
- },
- {
- "can_run": true,
- "name": "insights",
- "error_string": "",
- "module_options": {
- "log_level": {
- "type": "str",
- "max": "",
- "name": "log_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "log_to_cluster_level": {
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "default_value": "info",
- "long_desc": ""
- },
- "log_to_cluster": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "type": "bool",
- "name": "log_to_cluster",
- "max": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": ""
- },
- "log_to_file": {
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "bool",
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced"
- }
- }
- },
- {
- "module_options": {
- "log_to_cluster": {
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "type": "bool"
- },
- "log_to_file": {
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "log_level": {
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "",
- "type": "str",
- "default_value": "",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster_level": {
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "",
- "name": "log_to_cluster_level",
- "max": ""
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "iostat"
- },
- {
- "module_options": {
- "pg_num": {
- "type": "int",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "default pg_num for any created local pool",
- "name": "pg_num",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "128",
- "tags": []
- },
- "min_size": {
- "max": "",
- "name": "min_size",
- "desc": "default min_size for any created local pool",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "type": "int",
- "tags": [],
- "long_desc": "value to set min_size to (unchanged from Ceph's default if this option is not set)",
- "default_value": "",
- "level": "advanced"
- },
- "num_rep": {
- "name": "num_rep",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "desc": "default replica count for any created local pool",
- "type": "int",
- "level": "advanced",
- "default_value": "3",
- "long_desc": "",
- "tags": []
- },
- "failure_domain": {
- "max": "",
- "name": "failure_domain",
- "desc": "failure domain for any created local pool",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "default_value": "host",
- "long_desc": "what failure domain we should separate data replicas across."
- },
- "log_to_cluster": {
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": ""
- },
- "log_to_file": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": ""
- },
- "log_level": {
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "log_level",
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "prefix": {
- "type": "str",
- "desc": "name prefix for any created local pool",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "prefix",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str"
- },
- "subtree": {
- "tags": [],
- "level": "advanced",
- "long_desc": "which CRUSH subtree type the module should create a pool for.",
- "default_value": "rack",
- "desc": "CRUSH level for which to create a local pool",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "subtree",
- "type": "str"
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "localpool"
- },
- {
- "module_options": {
- "log_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "log_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": "",
- "type": "str"
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": ""
- },
- "log_to_cluster": {
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "log_to_file": {
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- }
- },
- "error_string": "",
- "name": "mirroring",
- "can_run": true
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_file": {
- "type": "bool",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": [],
- "type": "bool",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": ""
- },
- "log_to_cluster_level": {
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- },
- "log_level": {
- "default_value": "",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "",
- "type": "str"
- }
- },
- "name": "nfs",
- "can_run": true
- },
- {
- "module_options": {
- "log_level": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": ""
- },
- "fail_fs": {
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "type": "bool",
- "max": "",
- "name": "fail_fs",
- "desc": "Fail filesystem for rapid multi-rank mds upgrade",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": []
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "default_value": "info",
- "long_desc": "",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ]
- },
- "orchestrator": {
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [
- "cephadm",
- "rook",
- "test_orchestrator"
- ],
- "desc": "Orchestrator backend",
- "name": "orchestrator",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "log_to_file": {
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "orchestrator"
- },
- {
- "name": "osd_perf_query",
- "can_run": true,
- "module_options": {
- "log_to_cluster_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": [],
- "type": "str",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": ""
- },
- "log_level": {
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced",
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "log_level"
- },
- "log_to_file": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "log_to_file",
- "type": "bool"
- },
- "log_to_cluster": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "log_to_cluster"
- }
- },
- "error_string": ""
- },
- {
- "name": "osd_support",
- "can_run": true,
- "module_options": {
- "log_level": {
- "max": "",
- "name": "log_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1,
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "log_to_cluster_level": {
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "name": "log_to_cluster_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": ""
- },
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "log_to_file": {
- "name": "log_to_file",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": "",
- "type": "bool",
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": []
- }
- },
- "error_string": ""
- },
- {
- "name": "pg_autoscaler",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "sleep_interval": {
- "name": "sleep_interval",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "type": "secs",
- "long_desc": "",
- "default_value": "60",
- "level": "advanced",
- "tags": []
- },
- "threshold": {
- "type": "float",
- "enum_allowed": [],
- "min": "1.0",
- "see_also": [],
- "flags": 0,
- "desc": "scaling threshold",
- "name": "threshold",
- "max": "",
- "long_desc": "The factor by which the 'NEW PG_NUM' must vary from the current 'PG_NUM' before being accepted. Cannot be less than 1.0",
- "default_value": "3.0",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "name": "log_to_cluster",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "type": "bool"
- },
- "log_to_file": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": ""
- },
- "log_level": {
- "type": "str",
- "max": "",
- "name": "log_level",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "log_to_cluster_level": {
- "type": "str",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- }
- }
- },
- {
- "name": "progress",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "sleep_interval": {
- "max": "",
- "name": "sleep_interval",
- "desc": "how long the module is going to sleep",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "type": "secs",
- "tags": [],
- "default_value": "5",
- "long_desc": "",
- "level": "advanced"
- },
- "max_completed_events": {
- "max": "",
- "name": "max_completed_events",
- "desc": "number of past completed events to remember",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "int",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "50"
- },
- "log_to_cluster": {
- "type": "bool",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "enabled": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "enabled",
- "max": ""
- },
- "allow_pg_recovery_event": {
- "max": "",
- "name": "allow_pg_recovery_event",
- "desc": "allow the module to show pg recovery progress",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": ""
- },
- "log_to_file": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool"
- },
- "log_level": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_level",
- "max": ""
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "type": "str",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level"
- }
- }
- },
- {
- "can_run": true,
- "name": "prometheus",
- "module_options": {
- "cache": {
- "tags": [],
- "default_value": "True",
- "long_desc": "",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "cache",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0
- },
- "stale_cache_strategy": {
- "name": "stale_cache_strategy",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "log",
- "tags": []
- },
- "server_port": {
- "long_desc": "",
- "default_value": "9283",
- "level": "advanced",
- "tags": [],
- "type": "int",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "the port on which the module listens for HTTP requests",
- "name": "server_port",
- "max": ""
- },
- "log_to_file": {
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "standby_error_status_code": {
- "type": "int",
- "flags": 1,
- "min": "400",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "standby_error_status_code",
- "max": "599",
- "level": "advanced",
- "default_value": "500",
- "long_desc": "",
- "tags": []
- },
- "scrape_interval": {
- "type": "float",
- "name": "scrape_interval",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "default_value": "15.0",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "log_level": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "type": "str"
- },
- "standby_behaviour": {
- "desc": "",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [
- "default",
- "error"
- ],
- "max": "",
- "name": "standby_behaviour",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "default"
- },
- "server_addr": {
- "tags": [],
- "long_desc": "",
- "default_value": "::",
- "level": "advanced",
- "type": "str",
- "desc": "the IPv4 or IPv6 address on which the module listens for HTTP requests",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "server_addr"
- },
- "log_to_cluster": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "max": "",
- "name": "log_to_cluster"
- },
- "rbd_stats_pools": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "rbd_stats_pools",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "type": "str"
- },
- "log_to_cluster_level": {
- "type": "str",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "default_value": "info",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "rbd_stats_pools_refresh_interval": {
- "type": "int",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "rbd_stats_pools_refresh_interval",
- "max": "",
- "level": "advanced",
- "default_value": "300",
- "long_desc": "",
- "tags": []
- },
- "exclude_perf_counters": {
- "type": "bool",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [],
- "desc": "Do not include perf-counters in the metrics output",
- "name": "exclude_perf_counters",
- "max": "",
- "level": "advanced",
- "long_desc": "Gathering perf-counters from a single Prometheus exporter can degrade ceph-mgr performance, especially in large clusters. Instead, Ceph-exporter daemons are now used by default for perf-counter gathering. This should only be disabled when no ceph-exporters are deployed.",
- "default_value": "True",
- "tags": []
- }
- },
- "error_string": ""
- },
- {
- "can_run": true,
- "name": "rbd_support",
- "error_string": "",
- "module_options": {
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1,
- "type": "str"
- },
- "mirror_snapshot_schedule": {
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "mirror_snapshot_schedule",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": ""
- },
- "trash_purge_schedule": {
- "type": "str",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "trash_purge_schedule",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "log_level": {
- "max": "",
- "name": "log_level",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "max_concurrent_snap_create": {
- "tags": [],
- "long_desc": "",
- "default_value": "10",
- "level": "advanced",
- "type": "int",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "max_concurrent_snap_create"
- },
- "log_to_file": {
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "log_to_file",
- "type": "bool"
- },
- "log_to_cluster": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "max": "",
- "name": "log_to_cluster"
- }
- }
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "desc": "",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str"
- },
- "log_level": {
- "type": "str",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_level",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "enable_auth": {
- "type": "bool",
- "name": "enable_auth",
- "max": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "tags": []
- },
- "server_port": {
- "max": "",
- "name": "server_port",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "type": "str",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "log_to_file": {
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool"
- },
- "server_addr": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "server_addr",
- "type": "str"
- },
- "log_to_cluster": {
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "key_file": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "type": "str",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "key_file",
- "max": ""
- }
- },
- "can_run": true,
- "name": "restful"
- },
- {
- "can_run": true,
- "name": "selftest",
- "module_options": {
- "rwoption5": {
- "max": "",
- "name": "rwoption5",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "testkey": {
- "name": "testkey",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "roption2": {
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "roption2",
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "xyz",
- "level": "advanced"
- },
- "testnewline": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "type": "str",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "testnewline"
- },
- "rwoption4": {
- "type": "str",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "name": "rwoption4",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "log_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1,
- "max": "",
- "name": "log_level"
- },
- "log_to_file": {
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool",
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "testlkey": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "testlkey",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "type": "str"
- },
- "roption1": {
- "type": "str",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "max": "",
- "name": "roption1",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "rwoption2": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "type": "int",
- "max": "",
- "name": "rwoption2",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": []
- },
- "rwoption3": {
- "type": "float",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "name": "rwoption3",
- "max": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "rwoption1": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "desc": "",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "rwoption1"
- },
- "log_to_cluster_level": {
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced"
- },
- "rwoption6": {
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "max": "",
- "name": "rwoption6",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "type": "bool"
- },
- "rwoption7": {
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": [],
- "type": "int",
- "name": "rwoption7",
- "max": "42",
- "see_also": [],
- "min": "1",
- "flags": 0,
- "enum_allowed": [],
- "desc": ""
- },
- "log_to_cluster": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "name": "log_to_cluster",
- "max": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "bool"
- }
- },
- "error_string": ""
- },
- {
- "module_options": {
- "dump_on_update": {
- "type": "bool",
- "desc": "dump database to debug log on update",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "max": "",
- "name": "dump_on_update",
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced"
- },
- "log_level": {
- "max": "",
- "name": "log_level",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": ""
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": []
- },
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "allow_m_granularity": {
- "type": "bool",
- "desc": "allow minute scheduled snapshots",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "max": "",
- "name": "allow_m_granularity",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "log_to_file": {
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "snap_schedule"
- },
- {
- "module_options": {
- "log_level": {
- "type": "str",
- "max": "",
- "name": "log_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "log_to_cluster_level": {
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1,
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced"
- },
- "log_to_cluster": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool"
- },
- "log_to_file": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "log_to_file"
- }
- },
- "error_string": "",
- "name": "stats",
- "can_run": true
- },
- {
- "name": "status",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "log_to_file": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool"
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_cluster",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": ""
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": []
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "max": "",
- "name": "log_level",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str"
- }
- }
- },
- {
- "module_options": {
- "log_level": {
- "type": "str",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "log_to_cluster_level": {
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- },
- "log_to_cluster": {
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "log_to_file": {
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "interval": {
- "tags": [],
- "level": "advanced",
- "default_value": "15",
- "long_desc": "",
- "type": "secs",
- "max": "",
- "name": "interval",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": []
- },
- "address": {
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "name": "address",
- "max": "",
- "type": "str",
- "level": "advanced",
- "default_value": "unixgram:///tmp/telegraf.sock",
- "long_desc": "",
- "tags": []
- }
- },
- "error_string": "",
- "name": "telegraf",
- "can_run": true
- },
- {
- "name": "telemetry",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "channel_device": {
- "level": "advanced",
- "default_value": "True",
- "long_desc": "",
- "tags": [],
- "type": "bool",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "Share device health metrics (e.g., SMART data, minus potentially identifying info like serial numbers)",
- "name": "channel_device",
- "max": ""
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": []
- },
- "leaderboard_description": {
- "type": "str",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "leaderboard_description",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "channel_perf": {
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": [],
- "type": "bool",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "Share various performance metrics of a cluster",
- "name": "channel_perf",
- "max": ""
- },
- "log_to_cluster": {
- "type": "bool",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "log_to_cluster",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "channel_basic": {
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "Share basic cluster information (size, version)",
- "name": "channel_basic",
- "max": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": []
- },
- "organization": {
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "organization",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "last_opt_revision": {
- "max": "",
- "name": "last_opt_revision",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "int",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "1"
- },
- "device_url": {
- "tags": [],
- "long_desc": "",
- "default_value": "https://telemetry.ceph.com/device",
- "level": "advanced",
- "max": "",
- "name": "device_url",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "type": "str"
- },
- "proxy": {
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "desc": "",
- "name": "proxy",
- "max": "",
- "type": "str",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "leaderboard": {
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": [],
- "name": "leaderboard",
- "max": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "bool"
- },
- "channel_ident": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "type": "bool",
- "max": "",
- "name": "channel_ident",
- "desc": "Share a user-provided description and/or contact email for the cluster",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": []
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "max": "",
- "name": "log_level",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ]
- },
- "log_to_file": {
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "interval": {
- "long_desc": "",
- "default_value": "24",
- "level": "advanced",
- "tags": [],
- "type": "int",
- "name": "interval",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "8",
- "see_also": [],
- "desc": ""
- },
- "contact": {
- "desc": "",
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "contact",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "enabled": {
- "type": "bool",
- "name": "enabled",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "desc": "",
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "url": {
- "max": "",
- "name": "url",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "type": "str",
- "tags": [],
- "default_value": "https://telemetry.ceph.com/report",
- "long_desc": "",
- "level": "advanced"
- },
- "description": {
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "description",
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "channel_crash": {
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "channel_crash",
- "desc": "Share metadata about Ceph daemon crashes (version, stack straces, etc)",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": []
- }
- }
- },
- {
- "name": "test_orchestrator",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "log_to_file": {
- "type": "bool",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": []
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "max": "",
- "name": "log_level",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ]
- },
- "log_to_cluster_level": {
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "name": "log_to_cluster_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": ""
- }
- }
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_file": {
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool"
- },
- "max_concurrent_clones": {
- "type": "int",
- "name": "max_concurrent_clones",
- "max": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "Number of asynchronous cloner threads",
- "level": "advanced",
- "default_value": "4",
- "long_desc": "",
- "tags": []
- },
- "log_to_cluster_level": {
- "name": "log_to_cluster_level",
- "max": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- },
- "snapshot_clone_delay": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "0",
- "type": "int",
- "desc": "Delay clone begin operation by snapshot_clone_delay seconds",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "snapshot_clone_delay"
- },
- "log_level": {
- "type": "str",
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- }
- },
- "name": "volumes",
- "can_run": true
- },
- {
- "error_string": "",
- "module_options": {
- "log_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "type": "str",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_level",
- "max": ""
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": []
- },
- "discovery_interval": {
- "level": "advanced",
- "default_value": "100",
- "long_desc": "",
- "tags": [],
- "type": "uint",
- "name": "discovery_interval",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": ""
- },
- "zabbix_port": {
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "zabbix_port",
- "max": "",
- "type": "int",
- "level": "advanced",
- "default_value": "10051",
- "long_desc": "",
- "tags": []
- },
- "identifier": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "desc": "",
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "identifier",
- "type": "str"
- },
- "zabbix_host": {
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced",
- "max": "",
- "name": "zabbix_host",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "type": "str"
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool"
- },
- "zabbix_sender": {
- "default_value": "/usr/bin/zabbix_sender",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "name": "zabbix_sender",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "desc": ""
- },
- "log_to_file": {
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "interval": {
- "tags": [],
- "long_desc": "",
- "default_value": "60",
- "level": "advanced",
- "type": "secs",
- "max": "",
- "name": "interval",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": []
- }
- },
- "can_run": true,
- "name": "zabbix"
- }
- ],
- "gid": 179843533,
- "name": "proxmox-node03"
- },
- {
- "name": "proxmox-node01",
- "mgr_features": 4540138322906710015,
- "gid": 179864286,
- "available_modules": [
- {
- "name": "alerts",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "max": "",
- "name": "log_to_cluster_level"
- },
- "smtp_port": {
- "level": "advanced",
- "default_value": "465",
- "long_desc": "",
- "tags": [],
- "name": "smtp_port",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": "SMTP port",
- "type": "int"
- },
- "smtp_ssl": {
- "level": "advanced",
- "default_value": "True",
- "long_desc": "",
- "tags": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "Use SSL to connect to SMTP server",
- "name": "smtp_ssl",
- "max": "",
- "type": "bool"
- },
- "smtp_host": {
- "type": "str",
- "desc": "SMTP server",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "smtp_host",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool"
- },
- "smtp_password": {
- "type": "str",
- "desc": "Password to authenticate with",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "smtp_password",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "max": "",
- "name": "log_level",
- "desc": "",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str"
- },
- "smtp_sender": {
- "max": "",
- "name": "smtp_sender",
- "desc": "SMTP envelope sender",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "smtp_destination": {
- "desc": "Email address to send alerts to",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "smtp_destination",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "smtp_user": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "max": "",
- "name": "smtp_user",
- "desc": "User to authenticate as",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": []
- },
- "smtp_from_name": {
- "type": "str",
- "max": "",
- "name": "smtp_from_name",
- "desc": "Email From: name",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "default_value": "Ceph",
- "long_desc": ""
- },
- "interval": {
- "max": "",
- "name": "interval",
- "desc": "How frequently to reexamine health status",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "secs",
- "tags": [],
- "long_desc": "",
- "default_value": "60",
- "level": "advanced"
- },
- "log_to_file": {
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- }
- }
- },
- {
- "can_run": true,
- "name": "balancer",
- "error_string": "",
- "module_options": {
- "end_time": {
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [],
- "desc": "ending time of day to automatically balance",
- "name": "end_time",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "This is a time of day in the format HHMM.",
- "default_value": "2359",
- "tags": []
- },
- "end_weekday": {
- "level": "advanced",
- "long_desc": "0 = Sunday, 1 = Monday, etc.",
- "default_value": "0",
- "tags": [],
- "name": "end_weekday",
- "max": "6",
- "min": "0",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "Restrict automatic balancing to days of the week earlier than this",
- "type": "uint"
- },
- "log_level": {
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "type": "str",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_file": {
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "upmap_max_optimizations": {
- "type": "uint",
- "name": "upmap_max_optimizations",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": "maximum upmap optimizations to make per attempt",
- "level": "advanced",
- "default_value": "10",
- "long_desc": "",
- "tags": []
- },
- "begin_time": {
- "type": "str",
- "name": "begin_time",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "beginning time of day to automatically balance",
- "long_desc": "This is a time of day in the format HHMM.",
- "default_value": "0000",
- "level": "advanced",
- "tags": []
- },
- "begin_weekday": {
- "default_value": "0",
- "long_desc": "0 = Sunday, 1 = Monday, etc.",
- "level": "advanced",
- "tags": [],
- "type": "uint",
- "enum_allowed": [],
- "min": "0",
- "see_also": [],
- "flags": 1,
- "desc": "Restrict automatic balancing to this day of the week or later",
- "name": "begin_weekday",
- "max": "6"
- },
- "pool_ids": {
- "max": "",
- "name": "pool_ids",
- "desc": "pools which the automatic balancing will be limited to",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "type": "str",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "upmap_max_deviation": {
- "tags": [],
- "long_desc": "If the number of PGs are within this count then no optimization is attempted",
- "default_value": "5",
- "level": "advanced",
- "max": "",
- "name": "upmap_max_deviation",
- "desc": "deviation below which no optimization is attempted",
- "enum_allowed": [],
- "min": "1",
- "flags": 1,
- "see_also": [],
- "type": "int"
- },
- "active": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "tags": [],
- "type": "bool",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [],
- "desc": "automatically balance PGs across cluster",
- "name": "active",
- "max": ""
- },
- "mode": {
- "name": "mode",
- "max": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "crush-compat",
- "none",
- "upmap"
- ],
- "desc": "Balancer mode",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "upmap",
- "tags": []
- },
- "crush_compat_metrics": {
- "type": "str",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "metrics with which to calculate OSD utilization",
- "name": "crush_compat_metrics",
- "max": "",
- "long_desc": "Value is a list of one or more of \"pgs\", \"objects\", or \"bytes\", and indicates which metrics to use to balance utilization.",
- "default_value": "pgs,objects,bytes",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster_level": {
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "max": "",
- "name": "log_to_cluster_level",
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced"
- },
- "log_to_cluster": {
- "type": "bool",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": ""
- },
- "min_score": {
- "type": "float",
- "desc": "minimum score, below which no optimization is attempted",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "min_score",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "0"
- },
- "crush_compat_max_iterations": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "25",
- "type": "uint",
- "desc": "maximum number of iterations to attempt optimization",
- "flags": 1,
- "see_also": [],
- "min": "1",
- "enum_allowed": [],
- "max": "250",
- "name": "crush_compat_max_iterations"
- },
- "crush_compat_step": {
- "default_value": "0.5",
- "long_desc": ".99 is very aggressive, .01 is less aggressive",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "0.001",
- "desc": "aggressiveness of optimization",
- "name": "crush_compat_step",
- "max": "0.999",
- "type": "float"
- },
- "sleep_interval": {
- "tags": [],
- "long_desc": "",
- "default_value": "60",
- "level": "advanced",
- "desc": "how frequently to wake up and attempt optimization",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "max": "",
- "name": "sleep_interval",
- "type": "secs"
- }
- }
- },
- {
- "module_options": {
- "log_to_file": {
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_cluster",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": ""
- },
- "retain_interval": {
- "default_value": "31536000",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "type": "secs",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "how long to retain crashes before pruning them",
- "name": "retain_interval",
- "max": ""
- },
- "warn_recent_interval": {
- "max": "",
- "name": "warn_recent_interval",
- "desc": "time interval in which to warn about recent crashes",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "type": "secs",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "1209600"
- },
- "log_to_cluster_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "type": "str"
- },
- "log_level": {
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "log_level",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "crash"
- },
- {
- "error_string": "",
- "module_options": {
- "PWD_POLICY_CHECK_REPETITIVE_CHARS_ENABLED": {
- "name": "PWD_POLICY_CHECK_REPETITIVE_CHARS_ENABLED",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "type": "bool",
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "PWD_POLICY_CHECK_EXCLUSION_LIST_ENABLED": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "PWD_POLICY_CHECK_EXCLUSION_LIST_ENABLED",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "desc": ""
- },
- "log_level": {
- "type": "str",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "",
- "name": "log_level",
- "max": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "PWD_POLICY_EXCLUSION_LIST": {
- "long_desc": "",
- "default_value": "osd,host,dashboard,pool,block,nfs,ceph,monitors,gateway,logs,crush,maps",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "name": "PWD_POLICY_EXCLUSION_LIST",
- "max": "",
- "type": "str"
- },
- "FEATURE_TOGGLE_CEPHFS": {
- "type": "bool",
- "name": "FEATURE_TOGGLE_CEPHFS",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": []
- },
- "PWD_POLICY_MIN_LENGTH": {
- "type": "int",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "PWD_POLICY_MIN_LENGTH",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "8",
- "tags": []
- },
- "REST_REQUESTS_TIMEOUT": {
- "type": "int",
- "name": "REST_REQUESTS_TIMEOUT",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "long_desc": "",
- "default_value": "45",
- "level": "advanced",
- "tags": []
- },
- "crt_file": {
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "crt_file",
- "type": "str",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "ISSUE_TRACKER_API_KEY": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "max": "",
- "name": "ISSUE_TRACKER_API_KEY",
- "desc": "",
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "type": "str"
- },
- "standby_error_status_code": {
- "enum_allowed": [],
- "flags": 0,
- "min": "400",
- "see_also": [],
- "desc": "",
- "name": "standby_error_status_code",
- "max": "599",
- "type": "int",
- "long_desc": "",
- "default_value": "500",
- "level": "advanced",
- "tags": []
- },
- "PWD_POLICY_ENABLED": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "tags": [],
- "type": "bool",
- "name": "PWD_POLICY_ENABLED",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": ""
- },
- "PROMETHEUS_API_SSL_VERIFY": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "PROMETHEUS_API_SSL_VERIFY",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "desc": ""
- },
- "PWD_POLICY_CHECK_COMPLEXITY_ENABLED": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "PWD_POLICY_CHECK_COMPLEXITY_ENABLED",
- "max": ""
- },
- "PWD_POLICY_CHECK_USERNAME_ENABLED": {
- "type": "bool",
- "desc": "",
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "PWD_POLICY_CHECK_USERNAME_ENABLED",
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": ""
- },
- "RGW_API_ACCESS_KEY": {
- "type": "str",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "RGW_API_ACCESS_KEY",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "GRAFANA_UPDATE_DASHBOARDS": {
- "type": "bool",
- "max": "",
- "name": "GRAFANA_UPDATE_DASHBOARDS",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "ssl_server_port": {
- "type": "int",
- "max": "",
- "name": "ssl_server_port",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "8443"
- },
- "ssl": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "ssl",
- "type": "bool"
- },
- "PWD_POLICY_CHECK_SEQUENTIAL_CHARS_ENABLED": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "PWD_POLICY_CHECK_SEQUENTIAL_CHARS_ENABLED",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": ""
- },
- "FEATURE_TOGGLE_RBD": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "name": "FEATURE_TOGGLE_RBD",
- "max": ""
- },
- "FEATURE_TOGGLE_NFS": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "FEATURE_TOGGLE_NFS",
- "max": "",
- "type": "bool"
- },
- "key_file": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "name": "key_file",
- "max": "",
- "type": "str"
- },
- "log_to_cluster": {
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "log_to_cluster",
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced"
- },
- "AUDIT_API_ENABLED": {
- "max": "",
- "name": "AUDIT_API_ENABLED",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "cross_origin_url": {
- "type": "str",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "cross_origin_url",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "FEATURE_TOGGLE_MIRRORING": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "type": "bool",
- "max": "",
- "name": "FEATURE_TOGGLE_MIRRORING",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": []
- },
- "GRAFANA_FRONTEND_API_URL": {
- "type": "str",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "name": "GRAFANA_FRONTEND_API_URL",
- "max": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "standby_behaviour": {
- "type": "str",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [
- "error",
- "redirect"
- ],
- "max": "",
- "name": "standby_behaviour",
- "tags": [],
- "level": "advanced",
- "default_value": "redirect",
- "long_desc": ""
- },
- "GANESHA_CLUSTERS_RADOS_POOL_NAMESPACE": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "name": "GANESHA_CLUSTERS_RADOS_POOL_NAMESPACE",
- "max": "",
- "type": "str"
- },
- "log_to_file": {
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "",
- "type": "bool"
- },
- "ACCOUNT_LOCKOUT_ATTEMPTS": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "10",
- "max": "",
- "name": "ACCOUNT_LOCKOUT_ATTEMPTS",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "type": "int"
- },
- "GRAFANA_API_PASSWORD": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "admin",
- "tags": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "name": "GRAFANA_API_PASSWORD",
- "max": "",
- "type": "str"
- },
- "GRAFANA_API_URL": {
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "name": "GRAFANA_API_URL",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "log_to_cluster_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": [],
- "type": "str",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": ""
- },
- "AUDIT_API_LOG_PAYLOAD": {
- "type": "bool",
- "max": "",
- "name": "AUDIT_API_LOG_PAYLOAD",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True"
- },
- "PWD_POLICY_CHECK_OLDPWD_ENABLED": {
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "max": "",
- "name": "PWD_POLICY_CHECK_OLDPWD_ENABLED",
- "tags": [],
- "default_value": "True",
- "long_desc": "",
- "level": "advanced"
- },
- "ALERTMANAGER_API_SSL_VERIFY": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "max": "",
- "name": "ALERTMANAGER_API_SSL_VERIFY",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "bool"
- },
- "debug": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "Enable/disable debug options",
- "name": "debug",
- "max": "",
- "type": "bool"
- },
- "FEATURE_TOGGLE_DASHBOARD": {
- "type": "bool",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "FEATURE_TOGGLE_DASHBOARD",
- "max": "",
- "default_value": "True",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "GRAFANA_API_SSL_VERIFY": {
- "tags": [],
- "default_value": "True",
- "long_desc": "",
- "level": "advanced",
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "GRAFANA_API_SSL_VERIFY"
- },
- "PROMETHEUS_API_HOST": {
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": [],
- "name": "PROMETHEUS_API_HOST",
- "max": "",
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "type": "str"
- },
- "ISCSI_API_SSL_VERIFICATION": {
- "type": "bool",
- "max": "",
- "name": "ISCSI_API_SSL_VERIFICATION",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "tags": [],
- "default_value": "True",
- "long_desc": "",
- "level": "advanced"
- },
- "ENABLE_BROWSABLE_API": {
- "level": "advanced",
- "default_value": "True",
- "long_desc": "",
- "tags": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "ENABLE_BROWSABLE_API",
- "max": "",
- "type": "bool"
- },
- "UNSAFE_TLS_v1_2": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "UNSAFE_TLS_v1_2",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": ""
- },
- "ALERTMANAGER_API_HOST": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "max": "",
- "name": "ALERTMANAGER_API_HOST",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "type": "str"
- },
- "GRAFANA_API_USERNAME": {
- "max": "",
- "name": "GRAFANA_API_USERNAME",
- "desc": "",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "admin"
- },
- "FEATURE_TOGGLE_ISCSI": {
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "FEATURE_TOGGLE_ISCSI",
- "max": "",
- "type": "bool",
- "default_value": "True",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "USER_PWD_EXPIRATION_SPAN": {
- "max": "",
- "name": "USER_PWD_EXPIRATION_SPAN",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "type": "int",
- "tags": [],
- "level": "advanced",
- "default_value": "0",
- "long_desc": ""
- },
- "RGW_API_SECRET_KEY": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "max": "",
- "name": "RGW_API_SECRET_KEY",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": []
- },
- "USER_PWD_EXPIRATION_WARNING_1": {
- "type": "int",
- "name": "USER_PWD_EXPIRATION_WARNING_1",
- "max": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "10",
- "tags": []
- },
- "RGW_API_ADMIN_RESOURCE": {
- "tags": [],
- "long_desc": "",
- "default_value": "admin",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "RGW_API_ADMIN_RESOURCE",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0
- },
- "RGW_API_SSL_VERIFY": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "type": "bool",
- "max": "",
- "name": "RGW_API_SSL_VERIFY",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": []
- },
- "PWD_POLICY_CHECK_LENGTH_ENABLED": {
- "type": "bool",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "PWD_POLICY_CHECK_LENGTH_ENABLED",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True"
- },
- "server_port": {
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "max": "",
- "name": "server_port",
- "type": "int",
- "tags": [],
- "long_desc": "",
- "default_value": "8080",
- "level": "advanced"
- },
- "redirect_resolve_ip_addr": {
- "type": "bool",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "redirect_resolve_ip_addr",
- "max": "",
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": []
- },
- "PWD_POLICY_MIN_COMPLEXITY": {
- "name": "PWD_POLICY_MIN_COMPLEXITY",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "int",
- "level": "advanced",
- "default_value": "10",
- "long_desc": "",
- "tags": []
- },
- "FEATURE_TOGGLE_RGW": {
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "max": "",
- "name": "FEATURE_TOGGLE_RGW",
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True"
- },
- "motd": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "max": "",
- "name": "motd",
- "desc": "The message of the day",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "str"
- },
- "jwt_token_ttl": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "28800",
- "tags": [],
- "type": "int",
- "name": "jwt_token_ttl",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": ""
- },
- "url_prefix": {
- "name": "url_prefix",
- "max": "",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": []
- },
- "USER_PWD_EXPIRATION_WARNING_2": {
- "long_desc": "",
- "default_value": "5",
- "level": "advanced",
- "tags": [],
- "type": "int",
- "name": "USER_PWD_EXPIRATION_WARNING_2",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": ""
- },
- "server_addr": {
- "name": "server_addr",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "::",
- "tags": []
- }
- },
- "can_run": true,
- "name": "dashboard"
- },
- {
- "module_options": {
- "log_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "name": "log_level",
- "max": "",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "type": "str"
- },
- "self_heal": {
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "preemptively heal cluster around devices that may fail",
- "name": "self_heal",
- "max": "",
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": []
- },
- "pool_name": {
- "default_value": "device_health_metrics",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "name": "pool_name",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "name of pool in which to store device health metrics",
- "type": "str"
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "log_to_cluster_level"
- },
- "scrape_frequency": {
- "default_value": "86400",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "type": "secs",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "how frequently to scrape device health metrics",
- "name": "scrape_frequency",
- "max": ""
- },
- "enable_monitoring": {
- "default_value": "True",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "monitor device health metrics",
- "name": "enable_monitoring",
- "max": ""
- },
- "retention_period": {
- "type": "secs",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "how long to retain device health metrics",
- "name": "retention_period",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "15552000",
- "tags": []
- },
- "sleep_interval": {
- "name": "sleep_interval",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "how frequently to wake up and check device health",
- "type": "secs",
- "long_desc": "",
- "default_value": "600",
- "level": "advanced",
- "tags": []
- },
- "warn_threshold": {
- "type": "secs",
- "desc": "raise health warning if OSD may fail before this long",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "warn_threshold",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "7257600"
- },
- "log_to_cluster": {
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "log_to_cluster",
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced"
- },
- "mark_out_threshold": {
- "type": "secs",
- "name": "mark_out_threshold",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "automatically mark OSD if it may fail before this long",
- "long_desc": "",
- "default_value": "2419200",
- "level": "advanced",
- "tags": []
- },
- "log_to_file": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "",
- "type": "bool"
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "devicehealth"
- },
- {
- "name": "influx",
- "can_run": false,
- "module_options": {
- "log_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "type": "str",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_level",
- "max": ""
- },
- "threads": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "5",
- "tags": [],
- "type": "int",
- "name": "threads",
- "max": "32",
- "see_also": [],
- "min": "1",
- "flags": 0,
- "enum_allowed": [],
- "desc": "How many worker threads should be spawned for sending data to InfluxDB."
- },
- "database": {
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "InfluxDB database name. You will need to create this database and grant write privileges to the configured username or the username must have admin privileges to create it.",
- "name": "database",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "ceph",
- "tags": []
- },
- "interval": {
- "long_desc": "",
- "default_value": "30",
- "level": "advanced",
- "tags": [],
- "type": "secs",
- "name": "interval",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "5",
- "flags": 0,
- "desc": "Time between reports to InfluxDB. Default 30 seconds."
- },
- "log_to_file": {
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "password": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "password",
- "desc": "password of InfluxDB server user",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "type": "str"
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "log_to_cluster_level"
- },
- "batch_size": {
- "long_desc": "",
- "default_value": "5000",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "desc": "How big batches of data points should be when sending to InfluxDB.",
- "name": "batch_size",
- "max": "",
- "type": "int"
- },
- "log_to_cluster": {
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "username": {
- "type": "str",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "username of InfluxDB server user",
- "name": "username",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "verify_ssl": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "true",
- "type": "str",
- "max": "",
- "name": "verify_ssl",
- "desc": "Verify https cert for InfluxDB server. Use \"true\" or \"false\".",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": []
- },
- "port": {
- "type": "int",
- "name": "port",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "desc": "InfluxDB server port",
- "long_desc": "",
- "default_value": "8086",
- "level": "advanced",
- "tags": []
- },
- "ssl": {
- "desc": "Use https connection for InfluxDB server. Use \"true\" or \"false\".",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "max": "",
- "name": "ssl",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "default_value": "false",
- "long_desc": ""
- },
- "hostname": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "type": "str",
- "name": "hostname",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "InfluxDB server hostname"
- }
- },
- "error_string": "influxdb python module not found"
- },
- {
- "module_options": {
- "log_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level"
- },
- "log_to_cluster_level": {
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "tags": [],
- "name": "log_to_cluster_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "type": "str"
- },
- "log_to_cluster": {
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "log_to_file": {
- "type": "bool",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "insights"
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_cluster": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "type": "bool",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "log_to_cluster"
- },
- "log_to_file": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": []
- },
- "log_level": {
- "type": "str",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level",
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": ""
- },
- "log_to_cluster_level": {
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "type": "str",
- "default_value": "info",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- }
- },
- "can_run": true,
- "name": "iostat"
- },
- {
- "can_run": true,
- "name": "localpool",
- "error_string": "",
- "module_options": {
- "num_rep": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "3",
- "type": "int",
- "desc": "default replica count for any created local pool",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "num_rep"
- },
- "failure_domain": {
- "level": "advanced",
- "long_desc": "what failure domain we should separate data replicas across.",
- "default_value": "host",
- "tags": [],
- "type": "str",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "desc": "failure domain for any created local pool",
- "name": "failure_domain",
- "max": ""
- },
- "log_to_cluster": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "log_to_cluster",
- "type": "bool"
- },
- "log_to_file": {
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "pg_num": {
- "tags": [],
- "default_value": "128",
- "long_desc": "",
- "level": "advanced",
- "type": "int",
- "max": "",
- "name": "pg_num",
- "desc": "default pg_num for any created local pool",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": []
- },
- "min_size": {
- "type": "int",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "default min_size for any created local pool",
- "name": "min_size",
- "max": "",
- "long_desc": "value to set min_size to (unchanged from Ceph's default if this option is not set)",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "log_level": {
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "max": "",
- "name": "log_level",
- "type": "str"
- },
- "prefix": {
- "type": "str",
- "name": "prefix",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "name prefix for any created local pool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "subtree": {
- "level": "advanced",
- "long_desc": "which CRUSH subtree type the module should create a pool for.",
- "default_value": "rack",
- "tags": [],
- "name": "subtree",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "CRUSH level for which to create a local pool",
- "type": "str"
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str"
- }
- }
- },
- {
- "name": "mirroring",
- "can_run": true,
- "module_options": {
- "log_to_file": {
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool"
- },
- "log_to_cluster": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "type": "bool",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": []
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1,
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str"
- },
- "log_level": {
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "log_level",
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- }
- },
- "error_string": ""
- },
- {
- "module_options": {
- "log_to_file": {
- "name": "log_to_file",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "log_to_cluster": {
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "log_to_cluster_level": {
- "tags": [],
- "default_value": "info",
- "long_desc": "",
- "level": "advanced",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": "",
- "type": "str"
- },
- "log_level": {
- "type": "str",
- "max": "",
- "name": "log_level",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "nfs"
- },
- {
- "can_run": true,
- "name": "orchestrator",
- "module_options": {
- "fail_fs": {
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "Fail filesystem for rapid multi-rank mds upgrade",
- "name": "fail_fs",
- "max": ""
- },
- "log_to_cluster_level": {
- "type": "str",
- "name": "log_to_cluster_level",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- },
- "log_level": {
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "log_to_file": {
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": [],
- "type": "bool",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_file",
- "max": ""
- },
- "log_to_cluster": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": ""
- },
- "orchestrator": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "orchestrator",
- "desc": "Orchestrator backend",
- "enum_allowed": [
- "cephadm",
- "rook",
- "test_orchestrator"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "type": "str"
- }
- },
- "error_string": ""
- },
- {
- "can_run": true,
- "name": "osd_perf_query",
- "module_options": {
- "log_to_cluster_level": {
- "name": "log_to_cluster_level",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- },
- "log_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "type": "str",
- "name": "log_level",
- "max": "",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": ""
- },
- "log_to_file": {
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1
- }
- },
- "error_string": ""
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_cluster": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "max": "",
- "name": "log_to_cluster",
- "type": "bool"
- },
- "log_to_file": {
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": []
- },
- "log_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "type": "str",
- "name": "log_level",
- "max": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": ""
- },
- "log_to_cluster_level": {
- "level": "advanced",
- "default_value": "info",
- "long_desc": "",
- "tags": [],
- "name": "log_to_cluster_level",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "type": "str"
- }
- },
- "can_run": true,
- "name": "osd_support"
- },
- {
- "name": "pg_autoscaler",
- "can_run": true,
- "module_options": {
- "sleep_interval": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "60",
- "type": "secs",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "sleep_interval"
- },
- "threshold": {
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "1.0",
- "desc": "scaling threshold",
- "name": "threshold",
- "max": "",
- "type": "float",
- "long_desc": "The factor by which the 'NEW PG_NUM' must vary from the current 'PG_NUM' before being accepted. Cannot be less than 1.0",
- "default_value": "3.0",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "log_to_file": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": []
- },
- "log_level": {
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "",
- "type": "str",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster_level": {
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info"
- }
- },
- "error_string": ""
- },
- {
- "error_string": "",
- "module_options": {
- "enabled": {
- "max": "",
- "name": "enabled",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True"
- },
- "log_to_cluster": {
- "type": "bool",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "log_to_file": {
- "type": "bool",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "log_to_file",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "allow_pg_recovery_event": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "name": "allow_pg_recovery_event",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "desc": "allow the module to show pg recovery progress",
- "type": "bool"
- },
- "max_completed_events": {
- "type": "int",
- "name": "max_completed_events",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "number of past completed events to remember",
- "level": "advanced",
- "long_desc": "",
- "default_value": "50",
- "tags": []
- },
- "sleep_interval": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "5",
- "tags": [],
- "name": "sleep_interval",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "how long the module is going to sleep",
- "type": "secs"
- },
- "log_level": {
- "type": "str",
- "max": "",
- "name": "log_level",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "log_to_cluster_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": [],
- "type": "str",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": ""
- }
- },
- "can_run": true,
- "name": "progress"
- },
- {
- "module_options": {
- "rbd_stats_pools_refresh_interval": {
- "tags": [],
- "level": "advanced",
- "default_value": "300",
- "long_desc": "",
- "max": "",
- "name": "rbd_stats_pools_refresh_interval",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "int"
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": []
- },
- "exclude_perf_counters": {
- "long_desc": "Gathering perf-counters from a single Prometheus exporter can degrade ceph-mgr performance, especially in large clusters. Instead, Ceph-exporter daemons are now used by default for perf-counter gathering. This should only be disabled when no ceph-exporters are deployed.",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "name": "exclude_perf_counters",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "Do not include perf-counters in the metrics output",
- "type": "bool"
- },
- "rbd_stats_pools": {
- "max": "",
- "name": "rbd_stats_pools",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "type": "str",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "log_to_cluster": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "max": "",
- "name": "log_to_cluster"
- },
- "server_addr": {
- "tags": [],
- "long_desc": "",
- "default_value": "::",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "server_addr",
- "desc": "the IPv4 or IPv6 address on which the module listens for HTTP requests",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": []
- },
- "log_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_level",
- "max": "",
- "type": "str"
- },
- "standby_behaviour": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "default",
- "max": "",
- "name": "standby_behaviour",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "default",
- "error"
- ],
- "type": "str"
- },
- "server_port": {
- "long_desc": "",
- "default_value": "9283",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "the port on which the module listens for HTTP requests",
- "name": "server_port",
- "max": "",
- "type": "int"
- },
- "cache": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "cache",
- "max": "",
- "type": "bool"
- },
- "stale_cache_strategy": {
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "stale_cache_strategy",
- "max": "",
- "type": "str",
- "long_desc": "",
- "default_value": "log",
- "level": "advanced",
- "tags": []
- },
- "scrape_interval": {
- "max": "",
- "name": "scrape_interval",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "type": "float",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "15.0"
- },
- "log_to_file": {
- "desc": "",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "log_to_file",
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": ""
- },
- "standby_error_status_code": {
- "type": "int",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "400",
- "see_also": [],
- "max": "599",
- "name": "standby_error_status_code",
- "tags": [],
- "long_desc": "",
- "default_value": "500",
- "level": "advanced"
- }
- },
- "error_string": "",
- "name": "prometheus",
- "can_run": true
- },
- {
- "error_string": "",
- "module_options": {
- "max_concurrent_snap_create": {
- "tags": [],
- "level": "advanced",
- "default_value": "10",
- "long_desc": "",
- "type": "int",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "max_concurrent_snap_create"
- },
- "log_to_file": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "type": "bool",
- "name": "log_to_file",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "desc": ""
- },
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "bool",
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": []
- },
- "mirror_snapshot_schedule": {
- "type": "str",
- "name": "mirror_snapshot_schedule",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "log_to_cluster_level": {
- "type": "str",
- "name": "log_to_cluster_level",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- },
- "trash_purge_schedule": {
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "trash_purge_schedule",
- "max": "",
- "type": "str",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "log_level": {
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "",
- "type": "str",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- }
- },
- "name": "rbd_support",
- "can_run": true
- },
- {
- "module_options": {
- "server_port": {
- "type": "str",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "server_port",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "server_addr": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "name": "server_addr",
- "max": "",
- "type": "str"
- },
- "log_to_file": {
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "log_to_file",
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "key_file": {
- "name": "key_file",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "type": "str",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "type": "bool"
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "default_value": "info",
- "long_desc": "",
- "type": "str",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level"
- },
- "log_level": {
- "max": "",
- "name": "log_level",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": ""
- },
- "enable_auth": {
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "max": "",
- "name": "enable_auth",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "type": "bool"
- }
- },
- "error_string": "",
- "name": "restful",
- "can_run": true
- },
- {
- "name": "selftest",
- "can_run": true,
- "module_options": {
- "rwoption5": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "rwoption5",
- "type": "bool"
- },
- "testkey": {
- "type": "str",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "testkey",
- "max": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "testnewline": {
- "type": "str",
- "max": "",
- "name": "testnewline",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "roption2": {
- "type": "str",
- "name": "roption2",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "long_desc": "",
- "default_value": "xyz",
- "level": "advanced",
- "tags": []
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "max": "",
- "name": "log_level",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str"
- },
- "rwoption4": {
- "name": "rwoption4",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "testlkey": {
- "default_value": "",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "name": "testlkey",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "type": "str"
- },
- "log_to_file": {
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "roption1": {
- "max": "",
- "name": "roption1",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "type": "str",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "rwoption2": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "name": "rwoption2",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "type": "int"
- },
- "rwoption1": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "max": "",
- "name": "rwoption1",
- "type": "str"
- },
- "rwoption3": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "type": "float",
- "name": "rwoption3",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": ""
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str"
- },
- "rwoption6": {
- "tags": [],
- "level": "advanced",
- "default_value": "True",
- "long_desc": "",
- "type": "bool",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "rwoption6"
- },
- "rwoption7": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "type": "int",
- "name": "rwoption7",
- "max": "42",
- "see_also": [],
- "flags": 0,
- "min": "1",
- "enum_allowed": [],
- "desc": ""
- },
- "log_to_cluster": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool"
- }
- },
- "error_string": ""
- },
- {
- "can_run": true,
- "name": "snap_schedule",
- "module_options": {
- "allow_m_granularity": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "name": "allow_m_granularity",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "allow minute scheduled snapshots",
- "type": "bool"
- },
- "log_to_cluster": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": ""
- },
- "log_to_file": {
- "type": "bool",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "log_level": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "type": "str"
- },
- "dump_on_update": {
- "type": "bool",
- "name": "dump_on_update",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "dump database to debug log on update",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster_level": {
- "level": "advanced",
- "default_value": "info",
- "long_desc": "",
- "tags": [],
- "name": "log_to_cluster_level",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "type": "str"
- }
- },
- "error_string": ""
- },
- {
- "can_run": true,
- "name": "stats",
- "error_string": "",
- "module_options": {
- "log_level": {
- "type": "str",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_level",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "log_to_cluster_level": {
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced"
- },
- "log_to_cluster": {
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool"
- },
- "log_to_file": {
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- }
- }
- },
- {
- "can_run": true,
- "name": "status",
- "module_options": {
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "type": "str",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level"
- },
- "log_level": {
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": ""
- },
- "log_to_file": {
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": [],
- "type": "bool",
- "name": "log_to_file",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "desc": ""
- },
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- }
- },
- "error_string": ""
- },
- {
- "can_run": true,
- "name": "telegraf",
- "error_string": "",
- "module_options": {
- "address": {
- "tags": [],
- "long_desc": "",
- "default_value": "unixgram:///tmp/telegraf.sock",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "max": "",
- "name": "address",
- "type": "str"
- },
- "interval": {
- "long_desc": "",
- "default_value": "15",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "interval",
- "max": "",
- "type": "secs"
- },
- "log_to_file": {
- "type": "bool",
- "name": "log_to_file",
- "max": "",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "log_to_cluster_level": {
- "name": "log_to_cluster_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "",
- "type": "str",
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "tags": []
- },
- "log_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "name": "log_level",
- "max": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "type": "str"
- }
- }
- },
- {
- "can_run": true,
- "name": "telemetry",
- "module_options": {
- "leaderboard_description": {
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "leaderboard_description",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1
- },
- "channel_device": {
- "desc": "Share device health metrics (e.g., SMART data, minus potentially identifying info like serial numbers)",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "channel_device",
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced"
- },
- "last_opt_revision": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "1",
- "tags": [],
- "type": "int",
- "name": "last_opt_revision",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": ""
- },
- "organization": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "organization",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "type": "str"
- },
- "channel_basic": {
- "type": "bool",
- "desc": "Share basic cluster information (size, version)",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "channel_basic",
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced"
- },
- "channel_perf": {
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "Share various performance metrics of a cluster",
- "name": "channel_perf",
- "max": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "log_to_cluster": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "type": "bool"
- },
- "log_level": {
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "",
- "type": "str",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "channel_ident": {
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "Share a user-provided description and/or contact email for the cluster",
- "name": "channel_ident",
- "max": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "leaderboard": {
- "max": "",
- "name": "leaderboard",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "proxy": {
- "type": "str",
- "desc": "",
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "proxy",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "device_url": {
- "name": "device_url",
- "max": "",
- "see_also": [],
- "flags": 0,
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "https://telemetry.ceph.com/device",
- "tags": []
- },
- "channel_crash": {
- "type": "bool",
- "max": "",
- "name": "channel_crash",
- "desc": "Share metadata about Ceph daemon crashes (version, stack straces, etc)",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced"
- },
- "description": {
- "max": "",
- "name": "description",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "enabled": {
- "max": "",
- "name": "enabled",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": ""
- },
- "url": {
- "name": "url",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "type": "str",
- "long_desc": "",
- "default_value": "https://telemetry.ceph.com/report",
- "level": "advanced",
- "tags": []
- },
- "log_to_file": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "max": "",
- "name": "log_to_file"
- },
- "interval": {
- "tags": [],
- "long_desc": "",
- "default_value": "24",
- "level": "advanced",
- "type": "int",
- "max": "",
- "name": "interval",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "8",
- "flags": 0
- },
- "contact": {
- "max": "",
- "name": "contact",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- }
- },
- "error_string": ""
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "default_value": "info",
- "long_desc": "",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str"
- },
- "log_level": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "",
- "type": "str"
- },
- "log_to_file": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": ""
- },
- "log_to_cluster": {
- "type": "bool",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- }
- },
- "can_run": true,
- "name": "test_orchestrator"
- },
- {
- "module_options": {
- "snapshot_clone_delay": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "0",
- "tags": [],
- "type": "int",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "Delay clone begin operation by snapshot_clone_delay seconds",
- "name": "snapshot_clone_delay",
- "max": ""
- },
- "log_to_cluster_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": [],
- "type": "str",
- "name": "log_to_cluster_level",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": ""
- },
- "log_level": {
- "type": "str",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_level",
- "max": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_file": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "type": "bool"
- },
- "max_concurrent_clones": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "4",
- "tags": [],
- "type": "int",
- "name": "max_concurrent_clones",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "Number of asynchronous cloner threads"
- },
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "volumes"
- },
- {
- "module_options": {
- "log_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "log_level"
- },
- "discovery_interval": {
- "type": "uint",
- "name": "discovery_interval",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "desc": "",
- "default_value": "100",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster_level": {
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "str",
- "tags": [],
- "default_value": "info",
- "long_desc": "",
- "level": "advanced"
- },
- "zabbix_port": {
- "tags": [],
- "long_desc": "",
- "default_value": "10051",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "max": "",
- "name": "zabbix_port",
- "type": "int"
- },
- "identifier": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "identifier",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "type": "str"
- },
- "zabbix_host": {
- "type": "str",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "zabbix_host",
- "max": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool"
- },
- "zabbix_sender": {
- "type": "str",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "zabbix_sender",
- "tags": [],
- "long_desc": "",
- "default_value": "/usr/bin/zabbix_sender",
- "level": "advanced"
- },
- "log_to_file": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "log_to_file",
- "type": "bool"
- },
- "interval": {
- "type": "secs",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "max": "",
- "name": "interval",
- "tags": [],
- "default_value": "60",
- "long_desc": "",
- "level": "advanced"
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "zabbix"
- }
- ]
- }
- ],
- "epoch": 1508,
- "services": {
- "prometheus": "http://192.168.105.101:9283/",
- "dashboard": "http://192.168.105.101:9080/"
- },
- "active_name": "proxmox-node02",
- "modules": [
- "alerts",
- "dashboard",
- "iostat",
- "nfs",
- "prometheus",
- "restful"
- ],
- "active_addrs": {
- "addrvec": [
- {
- "nonce": 2343,
- "type": "v2",
- "addr": "192.168.105.101:6858"
- },
- {
- "addr": "192.168.105.101:6859",
- "type": "v1",
- "nonce": 2343
- }
- ]
- },
- "active_change": "2025-02-11T18:04:25.050119+0100",
- "active_clients": [
- {
- "name": "devicehealth",
- "addrvec": [
- {
- "addr": "192.168.105.101:0",
- "nonce": 1649438157,
- "type": "v2"
- }
- ]
- },
- {
- "addrvec": [
- {
- "type": "v2",
- "nonce": 1624070457,
- "addr": "192.168.105.101:0"
- }
- ],
- "name": "libcephsqlite"
- },
- {
- "name": "rbd_support",
- "addrvec": [
- {
- "nonce": 3467365716,
- "type": "v2",
- "addr": "192.168.105.101:0"
- }
- ]
- },
- {
- "addrvec": [
- {
- "nonce": 3357636400,
- "type": "v2",
- "addr": "192.168.105.101:0"
- }
- ],
- "name": "volumes"
- }
- ],
- "active_mgr_features": 4540138322906710015,
- "always_on_modules": {
- "quincy": [
- "balancer",
- "crash",
- "devicehealth",
- "orchestrator",
- "pg_autoscaler",
- "progress",
- "rbd_support",
- "status",
- "telemetry",
- "volumes"
- ],
- "pacific": [
- "balancer",
- "crash",
- "devicehealth",
- "orchestrator",
- "pg_autoscaler",
- "progress",
- "rbd_support",
- "status",
- "telemetry",
- "volumes"
- ],
- "octopus": [
- "balancer",
- "crash",
- "devicehealth",
- "orchestrator",
- "pg_autoscaler",
- "progress",
- "rbd_support",
- "status",
- "telemetry",
- "volumes"
- ],
- "reef": [
- "balancer",
- "crash",
- "devicehealth",
- "orchestrator",
- "pg_autoscaler",
- "progress",
- "rbd_support",
- "status",
- "telemetry",
- "volumes"
- ]
- },
- "available": true,
- "active_gid": 179832486,
- "available_modules": [
- {
- "can_run": true,
- "name": "alerts",
- "module_options": {
- "log_level": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "type": "str",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level"
- },
- "smtp_sender": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "smtp_sender",
- "desc": "SMTP envelope sender",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "str"
- },
- "smtp_destination": {
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [],
- "desc": "Email address to send alerts to",
- "name": "smtp_destination",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "smtp_user": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "name": "smtp_user",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "User to authenticate as",
- "type": "str"
- },
- "smtp_from_name": {
- "type": "str",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": "Email From: name",
- "name": "smtp_from_name",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "Ceph",
- "tags": []
- },
- "interval": {
- "type": "secs",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "How frequently to reexamine health status",
- "name": "interval",
- "max": "",
- "long_desc": "",
- "default_value": "60",
- "level": "advanced",
- "tags": []
- },
- "log_to_file": {
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "type": "str",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level"
- },
- "smtp_ssl": {
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "desc": "Use SSL to connect to SMTP server",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "smtp_ssl",
- "type": "bool"
- },
- "smtp_port": {
- "type": "int",
- "desc": "SMTP port",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "smtp_port",
- "tags": [],
- "level": "advanced",
- "default_value": "465",
- "long_desc": ""
- },
- "smtp_host": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "SMTP server",
- "name": "smtp_host",
- "max": "",
- "type": "str"
- },
- "log_to_cluster": {
- "type": "bool",
- "name": "log_to_cluster",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "smtp_password": {
- "type": "str",
- "name": "smtp_password",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "Password to authenticate with",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- }
- },
- "error_string": ""
- },
- {
- "can_run": true,
- "name": "balancer",
- "module_options": {
- "begin_weekday": {
- "type": "uint",
- "name": "begin_weekday",
- "max": "6",
- "enum_allowed": [],
- "min": "0",
- "see_also": [],
- "flags": 1,
- "desc": "Restrict automatic balancing to this day of the week or later",
- "long_desc": "0 = Sunday, 1 = Monday, etc.",
- "default_value": "0",
- "level": "advanced",
- "tags": []
- },
- "begin_time": {
- "long_desc": "This is a time of day in the format HHMM.",
- "default_value": "0000",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "beginning time of day to automatically balance",
- "name": "begin_time",
- "max": ""
- },
- "pool_ids": {
- "max": "",
- "name": "pool_ids",
- "desc": "pools which the automatic balancing will be limited to",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "upmap_max_optimizations": {
- "type": "uint",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": "maximum upmap optimizations to make per attempt",
- "name": "upmap_max_optimizations",
- "max": "",
- "level": "advanced",
- "default_value": "10",
- "long_desc": "",
- "tags": []
- },
- "log_to_file": {
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "max": "",
- "name": "log_to_file",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "log_level": {
- "name": "log_level",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "end_weekday": {
- "type": "uint",
- "name": "end_weekday",
- "max": "6",
- "see_also": [],
- "min": "0",
- "flags": 1,
- "enum_allowed": [],
- "desc": "Restrict automatic balancing to days of the week earlier than this",
- "level": "advanced",
- "long_desc": "0 = Sunday, 1 = Monday, etc.",
- "default_value": "0",
- "tags": []
- },
- "end_time": {
- "default_value": "2359",
- "long_desc": "This is a time of day in the format HHMM.",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "ending time of day to automatically balance",
- "name": "end_time",
- "max": ""
- },
- "sleep_interval": {
- "type": "secs",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "how frequently to wake up and attempt optimization",
- "name": "sleep_interval",
- "max": "",
- "long_desc": "",
- "default_value": "60",
- "level": "advanced",
- "tags": []
- },
- "min_score": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "0",
- "tags": [],
- "type": "float",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "minimum score, below which no optimization is attempted",
- "name": "min_score",
- "max": ""
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": ""
- },
- "crush_compat_step": {
- "tags": [],
- "long_desc": ".99 is very aggressive, .01 is less aggressive",
- "default_value": "0.5",
- "level": "advanced",
- "type": "float",
- "max": "0.999",
- "name": "crush_compat_step",
- "desc": "aggressiveness of optimization",
- "enum_allowed": [],
- "min": "0.001",
- "flags": 1,
- "see_also": []
- },
- "crush_compat_max_iterations": {
- "enum_allowed": [],
- "min": "1",
- "flags": 1,
- "see_also": [],
- "desc": "maximum number of iterations to attempt optimization",
- "name": "crush_compat_max_iterations",
- "max": "250",
- "type": "uint",
- "long_desc": "",
- "default_value": "25",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster_level": {
- "level": "advanced",
- "default_value": "info",
- "long_desc": "",
- "tags": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "type": "str"
- },
- "crush_compat_metrics": {
- "tags": [],
- "level": "advanced",
- "long_desc": "Value is a list of one or more of \"pgs\", \"objects\", or \"bytes\", and indicates which metrics to use to balance utilization.",
- "default_value": "pgs,objects,bytes",
- "type": "str",
- "max": "",
- "name": "crush_compat_metrics",
- "desc": "metrics with which to calculate OSD utilization",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": []
- },
- "active": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "tags": [],
- "type": "bool",
- "name": "active",
- "max": "",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "automatically balance PGs across cluster"
- },
- "upmap_max_deviation": {
- "enum_allowed": [],
- "min": "1",
- "flags": 1,
- "see_also": [],
- "desc": "deviation below which no optimization is attempted",
- "name": "upmap_max_deviation",
- "max": "",
- "type": "int",
- "long_desc": "If the number of PGs are within this count then no optimization is attempted",
- "default_value": "5",
- "level": "advanced",
- "tags": []
- },
- "mode": {
- "tags": [],
- "long_desc": "",
- "default_value": "upmap",
- "level": "advanced",
- "type": "str",
- "desc": "Balancer mode",
- "enum_allowed": [
- "crush-compat",
- "none",
- "upmap"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "mode"
- }
- },
- "error_string": ""
- },
- {
- "error_string": "",
- "module_options": {
- "warn_recent_interval": {
- "tags": [],
- "long_desc": "",
- "default_value": "1209600",
- "level": "advanced",
- "type": "secs",
- "desc": "time interval in which to warn about recent crashes",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "max": "",
- "name": "warn_recent_interval"
- },
- "log_level": {
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": [],
- "type": "str",
- "name": "log_level",
- "max": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": ""
- },
- "log_to_cluster_level": {
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "type": "str",
- "level": "advanced",
- "default_value": "info",
- "long_desc": "",
- "tags": []
- },
- "log_to_cluster": {
- "type": "bool",
- "name": "log_to_cluster",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "log_to_file": {
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "log_to_file",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "retain_interval": {
- "tags": [],
- "long_desc": "",
- "default_value": "31536000",
- "level": "advanced",
- "desc": "how long to retain crashes before pruning them",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "retain_interval",
- "type": "secs"
- }
- },
- "can_run": true,
- "name": "crash"
- },
- {
- "name": "dashboard",
- "can_run": true,
- "module_options": {
- "PWD_POLICY_EXCLUSION_LIST": {
- "type": "str",
- "max": "",
- "name": "PWD_POLICY_EXCLUSION_LIST",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "osd,host,dashboard,pool,block,nfs,ceph,monitors,gateway,logs,crush,maps"
- },
- "FEATURE_TOGGLE_CEPHFS": {
- "tags": [],
- "level": "advanced",
- "default_value": "True",
- "long_desc": "",
- "max": "",
- "name": "FEATURE_TOGGLE_CEPHFS",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "type": "bool"
- },
- "PWD_POLICY_CHECK_REPETITIVE_CHARS_ENABLED": {
- "max": "",
- "name": "PWD_POLICY_CHECK_REPETITIVE_CHARS_ENABLED",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "PWD_POLICY_CHECK_EXCLUSION_LIST_ENABLED": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "type": "bool",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "PWD_POLICY_CHECK_EXCLUSION_LIST_ENABLED",
- "max": ""
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "max": "",
- "name": "log_level",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str"
- },
- "standby_error_status_code": {
- "long_desc": "",
- "default_value": "500",
- "level": "advanced",
- "tags": [],
- "name": "standby_error_status_code",
- "max": "599",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "400",
- "desc": "",
- "type": "int"
- },
- "PWD_POLICY_ENABLED": {
- "type": "bool",
- "max": "",
- "name": "PWD_POLICY_ENABLED",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced"
- },
- "PWD_POLICY_MIN_LENGTH": {
- "max": "",
- "name": "PWD_POLICY_MIN_LENGTH",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "type": "int",
- "tags": [],
- "long_desc": "",
- "default_value": "8",
- "level": "advanced"
- },
- "crt_file": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "desc": "",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "crt_file",
- "type": "str"
- },
- "ISSUE_TRACKER_API_KEY": {
- "type": "str",
- "max": "",
- "name": "ISSUE_TRACKER_API_KEY",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "REST_REQUESTS_TIMEOUT": {
- "type": "int",
- "max": "",
- "name": "REST_REQUESTS_TIMEOUT",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "45",
- "level": "advanced"
- },
- "GRAFANA_UPDATE_DASHBOARDS": {
- "type": "bool",
- "max": "",
- "name": "GRAFANA_UPDATE_DASHBOARDS",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "RGW_API_ACCESS_KEY": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "RGW_API_ACCESS_KEY",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": ""
- },
- "ssl_server_port": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "8443",
- "type": "int",
- "max": "",
- "name": "ssl_server_port",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": []
- },
- "PWD_POLICY_CHECK_USERNAME_ENABLED": {
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "PWD_POLICY_CHECK_USERNAME_ENABLED",
- "max": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "PWD_POLICY_CHECK_COMPLEXITY_ENABLED": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "name": "PWD_POLICY_CHECK_COMPLEXITY_ENABLED",
- "max": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "bool"
- },
- "PROMETHEUS_API_SSL_VERIFY": {
- "level": "advanced",
- "default_value": "True",
- "long_desc": "",
- "tags": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "name": "PROMETHEUS_API_SSL_VERIFY",
- "max": "",
- "type": "bool"
- },
- "FEATURE_TOGGLE_RBD": {
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "name": "FEATURE_TOGGLE_RBD",
- "max": "",
- "type": "bool",
- "default_value": "True",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "type": "bool",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": ""
- },
- "FEATURE_TOGGLE_NFS": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "tags": [],
- "type": "bool",
- "name": "FEATURE_TOGGLE_NFS",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": ""
- },
- "key_file": {
- "type": "str",
- "max": "",
- "name": "key_file",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "ssl": {
- "max": "",
- "name": "ssl",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True"
- },
- "PWD_POLICY_CHECK_SEQUENTIAL_CHARS_ENABLED": {
- "type": "bool",
- "max": "",
- "name": "PWD_POLICY_CHECK_SEQUENTIAL_CHARS_ENABLED",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "standby_behaviour": {
- "level": "advanced",
- "default_value": "redirect",
- "long_desc": "",
- "tags": [],
- "type": "str",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [
- "error",
- "redirect"
- ],
- "desc": "",
- "name": "standby_behaviour",
- "max": ""
- },
- "cross_origin_url": {
- "name": "cross_origin_url",
- "max": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "AUDIT_API_ENABLED": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "type": "bool",
- "max": "",
- "name": "AUDIT_API_ENABLED",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": []
- },
- "FEATURE_TOGGLE_MIRRORING": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "FEATURE_TOGGLE_MIRRORING",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": ""
- },
- "GRAFANA_FRONTEND_API_URL": {
- "type": "str",
- "name": "GRAFANA_FRONTEND_API_URL",
- "max": "",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "ACCOUNT_LOCKOUT_ATTEMPTS": {
- "type": "int",
- "max": "",
- "name": "ACCOUNT_LOCKOUT_ATTEMPTS",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "tags": [],
- "default_value": "10",
- "long_desc": "",
- "level": "advanced"
- },
- "log_to_file": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "type": "bool"
- },
- "GRAFANA_API_PASSWORD": {
- "type": "str",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "GRAFANA_API_PASSWORD",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "admin"
- },
- "GANESHA_CLUSTERS_RADOS_POOL_NAMESPACE": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "GANESHA_CLUSTERS_RADOS_POOL_NAMESPACE",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": []
- },
- "AUDIT_API_LOG_PAYLOAD": {
- "default_value": "True",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "AUDIT_API_LOG_PAYLOAD",
- "max": ""
- },
- "log_to_cluster_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": [],
- "type": "str",
- "name": "log_to_cluster_level",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": ""
- },
- "GRAFANA_API_URL": {
- "type": "str",
- "name": "GRAFANA_API_URL",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "PWD_POLICY_CHECK_OLDPWD_ENABLED": {
- "type": "bool",
- "desc": "",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "PWD_POLICY_CHECK_OLDPWD_ENABLED",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True"
- },
- "ALERTMANAGER_API_SSL_VERIFY": {
- "type": "bool",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "ALERTMANAGER_API_SSL_VERIFY",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "tags": []
- },
- "debug": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "type": "bool",
- "desc": "Enable/disable debug options",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "max": "",
- "name": "debug"
- },
- "FEATURE_TOGGLE_DASHBOARD": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "name": "FEATURE_TOGGLE_DASHBOARD",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "type": "bool"
- },
- "ISCSI_API_SSL_VERIFICATION": {
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "ISCSI_API_SSL_VERIFICATION",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": []
- },
- "UNSAFE_TLS_v1_2": {
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "UNSAFE_TLS_v1_2",
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "ENABLE_BROWSABLE_API": {
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "max": "",
- "name": "ENABLE_BROWSABLE_API"
- },
- "PROMETHEUS_API_HOST": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "max": "",
- "name": "PROMETHEUS_API_HOST",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "type": "str"
- },
- "GRAFANA_API_SSL_VERIFY": {
- "type": "bool",
- "name": "GRAFANA_API_SSL_VERIFY",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "default_value": "True",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "GRAFANA_API_USERNAME": {
- "type": "str",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "GRAFANA_API_USERNAME",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "admin"
- },
- "ALERTMANAGER_API_HOST": {
- "name": "ALERTMANAGER_API_HOST",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "RGW_API_SECRET_KEY": {
- "type": "str",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "RGW_API_SECRET_KEY",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "USER_PWD_EXPIRATION_SPAN": {
- "long_desc": "",
- "default_value": "0",
- "level": "advanced",
- "tags": [],
- "type": "int",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "USER_PWD_EXPIRATION_SPAN",
- "max": ""
- },
- "FEATURE_TOGGLE_ISCSI": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "name": "FEATURE_TOGGLE_ISCSI",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "type": "bool"
- },
- "USER_PWD_EXPIRATION_WARNING_1": {
- "name": "USER_PWD_EXPIRATION_WARNING_1",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "desc": "",
- "type": "int",
- "long_desc": "",
- "default_value": "10",
- "level": "advanced",
- "tags": []
- },
- "RGW_API_ADMIN_RESOURCE": {
- "long_desc": "",
- "default_value": "admin",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "name": "RGW_API_ADMIN_RESOURCE",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": ""
- },
- "RGW_API_SSL_VERIFY": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "name": "RGW_API_SSL_VERIFY",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "",
- "type": "bool"
- },
- "PWD_POLICY_CHECK_LENGTH_ENABLED": {
- "max": "",
- "name": "PWD_POLICY_CHECK_LENGTH_ENABLED",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True"
- },
- "PWD_POLICY_MIN_COMPLEXITY": {
- "tags": [],
- "long_desc": "",
- "default_value": "10",
- "level": "advanced",
- "type": "int",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "PWD_POLICY_MIN_COMPLEXITY"
- },
- "redirect_resolve_ip_addr": {
- "type": "bool",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "redirect_resolve_ip_addr",
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": ""
- },
- "server_port": {
- "level": "advanced",
- "default_value": "8080",
- "long_desc": "",
- "tags": [],
- "type": "int",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "",
- "name": "server_port",
- "max": ""
- },
- "jwt_token_ttl": {
- "tags": [],
- "default_value": "28800",
- "long_desc": "",
- "level": "advanced",
- "type": "int",
- "max": "",
- "name": "jwt_token_ttl",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0
- },
- "motd": {
- "name": "motd",
- "max": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "desc": "The message of the day",
- "type": "str",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "FEATURE_TOGGLE_RGW": {
- "tags": [],
- "level": "advanced",
- "default_value": "True",
- "long_desc": "",
- "type": "bool",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "FEATURE_TOGGLE_RGW"
- },
- "server_addr": {
- "type": "str",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "server_addr",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "::",
- "tags": []
- },
- "USER_PWD_EXPIRATION_WARNING_2": {
- "long_desc": "",
- "default_value": "5",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "desc": "",
- "name": "USER_PWD_EXPIRATION_WARNING_2",
- "max": "",
- "type": "int"
- },
- "url_prefix": {
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "url_prefix",
- "max": "",
- "type": "str",
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": []
- }
- },
- "error_string": ""
- },
- {
- "name": "devicehealth",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "pool_name": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "device_health_metrics",
- "tags": [],
- "type": "str",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "name of pool in which to store device health metrics",
- "name": "pool_name",
- "max": ""
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": []
- },
- "self_heal": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "tags": [],
- "type": "bool",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "preemptively heal cluster around devices that may fail",
- "name": "self_heal",
- "max": ""
- },
- "log_level": {
- "type": "str",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "retention_period": {
- "type": "secs",
- "max": "",
- "name": "retention_period",
- "desc": "how long to retain device health metrics",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "15552000",
- "level": "advanced"
- },
- "enable_monitoring": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "monitor device health metrics",
- "name": "enable_monitoring",
- "max": ""
- },
- "scrape_frequency": {
- "type": "secs",
- "max": "",
- "name": "scrape_frequency",
- "desc": "how frequently to scrape device health metrics",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "86400"
- },
- "warn_threshold": {
- "tags": [],
- "long_desc": "",
- "default_value": "7257600",
- "level": "advanced",
- "max": "",
- "name": "warn_threshold",
- "desc": "raise health warning if OSD may fail before this long",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "type": "secs"
- },
- "sleep_interval": {
- "max": "",
- "name": "sleep_interval",
- "desc": "how frequently to wake up and check device health",
- "see_also": [],
- "flags": 1,
- "min": "",
- "enum_allowed": [],
- "type": "secs",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "600"
- },
- "log_to_file": {
- "type": "bool",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "mark_out_threshold": {
- "name": "mark_out_threshold",
- "max": "",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "desc": "automatically mark OSD if it may fail before this long",
- "type": "secs",
- "level": "advanced",
- "long_desc": "",
- "default_value": "2419200",
- "tags": []
- },
- "log_to_cluster": {
- "type": "bool",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- }
- }
- },
- {
- "error_string": "influxdb python module not found",
- "module_options": {
- "log_to_file": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "log_to_file",
- "type": "bool"
- },
- "interval": {
- "default_value": "30",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "type": "secs",
- "enum_allowed": [],
- "min": "5",
- "flags": 0,
- "see_also": [],
- "desc": "Time between reports to InfluxDB. Default 30 seconds.",
- "name": "interval",
- "max": ""
- },
- "database": {
- "max": "",
- "name": "database",
- "desc": "InfluxDB database name. You will need to create this database and grant write privileges to the configured username or the username must have admin privileges to create it.",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "default_value": "ceph",
- "long_desc": ""
- },
- "threads": {
- "desc": "How many worker threads should be spawned for sending data to InfluxDB.",
- "enum_allowed": [],
- "min": "1",
- "see_also": [],
- "flags": 0,
- "max": "32",
- "name": "threads",
- "type": "int",
- "tags": [],
- "long_desc": "",
- "default_value": "5",
- "level": "advanced"
- },
- "log_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "log_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": "",
- "type": "str"
- },
- "log_to_cluster": {
- "type": "bool",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "batch_size": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "5000",
- "type": "int",
- "desc": "How big batches of data points should be when sending to InfluxDB.",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "batch_size"
- },
- "ssl": {
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "Use https connection for InfluxDB server. Use \"true\" or \"false\".",
- "name": "ssl",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "false",
- "tags": []
- },
- "hostname": {
- "type": "str",
- "name": "hostname",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "InfluxDB server hostname",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "port": {
- "type": "int",
- "max": "",
- "name": "port",
- "desc": "InfluxDB server port",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "tags": [],
- "long_desc": "",
- "default_value": "8086",
- "level": "advanced"
- },
- "verify_ssl": {
- "desc": "Verify https cert for InfluxDB server. Use \"true\" or \"false\".",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "verify_ssl",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "true"
- },
- "username": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "desc": "username of InfluxDB server user",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "max": "",
- "name": "username",
- "type": "str"
- },
- "password": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "type": "str",
- "max": "",
- "name": "password",
- "desc": "password of InfluxDB server user",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": []
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str"
- }
- },
- "can_run": false,
- "name": "influx"
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_cluster": {
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "log_to_file": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": ""
- },
- "log_level": {
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "",
- "type": "str",
- "default_value": "",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster_level": {
- "type": "str",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- }
- },
- "can_run": true,
- "name": "insights"
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_file": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1
- },
- "log_to_cluster": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "max": "",
- "name": "log_to_cluster",
- "type": "bool"
- },
- "log_to_cluster_level": {
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info"
- },
- "log_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "log_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "str"
- }
- },
- "name": "iostat",
- "can_run": true
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_cluster_level": {
- "type": "str",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "default_value": "info",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "subtree": {
- "max": "",
- "name": "subtree",
- "desc": "CRUSH level for which to create a local pool",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "str",
- "tags": [],
- "long_desc": "which CRUSH subtree type the module should create a pool for.",
- "default_value": "rack",
- "level": "advanced"
- },
- "prefix": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "name prefix for any created local pool",
- "name": "prefix",
- "max": "",
- "type": "str"
- },
- "log_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "max": "",
- "name": "log_level",
- "type": "str"
- },
- "log_to_file": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool"
- },
- "num_rep": {
- "tags": [],
- "long_desc": "",
- "default_value": "3",
- "level": "advanced",
- "desc": "default replica count for any created local pool",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "num_rep",
- "type": "int"
- },
- "failure_domain": {
- "tags": [],
- "level": "advanced",
- "default_value": "host",
- "long_desc": "what failure domain we should separate data replicas across.",
- "type": "str",
- "max": "",
- "name": "failure_domain",
- "desc": "failure domain for any created local pool",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": []
- },
- "log_to_cluster": {
- "type": "bool",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "pg_num": {
- "tags": [],
- "default_value": "128",
- "long_desc": "",
- "level": "advanced",
- "desc": "default pg_num for any created local pool",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "max": "",
- "name": "pg_num",
- "type": "int"
- },
- "min_size": {
- "type": "int",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "default min_size for any created local pool",
- "name": "min_size",
- "max": "",
- "level": "advanced",
- "long_desc": "value to set min_size to (unchanged from Ceph's default if this option is not set)",
- "default_value": "",
- "tags": []
- }
- },
- "can_run": true,
- "name": "localpool"
- },
- {
- "name": "mirroring",
- "can_run": true,
- "module_options": {
- "log_to_file": {
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": ""
- },
- "log_to_cluster": {
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "log_to_cluster_level": {
- "name": "log_to_cluster_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "",
- "type": "str",
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "tags": []
- },
- "log_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "max": "",
- "name": "log_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "type": "str"
- }
- },
- "error_string": ""
- },
- {
- "name": "nfs",
- "can_run": true,
- "module_options": {
- "log_to_cluster": {
- "type": "bool",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "log_to_cluster",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "log_to_file": {
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "type": "bool"
- },
- "log_level": {
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "log_level",
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "log_to_cluster_level": {
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced"
- }
- },
- "error_string": ""
- },
- {
- "name": "orchestrator",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "log_to_file": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": ""
- },
- "orchestrator": {
- "type": "str",
- "desc": "Orchestrator backend",
- "enum_allowed": [
- "cephadm",
- "rook",
- "test_orchestrator"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "max": "",
- "name": "orchestrator",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "fail_fs": {
- "desc": "Fail filesystem for rapid multi-rank mds upgrade",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "max": "",
- "name": "fail_fs",
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "log_to_cluster_level": {
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info"
- },
- "log_level": {
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_level",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- }
- }
- },
- {
- "can_run": true,
- "name": "osd_perf_query",
- "error_string": "",
- "module_options": {
- "log_to_file": {
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool"
- },
- "log_to_cluster": {
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "max": "",
- "name": "log_to_cluster",
- "type": "bool",
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced"
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str"
- },
- "log_level": {
- "max": "",
- "name": "log_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "flags": 1,
- "min": "",
- "type": "str",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- }
- }
- },
- {
- "error_string": "",
- "module_options": {
- "log_level": {
- "type": "str",
- "name": "log_level",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "log_to_cluster_level": {
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_cluster",
- "max": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": ""
- },
- "log_to_file": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": "",
- "type": "bool"
- }
- },
- "can_run": true,
- "name": "osd_support"
- },
- {
- "can_run": true,
- "name": "pg_autoscaler",
- "module_options": {
- "log_to_cluster_level": {
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info"
- },
- "log_level": {
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "log_level",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "threshold": {
- "long_desc": "The factor by which the 'NEW PG_NUM' must vary from the current 'PG_NUM' before being accepted. Cannot be less than 1.0",
- "default_value": "3.0",
- "level": "advanced",
- "tags": [],
- "type": "float",
- "enum_allowed": [],
- "flags": 0,
- "min": "1.0",
- "see_also": [],
- "desc": "scaling threshold",
- "name": "threshold",
- "max": ""
- },
- "sleep_interval": {
- "long_desc": "",
- "default_value": "60",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "sleep_interval",
- "max": "",
- "type": "secs"
- },
- "log_to_file": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": ""
- },
- "log_to_cluster": {
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool",
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- }
- },
- "error_string": ""
- },
- {
- "error_string": "",
- "module_options": {
- "log_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": [],
- "type": "str",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_level",
- "max": ""
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": []
- },
- "sleep_interval": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "5",
- "desc": "how long the module is going to sleep",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "sleep_interval",
- "type": "secs"
- },
- "max_completed_events": {
- "long_desc": "",
- "default_value": "50",
- "level": "advanced",
- "tags": [],
- "type": "int",
- "name": "max_completed_events",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "number of past completed events to remember"
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_cluster",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": ""
- },
- "enabled": {
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "enabled",
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True"
- },
- "allow_pg_recovery_event": {
- "max": "",
- "name": "allow_pg_recovery_event",
- "desc": "allow the module to show pg recovery progress",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "log_to_file": {
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "max": "",
- "name": "log_to_file",
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": ""
- }
- },
- "can_run": true,
- "name": "progress"
- },
- {
- "error_string": "",
- "module_options": {
- "server_port": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "9283",
- "type": "int",
- "max": "",
- "name": "server_port",
- "desc": "the port on which the module listens for HTTP requests",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": []
- },
- "stale_cache_strategy": {
- "type": "str",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "stale_cache_strategy",
- "tags": [],
- "long_desc": "",
- "default_value": "log",
- "level": "advanced"
- },
- "cache": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "True",
- "tags": [],
- "name": "cache",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "type": "bool"
- },
- "scrape_interval": {
- "type": "float",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "max": "",
- "name": "scrape_interval",
- "tags": [],
- "long_desc": "",
- "default_value": "15.0",
- "level": "advanced"
- },
- "standby_error_status_code": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "500",
- "tags": [],
- "type": "int",
- "name": "standby_error_status_code",
- "max": "599",
- "see_also": [],
- "flags": 1,
- "min": "400",
- "enum_allowed": [],
- "desc": ""
- },
- "log_to_file": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool"
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level"
- },
- "standby_behaviour": {
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "default",
- "error"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "standby_behaviour",
- "tags": [],
- "long_desc": "",
- "default_value": "default",
- "level": "advanced"
- },
- "log_to_cluster": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "max": "",
- "name": "log_to_cluster",
- "type": "bool"
- },
- "rbd_stats_pools": {
- "max": "",
- "name": "rbd_stats_pools",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "server_addr": {
- "type": "str",
- "max": "",
- "name": "server_addr",
- "desc": "the IPv4 or IPv6 address on which the module listens for HTTP requests",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "tags": [],
- "default_value": "::",
- "long_desc": "",
- "level": "advanced"
- },
- "rbd_stats_pools_refresh_interval": {
- "tags": [],
- "long_desc": "",
- "default_value": "300",
- "level": "advanced",
- "type": "int",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "rbd_stats_pools_refresh_interval"
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "default_value": "info",
- "long_desc": "",
- "desc": "",
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str"
- },
- "exclude_perf_counters": {
- "tags": [],
- "long_desc": "Gathering perf-counters from a single Prometheus exporter can degrade ceph-mgr performance, especially in large clusters. Instead, Ceph-exporter daemons are now used by default for perf-counter gathering. This should only be disabled when no ceph-exporters are deployed.",
- "default_value": "True",
- "level": "advanced",
- "max": "",
- "name": "exclude_perf_counters",
- "desc": "Do not include perf-counters in the metrics output",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "type": "bool"
- }
- },
- "name": "prometheus",
- "can_run": true
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_cluster": {
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False"
- },
- "log_to_file": {
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_file",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": ""
- },
- "max_concurrent_snap_create": {
- "type": "int",
- "max": "",
- "name": "max_concurrent_snap_create",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "tags": [],
- "long_desc": "",
- "default_value": "10",
- "level": "advanced"
- },
- "trash_purge_schedule": {
- "type": "str",
- "max": "",
- "name": "trash_purge_schedule",
- "desc": "",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "type": "str",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level"
- },
- "log_to_cluster_level": {
- "type": "str",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info"
- },
- "mirror_snapshot_schedule": {
- "type": "str",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "name": "mirror_snapshot_schedule",
- "max": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- }
- },
- "can_run": true,
- "name": "rbd_support"
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_cluster_level": {
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "type": "str"
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level"
- },
- "enable_auth": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "name": "enable_auth",
- "max": "",
- "type": "bool"
- },
- "server_port": {
- "name": "server_port",
- "max": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": []
- },
- "log_to_file": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "type": "bool",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_file",
- "max": ""
- },
- "server_addr": {
- "type": "str",
- "enum_allowed": [],
- "see_also": [],
- "flags": 0,
- "min": "",
- "desc": "",
- "name": "server_addr",
- "max": "",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "key_file": {
- "max": "",
- "name": "key_file",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "log_to_cluster": {
- "type": "bool",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- }
- },
- "name": "restful",
- "can_run": true
- },
- {
- "can_run": true,
- "name": "selftest",
- "module_options": {
- "rwoption3": {
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "max": "",
- "name": "rwoption3",
- "type": "float",
- "tags": [],
- "default_value": "",
- "long_desc": "",
- "level": "advanced"
- },
- "rwoption1": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "rwoption1",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": []
- },
- "log_to_cluster_level": {
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info"
- },
- "rwoption6": {
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "name": "rwoption6",
- "max": ""
- },
- "rwoption7": {
- "min": "1",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "rwoption7",
- "max": "42",
- "type": "int",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "log_to_cluster": {
- "name": "log_to_cluster",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "rwoption5": {
- "type": "bool",
- "name": "rwoption5",
- "max": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "testkey": {
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": [],
- "type": "str",
- "name": "testkey",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": ""
- },
- "roption2": {
- "long_desc": "",
- "default_value": "xyz",
- "level": "advanced",
- "tags": [],
- "name": "roption2",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "type": "str"
- },
- "testnewline": {
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "name": "testnewline",
- "max": "",
- "type": "str",
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": []
- },
- "rwoption4": {
- "type": "str",
- "desc": "",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "rwoption4",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- },
- "log_level": {
- "type": "str",
- "name": "log_level",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": []
- },
- "log_to_file": {
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "max": "",
- "name": "log_to_file",
- "type": "bool"
- },
- "testlkey": {
- "max": "",
- "name": "testlkey",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "rwoption2": {
- "name": "rwoption2",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "desc": "",
- "type": "int",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "roption1": {
- "type": "str",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "max": "",
- "name": "roption1",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": ""
- }
- },
- "error_string": ""
- },
- {
- "name": "snap_schedule",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "log_level": {
- "type": "str",
- "name": "log_level",
- "max": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "dump_on_update": {
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "dump database to debug log on update",
- "name": "dump_on_update",
- "max": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster_level": {
- "name": "log_to_cluster_level",
- "max": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "type": "str",
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": []
- },
- "allow_m_granularity": {
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "enum_allowed": [],
- "see_also": [],
- "flags": 1,
- "min": "",
- "desc": "allow minute scheduled snapshots",
- "name": "allow_m_granularity",
- "max": ""
- },
- "log_to_cluster": {
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": [],
- "type": "bool",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": ""
- },
- "log_to_file": {
- "type": "bool",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- }
- }
- },
- {
- "name": "stats",
- "can_run": true,
- "module_options": {
- "log_to_file": {
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool",
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 1,
- "enum_allowed": [],
- "type": "bool"
- },
- "log_to_cluster_level": {
- "tags": [],
- "default_value": "info",
- "long_desc": "",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_level"
- }
- },
- "error_string": ""
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_file": {
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 1,
- "max": "",
- "name": "log_to_file",
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "log_to_cluster": {
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool",
- "level": "advanced",
- "default_value": "False",
- "long_desc": "",
- "tags": []
- },
- "log_to_cluster_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "max": "",
- "name": "log_to_cluster_level",
- "type": "str"
- },
- "log_level": {
- "type": "str",
- "max": "",
- "name": "log_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- }
- },
- "can_run": true,
- "name": "status"
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_cluster": {
- "type": "bool",
- "max": "",
- "name": "log_to_cluster",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "tags": [],
- "default_value": "False",
- "long_desc": "",
- "level": "advanced"
- },
- "log_to_file": {
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "log_to_file",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "address": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "unixgram:///tmp/telegraf.sock",
- "tags": [],
- "type": "str",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "address",
- "max": ""
- },
- "interval": {
- "max": "",
- "name": "interval",
- "desc": "",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "type": "secs",
- "tags": [],
- "long_desc": "",
- "default_value": "15",
- "level": "advanced"
- },
- "log_level": {
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": [],
- "name": "log_level",
- "max": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "min": "",
- "see_also": [],
- "flags": 1,
- "desc": "",
- "type": "str"
- },
- "log_to_cluster_level": {
- "long_desc": "",
- "default_value": "info",
- "level": "advanced",
- "tags": [],
- "type": "str",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": ""
- }
- },
- "name": "telegraf",
- "can_run": true
- },
- {
- "name": "telemetry",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "last_opt_revision": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "1",
- "type": "int",
- "desc": "",
- "flags": 0,
- "see_also": [],
- "min": "",
- "enum_allowed": [],
- "max": "",
- "name": "last_opt_revision"
- },
- "organization": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "type": "str",
- "desc": "",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "organization"
- },
- "channel_basic": {
- "max": "",
- "name": "channel_basic",
- "desc": "Share basic cluster information (size, version)",
- "enum_allowed": [],
- "flags": 0,
- "see_also": [],
- "min": "",
- "type": "bool",
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced"
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "type": "bool",
- "name": "log_to_cluster",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 1,
- "desc": ""
- },
- "channel_perf": {
- "type": "bool",
- "desc": "Share various performance metrics of a cluster",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "channel_perf",
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced"
- },
- "leaderboard_description": {
- "default_value": "",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "",
- "name": "leaderboard_description",
- "max": "",
- "type": "str"
- },
- "log_to_cluster_level": {
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "see_also": [],
- "min": "",
- "flags": 1,
- "tags": [],
- "long_desc": "",
- "default_value": "info",
- "level": "advanced"
- },
- "channel_device": {
- "desc": "Share device health metrics (e.g., SMART data, minus potentially identifying info like serial numbers)",
- "min": "",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "channel_device",
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "True"
- },
- "channel_crash": {
- "tags": [],
- "long_desc": "",
- "default_value": "True",
- "level": "advanced",
- "type": "bool",
- "desc": "Share metadata about Ceph daemon crashes (version, stack straces, etc)",
- "enum_allowed": [],
- "flags": 0,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "channel_crash"
- },
- "description": {
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "name": "description",
- "max": "",
- "type": "str",
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "tags": []
- },
- "enabled": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "type": "bool",
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "enabled"
- },
- "url": {
- "desc": "",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "url",
- "type": "str",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "https://telemetry.ceph.com/report"
- },
- "contact": {
- "type": "str",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "contact",
- "max": "",
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "tags": []
- },
- "interval": {
- "min": "8",
- "flags": 0,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "interval",
- "max": "",
- "type": "int",
- "level": "advanced",
- "long_desc": "",
- "default_value": "24",
- "tags": []
- },
- "log_to_file": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "type": "bool",
- "desc": "",
- "enum_allowed": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "max": "",
- "name": "log_to_file"
- },
- "log_level": {
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_level",
- "max": "",
- "type": "str",
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "tags": []
- },
- "channel_ident": {
- "desc": "Share a user-provided description and/or contact email for the cluster",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": [],
- "max": "",
- "name": "channel_ident",
- "type": "bool",
- "tags": [],
- "level": "advanced",
- "default_value": "False",
- "long_desc": ""
- },
- "leaderboard": {
- "type": "bool",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "desc": "",
- "name": "leaderboard",
- "max": "",
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": []
- },
- "proxy": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "",
- "type": "str",
- "max": "",
- "name": "proxy",
- "desc": "",
- "see_also": [],
- "min": "",
- "flags": 0,
- "enum_allowed": []
- },
- "device_url": {
- "tags": [],
- "default_value": "https://telemetry.ceph.com/device",
- "long_desc": "",
- "level": "advanced",
- "type": "str",
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "max": "",
- "name": "device_url"
- }
- }
- },
- {
- "error_string": "",
- "module_options": {
- "log_to_cluster_level": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "tags": [],
- "flags": 1,
- "see_also": [],
- "min": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "desc": "",
- "name": "log_to_cluster_level",
- "max": "",
- "type": "str"
- },
- "log_level": {
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced",
- "type": "str",
- "desc": "",
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "flags": 1,
- "min": "",
- "see_also": [],
- "max": "",
- "name": "log_level"
- },
- "log_to_file": {
- "default_value": "False",
- "long_desc": "",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "flags": 1,
- "min": "",
- "see_also": [],
- "desc": "",
- "name": "log_to_file",
- "max": "",
- "type": "bool"
- },
- "log_to_cluster": {
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "tags": [],
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool"
- }
- },
- "can_run": true,
- "name": "test_orchestrator"
- },
- {
- "name": "volumes",
- "can_run": true,
- "error_string": "",
- "module_options": {
- "log_to_cluster": {
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [],
- "desc": "",
- "name": "log_to_cluster",
- "max": "",
- "type": "bool",
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": []
- },
- "max_concurrent_clones": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "4",
- "type": "int",
- "desc": "Number of asynchronous cloner threads",
- "flags": 0,
- "min": "",
- "see_also": [],
- "enum_allowed": [],
- "max": "",
- "name": "max_concurrent_clones"
- },
- "log_to_file": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "type": "bool",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": []
- },
- "log_level": {
- "max": "",
- "name": "log_level",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str",
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": ""
- },
- "log_to_cluster_level": {
- "type": "str",
- "desc": "",
- "min": "",
- "flags": 1,
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "max": "",
- "name": "log_to_cluster_level",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info"
- },
- "snapshot_clone_delay": {
- "type": "int",
- "name": "snapshot_clone_delay",
- "max": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "desc": "Delay clone begin operation by snapshot_clone_delay seconds",
- "long_desc": "",
- "default_value": "0",
- "level": "advanced",
- "tags": []
- }
- }
- },
- {
- "module_options": {
- "zabbix_host": {
- "max": "",
- "name": "zabbix_host",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "zabbix_sender": {
- "tags": [],
- "long_desc": "",
- "default_value": "/usr/bin/zabbix_sender",
- "level": "advanced",
- "type": "str",
- "max": "",
- "name": "zabbix_sender",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0
- },
- "log_to_file": {
- "tags": [],
- "long_desc": "",
- "default_value": "False",
- "level": "advanced",
- "max": "",
- "name": "log_to_file",
- "desc": "",
- "enum_allowed": [],
- "min": "",
- "flags": 1,
- "see_also": [],
- "type": "bool"
- },
- "interval": {
- "type": "secs",
- "name": "interval",
- "max": "",
- "enum_allowed": [],
- "min": "",
- "see_also": [],
- "flags": 0,
- "desc": "",
- "long_desc": "",
- "default_value": "60",
- "level": "advanced",
- "tags": []
- },
- "log_to_cluster": {
- "level": "advanced",
- "long_desc": "",
- "default_value": "False",
- "tags": [],
- "type": "bool",
- "name": "log_to_cluster",
- "max": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [],
- "desc": ""
- },
- "discovery_interval": {
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 0,
- "enum_allowed": [],
- "max": "",
- "name": "discovery_interval",
- "type": "uint",
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "100"
- },
- "log_to_cluster_level": {
- "tags": [],
- "level": "advanced",
- "long_desc": "",
- "default_value": "info",
- "type": "str",
- "max": "",
- "name": "log_to_cluster_level",
- "desc": "",
- "flags": 1,
- "min": "",
- "see_also": [],
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ]
- },
- "log_level": {
- "tags": [],
- "level": "advanced",
- "default_value": "",
- "long_desc": "",
- "max": "",
- "name": "log_level",
- "desc": "",
- "min": "",
- "see_also": [],
- "flags": 1,
- "enum_allowed": [
- "",
- "critical",
- "debug",
- "error",
- "info",
- "warning"
- ],
- "type": "str"
- },
- "identifier": {
- "desc": "",
- "enum_allowed": [],
- "see_also": [],
- "min": "",
- "flags": 0,
- "max": "",
- "name": "identifier",
- "type": "str",
- "tags": [],
- "long_desc": "",
- "default_value": "",
- "level": "advanced"
- },
- "zabbix_port": {
- "long_desc": "",
- "default_value": "10051",
- "level": "advanced",
- "tags": [],
- "type": "int",
- "enum_allowed": [],
- "min": "",
- "flags": 0,
- "see_also": [],
- "desc": "",
- "name": "zabbix_port",
- "max": ""
- }
- },
- "error_string": "",
- "can_run": true,
- "name": "zabbix"
- }
- ]
- },
- "health": {
- "checks": {
- "POOL_NEARFULL": {
- "detail": [
- {
- "message": "pool '.mgr' is nearfull"
- },
- {
- "message": "pool 'vm_nvme' is nearfull"
- },
- {
- "message": "pool 'cephfs_data' is nearfull"
- },
- {
- "message": "pool 'cephfs_metadata' is nearfull"
- }
- ],
- "summary": {
- "count": 4,
- "message": "4 pool(s) nearfull"
- },
- "severity": "HEALTH_WARN",
- "muted": false
- },
- "OSD_NEARFULL": {
- "severity": "HEALTH_WARN",
- "detail": [
- {
- "message": "osd.3 is near full"
- },
- {
- "message": "osd.8 is near full"
- },
- {
- "message": "osd.9 is near full"
- }
- ],
- "summary": {
- "message": "3 nearfull osd(s)",
- "count": 3
- },
- "muted": false
- }
- },
- "status": "HEALTH_WARN",
- "mutes": []
- }
- }
-}`)
-}
diff --git a/go-proxmox/tests/mocks/pve9x/cluster.go b/go-proxmox/tests/mocks/pve9x/cluster.go
deleted file mode 100644
index 9779aa1..0000000
--- a/go-proxmox/tests/mocks/pve9x/cluster.go
+++ /dev/null
@@ -1,522 +0,0 @@
-package pve9x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func cluster() {
- gock.New(config.C.URI).
- Get("/cluster/nextid$").
- Reply(200).
- JSON(`{"data": "100"}`)
-
- gock.New(config.C.URI).
- Get("/cluster/nextid$").
- MatchParam("vmid", "100").
- Reply(200).
- JSON(`{"data": "100"}`)
-
- gock.New(config.C.URI).
- Get("/cluster/nextid").
- MatchParam("vmid", "200").
- Reply(400).
- JSON(`{"errors":{"vmid":"VM 200 already exists"},"data":null}`)
-
- gock.New(config.C.URI).
- Get("/cluster/status").
- Reply(200).
- JSON(`{
- "data": [
- {
- "type": "cluster",
- "version": 4,
- "quorate": 1,
- "name": "clustername",
- "id": "cluster",
- "nodes": 4
- },
- {
- "name": "node2",
- "nodeid": 2,
- "id": "node/node2",
- "online": 1,
- "type": "node",
- "ip": "192.168.1.2",
- "local": 0,
- "level": ""
- },
- {
- "name": "node3",
- "nodeid": 3,
- "type": "node",
- "ip": "192.168.1.3",
- "local": 0,
- "id": "node/node3",
- "online": 1,
- "level": ""
- },
- {
- "name": "node1",
- "nodeid": 1,
- "online": 1,
- "id": "node/node1",
- "local": 1,
- "ip": "192.168.1.1",
- "type": "node",
- "level": ""
- },
- {
- "nodeid": 4,
- "name": "node4",
- "level": "",
- "local": 0,
- "type": "node",
- "ip": "192.168.1.4",
- "online": 1,
- "id": "node/node4"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/cluster/resources$").
- MatchParams(map[string]string{
- "type": "node",
- }).
- Reply(200).
- JSON(`{
- "data": [
- {
- "type": "node",
- "id": "node1"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/cluster/resources$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "netout": 545248946,
- "type": "qemu",
- "name": "server1",
- "maxcpu": 1,
- "mem": 842551296,
- "netin": 2456116121,
- "maxmem": 1073741824,
- "disk": 0,
- "node": "node2",
- "cpu": 0.0249060195469461,
- "maxdisk": 34359738368,
- "vmid": 100,
- "diskwrite": 6059209728,
- "diskread": 4510777856,
- "status": "running",
- "template": 0,
- "id": "qemu/100",
- "uptime": 874350
- },
- {
- "id": "qemu/101",
- "diskwrite": 0,
- "status": "stopped",
- "diskread": 0,
- "template": 1,
- "uptime": 0,
- "name": "leap154",
- "maxcpu": 4,
- "mem": 0,
- "netin": 0,
- "maxmem": 16777216000,
- "netout": 0,
- "type": "qemu",
- "maxdisk": 68719476736,
- "vmid": 101,
- "disk": 0,
- "node": "node1",
- "cpu": 0
- },
- {
- "netout": 0,
- "type": "qemu",
- "maxcpu": 4,
- "name": "machine-test",
- "maxmem": 8388608000,
- "netin": 0,
- "mem": 0,
- "node": "node1",
- "disk": 0,
- "cpu": 0,
- "maxdisk": 53901000704,
- "vmid": 102,
- "status": "stopped",
- "diskwrite": 0,
- "diskread": 0,
- "template": 0,
- "id": "qemu/102",
- "uptime": 0,
- "tags": "go-proxmox+cloud-init"
- },
- {
- "type": "qemu",
- "netout": 0,
- "netin": 0,
- "mem": 0,
- "maxmem": 8388608000,
- "maxcpu": 4,
- "name": "VM 200",
- "cpu": 0,
- "node": "node1",
- "disk": 0,
- "vmid": 200,
- "maxdisk": 53901000704,
- "template": 0,
- "diskwrite": 0,
- "diskread": 0,
- "status": "stopped",
- "id": "qemu/200",
- "uptime": 0
- },
- {
- "maxdisk": 482713534464,
- "cpu": 0.0054917623564653,
- "node": "node3",
- "disk": 2983723008,
- "maxmem": 16668827648,
- "mem": 1681965056,
- "maxcpu": 4,
- "type": "node",
- "uptime": 872961,
- "level": "",
- "id": "node/node3",
- "cgroup-mode": 2,
- "status": "online"
- },
- {
- "cgroup-mode": 2,
- "status": "online",
- "id": "node/node2",
- "level": "",
- "uptime": 874373,
- "type": "node",
- "mem": 8127873024,
- "maxmem": 33567911936,
- "maxcpu": 12,
- "cpu": 0.00365387809333998,
- "node": "node2",
- "disk": 2797338624,
- "maxdisk": 940166742016
- },
- {
- "status": "online",
- "cgroup-mode": 2,
- "id": "node/node1",
- "level": "",
- "uptime": 872854,
- "type": "node",
- "maxcpu": 8,
- "mem": 2113265664,
- "maxmem": 65919459328,
- "disk": 10486546432,
- "node": "node1",
- "cpu": 0.00336910406788121,
- "maxdisk": 951055941632
- },
- {
- "cgroup-mode": 2,
- "status": "online",
- "id": "node/node4",
- "level": "",
- "uptime": 872920,
- "type": "node",
- "mem": 1698938880,
- "maxmem": 16651702272,
- "maxcpu": 4,
- "cpu": 0.00724094881398252,
- "disk": 2789867520,
- "node": "node4",
- "maxdisk": 482719825920
- },
- {
- "shared": 0,
- "type": "storage",
- "status": "available",
- "plugintype": "zfspool",
- "id": "storage/node3/local-zfs",
- "storage": "local-zfs",
- "node": "node3",
- "disk": 98304,
- "content": "images,rootdir",
- "maxdisk": 479730032640
- },
- {
- "shared": 0,
- "type": "storage",
- "status": "available",
- "id": "storage/node2/local-zfs",
- "plugintype": "zfspool",
- "content": "images,rootdir",
- "disk": 25294921728,
- "storage": "local-zfs",
- "node": "node2",
- "maxdisk": 962664386560
- },
- {
- "maxdisk": 955016175616,
- "node": "node1",
- "storage": "local-zfs",
- "content": "images,rootdir",
- "disk": 14446702592,
- "id": "storage/node1/local-zfs",
- "plugintype": "zfspool",
- "status": "available",
- "shared": 0,
- "type": "storage"
- },
- {
- "type": "storage",
- "shared": 0,
- "status": "available",
- "plugintype": "zfspool",
- "id": "storage/node4/local-zfs",
- "content": "images,rootdir",
- "disk": 98304,
- "storage": "local-zfs",
- "node": "node4",
- "maxdisk": 479930105856
- },
- {
- "maxdisk": 482713534464,
- "content": "backup,vztmpl,iso",
- "disk": 2983723008,
- "storage": "local",
- "node": "node3",
- "plugintype": "dir",
- "id": "storage/node3/local",
- "status": "available",
- "type": "storage",
- "shared": 0
- },
- {
- "maxdisk": 940166742016,
- "node": "node2",
- "storage": "local",
- "disk": 2797338624,
- "content": "backup,vztmpl,iso",
- "id": "storage/node2/local",
- "plugintype": "dir",
- "shared": 0,
- "type": "storage",
- "status": "available"
- },
- {
- "maxdisk": 951055941632,
- "disk": 10486546432,
- "content": "backup,vztmpl,iso",
- "storage": "local",
- "node": "node1",
- "id": "storage/node1/local",
- "plugintype": "dir",
- "status": "available",
- "shared": 0,
- "type": "storage"
- },
- {
- "plugintype": "dir",
- "id": "storage/node4/local",
- "status": "available",
- "shared": 0,
- "type": "storage",
- "maxdisk": 482719825920,
- "storage": "local",
- "node": "node4",
- "content": "backup,vztmpl,iso",
- "disk": 2789867520
- },
- {
- "plugintype": "dir",
- "id": "storage/node3/cloud-init",
- "status": "available",
- "type": "storage",
- "shared": 0,
- "maxdisk": 482713534464,
- "content": "snippets",
- "disk": 2983723008,
- "storage": "cloud-init",
- "node": "node3"
- },
- {
- "plugintype": "dir",
- "id": "storage/node2/cloud-init",
- "status": "available",
- "type": "storage",
- "shared": 0,
- "maxdisk": 940166742016,
- "disk": 2797338624,
- "content": "snippets",
- "node": "node2",
- "storage": "cloud-init"
- },
- {
- "disk": 10486546432,
- "content": "snippets",
- "node": "node1",
- "storage": "cloud-init",
- "maxdisk": 951055941632,
- "status": "available",
- "type": "storage",
- "shared": 0,
- "id": "storage/node1/cloud-init",
- "plugintype": "dir"
- },
- {
- "id": "storage/node4/cloud-init",
- "plugintype": "dir",
- "type": "storage",
- "shared": 0,
- "status": "available",
- "maxdisk": 482719825920,
- "content": "snippets",
- "disk": 2789867520,
- "storage": "cloud-init",
- "node": "node4"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Get("^/cluster/sdn/zones$").
- MatchParams(map[string]string{
- "type": "vxlan",
- }).
- Reply(200).
- JSON(`{
- "data": [
- {"zone":"test1","type":"vxlan","ipam":"pve"}
- ]
- }`)
-
- gock.New(config.C.URI).
- Get("^/cluster/sdn/zones$").
- Reply(200).
- JSON(`{
- "data": [
- {"zone":"test1","type":"vxlan","ipam":"pve"},
- {"zone":"test2","type":"simple","ipam":"pve"}
- ]
- }`)
-
- gock.New(config.C.URI).
- Get("^/cluster/sdn/vnets$").
- Reply(200).
- JSON(`{
- "data": [
- {"vnet":"user1","type":"vnet","zone":"test1","vlanaware":1,"tag":10},
- {"vnet":"user10","type":"vnet","zone":"test1","vlanaware":1,"tag":30},
- {"vnet":"user11","type":"vnet","zone":"test1","vlanaware":1,"tag":31},
- {"vnet":"user2","type":"vnet","zone":"test3","vlanaware":1,"tag":11},
- {"vnet":"user3","type":"vnet","zone":"test1","vlanaware":1,"tag":12}
- ]
- }`)
-
- gock.New(config.C.URI).
- Get("^/cluster/sdn/vnets/user1$").
- Reply(200).
- JSON(`{
- "data": {"vnet":"user1","type":"vnet","zone":"test1","vlanaware":1,"tag":10}
- }`)
-
- // GET /cluster/firewall/groups - List firewall security groups
- gock.New(config.C.URI).
- Persist().
- Get("^/cluster/firewall/groups$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "group": "test-group",
- "comment": "Test security group"
- },
- {
- "group": "web-servers",
- "comment": "Web server security group"
- }
- ]
- }`)
-
- // GET /cluster/firewall/groups/{group} - Get firewall group rules
- gock.New(config.C.URI).
- Persist().
- Get("^/cluster/firewall/groups/test-group$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "pos": 0,
- "type": "in",
- "action": "ACCEPT",
- "enable": 1,
- "proto": "tcp",
- "dport": "22",
- "comment": "Allow SSH"
- },
- {
- "pos": 1,
- "type": "in",
- "action": "ACCEPT",
- "enable": 1,
- "proto": "tcp",
- "dport": "80",
- "comment": "Allow HTTP"
- }
- ]
- }`)
-
- // POST /cluster/firewall/groups - Create new firewall group
- gock.New(config.C.URI).
- Persist().
- Post("^/cluster/firewall/groups$").
- Reply(200).
- JSON(`{
- "data": null
- }`)
-
- // POST /cluster/firewall/groups/{group} - Create rule in group
- gock.New(config.C.URI).
- Persist().
- Post("^/cluster/firewall/groups/test-group$").
- Reply(200).
- JSON(`{
- "data": null
- }`)
-
- // PUT /cluster/firewall/groups/{group}/{pos} - Update rule in group
- gock.New(config.C.URI).
- Persist().
- Put("^/cluster/firewall/groups/test-group/[0-9]+$").
- Reply(200).
- JSON(`{
- "data": null
- }`)
-
- // DELETE /cluster/firewall/groups/{group}/{pos} - Delete rule from group
- gock.New(config.C.URI).
- Persist().
- Delete("^/cluster/firewall/groups/test-group/[0-9]+$").
- Reply(200).
- JSON(`{
- "data": null
- }`)
-
- // DELETE /cluster/firewall/groups/{group} - Delete firewall group
- gock.New(config.C.URI).
- Persist().
- Delete("^/cluster/firewall/groups/test-group$").
- Reply(200).
- JSON(`{
- "data": null
- }`)
-}
diff --git a/go-proxmox/tests/mocks/pve9x/containers.go b/go-proxmox/tests/mocks/pve9x/containers.go
deleted file mode 100644
index 8479dbc..0000000
--- a/go-proxmox/tests/mocks/pve9x/containers.go
+++ /dev/null
@@ -1,224 +0,0 @@
-package pve9x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func containers() {
- // GET /nodes/{node}/lxc - List containers
- gock.New(config.C.URI).
- Get("^/nodes/node1/lxc$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "vmid": 100,
- "status": "running",
- "name": "ct-test-1",
- "cpus": 2,
- "maxmem": 2147483648,
- "maxdisk": 10737418240,
- "maxswap": 536870912,
- "uptime": 12345,
- "tags": "prod;web"
- },
- {
- "vmid": 101,
- "status": "stopped",
- "name": "ct-test-2",
- "cpus": 1,
- "maxmem": 1073741824,
- "maxdisk": 8589934592,
- "maxswap": 268435456,
- "uptime": 0,
- "tags": "tag1;tag2"
- },
- {
- "vmid": 102,
- "status": "running",
- "name": "ct-test-3",
- "cpus": 4,
- "maxmem": 4294967296,
- "maxdisk": 21474836480,
- "maxswap": 1073741824,
- "uptime": 54321,
- "tags": ""
- }
- ]
-}`)
-
- // GET /nodes/{node}/lxc/{vmid}/status/current - Get container current status
- gock.New(config.C.URI).
- Get("^/nodes/node1/lxc/101/status/current$").
- Reply(200).
- JSON(`{
- "data": {
- "vmid": 101,
- "status": "stopped",
- "name": "ct-test-2",
- "cpus": 1,
- "maxmem": 1073741824,
- "maxdisk": 8589934592,
- "maxswap": 268435456,
- "uptime": 0,
- "tags": "tag1;tag2"
- }
-}`)
-
- // GET /nodes/{node}/lxc/{vmid}/config - Get container configuration
- gock.New(config.C.URI).
- Get("^/nodes/node1/lxc/101/config$").
- Reply(200).
- JSON(`{
- "data": {
- "arch": "amd64",
- "cores": 1,
- "hostname": "ct-test-2",
- "memory": 1024,
- "net0": "name=eth0,bridge=vmbr0,firewall=1,hwaddr=BC:24:11:2E:C5:7E,ip=dhcp,type=veth",
- "ostype": "ubuntu",
- "rootfs": "local-lvm:vm-101-disk-0,size=8G",
- "swap": 256,
- "tags": "tag1;tag2",
- "digest": "abcdef1234567890"
- }
-}`)
-
- // POST /nodes/{node}/lxc/{vmid}/clone - Clone container
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/clone$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzmigrate:101:root@pam:"}`)
-
- // DELETE /nodes/{node}/lxc/{vmid} - Delete container
- gock.New(config.C.URI).
- Delete("^/nodes/node1/lxc/101$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzdestroy:101:root@pam:"}`)
-
- // PUT /nodes/{node}/lxc/{vmid}/config - Update container config
- gock.New(config.C.URI).
- Put("^/nodes/node1/lxc/101/config$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzconfig:101:root@pam:"}`)
-
- // POST /nodes/{node}/lxc/{vmid}/status/start - Start container
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/status/start$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzstart:101:root@pam:"}`)
-
- // POST /nodes/{node}/lxc/{vmid}/status/stop - Stop container
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/status/stop$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzstop:101:root@pam:"}`)
-
- // POST /nodes/{node}/lxc/{vmid}/status/suspend - Suspend container
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/status/suspend$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzsuspend:101:root@pam:"}`)
-
- // POST /nodes/{node}/lxc/{vmid}/status/reboot - Reboot container
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/status/reboot$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzreboot:101:root@pam:"}`)
-
- // POST /nodes/{node}/lxc/{vmid}/status/resume - Resume container
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/status/resume$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzresume:101:root@pam:"}`)
-
- // POST /nodes/{node}/lxc/{vmid}/status/shutdown - Shutdown container
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/status/shutdown$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzshutdown:101:root@pam:"}`)
-
- // POST /nodes/{node}/lxc/{vmid}/template - Convert to template
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/template$").
- Reply(200).
- JSON(`{"data": null}`)
-
- // GET /nodes/{node}/lxc/{vmid}/snapshot - List snapshots
- gock.New(config.C.URI).
- Get("^/nodes/node1/lxc/101/snapshot$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "name": "snapshot1",
- "description": "First snapshot",
- "snaptime": 1609459200
- },
- {
- "name": "snapshot2",
- "description": "Second snapshot",
- "snaptime": 1609545600
- },
- {
- "name": "snapshot3",
- "description": "Third snapshot",
- "snaptime": 1609632000
- }
- ]
-}`)
-
- // POST /nodes/{node}/lxc/{vmid}/snapshot - Create snapshot
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/snapshot$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzsnapshot:101:root@pam:"}`)
-
- // GET /nodes/{node}/lxc/{vmid}/snapshot/{snapname} - Get snapshot
- gock.New(config.C.URI).
- Get("^/nodes/node1/lxc/101/snapshot/snapshot1$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "name": "snapshot1",
- "description": "First snapshot",
- "snaptime": 1609459200
- }
- ]
-}`)
-
- // DELETE /nodes/{node}/lxc/{vmid}/snapshot/{snapname} - Delete snapshot
- gock.New(config.C.URI).
- Delete("^/nodes/node1/lxc/101/snapshot/snapshot1$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzdelsnapshot:101:root@pam:"}`)
-
- // POST /nodes/{node}/lxc/{vmid}/snapshot/{snapname}/rollback - Rollback snapshot
- gock.New(config.C.URI).
- Post("^/nodes/node1/lxc/101/snapshot/snapshot1/rollback$").
- Reply(200).
- JSON(`{"data": "UPID:node1:00001234:00005678:5A3B7C8D:vzrollback:101:root@pam:"}`)
-
- // GET /nodes/{node}/lxc/{vmid}/interfaces - Get network interfaces
- gock.New(config.C.URI).
- Get("^/nodes/node1/lxc/101/interfaces$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "hwaddr": "00:00:00:00:00:00",
- "inet": "127.0.0.1/8",
- "inet6": "::1/128",
- "name": "lo"
- },
- {
- "hwaddr": "bc:24:11:89:67:07",
- "inet": "192.168.3.95/22",
- "inet6": "fe80::be24:11ff:fe89:6707/64",
- "name": "eth0"
- }
- ]
-}`)
-}
diff --git a/go-proxmox/tests/mocks/pve9x/nodes.go b/go-proxmox/tests/mocks/pve9x/nodes.go
deleted file mode 100644
index d14b1a7..0000000
--- a/go-proxmox/tests/mocks/pve9x/nodes.go
+++ /dev/null
@@ -1,645 +0,0 @@
-package pve9x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func nodes() {
- // GET /nodes - List all nodes
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "uptime": 2236708,
- "level": "",
- "maxmem": 33568288768,
- "disk": 2310930432,
- "node": "node1",
- "maxdisk": 940743983104,
- "mem": 11508809728,
- "ssl_fingerprint": "80:D4:F2:DF:64:95:CD:8D:A0:82:82:AC:48:BA:C0:7A:1B:6B:87:8B:FE:B9:83:1C:95:4E:79:58:77:99:69:F5",
- "status": "online",
- "type": "node",
- "cpu": 0.00348605577689243,
- "id": "node/node1",
- "maxcpu": 12
- },
- {
- "level": "",
- "uptime": 6256882,
- "node": "node2",
- "maxdisk": 482721529856,
- "maxmem": 16651751424,
- "disk": 2303721472,
- "ssl_fingerprint": "17:F1:B6:52:8B:0C:22:4A:97:1F:B2:F2:90:3D:29:0A:D0:DF:BE:0E:76:5A:B5:EC:F6:2E:6E:8F:60:E6:C5:C0",
- "status": "online",
- "mem": 1838854144,
- "maxcpu": 4,
- "cpu": 0.00722831505483549,
- "type": "node",
- "id": "node/node2"
- },
- {
- "maxdisk": 482717728768,
- "node": "node3",
- "disk": 2315386880,
- "maxmem": 16668868608,
- "level": "",
- "uptime": 6258488,
- "maxcpu": 4,
- "id": "node/node3",
- "cpu": 0.00821557582405153,
- "type": "node",
- "status": "online",
- "ssl_fingerprint": "1D:56:94:B4:75:4B:5C:33:46:DD:14:38:6C:EC:6E:12:A8:F0:66:64:5E:F2:40:F7:60:2A:C0:9F:BF:6C:51:3C",
- "mem": 1858961408
- },
- {
- "maxmem": 65919561728,
- "disk": 9992273920,
- "node": "node4",
- "maxdisk": 951055024128,
- "uptime": 6257222,
- "level": "",
- "cpu": 0.00748876684972541,
- "type": "node",
- "id": "node/node4",
- "maxcpu": 8,
- "mem": 2268295168,
- "ssl_fingerprint": "0D:78:80:CD:64:8E:96:E5:31:87:1C:45:3C:62:93:2F:23:4C:D5:02:42:FE:C8:40:DC:AF:3D:2A:F8:B4:F6:CE",
- "status": "online"
- }
- ]
-}`)
-
- // GET /nodes/node1/version - Node version
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/version$").
- Reply(200).
- JSON(`{
- "data": {
- "release": "9.1",
- "version": "9.1-1",
- "repoid": "9a1b2c3d"
- }
-}`)
-
- // GET /nodes/doesntexist/status - Error case for non-existent node
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/doesntexist/status$").
- Reply(500).
- JSON(`{
- "data": null
-}`)
-
- // GET /nodes/node1/status - Node status
- gock.New(config.C.URI).
- Get("^/nodes/node1/status$").
- Reply(200).
- JSON(`{
- "data": {
- "cpu": 0.0123456789,
- "memory": {
- "used": 2147483648,
- "total": 8589934592,
- "free": 6442450944
- },
- "uptime": 86400,
- "loadavg": ["0.15", "0.25", "0.30"],
- "kversion": "Linux 6.11.0-1-pve",
- "pveversion": "pve-manager/9.1-1/9a1b2c3d",
- "cpuinfo": {
- "model": "Intel(R) Xeon(R) CPU E5-2680 v4",
- "cores": 4,
- "cpus": 8,
- "sockets": 1
- }
- }
-}`)
-
- // GET /nodes/node2/status - Node status for node2
- gock.New(config.C.URI).
- Get("^/nodes/node2/status$").
- Reply(200).
- JSON(`{
- "data": {
- "cpu": 0.0234567890,
- "memory": {
- "used": 4294967296,
- "total": 17179869184,
- "free": 12884901888
- },
- "uptime": 172800,
- "loadavg": ["0.25", "0.35", "0.40"],
- "kversion": "Linux 6.11.0-1-pve",
- "pveversion": "pve-manager/9.1-1/9a1b2c3d",
- "cpuinfo": {
- "model": "Intel(R) Xeon(R) CPU E5-2680 v4",
- "cores": 8,
- "cpus": 16,
- "sockets": 2
- }
- }
-}`)
-
- // GET /nodes/{node}/network/{iface} - Get specific network interface
- gock.New(config.C.URI).
- Get("^/nodes/node1/network/vmbr0$").
- Reply(200).
- JSON(`{
- "data": {
- "iface": "vmbr0",
- "type": "bridge",
- "method": "static",
- "method6": "manual",
- "address": "192.168.1.100",
- "netmask": "24",
- "cidr": "192.168.1.100/24",
- "gateway": "192.168.1.1",
- "bridge_ports": "eno1",
- "bridge_stp": "off",
- "bridge_fd": "0",
- "autostart": 1,
- "active": 1,
- "priority": 10,
- "families": ["inet"]
- }
-}`)
-
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/network").
- ParamPresent("type").
- Reply(200).
- JSON(`{
- "data": [
- {
- "iface": "vmbr1",
- "bridge_fd": "0",
- "autostart": 1,
- "bridge_ports": "eno1.2 vmbr2.10",
- "priority": 31,
- "families": [
- "inet"
- ],
- "bridge_vids": "2-4094",
- "active": "1",
- "bridge_stp": "off",
- "bridge_vlan_aware": 1,
- "type": "bridge",
- "comments": "some comment\n",
- "method6": "manual",
- "method": "manual"
- }
- ]
-}`)
-
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/network$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "method": "manual",
- "method6": "manual",
- "priority": 20,
- "families": [
- "inet"
- ],
- "type": "eth",
- "exists": 1,
- "iface": "eno1"
- },
- {
- "netmask": "32",
- "priority": 16,
- "families": [
- "inet"
- ],
- "address": "192.168.2.50",
- "cidr": "192.168.2.50/32",
- "vlan-raw-device": "eno1",
- "vlan-id": "2",
- "iface": "eno1.2",
- "autostart": 1,
- "exists": 1,
- "options": [
- "metric 200"
- ],
- "method6": "manual",
- "method": "static",
- "type": "vlan",
- "comments": "Some Comment\n",
- "active": 1
- },
- {
- "iface": "vmbr1",
- "bridge_fd": "0",
- "autostart": 1,
- "bridge_ports": "eno1.2 vmbr2.10",
- "priority": 31,
- "families": [
- "inet"
- ],
- "bridge_vids": "2-4094",
- "active": 1,
- "bridge_stp": "off",
- "bridge_vlan_aware": 1,
- "type": "bridge",
- "comments": "some comment\n",
- "method6": "manual",
- "method": "manual"
- },
- {
- "options": [
- "metric 100"
- ],
- "exists": null,
- "iface": "vmbr2.2",
- "autostart": 1,
- "vlan-id": "2",
- "vlan-raw-device": "vmbr2",
- "cidr": "192.168.22.31/24",
- "address": "192.168.22.31",
- "priority": 33,
- "families": [
- "inet"
- ],
- "netmask": "24",
- "active": 1,
- "type": "vlan",
- "method": "static",
- "method6": "manual"
- },
- {
- "families": [
- "inet"
- ],
- "priority": 35,
- "netmask": "24",
- "cidr": "172.16.20.1/24",
- "vlan-raw-device": "vmbr2",
- "address": "172.20.0.1",
- "iface": "vmbr2.8",
- "exists": null,
- "autostart": 1,
- "vlan-id": "8",
- "method": "static",
- "method6": "manual",
- "comments": "Some Network\n",
- "type": "vlan",
- "active": 1
- }
- ]
-}`)
-
- // GET /nodes/node2/network - Node2 network interfaces (should return 2 per test)
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node2/network$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "iface": "eno1",
- "type": "eth",
- "method": "manual",
- "method6": "manual",
- "priority": 20,
- "families": ["inet"],
- "exists": 1
- },
- {
- "iface": "vmbr0",
- "type": "bridge",
- "method": "static",
- "method6": "manual",
- "address": "192.168.1.101",
- "netmask": "24",
- "cidr": "192.168.1.101/24",
- "gateway": "192.168.1.1",
- "bridge_ports": "eno1",
- "bridge_stp": "off",
- "bridge_fd": "0",
- "autostart": 1,
- "active": 1,
- "priority": 10,
- "families": ["inet"]
- }
- ]
-}`)
-
- // GET /nodes/{node}/report - Get node report
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/report$").
- Reply(200).
- JSON(`{
- "data": "pve-manager: 9.1-1\nkernel: 6.11.0-1-pve\nproxmox-ve: 9.1-1\nqemu-server: 9.1-1\nlxc-pve: 6.0.0-1"
-}`)
-
- // POST /nodes/{node}/termproxy - Create terminal proxy
- gock.New(config.C.URI).
- Persist().
- Post("^/nodes/node1/termproxy$").
- Reply(200).
- JSON(`{
- "data": {
- "port": 5900,
- "ticket": "PVE:termproxy:12345678",
- "upid": "UPID:node1:00001234:00005678:12345678:termproxy:root@pam:",
- "user": "root@pam"
- }
-}`)
-
- // GET /nodes/{node}/aplinfo - List appliances
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/aplinfo$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "template": "ubuntu-22.04-standard",
- "type": "lxc",
- "package": "ubuntu-22.04-standard_22.04-1_amd64.tar.zst",
- "os": "ubuntu",
- "version": "22.04",
- "headline": "Ubuntu 22.04 LTS",
- "infopage": "https://pve.proxmox.com/wiki/Linux_Container",
- "description": "Ubuntu 22.04 LTS (Jammy Jellyfish) standard system",
- "section": "system"
- },
- {
- "template": "debian-12-standard",
- "type": "lxc",
- "package": "debian-12-standard_12.0-1_amd64.tar.zst",
- "os": "debian",
- "version": "12.0",
- "headline": "Debian 12 (Bookworm)",
- "infopage": "https://pve.proxmox.com/wiki/Linux_Container",
- "description": "Debian 12 (Bookworm) standard system",
- "section": "system"
- }
- ]
-}`)
-
- // POST /nodes/{node}/aplinfo - Download appliance
- gock.New(config.C.URI).
- Persist().
- Post("^/nodes/node1/aplinfo$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00001234:00005678:12345678:download:root@pam:"
-}`)
-
- // GET /nodes/{node}/storage - List storages
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/storage$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "storage": "local",
- "content": "images,rootdir,vztmpl,backup,iso,snippets",
- "type": "dir",
- "active": 1,
- "avail": 50000000000,
- "used": 10000000000,
- "total": 60000000000,
- "enabled": 1,
- "shared": 0
- },
- {
- "storage": "local-lvm",
- "content": "images,rootdir",
- "type": "lvmthin",
- "active": 1,
- "avail": 100000000000,
- "used": 20000000000,
- "total": 120000000000,
- "enabled": 1,
- "shared": 0
- }
- ]
-}`)
-
- // GET /nodes/{node}/storage/{storage}/status - Get storage status
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/storage/local/status$").
- Reply(200).
- JSON(`{
- "data": {
- "storage": "local",
- "content": "images,rootdir,vztmpl,backup,iso,snippets",
- "type": "dir",
- "active": 1,
- "avail": 50000000000,
- "used": 10000000000,
- "total": 60000000000,
- "enabled": 1,
- "shared": 0
- }
-}`)
-
- // GET /nodes/{node}/storage/{storage}/content - List storage content
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/storage/local/content").
- MatchParam("content", "vztmpl").
- Reply(200).
- JSON(`{
- "data": [
- {
- "volid": "local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst",
- "content": "vztmpl",
- "format": "tgz",
- "size": 123456789,
- "ctime": 1234567890
- },
- {
- "volid": "local:vztmpl/debian-12-standard_12.0-1_amd64.tar.zst",
- "content": "vztmpl",
- "format": "tgz",
- "size": 98765432,
- "ctime": 1234567890
- }
- ]
-}`)
-
- // POST /nodes/{node}/storage/{storage}/download-url - Download from URL
- gock.New(config.C.URI).
- Persist().
- Post("^/nodes/node1/storage/local/download-url$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00001234:00005678:12345678:download:root@pam:"
-}`)
-
- // GET /nodes/{node}/firewall/options - Get firewall options
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/firewall/options$").
- Reply(200).
- JSON(`{
- "data": {
- "enable": true,
- "log_level_in": "info",
- "log_level_out": "info",
- "ndp": true,
- "nf_conntrack_allow_invalid": false,
- "nf_conntrack_max": 262144,
- "nf_conntrack_tcp_timeout_established": 432000,
- "nosmurfs": true,
- "protection_synflood": false,
- "protection_synflood_burst": 1000,
- "protection_synflood_rate": 200,
- "smurf_log_level": "info",
- "tcp_flags_log_level": "nolog",
- "tcpflags": false
- }
-}`)
-
- // PUT /nodes/{node}/firewall/options - Update firewall options
- gock.New(config.C.URI).
- Persist().
- Put("^/nodes/node1/firewall/options$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // GET /nodes/{node}/firewall/rules - Get firewall rules
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/firewall/rules$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "pos": 0,
- "type": "in",
- "action": "ACCEPT",
- "enable": 1,
- "iface": "vmbr0",
- "source": "192.168.1.0/24",
- "dest": "192.168.1.100",
- "proto": "tcp",
- "dport": "22",
- "comment": "Allow SSH from LAN"
- },
- {
- "pos": 1,
- "type": "in",
- "action": "DROP",
- "enable": 1,
- "proto": "tcp",
- "dport": "22",
- "comment": "Block all other SSH"
- }
- ]
-}`)
-
- // POST /nodes/{node}/firewall/rules - Create firewall rule
- gock.New(config.C.URI).
- Persist().
- Post("^/nodes/node1/firewall/rules$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // PUT /nodes/{node}/firewall/rules/{pos} - Update firewall rule
- gock.New(config.C.URI).
- Persist().
- Put("^/nodes/node1/firewall/rules/[0-9]+$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // DELETE /nodes/{node}/firewall/rules/{pos} - Delete firewall rule
- gock.New(config.C.URI).
- Persist().
- Delete("^/nodes/node1/firewall/rules/[0-9]+$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // GET /nodes/{node}/certificates/info - Get certificates
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/certificates/info$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "filename": "/etc/pve/nodes/node1/pve-ssl.pem",
- "fingerprint": "80:D4:F2:DF:64:95:CD:8D:A0:82:82:AC:48:BA:C0:7A:1B:6B:87:8B:FE:B9:83:1C:95:4E:79:58:77:99:69:F5",
- "issuer": "Proxmox Virtual Environment",
- "notafter": 1735689600,
- "notbefore": 1704153600,
- "subject": "node1.example.com",
- "san": [
- "DNS:node1",
- "DNS:node1.example.com",
- "IP:192.168.1.100"
- ],
- "pem": "-----BEGIN CERTIFICATE-----\nMIIDXTCCAkWgAwIBAgIJAKZx...\n-----END CERTIFICATE-----"
- }
- ]
-}`)
-
- // POST /nodes/{node}/certificates/custom - Upload custom certificate
- gock.New(config.C.URI).
- Persist().
- Post("^/nodes/node1/certificates/custom$").
- Reply(200).
- JSON(`{
- "data": {
- "filename": "/etc/pve/nodes/node1/pve-ssl.pem",
- "fingerprint": "AB:CD:EF:12:34:56:78:90:AB:CD:EF:12:34:56:78:90:AB:CD:EF:12:34:56:78:90:AB:CD:EF:12:34:56:78:90",
- "issuer": "Custom CA",
- "notafter": 1767225600,
- "notbefore": 1735689600,
- "subject": "node1.example.com"
- }
-}`)
-
- // DELETE /nodes/{node}/certificates/custom - Delete custom certificate
- gock.New(config.C.URI).
- Persist().
- Delete("^/nodes/node1/certificates/custom$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // POST /nodes/{node}/vzdump - Backup VMs
- gock.New(config.C.URI).
- Persist().
- Post("^/nodes/node1/vzdump$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00001234:00005678:12345678:vzdump:root@pam:"
-}`)
-
- // GET /nodes/{node}/vzdump/extractconfig - Extract backup config
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/vzdump/extractconfig").
- Reply(200).
- JSON(`{
- "data": "cores: 2\nmemory: 2048\nostype: debian\nrootfs: local-lvm:vm-100-disk-0,size=8G\nnet0: name=eth0,bridge=vmbr0,ip=dhcp"
-}`)
-}
diff --git a/go-proxmox/tests/mocks/pve9x/pools.go b/go-proxmox/tests/mocks/pve9x/pools.go
deleted file mode 100644
index 7c900c5..0000000
--- a/go-proxmox/tests/mocks/pve9x/pools.go
+++ /dev/null
@@ -1,164 +0,0 @@
-package pve9x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func pool() {
- gock.New(config.C.URI).
- Get("^/pools$").
- Reply(200).
- JSON(`{"data": [
- {
- "poolid": "test-pool",
- "comment": "Test pool"
- }
- ]
-}`)
-
- // Mock for the new /pools/?poolid=test-pool endpoint (returns array)
- gock.New(config.C.URI).
- Get("^/pools/$").
- MatchParam("poolid", "test-pool").
- Reply(200).
- JSON(`{"data": [
- {
- "poolid": "test-pool",
- "comment": "Test pool",
- "members": [
- {
- "disk": 0,
- "uptime": 88341,
- "diskwrite": 7389189632,
- "netout": 73088105,
- "maxmem": 17179869184,
- "maxdisk": 10737418240,
- "type": "qemu",
- "vmid": 100,
- "template": 0,
- "cpu": 0.0378721079577321,
- "name": "test-vm",
- "node": "pve1",
- "id": "qemu/100",
- "diskread": 500085248,
- "netin": 485707842,
- "maxcpu": 4,
- "mem": 3650678784,
- "status": "running"
- },
- {
- "diskread": 486947840,
- "id": "qemu/106",
- "cpu": 0.02889417191544,
- "template": 0,
- "name": "test-vm2",
- "node": "pve2",
- "maxcpu": 1,
- "netin": 337525157,
- "status": "running",
- "mem": 1744027648,
- "disk": 0,
- "diskwrite": 1382547968,
- "uptime": 88204,
- "netout": 21769689,
- "type": "qemu",
- "vmid": 106,
- "maxdisk": 10737418240,
- "maxmem": 2147483648
- },
- {
- "node": "node1",
- "maxdisk": 948340654080,
- "type": "storage",
- "id": "storage/node1/local",
- "status": "available",
- "storage": "local",
- "content": "backup,vztmpl,iso",
- "plugintype": "dir",
- "disk": 10486939648,
- "shared": 0
- }
- ]
- }
- ]
-}`)
-
- // Mock for the deprecated /pools/test-pool endpoint (kept for backwards compatibility)
- gock.New(config.C.URI).
- Get("^/pools/test-pool$").
- Reply(200).
- JSON(`{"data": {
- "comment": "Test pool",
- "members": [
- {
- "disk": 0,
- "uptime": 88341,
- "diskwrite": 7389189632,
- "netout": 73088105,
- "maxmem": 17179869184,
- "maxdisk": 10737418240,
- "type": "qemu",
- "vmid": 100,
- "template": 0,
- "cpu": 0.0378721079577321,
- "name": "test-vm",
- "node": "pve1",
- "id": "qemu/100",
- "diskread": 500085248,
- "netin": 485707842,
- "maxcpu": 4,
- "mem": 3650678784,
- "status": "running"
- },
- {
- "diskread": 486947840,
- "id": "qemu/106",
- "cpu": 0.02889417191544,
- "template": 0,
- "name": "test-vm2",
- "node": "pve2",
- "maxcpu": 1,
- "netin": 337525157,
- "status": "running",
- "mem": 1744027648,
- "disk": 0,
- "diskwrite": 1382547968,
- "uptime": 88204,
- "netout": 21769689,
- "type": "qemu",
- "vmid": 106,
- "maxdisk": 10737418240,
- "maxmem": 2147483648
- },
- {
- "node": "node1",
- "maxdisk": 948340654080,
- "type": "storage",
- "id": "storage/node1/local",
- "status": "available",
- "storage": "local",
- "content": "backup,vztmpl,iso",
- "plugintype": "dir",
- "disk": 10486939648,
- "shared": 0
- }
- ]
- }
-}`)
-
- gock.New(config.C.URI).
- Post("^/pools$").
- Reply(200).
- JSON(`{"data": null}`)
-
- gock.New(config.C.URI).
- Put("^/pools/test-pool$").
- Reply(200).
- JSON(`{"data": null}`)
-
- gock.New(config.C.URI).
- Delete("^/pools/test-pool$").
- Reply(200).
- JSON(`{"data": null}`)
-}
diff --git a/go-proxmox/tests/mocks/pve9x/proxmox.go b/go-proxmox/tests/mocks/pve9x/proxmox.go
deleted file mode 100644
index 148fecc..0000000
--- a/go-proxmox/tests/mocks/pve9x/proxmox.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package pve9x
-
-func Load() {
- version()
- access()
- nodes()
- cluster()
- pool()
- ceph()
- containers()
- virtualMachines()
- storage()
- tasks()
-}
diff --git a/go-proxmox/tests/mocks/pve9x/storage.go b/go-proxmox/tests/mocks/pve9x/storage.go
deleted file mode 100644
index e99015b..0000000
--- a/go-proxmox/tests/mocks/pve9x/storage.go
+++ /dev/null
@@ -1,145 +0,0 @@
-package pve9x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func storage() {
- // GET /storage - List all cluster storages
- gock.New(config.C.URI).
- Persist().
- Get("^/storage$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "content": "vztmpl,iso,backup",
- "digest": "1234567890abcdef1234567890abcdef12345678",
- "storage": "local",
- "type": "dir",
- "shared": 0,
- "path": "/var/lib/vz"
- },
- {
- "content": "images,rootdir",
- "digest": "abcdef1234567890abcdef1234567890abcdef12",
- "storage": "local-lvm",
- "type": "lvmthin",
- "shared": 0,
- "thinpool": "data",
- "vgname": "pve"
- },
- {
- "content": "images,rootdir",
- "digest": "fedcba0987654321fedcba0987654321fedcba09",
- "storage": "nfs-storage",
- "type": "nfs",
- "shared": 1,
- "path": "/mnt/pve/nfs-storage",
- "nodes": "node1,node2"
- }
- ]
-}`)
-
- // GET /storage/{storage} - Get specific storage
- gock.New(config.C.URI).
- Persist().
- Get("^/storage/local$").
- Reply(200).
- JSON(`{
- "data": {
- "content": "vztmpl,iso,backup",
- "digest": "1234567890abcdef1234567890abcdef12345678",
- "storage": "local",
- "type": "dir",
- "shared": 0,
- "path": "/var/lib/vz"
- }
-}`)
-
- gock.New(config.C.URI).
- Persist().
- Get("^/storage/local-lvm$").
- Reply(200).
- JSON(`{
- "data": {
- "content": "images,rootdir",
- "digest": "abcdef1234567890abcdef1234567890abcdef12",
- "storage": "local-lvm",
- "type": "lvmthin",
- "shared": 0,
- "thinpool": "data",
- "vgname": "pve"
- }
-}`)
-
- // POST /storage - Create new storage
- gock.New(config.C.URI).
- Post("^/storage$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // PUT /storage/{storage} - Update storage
- gock.New(config.C.URI).
- Put("^/storage/local$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // DELETE /storage/{storage} - Delete storage
- gock.New(config.C.URI).
- Delete("^/storage/test-storage$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000001:00000001:00000001:storage:delete:root@pam:"
-}`)
-
- // GET /nodes/{node}/storage/{storage}/content - Get storage content
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/storage/local/content$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "volid": "local:iso/debian-12.0.0-amd64-netinst.iso",
- "format": "iso",
- "size": 654311424,
- "ctime": 1693252591
- },
- {
- "volid": "local:vztmpl/debian-12-standard_12.0-1_amd64.tar.zst",
- "format": "tar.zst",
- "size": 128974848,
- "ctime": 1693252600
- },
- {
- "volid": "local:backup/vzdump-qemu-100-2023_08_28-12_00_00.vma.zst",
- "format": "vma.zst",
- "size": 2147483648,
- "ctime": 1693252800,
- "vmid": 100
- }
- ]
-}`)
-
- // DELETE /nodes/{node}/storage/{storage}/content/{volume} - Delete storage content
- gock.New(config.C.URI).
- Delete("^/nodes/node1/storage/local/content/local:iso/test.iso$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000002:00000002:00000002:imgdel:delete:root@pam:"
-}`)
-
- // POST /nodes/{node}/storage/{storage}/download-url - Download from URL
- gock.New(config.C.URI).
- Post("^/nodes/node1/storage/local/download-url$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000003:00000003:00000003:download:iso:root@pam:"
-}`)
-}
diff --git a/go-proxmox/tests/mocks/pve9x/tasks.go b/go-proxmox/tests/mocks/pve9x/tasks.go
deleted file mode 100644
index 2ebbd23..0000000
--- a/go-proxmox/tests/mocks/pve9x/tasks.go
+++ /dev/null
@@ -1,117 +0,0 @@
-package pve9x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func tasks() {
- // GET /nodes/{node}/tasks/{upid}/status - Get task status (running)
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/tasks/UPID:node1:00000001:00000001:00000001:test:running:root@pam:/status$").
- Reply(200).
- JSON(`{
- "data": {
- "status": "running",
- "upid": "UPID:node1:00000001:00000001:00000001:test:running:root@pam:",
- "type": "test",
- "id": "running",
- "user": "root@pam",
- "node": "node1",
- "pid": 1,
- "pstart": 1,
- "starttime": 1693252591
- }
-}`)
-
- // GET /nodes/{node}/tasks/{upid}/status - Get task status (stopped/completed)
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/tasks/UPID:node1:00000002:00000002:00000002:test:completed:root@pam:/status$").
- Reply(200).
- JSON(`{
- "data": {
- "status": "stopped",
- "exitstatus": "OK",
- "upid": "UPID:node1:00000002:00000002:00000002:test:completed:root@pam:",
- "type": "test",
- "id": "completed",
- "user": "root@pam",
- "node": "node1",
- "pid": 2,
- "pstart": 2,
- "starttime": 1693252591,
- "endtime": 1693252600
- }
-}`)
-
- // GET /nodes/{node}/tasks/{upid}/status - Get task status (failed)
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/tasks/UPID:node1:00000003:00000003:00000003:test:failed:root@pam:/status$").
- Reply(200).
- JSON(`{
- "data": {
- "status": "stopped",
- "exitstatus": "some error occurred",
- "upid": "UPID:node1:00000003:00000003:00000003:test:failed:root@pam:",
- "type": "test",
- "id": "failed",
- "user": "root@pam",
- "node": "node1",
- "pid": 3,
- "pstart": 3,
- "starttime": 1693252591,
- "endtime": 1693252600
- }
-}`)
-
- // DELETE /nodes/{node}/tasks/{upid} - Stop task
- gock.New(config.C.URI).
- Delete("^/nodes/node1/tasks/UPID:node1:00000001:00000001:00000001:test:running:root@pam:$").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // GET /nodes/{node}/tasks/{upid}/log - Get task log
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/tasks/UPID:node1:00000002:00000002:00000002:test:completed:root@pam:/log$").
- MatchParam("start", "0").
- MatchParam("limit", "50").
- Reply(200).
- JSON(`{
- "data": [
- {"n": 1, "t": "task started"},
- {"n": 2, "t": "processing step 1"},
- {"n": 3, "t": "processing step 2"},
- {"n": 4, "t": "processing step 3"},
- {"n": 5, "t": "task completed successfully"}
- ]
-}`)
-
- // GET /nodes/{node}/tasks/{upid}/log - Get task log with offset
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/tasks/UPID:node1:00000002:00000002:00000002:test:completed:root@pam:/log$").
- MatchParam("start", "5").
- MatchParam("limit", "50").
- Reply(200).
- JSON(`{
- "data": []
-}`)
-
- // GET /nodes/{node}/tasks/{upid}/log - Get task log for running task
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/tasks/UPID:node1:00000001:00000001:00000001:test:running:root@pam:/log$").
- Reply(200).
- JSON(`{
- "data": [
- {"n": 1, "t": "task started"},
- {"n": 2, "t": "processing..."}
- ]
-}`)
-}
diff --git a/go-proxmox/tests/mocks/pve9x/version.go b/go-proxmox/tests/mocks/pve9x/version.go
deleted file mode 100644
index 69f8ee4..0000000
--- a/go-proxmox/tests/mocks/pve9x/version.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package pve9x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func version() {
- versionJSON := `
-{
- "data": {
- "repoid": "9a1b2c3d",
- "release": "9.1",
- "version": "9.1-1"
- }
-}`
- gock.New(config.C.URI).
- Get("^/version$").
- Reply(200).
- JSON(versionJSON)
-
- gock.New(config.C.URI).
- Post("^/version$"). // fake to test client Post method
- Reply(200).
- JSON(versionJSON)
-
- gock.New(config.C.URI).
- Put("^/version$"). // fake to test client Put method
- Reply(200).
- JSON(versionJSON)
-
- gock.New(config.C.URI).
- Delete("^/version$"). // fake to test client Delete method
- Reply(200).
- JSON(versionJSON)
-}
diff --git a/go-proxmox/tests/mocks/pve9x/virtual_machines.go b/go-proxmox/tests/mocks/pve9x/virtual_machines.go
deleted file mode 100644
index 0ab0d45..0000000
--- a/go-proxmox/tests/mocks/pve9x/virtual_machines.go
+++ /dev/null
@@ -1,787 +0,0 @@
-package pve9x
-
-import (
- "github.com/h2non/gock"
- "github.com/luthermonson/go-proxmox/tests/mocks/config"
-)
-
-func virtualMachines() {
- // GET /nodes/{node}/qemu/{vmid}/status/current - VM status
- gock.New(config.C.URI).
- Get("^/nodes/node1/qemu/101/status/current$").
- Reply(200).
- JSON(`{
- "data": {
- "pid": 1563102,
- "shares": 1000,
- "agent": 1,
- "diskwrite": 1515457024,
- "cpus": 8,
- "ha": {
- "managed": 0
- },
- "maxmem": 2097152000,
- "blockstat": {
- "scsi0": {
- "rd_total_time_ns": 7089432813,
- "flush_total_time_ns": 7442045713,
- "wr_total_time_ns": 65889619830,
- "failed_rd_operations": 0,
- "rd_bytes": 649448960,
- "wr_bytes": 1515457024,
- "unmap_operations": 469,
- "failed_unmap_operations": 0,
- "failed_wr_operations": 0,
- "account_failed": true,
- "invalid_unmap_operations": 0,
- "wr_operations": 157514,
- "rd_operations": 15582,
- "failed_flush_operations": 0,
- "invalid_wr_operations": 0,
- "account_invalid": true,
- "unmap_total_time_ns": 9514953,
- "unmap_merged": 0,
- "timed_stats": [],
- "unmap_bytes": 15973687808,
- "invalid_flush_operations": 0,
- "idle_time_ns": 4427685914,
- "flush_operations": 15494,
- "invalid_rd_operations": 0,
- "wr_highest_offset": 2808696832,
- "rd_merged": 0,
- "wr_merged": 0
- },
- "ide2": {
- "unmap_merged": 0,
- "timed_stats": [],
- "unmap_bytes": 0,
- "invalid_flush_operations": 0,
- "idle_time_ns": 170803536780303,
- "flush_operations": 0,
- "invalid_rd_operations": 0,
- "wr_highest_offset": 0,
- "rd_merged": 0,
- "wr_merged": 0,
- "failed_flush_operations": 0,
- "invalid_wr_operations": 0,
- "account_invalid": true,
- "unmap_total_time_ns": 0,
- "unmap_operations": 0,
- "failed_unmap_operations": 0,
- "failed_wr_operations": 0,
- "account_failed": true,
- "invalid_unmap_operations": 0,
- "wr_operations": 0,
- "rd_operations": 98,
- "rd_total_time_ns": 10689186,
- "flush_total_time_ns": 0,
- "wr_total_time_ns": 0,
- "failed_rd_operations": 0,
- "rd_bytes": 344348,
- "wr_bytes": 0
- }
- },
- "uptime": 170815,
- "cpu": 0.0112815646165076,
- "running-machine": "pc-i440fx-8.0+pve0",
- "balloon": 2097152000,
- "qmpstatus": "running",
- "status": "running",
- "maxdisk": 18467520512,
- "diskread": 649793308,
- "freemem": 887222272,
- "ballooninfo": {
- "actual": 2097152000,
- "max_mem": 2097152000,
- "free_mem": 887222272,
- "major_page_faults": 1811,
- "minor_page_faults": 3803793,
- "mem_swapped_out": 0,
- "mem_swapped_in": 0,
- "total_mem": 2015014912,
- "last_update": 1693252591
- },
- "vmid": 101,
- "balloon_min": 2097152000,
- "mem": 1127792640,
- "proxmox-support": {
- "pbs-dirty-bitmap-savevm": true,
- "pbs-dirty-bitmap": true,
- "query-bitmap-info": true,
- "pbs-masterkey": true,
- "backup-max-workers": true,
- "pbs-dirty-bitmap-migration": true,
- "pbs-library-version": "1.4.0 (UNKNOWN)"
- },
- "running-qemu": "8.0.2",
- "name": "matt",
- "netout": 14139344,
- "netin": 547369168,
- "nics": {
- "tap1001i0": {
- "netout": 14139344,
- "netin": 547369168
- }
- },
- "disk": 0
- }
-}`)
-
- // GET /nodes/{node}/qemu/{vmid}/rrddata - VM RRD data
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/qemu/101/rrddata$").
- MatchParams(map[string]string{
- "timeframe": "hour",
- }).
- Reply(200).
- JSON(`{
- "data": [
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693110660,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693110720,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693110780,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "time": 1693110840,
- "maxdisk": 68719476736,
- "disk": 0,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693110900
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693110960
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693111020,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "time": 1693111080,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693111140,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "time": 1693111200,
- "maxdisk": 68719476736,
- "disk": 0,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693111260,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693111320,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693111380,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693111440
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693111500,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693111560,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693111620,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693111680
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693111740,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693111800,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693111860,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693111920,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693111980,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693112040,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "time": 1693112100,
- "maxdisk": 68719476736,
- "disk": 0,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693112160,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693112220,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "time": 1693112280,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "time": 1693112340,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693112400,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693112460
- },
- {
- "time": 1693112520,
- "maxdisk": 68719476736,
- "disk": 0,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693112580,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693112640
- },
- {
- "time": 1693112700,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693112760,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693112820,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693112880,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693112940
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693113000,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113060,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693113120,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113180
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113240,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "time": 1693113300,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113360
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113420,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "time": 1693113480,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113540,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693113600,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693113660,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693113720,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113780
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693113840
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693113900
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693113960,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693114020,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693114080,
- "maxcpu": 4,
- "maxmem": 16777216000
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693114140,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693114200
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "disk": 0,
- "maxdisk": 68719476736,
- "time": 1693114260
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693114320,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "time": 1693114380,
- "maxdisk": 68719476736,
- "disk": 0,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "time": 1693114440,
- "disk": 0,
- "maxdisk": 68719476736,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693114500,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693114560,
- "maxdisk": 68719476736,
- "disk": 0
- },
- {
- "maxmem": 16777216000,
- "maxcpu": 4,
- "time": 1693114620,
- "disk": 0,
- "maxdisk": 68719476736
- },
- {
- "time": 1693114680,
- "maxdisk": 68719476736,
- "disk": 0,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxdisk": 68719476736,
- "disk": 0,
- "time": 1693114740,
- "maxmem": 16777216000,
- "maxcpu": 4
- },
- {
- "maxcpu": 4,
- "maxmem": 16777216000,
- "time": 1693114800,
- "disk": 0,
- "maxdisk": 68719476736
- }
- ]
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/clone - Clone VM
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/101/clone").
- Reply(200).
- JSON(`{
- "data": null
-}`)
-
- // GET /nodes/{node}/qemu/{vmid}/config - Get VM config
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/qemu/100/config$").
- Reply(200).
- JSON(`{
- "data": {
- "digest": "abc123def456",
- "name": "test-vm",
- "vmid": 100,
- "cores": 2,
- "memory": 2048,
- "sockets": 1,
- "ostype": "l26",
- "boot": "order=scsi0;ide2;net0",
- "scsi0": "local-lvm:vm-100-disk-0,size=32G",
- "ide2": "local:iso/debian-12.iso,media=cdrom",
- "net0": "virtio=BC:24:11:2E:C5:4A,bridge=vmbr0",
- "scsihw": "virtio-scsi-pci",
- "tags": "production;webserver"
- }
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/config - Update VM config (for tag management)
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/100/config$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000004:00000004:00000004:qmconfig:100:root@pam:"
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/status/start - Start VM
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/100/status/start$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000005:00000005:00000005:qmstart:100:root@pam:"
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/status/stop - Stop VM
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/100/status/stop$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000006:00000006:00000006:qmstop:100:root@pam:"
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/status/shutdown - Shutdown VM
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/100/status/shutdown$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000007:00000007:00000007:qmshutdown:100:root@pam:"
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/status/reboot - Reboot VM
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/100/status/reboot$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000008:00000008:00000008:qmreboot:100:root@pam:"
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/status/reset - Reset VM
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/100/status/reset$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:00000009:00000009:00000009:qmreset:100:root@pam:"
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/status/suspend - Pause VM
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/100/status/suspend$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:0000000A:0000000A:0000000A:qmsuspend:100:root@pam:"
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/status/resume - Resume VM
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/100/status/resume$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:0000000B:0000000B:0000000B:qmresume:100:root@pam:"
-}`)
-
- // DELETE /nodes/{node}/qemu/{vmid} - Delete VM
- gock.New(config.C.URI).
- Delete("^/nodes/node1/qemu/999$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:0000000C:0000000C:0000000C:qmdestroy:999:root@pam:"
-}`)
-
- // GET /nodes/{node}/qemu/{vmid}/snapshot - List VM snapshots
- gock.New(config.C.URI).
- Persist().
- Get("^/nodes/node1/qemu/100/snapshot$").
- Reply(200).
- JSON(`{
- "data": [
- {
- "name": "current",
- "description": "You are here!",
- "snaptime": 0
- },
- {
- "name": "snap1",
- "description": "Before upgrade",
- "snaptime": 1693252591,
- "vmstate": 1,
- "parent": "current"
- },
- {
- "name": "snap2",
- "description": "After upgrade",
- "snaptime": 1693252600,
- "parent": "snap1"
- }
- ]
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/snapshot - Create VM snapshot
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/100/snapshot$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:0000000D:0000000D:0000000D:qmsnapshot:100:root@pam:"
-}`)
-
- // POST /nodes/{node}/qemu/{vmid}/snapshot/{snapname}/rollback - Rollback snapshot
- gock.New(config.C.URI).
- Post("^/nodes/node1/qemu/100/snapshot/snap1/rollback$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:0000000E:0000000E:0000000E:qmrollback:100:root@pam:"
-}`)
-
- // DELETE /nodes/{node}/qemu/{vmid}/snapshot/{snapname} - Delete snapshot
- gock.New(config.C.URI).
- Delete("^/nodes/node1/qemu/100/snapshot/snap2$").
- Reply(200).
- JSON(`{
- "data": "UPID:node1:0000000F:0000000F:0000000F:qmdelsnapshot:100:root@pam:"
-}`)
-}
diff --git a/go-proxmox/types.go b/go-proxmox/types.go
deleted file mode 100644
index 45acae8..0000000
--- a/go-proxmox/types.go
+++ /dev/null
@@ -1,2093 +0,0 @@
-package proxmox
-
-import (
- "bytes"
- "encoding/json"
- "fmt"
- "math"
- "regexp"
- "strconv"
- "strings"
- "time"
-
- "github.com/jinzhu/copier"
-)
-
-var (
- isFloat = regexp.MustCompile(`^[0-9.]*$`)
-)
-
-type Credentials struct {
- Username string `json:"username"`
- Password string `json:"password"`
- Otp string `json:"otp,omitempty"` // One-time password for Two-factor authentication.
- Path string `json:"path,omitempty"`
- Privs string `json:"privs,omitempty"`
- Realm string `json:"realm,omitempty"`
-}
-
-type Permission map[string]IntOrBool
-type Permissions map[string]Permission
-
-type PermissionsOptions struct {
- Path string // path to limit the return e.g. / or /nodes
- UserID string // username e.g. root@pam or token
-}
-
-type Session struct {
- Username string `json:"username"`
- CSRFPreventionToken string `json:"CSRFPreventionToken,omitempty"`
-
- // Cap is being returned but not documented in the API docs, likely will get rewritten later with better types
- Cap map[string]map[string]int `json:"cap,omitempty"`
- ClusterName string `json:"clustername,omitempty"`
- Ticket string `json:"ticket,omitempty"`
-}
-
-type Version struct {
- Release string `json:"release"`
- RepoID string `json:"repoid"`
- Version string `json:"version"`
-}
-
-type Term struct {
- Port StringOrInt
- Ticket string
- UPID string
- User string
-}
-
-type VNCConfig struct {
- GeneratePassword bool `json:"generate-password,omitempty"`
- Websocket bool `json:"websocket,omitempty"`
-}
-
-type VNC struct {
- Cert string
- Port StringOrInt
- Ticket string
- UPID string
- User string
- Password string `json:",omitempty"`
-}
-
-type Cluster struct {
- client *Client
- Version int
- Quorate int
- Nodes NodeStatuses
- Name string
- ID string
-}
-
-func (cl *Cluster) UnmarshalJSON(b []byte) error {
- var tmp []map[string]interface{}
- if err := json.Unmarshal(b, &tmp); err != nil {
- return err
- }
-
- for _, d := range tmp {
- t, ok := d["type"]
- if !ok {
- break
- }
-
- switch t.(string) {
- case "cluster":
- if v, ok := d["id"]; ok {
- cl.ID = v.(string)
- }
- if v, ok := d["name"]; ok {
- cl.Name = v.(string)
- }
- if v, ok := d["version"]; ok {
- cl.Version = int(v.(float64))
- }
- if v, ok := d["quorate"]; ok {
- cl.Quorate = int(v.(float64))
- }
- case "node":
- ns := NodeStatus{
- Status: "offline",
- Type: "node",
- }
- if v, ok := d["name"]; ok {
- ns.Name = v.(string)
- }
- if v, ok := d["level"]; ok {
- ns.Level = v.(string)
- }
- if v, ok := d["online"]; ok {
- ns.Online = int(v.(float64))
- if ns.Online == 1 {
- ns.Status = "online"
- }
- }
- if v, ok := d["id"]; ok {
- ns.ID = v.(string)
- }
- if v, ok := d["ip"]; ok {
- ns.IP = v.(string)
- }
- if v, ok := d["local"]; ok {
- ns.Local = int(v.(float64))
- }
-
- cl.Nodes = append(cl.Nodes, &ns)
- }
- }
-
- return nil
-}
-
-type ClusterResources []*ClusterResource
-
-type ClusterResource struct {
- ID string `json:"id"`
- Type string `json:"type"`
- CGroupMode uint64 `json:"cgroup-mode,omitempty"`
- Content string `json:",omitempty"`
- CPU float64 `json:",omitempty"`
- Disk uint64 `json:",omitempty"` // documented as string but this is an int
- DiskRead uint64 `json:",omitempty"`
- DiskWrite uint64 `json:",omitempty"`
- HAstate string `json:",omitempty"`
- Level string `json:",omitempty"`
- MaxCPU uint64 `json:",omitempty"`
- MaxDisk uint64 `json:",omitempty"`
- MaxMem uint64 `json:",omitempty"`
- Mem uint64 `json:",omitempty"` // documented as string but this is an int
- Name string `json:",omitempty"`
- NetIn uint64 `json:",omitempty"`
- NetOut uint64 `json:",omitempty"`
- Node string `json:",omitempty"`
- PluginType string `json:",omitempty"`
- Pool string `json:",omitempty"`
- Shared uint64 `json:",omitempty"`
- Status string `json:",omitempty"`
- Storage string `json:",omitempty"`
- Tags string `json:",omitempty"`
- Template uint64 `json:",omitempty"`
- Uptime uint64 `json:",omitempty"`
- VMID uint64 `json:",omitempty"`
-}
-
-type Ceph struct {
- client *Client
-}
-
-type ClusterCephStatus struct {
- ElectionEpoch int `json:"election_epoch"`
- Fsid string `json:"fsid"`
- Fsmap CephFsMap `json:"fsmap"`
- Health CephHealth `json:"health"`
- Mgrmap CephMgrMap `json:"mgrmap"`
- Monmap CephMonMap `json:"monmap"`
- Osdmap CephOsdMap `json:"osdmap"`
- Pgmap CephPgMap `json:"pgmap"`
- ProgressEvents struct{} `json:"progress_events"`
- Quorum []int `json:"quorum"`
- QuorumAge int `json:"quorum_age"`
- QuorumNames []string `json:"quorum_names"`
- Servicemap CephServiceMap `json:"servicemap"`
-}
-
-type CephHealthCheckName string
-type CephHealthCheckDetail struct {
- Message string `json:"message"`
-}
-type CephHealthCheckSummary struct {
- Count int `json:"count"`
- Message string `json:"message"`
-}
-type CephHealthCheck struct {
- Detail []CephHealthCheckDetail `json:"detail"`
- Muted bool `json:"muted"`
- Severity string `json:"severity"`
- Summary CephHealthCheckSummary `json:"summary"`
-}
-
-type CephHealth struct {
- Checks map[CephHealthCheckName]CephHealthCheck `json:"checks"`
- Mutes []interface{} `json:"mutes"`
- Status string `json:"status"`
-}
-
-type CephOsdMap struct {
- Epoch int `json:"epoch"`
- NumInOsds int `json:"num_in_osds"`
- NumOsds int `json:"num_osds"`
- NumRemappedPgs int `json:"num_remapped_pgs"`
- NumUpOsds int `json:"num_up_osds"`
- OsdInSince int `json:"osd_in_since"`
- OsdUpSince int `json:"osd_up_since"`
-}
-
-type CephPgMap struct {
- BytesAvail int64 `json:"bytes_avail"`
- BytesTotal int64 `json:"bytes_total"`
- BytesUsed int64 `json:"bytes_used"`
- DataBytes int64 `json:"data_bytes"`
- NumObjects int `json:"num_objects"`
- NumPgs int `json:"num_pgs"`
- NumPools int `json:"num_pools"`
- PgsByState []struct {
- Count int `json:"count"`
- StateName string `json:"state_name"`
- } `json:"pgs_by_state"`
- ReadBytesSec int `json:"read_bytes_sec"`
- ReadOpPerSec int `json:"read_op_per_sec"`
- WriteBytesSec int `json:"write_bytes_sec"`
- WriteOpPerSec int `json:"write_op_per_sec"`
-}
-
-type CephMonMap struct {
- Created time.Time `json:"created"`
- DisallowedLeaders string `json:"disallowed_leaders: "`
- ElectionStrategy int `json:"election_strategy"`
- Epoch int `json:"epoch"`
- Features CephMonFeatures `json:"features"`
- Fsid string `json:"fsid"`
- MinMonRelease int `json:"min_mon_release"`
- MinMonReleaseName string `json:"min_mon_release_name"`
- Modified time.Time `json:"modified"`
- Mons []CephMon `json:"mons"`
- Quorum []int `json:"quorum"`
- RemovedRanks string `json:"removed_ranks: "`
- StretchMode bool `json:"stretch_mode"`
- TiebreakerMon string `json:"tiebreaker_mon"`
-}
-
-type CephMon struct {
- Addr string `json:"addr"`
- CrushLocation string `json:"crush_location"`
- Name string `json:"name"`
- Priority int `json:"priority"`
- Rank int `json:"rank"`
- Weight int `json:"weight"`
- PublicAddr string `json:"public_addr"`
- PublicAddrs struct {
- Addrvec []CephMgrAddrVector `json:"addrvec"`
- } `json:"public_addrs"`
-}
-
-type CephMonFeatures struct {
- Optional []interface{} `json:"optional"`
- Persistent []string `json:"persistent"`
-}
-
-type CephFsMap struct {
- ByRank []struct {
- FilesystemID int `json:"filesystem_id"`
- Gid int `json:"gid"`
- Name string `json:"name"`
- Rank int `json:"rank"`
- Status string `json:"status"`
- } `json:"by_rank"`
- Epoch int `json:"epoch"`
- ID int `json:"id"`
- In int `json:"in"`
- Max int `json:"max"`
- Up int `json:"up"`
- UpStandby int `json:"up:standby"`
-}
-
-type CephServiceMap struct {
- Epoch int `json:"epoch"`
- Modified string `json:"modified"`
- Services struct{} `json:"services"`
-}
-
-type CephMgrMap struct {
- ActiveAddr string `json:"active_addr"`
- ActiveAddrs CephMgrActiveAddresses `json:"active_addrs"`
- ActiveChange string `json:"active_change"`
- ActiveClients []CephMgrActiveClient `json:"active_clients"`
- ActiveGid int `json:"active_gid"`
- ActiveMgrFeatures int64 `json:"active_mgr_features"`
- ActiveName string `json:"active_name"`
- AlwaysOnModules CephMgrAlwaysOnModules `json:"always_on_modules"`
- Available bool `json:"available"`
- AvailableModules []CephMgrAvailableModule `json:"available_modules"`
- Epoch int `json:"epoch"`
- LastFailureOsdEpoch int `json:"last_failure_osd_epoch"`
- Modules []string `json:"modules"`
- Services CephMgrServices `json:"services"`
- Standbys []CephMgrStandby `json:"standbys"`
-}
-
-type CephMgrAvailableModule struct {
- CanRun bool `json:"can_run"`
- ErrorString string `json:"error_string"`
- ModuleOptions CephMgrAvailableModuleOptions `json:"module_options"`
- Name string `json:"name"`
-}
-
-type CephMgrAvailableModuleOptions struct {
- Interval CephMgrAvailableModuleOption `json:"interval"`
- LogLevel CephMgrAvailableModuleOption `json:"log_level"`
- LogToCluster CephMgrAvailableModuleOption `json:"log_to_cluster"`
- LogToClusterLevel CephMgrAvailableModuleOption `json:"log_to_cluster_level"`
- LogToFile CephMgrAvailableModuleOption `json:"log_to_file"`
- SMTPDestination CephMgrAvailableModuleOption `json:"smtp_destination"`
- SMTPFromName CephMgrAvailableModuleOption `json:"smtp_from_name"`
- SMTPHost CephMgrAvailableModuleOption `json:"smtp_host"`
- SMTPPassword CephMgrAvailableModuleOption `json:"smtp_password"`
- SMTPPort CephMgrAvailableModuleOption `json:"smtp_port"`
- SMTPSender CephMgrAvailableModuleOption `json:"smtp_sender"`
- SMTPSsl CephMgrAvailableModuleOption `json:"smtp_ssl"`
- SMTPUser CephMgrAvailableModuleOption `json:"smtp_user"`
-}
-
-type CephMgrAvailableModuleOption struct {
- DefaultValue string `json:"default_value"`
- Desc string `json:"desc"`
- EnumAllowed []string `json:"enum_allowed"`
- Flags int `json:"flags"`
- Level string `json:"level"`
- LongDesc string `json:"long_desc"`
- Max string `json:"max"`
- Min string `json:"min"`
- Name string `json:"name"`
- SeeAlso []interface{} `json:"see_also"`
- Tags []interface{} `json:"tags"`
- Type string `json:"type"`
-}
-
-type CephMgrServices struct {
- Dashboard string `json:"dashboard"`
- Prometheus string `json:"prometheus"`
-}
-
-type CephMgrStandby struct {
- AvailableModules []CephMgrAvailableModule `json:"available_modules"`
- Gid int `json:"gid"`
- MgrFeatures int64 `json:"mgr_features"`
- Name string `json:"name"`
-}
-
-type CephMgrActiveAddresses struct {
- Addrvec []CephMgrAddrVector `json:"addrvec"`
-}
-
-type CephMgrAddrVector struct {
- Addr string `json:"addr"`
- Nonce int `json:"nonce"`
- Type string `json:"type"`
-}
-
-type CephMgrActiveClient struct {
- Addrvec []CephMgrAddrVector `json:"addrvec"`
- Name string `json:"name"`
-}
-
-type CephMgrAlwaysOnModules struct {
- Octopus []string `json:"octopus"`
- Pacific []string `json:"pacific"`
- Quincy []string `json:"quincy"`
- Reef []string `json:"reef"`
- Squid []string `json:"squid"`
-}
-
-type NodeStatuses []*NodeStatus
-type NodeStatus struct {
- // shared
- Status string `json:",omitempty"`
- Level string `json:",omitempty"`
- ID string `json:",omitempty"` // format "node/"
-
- // from /nodes endpoint
- Node string `json:",omitempty"`
- Type string `json:",omitempty"`
- MaxCPU int `json:",omitempty"`
- MaxMem uint64 `json:",omitempty"`
- Disk uint64 `json:",omitempty"`
- SSLFingerprint string `json:"ssl_fingerprint,omitempty"`
- MaxDisk uint64 `json:",omitempty"`
- Mem uint64 `json:",omitempty"`
- CPU float64 `json:",omitempty"`
- Uptime uint64 `json:",omitempty"`
-
- // from /cluster endpoint
- NodeID int `json:",omitempty"` // the internal id of the node
- Name string `json:",omitempty"`
- IP string `json:",omitempty"`
- Online int `json:",omitempty"`
- Local int `json:",omitempty"`
-}
-
-type Node struct {
- Name string
- client *Client
- Kversion string
- LoadAvg []string
- CPU float64
- RootFS RootFS
- PVEVersion string
- CPUInfo CPUInfo
- Swap Memory
- Idle int
- Memory Memory
- Ksm Ksm
- Uptime uint64
- Wait float64
-}
-
-type VirtualMachines []*VirtualMachine
-type VirtualMachine struct {
- client *Client
- VirtualMachineConfig *VirtualMachineConfig
-
- Name string
- Node string
-
- Agent IntOrBool
- NetIn uint64
- CPUs int
- DiskWrite uint64
- Status string
- Lock string `json:",omitempty"`
- VMID StringOrUint64
- PID StringOrUint64
- Netout uint64
- Disk uint64
- Mem uint64
- CPU float64
- MaxMem uint64
- MaxDisk uint64
- DiskRead uint64
- QMPStatus string `json:"qmpstatus,omitempty"`
- RunningMachine string `json:"running-machine,omitempty"`
- RunningQemu string `json:"running-qemu,omitempty"`
- Tags string `json:"tags,omitempty"`
- Uptime uint64
- Template IsTemplate // empty str if a vm, int 1 if a template
- HA HA `json:",omitempty"`
-}
-
-type HA struct {
- Managed int
-}
-
-type RootFS struct {
- Avail uint64
- Total uint64
- Free uint64
- Used uint64
-}
-
-type CPUInfo struct {
- UserHz int `json:"user_hz"`
- MHZ StringOrInt
- Model string
- Cores int
- Sockets int
- Flags string
- CPUs int
- HVM string
-}
-
-type Memory struct {
- Used uint64
- Free uint64
- Total uint64
-}
-
-type Ksm struct {
- Shared int64
-}
-
-type Time struct {
- Timezone string
- Time uint64
- Localtime uint64
-}
-
-type Timeframe string
-
-const (
- TimeframeHour = Timeframe("hour")
- TimeframeDay = Timeframe("day")
- TimeframeWeek = Timeframe("week")
- TimeframeMonth = Timeframe("month")
- TimeframeYear = Timeframe("year")
-)
-
-type ConsolidationFunction string
-
-const (
- AVERAGE = ConsolidationFunction("AVERAGE")
- MAX = ConsolidationFunction("MAX")
-)
-
-type RRDData struct {
- Time uint64
- CPU float64
- MaxCPU int
- Mem float64
- MaxMem uint64
- Disk int
- MaxDisk uint64
- DiskRead float64
- DiskWrite float64
- NetIn float64
- NetOut float64
-}
-
-// VirtualMachineOptions A key/value pair used to modify a virtual machine config
-// Refer to https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/qemu/{vmid}/config for a list of valid values
-type VirtualMachineOptions []*VirtualMachineOption
-type VirtualMachineOption struct {
- Name string
- Value interface{}
-}
-
-type VirtualMachineConfig struct {
- // PVE Metadata
- Digest string `json:"digest"`
- Name string `json:"name,omitempty"`
- Description string `json:"description,omitempty"`
- Meta string `json:"meta,omitempty"`
- VMGenID string `json:"vmgenid,omitempty"`
- Hookscript string `json:"hookscript,omitempty"`
- Hotplug string `json:"hotplug,omitempty"`
- Template int `json:"template,omitempty"`
- Agent string `json:"agent,omitempty"`
- Autostart int `json:"autostart,omitempty"`
- Tablet int `json:"tablet,omitempty"`
- KVM int `json:"kvm,omitempty"`
-
- Tags string `json:"tags,omitempty"`
- TagsSlice []string `json:"-"` // internal helper to manage tags easier
-
- Protection int `json:"protection,omitempty"`
- Lock string `json:"lock,omitempty"`
-
- // Boot configuration
- Boot string `json:"boot,omitempty"`
- OnBoot int `json:"onboot,omitempty"`
-
- // Qemu general specs
- OSType string `json:"ostype,omitempty"`
- Machine string `json:"machine,omitempty"`
- Args string `json:"args,omitempty"`
-
- // Qemu firmware specs
- Bios string `json:"bios,omitempty"`
- EFIDisk0 string `json:"efidisk0,omitempty"`
- SMBios1 string `json:"smbios1,omitempty"`
- Acpi int `json:"acpi,omitempty"`
-
- // Qemu CPU specs
- Sockets int `json:"sockets,omitempty"`
- Cores int `json:"cores,omitempty"`
- CPU string `json:"cpu,omitempty"`
- CPULimit StringOrFloat64 `json:"cpulimit,omitempty"`
- CPUUnits int `json:"cpuunits,omitempty"`
- Vcpus int `json:"vcpus,omitempty"`
- Affinity string `json:"affinity,omitempty"`
-
- // Qemu memory specs
- Numa int `json:"numa,omitempty"`
- Memory StringOrInt `json:"memory,omitempty"` // See commit 7f8c808772979f274cdfac1dc7264771a3b7a7ae on qemu-server
- Hugepages string `json:"hugepages,omitempty"`
- Balloon int `json:"balloon,omitempty"`
-
- // Other Qemu devices
- VGA string `json:"vga,omitempty"`
- SCSIHW string `json:"scsihw,omitempty"`
- TPMState0 string `json:"tpmstate0,omitempty"`
- Rng0 string `json:"rng0,omitempty"`
- Audio0 string `json:"audio0,omitempty"`
-
- // Disk devices
- IDEs map[string]string `json:"-"`
- IDE0 string `json:"ide0,omitempty"`
- IDE1 string `json:"ide1,omitempty"`
- IDE2 string `json:"ide2,omitempty"`
- IDE3 string `json:"ide3,omitempty"`
-
- SCSIs map[string]string `json:"-"`
- SCSI0 string `json:"scsi0,omitempty"`
- SCSI1 string `json:"scsi1,omitempty"`
- SCSI2 string `json:"scsi2,omitempty"`
- SCSI3 string `json:"scsi3,omitempty"`
- SCSI4 string `json:"scsi4,omitempty"`
- SCSI5 string `json:"scsi5,omitempty"`
- SCSI6 string `json:"scsi6,omitempty"`
- SCSI7 string `json:"scsi7,omitempty"`
- SCSI8 string `json:"scsi8,omitempty"`
- SCSI9 string `json:"scsi9,omitempty"`
- SCSI10 string `json:"scsi10,omitempty"`
- SCSI11 string `json:"scsi11,omitempty"`
- SCSI12 string `json:"scsi12,omitempty"`
- SCSI13 string `json:"scsi13,omitempty"`
- SCSI14 string `json:"scsi14,omitempty"`
- SCSI15 string `json:"scsi15,omitempty"`
- SCSI16 string `json:"scsi16,omitempty"`
- SCSI17 string `json:"scsi17,omitempty"`
- SCSI18 string `json:"scsi18,omitempty"`
- SCSI19 string `json:"scsi19,omitempty"`
- SCSI20 string `json:"scsi20,omitempty"`
- SCSI21 string `json:"scsi21,omitempty"`
- SCSI22 string `json:"scsi22,omitempty"`
- SCSI23 string `json:"scsi23,omitempty"`
- SCSI24 string `json:"scsi24,omitempty"`
- SCSI25 string `json:"scsi25,omitempty"`
- SCSI26 string `json:"scsi26,omitempty"`
- SCSI27 string `json:"scsi27,omitempty"`
- SCSI28 string `json:"scsi28,omitempty"`
- SCSI29 string `json:"scsi29,omitempty"`
- SCSI30 string `json:"scsi30,omitempty"`
-
- SATAs map[string]string `json:"-"`
- SATA0 string `json:"sata0,omitempty"`
- SATA1 string `json:"sata1,omitempty"`
- SATA2 string `json:"sata2,omitempty"`
- SATA3 string `json:"sata3,omitempty"`
- SATA4 string `json:"sata4,omitempty"`
- SATA5 string `json:"sata5,omitempty"`
-
- VirtIOs map[string]string `json:"-"`
- VirtIO0 string `json:"virtio0,omitempty"`
- VirtIO1 string `json:"virtio1,omitempty"`
- VirtIO2 string `json:"virtio2,omitempty"`
- VirtIO3 string `json:"virtio3,omitempty"`
- VirtIO4 string `json:"virtio4,omitempty"`
- VirtIO5 string `json:"virtio5,omitempty"`
- VirtIO6 string `json:"virtio6,omitempty"`
- VirtIO7 string `json:"virtio7,omitempty"`
- VirtIO8 string `json:"virtio8,omitempty"`
- VirtIO9 string `json:"virtio9,omitempty"`
- VirtIO10 string `json:"virtio10,omitempty"`
- VirtIO11 string `json:"virtio11,omitempty"`
- VirtIO12 string `json:"virtio12,omitempty"`
- VirtIO13 string `json:"virtio13,omitempty"`
- VirtIO14 string `json:"virtio14,omitempty"`
- VirtIO15 string `json:"virtio15,omitempty"`
-
- Unuseds map[string]string `json:"-"`
- Unused0 string `json:"unused0,omitempty"`
- Unused1 string `json:"unused1,omitempty"`
- Unused2 string `json:"unused2,omitempty"`
- Unused3 string `json:"unused3,omitempty"`
- Unused4 string `json:"unused4,omitempty"`
- Unused5 string `json:"unused5,omitempty"`
- Unused6 string `json:"unused6,omitempty"`
- Unused7 string `json:"unused7,omitempty"`
- Unused8 string `json:"unused8,omitempty"`
- Unused9 string `json:"unused9,omitempty"`
-
- // Network devices
- Nets map[string]string `json:"-"`
- Net0 string `json:"net0,omitempty"`
- Net1 string `json:"net1,omitempty"`
- Net2 string `json:"net2,omitempty"`
- Net3 string `json:"net3,omitempty"`
- Net4 string `json:"net4,omitempty"`
- Net5 string `json:"net5,omitempty"`
- Net6 string `json:"net6,omitempty"`
- Net7 string `json:"net7,omitempty"`
- Net8 string `json:"net8,omitempty"`
- Net9 string `json:"net9,omitempty"`
-
- // NUMA topology
- Numas map[string]string `json:"-"`
- Numa0 string `json:"numa0,omitempty"`
- Numa1 string `json:"numa1,omitempty"`
- Numa2 string `json:"numa2,omitempty"`
- Numa3 string `json:"numa3,omitempty"`
- Numa4 string `json:"numa4,omitempty"`
- Numa5 string `json:"numa5,omitempty"`
- Numa6 string `json:"numa6,omitempty"`
- Numa7 string `json:"numa7,omitempty"`
- Numa8 string `json:"numa8,omitempty"`
- Numa9 string `json:"numa9,omitempty"`
-
- // Host PCI devices
- HostPCIs map[string]string `json:"-"`
- HostPCI0 string `json:"hostpci0,omitempty"`
- HostPCI1 string `json:"hostpci1,omitempty"`
- HostPCI2 string `json:"hostpci2,omitempty"`
- HostPCI3 string `json:"hostpci3,omitempty"`
- HostPCI4 string `json:"hostpci4,omitempty"`
- HostPCI5 string `json:"hostpci5,omitempty"`
- HostPCI6 string `json:"hostpci6,omitempty"`
- HostPCI7 string `json:"hostpci7,omitempty"`
- HostPCI8 string `json:"hostpci8,omitempty"`
- HostPCI9 string `json:"hostpci9,omitempty"`
-
- // Serial devices
- Serials map[string]string `json:"-"`
- Serial0 string `json:"serial0,omitempty"`
- Serial1 string `json:"serial1,omitempty"`
- Serial2 string `json:"serial2,omitempty"`
- Serial3 string `json:"serial3,omitempty"`
-
- // USB devices
- USBs map[string]string `json:"-"`
- USB0 string `json:"usb0,omitempty"`
- USB1 string `json:"usb1,omitempty"`
- USB2 string `json:"usb2,omitempty"`
- USB3 string `json:"usb3,omitempty"`
- USB4 string `json:"usb4,omitempty"`
- USB5 string `json:"usb5,omitempty"`
- USB6 string `json:"usb6,omitempty"`
- USB7 string `json:"usb7,omitempty"`
- USB8 string `json:"usb8,omitempty"`
- USB9 string `json:"usb9,omitempty"`
- USB10 string `json:"usb10,omitempty"`
- USB11 string `json:"usb11,omitempty"`
- USB12 string `json:"usb12,omitempty"`
- USB13 string `json:"usb13,omitempty"`
- USB14 string `json:"usb14,omitempty"`
-
- // Parallel devices
- Parallels map[string]string `json:"-"`
- Parallel0 string `json:"parallel0,omitempty"`
- Parallel1 string `json:"parallel1,omitempty"`
- Parallel2 string `json:"parallel2,omitempty"`
-
- // Cloud-init
- CIType string `json:"citype,omitempty"`
- CIUser string `json:"ciuser,omitempty"`
- CIPassword string `json:"cipassword,omitempty"`
- Nameserver string `json:"nameserver,omitempty"`
- Searchdomain string `json:"searchdomain,omitempty"`
- SSHKeys string `json:"sshkeys,omitempty"`
- CICustom string `json:"cicustom,omitempty"`
- CIUpgrade int `json:"ciupgrade,omitempty"`
-
- // Cloud-init interfaces
- IPConfigs map[string]string `json:"-"`
- IPConfig0 string `json:"ipconfig0,omitempty"`
- IPConfig1 string `json:"ipconfig1,omitempty"`
- IPConfig2 string `json:"ipconfig2,omitempty"`
- IPConfig3 string `json:"ipconfig3,omitempty"`
- IPConfig4 string `json:"ipconfig4,omitempty"`
- IPConfig5 string `json:"ipconfig5,omitempty"`
- IPConfig6 string `json:"ipconfig6,omitempty"`
- IPConfig7 string `json:"ipconfig7,omitempty"`
- IPConfig8 string `json:"ipconfig8,omitempty"`
- IPConfig9 string `json:"ipconfig9,omitempty"`
-}
-
-type VirtualMachineMigrateOptions struct {
- Target string `json:"target"`
- BWLimit uint64 `json:"bwlimit,omitempty"`
- Force IntOrBool `json:"force,omitempty"`
- MigrationNetwork string `json:"migration_network,omitempty"`
- MigrationType string `json:"migration_type,omitempty"`
- Online IntOrBool `json:"online,omitempty"`
- TargetStorage string `json:"targetstorage,omitempty"`
- WithLocalDisks IntOrBool `json:"with-local-disks,omitempty"`
-}
-
-type ContainerMigrateOptions struct {
- Target string `json:"target"`
- BWLimit uint64 `json:"bwlimit,omitempty"`
- Online IntOrBool `json:"online,omitempty"`
- Restart IntOrBool `json:"restart,omitempty"`
-}
-
-type VirtualMachineCloneOptions struct {
- NewID int `json:"newid"`
- BWLimit uint64 `json:"bwlimit,omitempty"`
- Description string `json:"description,omitempty"`
- Format string `json:"format,omitempty"`
- Full uint8 `json:"full,omitempty"`
- Name string `json:"name,omitempty"`
- Pool string `json:"pool,omitempty"`
- SnapName string `json:"snapname,omitempty"`
- Storage string `json:"storage,omitempty"`
- Target string `json:"target,omitempty"`
-}
-
-type VirtualMachineMoveDiskOptions struct {
- Disk string `json:"disk"`
- BWLimit uint64 `json:"bwlimit,omitempty"`
- Delete uint8 `json:"delete,omitempty"`
- Digest string `json:"digest,omitempty"`
- Format string `json:"format,omitempty"`
- Storage string `json:"storage,omitempty"`
- TargetDigest string `json:"target-digest,omitempty"`
- TargetDisk string `json:"target-disk,omitempty"`
- TargetVMID int `json:"target-vmid,omitempty"`
-}
-
-type UPID string
-
-type Tasks []*Task
-type Task struct {
- client *Client
- UPID UPID
- ID string
- Type string
- User string
- Status string
- Node string
- PID uint64 `json:",omitempty"`
- PStart uint64 `json:",omitempty"`
- Saved string `json:",omitempty"`
- ExitStatus string `json:",omitempty"`
- IsCompleted bool
- IsRunning bool
- IsFailed bool
- IsSuccessful bool
- StartTime time.Time `json:"-"`
- EndTime time.Time `json:"-"`
- Duration time.Duration `json:"-"`
-}
-
-func (t *Task) UnmarshalJSON(b []byte) error {
- var tmp map[string]interface{}
- if err := json.Unmarshal(b, &tmp); err != nil {
- return err
- }
-
- type TempTask Task
- var task TempTask
- if err := json.Unmarshal(b, &task); err != nil {
- return err
- }
-
- if starttime, ok := tmp["starttime"]; ok {
- task.StartTime = time.Unix(int64(starttime.(float64)), 0)
- }
-
- if endtime, ok := tmp["endtime"]; ok {
- task.EndTime = time.Unix(int64(endtime.(float64)), 0)
- }
-
- if !task.StartTime.IsZero() && !task.EndTime.IsZero() {
- task.Duration = task.EndTime.Sub(task.StartTime)
- }
-
- c := Task(task)
- return copier.Copy(t, &c)
-}
-
-type Log map[int]string
-
-// line numbers in the response start a 1 but the start param indexes from 0 so converting to that
-func (l *Log) UnmarshalJSON(b []byte) error {
- var data []map[string]interface{}
- if err := json.Unmarshal(b, &data); err != nil {
- return err
- }
-
- log := make(map[int]string, len(data))
- for _, row := range data {
- if n, ok := row["n"]; ok {
- if t, ok := row["t"]; ok {
- log[int(n.(float64))-1] = t.(string)
- }
- }
- }
-
- return copier.Copy(l, Log(log))
-}
-
-type Containers []*Container
-type Container struct {
- client *Client
- ContainerConfig *ContainerConfig
-
- CPUs int
- MaxDisk uint64
- MaxMem uint64
- MaxSwap uint64
- Name string
- Node string
- Status string
- Tags string
- Uptime uint64
- VMID StringOrUint64
-}
-
-type ContainerExecOptions struct {
- Command string `json:"command"`
- ExtraArgs []string `json:"extra-args,omitempty"`
- InputData string `json:"input-data,omitempty"`
- Environment []string `json:"environment,omitempty"`
- Timeout int `json:"timeout,omitempty"`
- Tty bool `json:"tty,omitempty"`
-}
-
-type ContainerExecResult struct {
- PID StringOrInt `json:"pid"`
-}
-
-type ContainerExecStatus struct {
- Exited IntOrBool `json:"exited,omitempty"`
- ExitStatus int `json:"exitstatus,omitempty"`
- Signal string `json:"signal,omitempty"`
- OutData string `json:"out-data,omitempty"`
- ErrData string `json:"err-data,omitempty"`
-}
-
-type ContainerInterfaces []*ContainerInterface
-
-type ContainerInterface struct {
- HWAddr string `json:"hwaddr,omitempty"`
- Name string `json:"name,omitempty"`
- Inet string `json:"inet,omitempty"`
- Inet6 string `json:"inet6,omitempty"`
-}
-
-type ContainerCloneOptions struct {
- NewID int `json:"newid"`
- BWLimit uint64 `json:"bwlimit,omitempty"`
- Description string `json:"description,omitempty"`
- Full uint8 `json:"full,omitempty"`
- Hostname string `json:"hostname,omitempty"`
- Pool string `json:"pool,omitempty"`
- SnapName string `json:"snapname,omitempty"`
- Storage string `json:"storage,omitempty"`
- Target string `json:"target,omitempty"`
-}
-
-type ContainerConfig struct {
- Arch string `json:"arch,omitempty"`
- CMode string `json:"cmode,omitempty"`
- Console IntOrBool `json:"console,omitempty"`
- Cores int `json:"cores,omitempty"`
- CPULimit int `json:"cpulimit,omitempty"`
- CPUUnits int `json:"cpuunits,omitempty"`
- Debug IntOrBool `json:"debug,omitempty"`
- Description string `json:"description,omitempty"`
- Devs map[string]string `json:"-"` // internal helper for Dev0..9
- Dev0 string `json:"dev0,omitempty"`
- Dev1 string `json:"dev1,omitempty"`
- Dev2 string `json:"dev2,omitempty"`
- Dev3 string `json:"dev3,omitempty"`
- Dev4 string `json:"dev4,omitempty"`
- Dev5 string `json:"dev5,omitempty"`
- Dev6 string `json:"dev6,omitempty"`
- Dev7 string `json:"dev7,omitempty"`
- Dev8 string `json:"dev8,omitempty"`
- Dev9 string `json:"dev9,omitempty"`
- Digest string `json:"digest"`
- Features string `json:"features,omitempty"`
- HookScript string `json:"hookscript,omitempty"`
- LXC [][]string `json:"lxc,omitempty"`
- Hostname string `json:"hostname,omitempty"`
- Lock string `json:"lock,omitempty"`
- Memory int `json:"memory,omitempty"`
- Mps map[string]string `json:"-"` // internal helper for Mp0..9
- Mp0 string `json:"mp0,omitempty"`
- Mp1 string `json:"mp1,omitempty"`
- Mp2 string `json:"mp2,omitempty"`
- Mp3 string `json:"mp3,omitempty"`
- Mp4 string `json:"mp4,omitempty"`
- Mp5 string `json:"mp5,omitempty"`
- Mp6 string `json:"mp6,omitempty"`
- Mp7 string `json:"mp7,omitempty"`
- Mp8 string `json:"mp8,omitempty"`
- Mp9 string `json:"mp9,omitempty"`
- Nameserver string `json:"nameserver,omitempty"`
- Nets map[string]string `json:"-"` // internal helper for Net0..9
- Net0 string `json:"net0,omitempty"`
- Net1 string `json:"net1,omitempty"`
- Net2 string `json:"net2,omitempty"`
- Net3 string `json:"net3,omitempty"`
- Net4 string `json:"net4,omitempty"`
- Net5 string `json:"net5,omitempty"`
- Net6 string `json:"net6,omitempty"`
- Net7 string `json:"net7,omitempty"`
- Net8 string `json:"net8,omitempty"`
- Net9 string `json:"net9,omitempty"`
- OnBoot IntOrBool `json:"onboot,omitempty"`
- OSType string `json:"ostype,omitempty"`
- Protection IntOrBool `json:"protection,omitempty"`
- RootFS string `json:"rootfs,omitempty"`
- SearchDomain string `json:"searchdomain:omitempty"`
- Startup string `json:"startup:omitempty"`
- Swap int `json:"swap,omitempty"`
- TagsSlice []string `json:"-"` // internal helper to manage tags easier
- Tags string `json:"tags,omitempty"`
- Template IntOrBool `json:"template,omitempty"`
- Timezone string `json:"timezone,omitempty"`
- TTY int `json:"tty,omitempty"`
- Unprivileged IntOrBool `json:"unprivileged,omitempty"`
- Unuseds map[string]string `json:"-"` // internal helper
- Unused0 string `json:"unused0,omitempty"`
- Unused1 string `json:"unused1,omitempty"`
- Unused2 string `json:"unused2,omitempty"`
- Unused3 string `json:"unused3,omitempty"`
- Unused4 string `json:"unused4,omitempty"`
- Unused5 string `json:"unused5,omitempty"`
- Unused6 string `json:"unused6,omitempty"`
- Unused7 string `json:"unused7,omitempty"`
- Unused8 string `json:"unused8,omitempty"`
- Unused9 string `json:"unused9,omitempty"`
-}
-
-func (cc *ContainerConfig) UnmarshalJSON(data []byte) error {
- type tmpContainerConfig ContainerConfig
-
- // create a struct and embed temporary alias of ContainerConfig to avoid recursion
- // this will also populate the rest of the fields using the built in unmarshal function
- tmp := &struct {
- *tmpContainerConfig
- }{
- tmpContainerConfig: (*tmpContainerConfig)(cc),
- }
- if err := json.Unmarshal(data, &tmp); err != nil {
- return err
- }
-
- // Split the tags on TagSeparator and populate TagsSlice
- cc.TagsSlice = strings.Split(cc.Tags, TagSeperator)
-
- // Populate the indexed fields into helper maps
- cc.MergeDevs()
- cc.MergeMps()
- cc.MergeNets()
- cc.MergeUnuseds()
-
- return nil
-}
-
-// ContainerOptions A key/value pair used to modify a container(LXC) config
-// Refer to https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/lxc/{vmid}/config for a list of valid values
-type ContainerOptions []*ContainerOption
-type ContainerOption struct {
- Name string
- Value interface{}
-}
-
-type Appliances []*Appliance
-type Appliance struct {
- client *Client
- Node string `json:",omitempty"`
- Os string
- Source string
- Type string
- SHA512Sum string
- Package string
- Template string
- Architecture string
- InfoPage string
- Description string
- ManageURL string
- Version string
- Section string
- Headline string
-}
-
-type Storages []*Storage
-type Storage struct {
- client *Client
- Node string
- Name string `json:"storage"`
- Enabled int
- UsedFraction float64 `json:"used_fraction"`
- Active int
- Content string
- Shared int
- Avail uint64
- Type string
- Used uint64
- Total uint64
- Storage string
-}
-
-// UnmarshalJSON implements custom unmarshaling for Storage to handle large values
-// that may be returned as floats in scientific notation (e.g., values > 1PB)
-func (s *Storage) UnmarshalJSON(b []byte) error {
- // Temporary struct to capture raw JSON with json.Number for numeric fields
- aux := &struct {
- Node string `json:"node,omitempty"`
- Name string `json:"storage,omitempty"`
- Enabled json.Number `json:"enabled,omitempty"`
- UsedFraction json.Number `json:"used_fraction,omitempty"`
- Active json.Number `json:"active,omitempty"`
- Content string `json:"content,omitempty"`
- Shared json.Number `json:"shared,omitempty"`
- Avail json.Number `json:"avail,omitempty"`
- Type string `json:"type,omitempty"`
- Used json.Number `json:"used,omitempty"`
- Total json.Number `json:"total,omitempty"`
- }{}
-
- // Decode with UseNumber to preserve precision
- decoder := json.NewDecoder(bytes.NewReader(b))
- decoder.UseNumber()
- if err := decoder.Decode(&aux); err != nil {
- return err
- }
-
- // Copy string fields
- s.Node = aux.Node
- s.Name = aux.Name
- s.Storage = aux.Name // Storage field gets same value as Name
- s.Content = aux.Content
- s.Type = aux.Type
-
- // Convert json.Number values to appropriate types
- if aux.Enabled != "" {
- if val, err := aux.Enabled.Int64(); err == nil {
- s.Enabled = int(val)
- }
- }
-
- if aux.Active != "" {
- if val, err := aux.Active.Int64(); err == nil {
- s.Active = int(val)
- }
- }
-
- if aux.Shared != "" {
- if val, err := aux.Shared.Int64(); err == nil {
- s.Shared = int(val)
- }
- }
-
- if aux.Avail != "" {
- // Try int64 first, then fall back to float64 for scientific notation
- if val, err := aux.Avail.Int64(); err == nil {
- s.Avail = uint64(val)
- } else if val, err := aux.Avail.Float64(); err == nil {
- s.Avail = uint64(val)
- }
- }
-
- if aux.Used != "" {
- // Try int64 first, then fall back to float64 for scientific notation
- if val, err := aux.Used.Int64(); err == nil {
- s.Used = uint64(val)
- } else if val, err := aux.Used.Float64(); err == nil {
- s.Used = uint64(val)
- }
- }
-
- if aux.Total != "" {
- // Try int64 first, then fall back to float64 for scientific notation
- if val, err := aux.Total.Int64(); err == nil {
- s.Total = uint64(val)
- } else if val, err := aux.Total.Float64(); err == nil {
- s.Total = uint64(val)
- }
- }
-
- if aux.UsedFraction != "" {
- if val, err := aux.UsedFraction.Float64(); err == nil {
- s.UsedFraction = val
- }
- }
-
- return nil
-}
-
-// UnmarshalJSON implements custom unmarshaling for Storages slice
-func (storages *Storages) UnmarshalJSON(b []byte) error {
- var items []*Storage
- if err := json.Unmarshal(b, &items); err != nil {
- return err
- }
- *storages = items
- return nil
-}
-
-type ClusterStorages []*ClusterStorage
-
-type ClusterStorage struct {
- client *Client
- Content string
- Digest string
- Storage string
- Type string
- Shared int `json:",omitempty"`
- Nodes string `json:",omitempty"`
- Thinpool string `json:",omitempty"`
- Path string `json:",omitempty"`
- VgName string `json:",omitempty"`
-}
-
-type ClusterStorageOptions struct {
- Name string
- Value string
-}
-type Volume interface {
- Delete() error
-}
-
-type ISOs []*ISO
-type ISO struct{ Content }
-
-type VzTmpls []*VzTmpl
-type VzTmpl struct{ Content }
-
-type Imports []*Import
-type Import struct{ Content }
-
-type Backups []*Backup
-type Backup struct{ Content }
-
-type Content struct {
- client *Client
- URL string
- Node string
- Storage string `json:",omitempty"`
- Content string `json:",omitempty"`
- VolID string `json:",omitempty"`
- CTime uint64 `json:",omitempty"`
- Format string
- Size StringOrUint64
- Used StringOrUint64 `json:",omitempty"`
- Path string `json:",omitempty"`
- Notes string `json:",omitempty"`
-}
-
-type IsTemplate bool
-
-func (it *IsTemplate) UnmarshalJSON(b []byte) error {
- *it = true
- if string(b) == "\"\"" {
- *it = false
- }
-
- return nil
-}
-
-type StringOrInt int
-
-func (d *StringOrInt) UnmarshalJSON(b []byte) error {
- str := strings.ReplaceAll(string(b), "\"", "")
- if str == "" {
- *d = StringOrInt(0)
- return nil
- }
-
- if !isFloat.MatchString(str) {
- return fmt.Errorf("failed to match %s: %s", isFloat.String(), str)
- }
-
- parsed, err := strconv.ParseFloat(str, 64)
- if err != nil {
- return err
- }
-
- *d = StringOrInt(math.Trunc(parsed)) // truncate to make an int
- return nil
-}
-
-type StringOrUint64 uint64
-
-func (d *StringOrUint64) UnmarshalJSON(b []byte) error {
- str := strings.ReplaceAll(string(b), "\"", "")
- if str == "" {
- *d = StringOrUint64(0)
- return nil
- }
-
- if !isFloat.MatchString(str) {
- return fmt.Errorf("failed to match %s: %s", isFloat.String(), str)
- }
-
- parsed, err := strconv.ParseFloat(str, 64)
- if err != nil {
- return err
- }
-
- *d = StringOrUint64(math.Trunc(parsed)) // truncate to make an int
-
- return nil
-}
-
-type StringOrFloat64 float64
-
-func (d *StringOrFloat64) UnmarshalJSON(b []byte) error {
- str := strings.ReplaceAll(string(b), "\"", "")
- if str == "" {
- *d = StringOrFloat64(0)
- return nil
- }
-
- if !isFloat.MatchString(str) {
- return fmt.Errorf("failed to match %s: %s", isFloat.String(), str)
- }
-
- parsed, err := strconv.ParseFloat(str, 64)
- if err != nil {
- return err
- }
- *d = StringOrFloat64(parsed)
- return nil
-}
-
-type IntOrBool bool
-
-func (b *IntOrBool) UnmarshalJSON(i []byte) error {
- parsed, err := strconv.ParseBool(string(i))
- if err != nil {
- return err
- }
- *b = IntOrBool(parsed)
- return nil
-}
-
-func (b *IntOrBool) MarshalJSON() ([]byte, error) {
- if *b {
- return []byte("1"), nil
- }
- return []byte("0"), nil
-}
-
-type NodeNetworks []*NodeNetwork
-type NodeNetwork struct {
- client *Client
- Node string `json:"-"`
- NodeAPI *Node `json:"-"`
-
- Iface string `json:"iface,omitempty"`
- Autostart int `json:"autostart,omitempty"`
-
- CIDR string `json:"cidr,omitempty"`
- CIDR6 string `json:"cidr6,omitempty"`
- Gateway string `json:"gateway,omitempty"`
- Gateway6 string `json:"gateway6,omitempty"`
- MTU string `json:"mtu,omitempty"`
- Netmask string `json:"netmask,omitempty"`
- Netmask6 string `json:"netmask6,omitempty"`
- VLANID string `json:"vlan-id,omitempty"`
- VLANRawDevice string `json:"vlan-raw-device,omitempty"`
- BridgeVLANAware int `json:"bridge_vlan_aware,omitempty"`
- BridgePorts string `json:"bridge_ports,omitempty"`
- BridgeStp string `json:"bridge_stp,omitempty"` // not in current docs, deprecated?
- BridgeFd string `json:"bridge_fd,omitempty"` // not in current docs, deprecated?
- Comments string `json:"comments,omitempty"`
- Comments6 string `json:"comments6,omitempty"`
- BondPrimary string `json:"bond-primary,omitempty"`
- BondMode string `json:"bond_mode,omitempty"`
- BondXmit string `json:"bond_xmit,omitempty"`
- BondXmitHashPolicy string `json:"bond_xmit_hash_policy,omitempty"`
-
- OVSBonds string `json:"ovs_bonds,omitempty"`
- OVSBridge string `json:"ovs_bridge,omitempty"`
- OVSOptions string `json:"ovs_options,omitempty"`
- OVSPorts string `json:"ovs_ports,omitempty"`
- OVSTags string `json:"ovs_tag,omitempty"`
-
- Slaves string `json:"slaves,omitempty"`
- Address string `json:"address,omitempty"`
- Address6 string `json:"address6,omitempty"`
- Type string `json:"type,omitempty"`
- Active StringOrInt `json:"active,omitempty"`
- Method string `json:"method,omitempty"`
- Method6 string `json:"method6,omitempty"`
- Priority int `json:"priority,omitempty"`
-}
-
-type AgentNetworkIPAddress struct {
- IPAddressType string `json:"ip-address-type"` // ipv4 ipv6
- IPAddress string `json:"ip-address"`
- Prefix int `json:"prefix"`
- MacAddress string `json:"mac-address"`
-}
-
-type AgentNetworkIface struct {
- Name string `json:"name"`
- HardwareAddress string `json:"hardware-address"`
- IPAddresses []*AgentNetworkIPAddress `json:"ip-addresses"`
-}
-
-type AgentOsInfo struct {
- Version string `json:"version"`
- VersionID string `json:"version-id"`
- ID string `json:"id"`
- Machine string `json:"machine"`
- PrettyName string `json:"pretty-name"`
- Name string `json:"name"`
- KernelRelease string `json:"kernel-release"`
- KernelVersion string `json:"kernel-version"`
-}
-
-type AgentExecStatus struct {
- Exited int `json:"exited"`
- ErrData string `json:"err-data"`
- ErrTruncated bool `json:"err-truncated"`
- ExitCode int `json:"exitcode"`
- OutData string `json:"out-data"`
- OutTruncated IntOrBool `json:"out-truncated"`
- Signal bool `json:"signal"`
-}
-
-type FirewallSecurityGroup struct {
- client *Client
- Group string `json:"group,omitempty"`
- Comment string `json:"comment,omitempty"`
- Rules []*FirewallRule `json:"rules,omitempty"`
-}
-type FirewallRule struct {
- Type string `json:"type,omitempty"`
- Action string `json:"action,omitempty"`
- Pos int `json:"pos,omitempty"`
- Comment string `json:"comment,omitempty"`
- Dest string `json:"dest,omitempty"`
- Dport string `json:"dport,omitempty"`
- Enable int `json:"enable,omitempty"`
- IcmpType string `json:"icmp_type,omitempty"`
- Iface string `json:"iface,omitempty"`
- Log string `json:"log,omitempty"`
- Macro string `json:"macro,omitempty"`
- Proto string `json:"proto,omitempty"`
- Source string `json:"source,omitempty"`
- Sport string `json:"sport,omitempty"`
-}
-
-func (r *FirewallRule) IsEnable() bool {
- return r.Enable == 1
-}
-
-type FirewallNodeOption struct {
- Enable bool `json:"enable,omitempty"`
- LogLevelIn string `json:"log_level_in,omitempty"`
- LogLevelOut string `json:"log_level_out,omitempty"`
- LogNfConntrack bool `json:"log_nf_conntrack,omitempty"`
- Ntp bool `json:"ntp,omitempty"`
- NFConntrackAllowInvalid bool `json:"nf_conntrack_allow_invalid,omitempty"`
- NFConntrackMax int `json:"nf_conntrack_max,omitempty"`
- NFConntrackTCPTimeoutEstablished int `json:"nf_conntrack_tcp_timeout_established,omitempty"`
- NFConntrackTCPTimeoutSynRecv int `json:"nf_conntrack_tcp_timeout_syn_recv,omitempty"`
- Nosmurfs bool `json:"nosmurfs,omitempty"`
- ProtectionSynflood bool `json:"protection_synflood,omitempty"`
- ProtectionSynfloodBurst int `json:"protection_synflood_burst,omitempty"`
- ProtectionSynfloodRate int `json:"protection_synflood_rate,omitempty"`
- SmurfLogLevel string `json:"smurf_log_level,omitempty"`
- TCPFlagsLogLevel string `json:"tcp_flags_log_level,omitempty"`
- TCPflags bool `json:"tcpflags,omitempty"`
-}
-
-type FirewallVirtualMachineOption struct {
- Enable bool `json:"enable,omitempty"`
- Dhcp bool `json:"dhcp,omitempty"`
- Ipfilter bool `json:"ipfilter,omitempty"`
- LogLevelIn string `json:"log_level_in,omitempty"`
- LogLevelOut string `json:"log_level_out,omitempty"`
- Macfilter bool `json:"macfilter,omitempty"`
- Ntp bool `json:"ntp,omitempty"`
- PolicyIn string `json:"policy_in,omitempty"`
- PolicyOut string `json:"policy_out,omitempty"`
- Radv bool `json:"radv,omitempty"`
-}
-
-type Snapshot struct {
- Name string
- Vmstate int
- Description string
- Snaptime int64
- Parent string
- Snapstate string
-}
-
-type Pools []*Pool
-type Pool struct {
- client *Client
- PoolID string `json:"poolid,omitempty"`
- Comment string `json:"comment,omitempty"`
- Members []ClusterResource `json:"members,omitempty"`
-}
-
-type PoolUpdateOption struct {
- Comment string `json:"comment,omitempty"`
- // Delete objects rather than adding them
- Delete bool `json:"delete,omitempty"`
- // Comma separated lists of Storage names to add/delete to the pool
- Storage string `json:"storage,omitempty"`
- // Comma separated lists of Virtual Machine IDs to add/delete to the pool
- VirtualMachines string `json:"vms,omitempty"`
-}
-
-type DomainType string
-
-const (
- DomainTypeAD = DomainType("ad")
- DomainTypeLDAP = DomainType("ldap")
- DomainTypeOpenID = DomainType("openid")
- DomainTypePam = DomainType("pam")
- DomainTypePVE = DomainType("pve")
-)
-
-type Domains []*Domain
-type Domain struct {
- client *Client
- Realm string `json:",omitempty"`
- Type string `json:",omitempty"`
-
- // options https://pve.proxmox.com/pve-docs/api-viewer/#/access/domains
- ACRValues string `json:"acr-values,omitempty"`
- AutoCreate IntOrBool `json:"autocreate,omitempty"`
- BaseDN string `json:"base_dn,omitempty"`
- BindDN string `json:"bind_dn,omitempty"`
- CAPath string `json:"capath,omitempty"`
- CaseSensitive IntOrBool `json:"case-sensitive,omitempty"`
- Cert string `json:"cert,omitempty"`
- CertKey string `json:"certkey,omitempty"`
- ClientID string `json:"client-id,omitempty"`
- ClientKey string `json:"client-key,omitempty"`
- Comment string `json:"comment,omitempty"`
- Default IntOrBool `json:"default,omitempty"`
- DeleteList string `json:"delete,omitempty"` // a list of settings you want to delete?
- Digest string `json:"digest,omitempty"`
- Domain string `json:"domain,omitempty"`
- Filter string `json:"filter,omitempty"`
- GroupClasses string `json:"group_classes,omitempty"`
- GroupDN string `json:"group_dn,omitempty"`
- GroupFilter string `json:"group_filter,omitempty"`
- GroupName string `json:"group_name,omitempty"`
- IssuerURL string `json:"issuer-url,omitempty"`
- Mode string `json:"mode,omitempty"` // ldap, ldaps,ldap+starttls
- Password string `json:"password,omitempty"`
- Port int `json:"port,omitempty"`
- Prompt string `json:"prompt,omitempty"`
- Scopes string `json:"scopes,omitempty"`
- Secure IntOrBool `json:"secure,omitempty"`
- Server1 string `json:"server1,omitempty"`
- Server2 string `json:"server2,omitempty"`
- SSLVersion string `json:"sslversion,omitempty"`
- SyncDefaults string `json:"sync-defaults,omitempty"`
- SyncAttributes string `json:"sync_attributes,omitempty"`
- TFA string `json:"tfa,omitempty"`
- UserAttr string `json:"user_attr,omitempty"`
- UserClasses string `json:"user_classes,omitempty"`
- Verify IntOrBool `json:"verify"`
-}
-
-// DomainSyncOptions see details https://pve.proxmox.com/pve-docs/api-viewer/#/access/domains/{realm}/sync
-type DomainSyncOptions struct {
- DryRun bool `json:"dry-run,omitempty"`
- EnableNew bool `json:"enable-new,omitempty"`
- RemoveVanished string `json:"remove-vanished,omitempty"`
- Scope string `json:"scope,omitempty"` // users, groups, both
-}
-
-type Groups []*Group
-type Group struct {
- client *Client
- GroupID string `json:"groupid,omitempty"`
- Comment string `json:"comment,omitempty"`
- Users string `json:"users,omitempty"` // only populated via Groups lister
- Members []string `json:"members,omitempty"` // only populated via Group read
-}
-
-type Users []*User
-type User struct {
- client *Client
- UserID string `json:"userid,omitempty"`
- Comment string `json:"comment,omitempty"`
- Email string `json:"email,omitempty"`
- Enable IntOrBool `json:"enable"`
- Expire int `json:"expire,omitempty"`
- Firstname string `json:"firstname,omitempty"`
- Lastname string `json:"lastname,omitempty"`
- Groups []string `json:"groups,omitempty"`
- Keys string `json:"keys,omitempty"`
- Tokens map[string]Token `json:"tokens,omitempty"`
- RealmType string `json:"realm-type,omitempty"`
- TFALockedUntil string `json:"tfa-locked-until,omitempty"`
- TOTPLocked IntOrBool `json:"totp-locked,omitempty"`
-}
-
-type UserOptions struct {
- Append IntOrBool `json:"append,omitempty"`
- Comment string `json:"comment,omitempty"`
- Email string `json:"email,omitempty"`
- Enable IntOrBool `json:"enable"`
- Expire int `json:"expire,omitempty"`
- Firstname string `json:"firstname,omitempty"`
- Groups []string `json:"groups,omitempty"`
- Keys string `json:"keys,omitempty"`
- Lastname string `json:"lastname,omitempty"`
-}
-
-type Tokens []*Token
-type Token struct {
- TokenID string `json:"tokenid,omitempty"`
- Comment string `json:"comment,omitempty"`
- Expire int `json:"expire,omitempty"`
- Privsep IntOrBool `json:"privsep"`
-}
-
-type Roles []*Role
-type Role struct {
- client *Client
- RoleID string `json:"roleid,omitempty"`
- Privs string `json:"privs,omitempty"`
- Special IntOrBool `json:"special,omitempty"`
-}
-
-type ACLs []*ACL
-type ACL struct {
- Path string `json:"path,omitempty"`
- RoleID string `json:"roleid,omitempty"`
- Type string `json:"type,omitempty"`
- UGID string `json:"ugid,omitempty"`
- Propagate IntOrBool `json:"propagate,omitempty"`
-}
-
-type ACLOptions struct {
- Path string `json:"path,omitempty"`
- Roles string `json:"roles,omitempty"` // comma separated list of roles
- Groups string `json:"groups,omitempty"`
- Users string `json:"users,omitempty"`
- Tokens string `json:"tokens,omitempty"`
- Propagate IntOrBool `json:"propagate"` // Default is true, omitempty would never send false
- Delete IntOrBool `json:"delete,omitempty"` // true to delete the ACL
-}
-
-type StorageDownloadURLOptions struct {
- Content string `json:"content,omitempty"`
- Filename string `json:"filename,omitempty"`
- Node string `json:"node,omitempty"`
- Storage string `json:"storage,omitempty"`
- URL string `json:"url,omitempty"`
- Checksum string `json:"checksum,omitempty"`
- ChecksumAlgorithm string `json:"checksum-algorithm,omitempty"`
- Compression string `json:"compression,omitempty"`
- VerifyCertificates IntOrBool `json:"verify-certificates"`
-}
-
-type StorageContent struct {
- Format string `json:"format,omitempty"`
- Size uint64 `json:"size,omitempty"`
- Volid string `json:"volid,omitempty"`
- Ctime StringOrUint64 `json:"ctime,omitempty"`
- Encryption string `json:"encryption,omitempty"`
- Notes string `json:"notes,omitempty"`
- Parent string `json:"parent,omitempty"`
- Protection IntOrBool `json:"protection,omitempty"`
- Used uint64 `json:"used,omitempty"`
- Verification string `json:"verification,omitempty"`
- VMID uint64 `json:"vmid,omitempty"`
-}
-
-type NodeCertificates []*NodeCertificate
-
-type NodeCertificate struct {
- Filename string `json:"filename,omitempty"`
- Fingerprint string `json:"fingerprint,omitempty"`
- Issuer string `json:"issuer,omitempty"`
- NotAfter string `json:"not-after,omitempty"`
- NotBefore string `json:"not-before,omitempty"`
- Pem string `json:"pem,omitempty"`
- PublicKeyBits int `json:"public-key-bits,omitempty"`
- PublicKeyType string `json:"public-key-type,omitempty"`
- San []string `json:"san,omitempty"`
- Subject string `json:"subject,omitempty"`
-}
-
-type CustomCertificate struct {
- Certificates string `json:"certificates,omitempty"` // PEM encoded certificate (chain)
- Force bool `json:"force,omitempty"` // overwrite existing certificate
- Key string `json:"key,omitempty"` // PEM encoded private key
- Restart bool `json:"restart,omitempty"` // restart pveproxy
-}
-
-type NewUser struct {
- UserID string `json:"userid"`
- Comment string `json:"comment,omitempty"`
- Email string `json:"email,omitempty"`
- Enable bool `json:"enable"`
- Expire int `json:"expire,omitempty"`
- Firstname string `json:"firstname,omitempty"`
- Groups []string `json:"groups,omitempty"`
- Keys []string `json:"keys,omitempty"`
- Lastname string `json:"lastname,omitempty"`
- Password string `json:"password,omitempty"`
-}
-
-type TFA struct {
- Realm string `json:"realm,omitempty"`
- Types []string `json:"types,omitempty"`
- User string `json:"user,omitempty"`
-}
-
-type NewAPIToken struct {
- FullTokenID string `json:"full-tokenid,omitempty"`
- Info interface{} `json:"info,omitempty"`
- Value string `json:"value,omitempty"`
-}
-
-type VNCProxyOptions struct {
- Websocket string `json:"websocket,omitempty"`
- Height int `json:"height,omitempty"`
- Width int `json:"width,omitempty"`
-}
-
-type ContainerSnapshot struct {
- Description string `json:"description,omitempty"`
- Name string `json:"snapname,omitempty"`
- Parent string `json:"parent,omitempty"`
- SnapshotCreationTime int64 `json:"snaptime,omitempty"`
-}
-
-type Firewall struct {
- Aliases []*FirewallAlias `json:"aliases,omitempty"`
- Ipset []*FirewallIPSet `json:"ipset,omitempty"`
- Rules []*FirewallRule `json:"rules,omitempty"`
- Options *FirewallNodeOption `json:"options,omitempty"`
- // Refs map[string]string `json:"refs,omitempty"`
-}
-
-type FirewallAlias struct {
- Cidr string `json:"cidr,omitempty"`
- Digest string `json:"digest,omitempty"`
- Name string `json:"name,omitempty"`
- Comment string `json:"comment,omitempty"`
-}
-
-type FirewallIPSet struct {
- Name string `json:"name,omitempty"`
- Digest string `json:"digest,omitempty"`
- Comment string `json:"comment,omitempty"`
-}
-
-type FirewallIPSetCreationOption struct {
- Name string `json:"name"`
- Digest string `json:"digest,omitempty"`
- Comment string `json:"comment,omitempty"`
- Rename string `json:"rename,omitempty"`
-}
-
-type FirewallIPSetEntry struct {
- CIDR string `json:"cidr,omitempty"`
- Digest string `json:"digest,omitempty"`
- Comment string `json:"comment,omitempty"`
- NoMatch bool `json:"nomatch,omitempty"`
-}
-
-type FirewallIPSetEntryCreationOption struct {
- CIDR string `json:"cidr"`
- Comment string `json:"comment,omitempty"`
- NoMatch bool `json:"nomatch,omitempty"`
-}
-
-type FirewallIPSetEntryUpdateOption struct {
- Comment string `json:"comment,omitempty"`
- Digest string `json:"digest,omitempty"`
- NoMatch bool `json:"nomatch,omitempty"`
-}
-
-type (
- VirtualMachineBackupMode = string
- VirtualMachineBackupCompress = string
- VirtualMachineBackupNotificationPolicy = string
-)
-
-const (
- VirtualMachineBackupModeSnapshot = VirtualMachineBackupMode("snapshot")
- VirtualMachineBackupModeSuspend = VirtualMachineBackupMode("suspend")
- VirtualMachineBackupModeStop = VirtualMachineBackupMode("stop")
-
- VirtualMachineBackupCompressZero = VirtualMachineBackupCompress("0")
- VirtualMachineBackupCompressOne = VirtualMachineBackupCompress("1")
- VirtualMachineBackupCompressGzip = VirtualMachineBackupCompress("gzip")
- VirtualMachineBackupCompressLzo = VirtualMachineBackupCompress("lzo")
- VirtualMachineBackupCompressZstd = VirtualMachineBackupCompress("zstd")
-
- VirtualMachineBackupNotificationPolicyAlways = VirtualMachineBackupNotificationPolicy("always")
- VirtualMachineBackupNotificationPolicyFailure = VirtualMachineBackupNotificationPolicy("failure")
- VirtualMachineBackupNotificationPolicyNever = VirtualMachineBackupNotificationPolicy("never")
-)
-
-type VirtualMachineBackupOptions struct {
- All bool `json:"all,omitempty"`
- BwLimit uint `json:"bwlimit,omitempty"`
- Compress VirtualMachineBackupCompress `json:"compress,omitempty"`
- DumpDir string `json:"dumpDir,omitempty"`
- Exclude string `json:"exclude,omitempty"`
- ExcludePath []string `json:"exclude-path,omitempty"`
- IoNice uint `json:"ionice,omitempty"`
- LockWait uint `json:"lockwait,omitempty"`
- MailTo string `json:"mailto,omitempty"`
- Mode VirtualMachineBackupMode `json:"mode,omitempty"`
- Node string `json:"node,omitempty"`
- NotesTemplate string `json:"notes-template,omitempty"`
- NotificationPolicy VirtualMachineBackupNotificationPolicy `json:"notification-policy,omitempty"`
- NotificationTarget string `json:"notification-target,omitempty"`
- Performance string `json:"performance,omitempty"`
- Pigz int `json:"pigz,omitempty"`
- Pool string `json:"pool,omitempty"`
- Protected string `json:"protected,omitempty"`
- PruneBackups string `json:"prune-backups,omitempty"`
- Quiet bool `json:"quiet,omitempty"`
- Remove bool `json:"remove"`
- Script string `json:"script,omitempty"`
- StdExcludes bool `json:"stdexcludes"`
- StdOut bool `json:"stdout,omitempty"`
- Stop bool `json:"stop,omitempty"`
- StopWait uint `json:"stopwait,omitempty"`
- Storage string `json:"storage,omitempty"`
- TmpDir string `json:"tmpdir,omitempty"`
- VMID uint64 `json:"vmid,omitempty"`
- Zstd uint `json:"zstd,omitempty"`
-}
-
-type Separator = string
-
-const (
- StringSeparator = Separator("\n")
- FieldSeparator = Separator(":")
- SpaceSeparator = Separator(" ")
-)
-
-type VzdumpConfig struct {
- Boot string `json:"boot"`
- CiPassword string `json:"cipassword"`
- CiUser string `json:"ciuser"`
- Cores uint64 `json:"cores,string"`
- Memory uint64 `json:"memory,string"`
- Meta string `json:"meta"`
- Numa string `json:"numa"`
- OsType string `json:"ostype"`
- Scsihw string `json:"scsihw"`
- Sockets uint64 `json:"sockets,string"`
- SSHKeys string `json:"sshkeys"`
- VmgenID string `json:"vmgenid"`
-
- IDE0 string `json:"ide0,omitempty"`
- IDE1 string `json:"ide1,omitempty"`
- IDE2 string `json:"ide2,omitempty"`
- IDE3 string `json:"ide3,omitempty"`
-
- SCSI0 string `json:"scsi0,omitempty"`
- SCSI1 string `json:"scsi1,omitempty"`
- SCSI2 string `json:"scsi2,omitempty"`
- SCSI3 string `json:"scsi3,omitempty"`
- SCSI4 string `json:"scsi4,omitempty"`
- SCSI5 string `json:"scsi5,omitempty"`
- SCSI6 string `json:"scsi6,omitempty"`
- SCSI7 string `json:"scsi7,omitempty"`
- SCSI8 string `json:"scsi8,omitempty"`
- SCSI9 string `json:"scsi9,omitempty"`
- SCSI10 string `json:"scsi10,omitempty"`
- SCSI11 string `json:"scsi11,omitempty"`
- SCSI12 string `json:"scsi12,omitempty"`
- SCSI13 string `json:"scsi13,omitempty"`
- SCSI14 string `json:"scsi14,omitempty"`
- SCSI15 string `json:"scsi15,omitempty"`
- SCSI16 string `json:"scsi16,omitempty"`
- SCSI17 string `json:"scsi17,omitempty"`
- SCSI18 string `json:"scsi18,omitempty"`
- SCSI19 string `json:"scsi19,omitempty"`
- SCSI20 string `json:"scsi20,omitempty"`
- SCSI21 string `json:"scsi21,omitempty"`
- SCSI22 string `json:"scsi22,omitempty"`
- SCSI23 string `json:"scsi23,omitempty"`
- SCSI24 string `json:"scsi24,omitempty"`
- SCSI25 string `json:"scsi25,omitempty"`
- SCSI26 string `json:"scsi26,omitempty"`
- SCSI27 string `json:"scsi27,omitempty"`
- SCSI28 string `json:"scsi28,omitempty"`
- SCSI29 string `json:"scsi29,omitempty"`
- SCSI30 string `json:"scsi30,omitempty"`
-
- SATA0 string `json:"sata0,omitempty"`
- SATA1 string `json:"sata1,omitempty"`
- SATA2 string `json:"sata2,omitempty"`
- SATA3 string `json:"sata3,omitempty"`
- SATA4 string `json:"sata4,omitempty"`
- SATA5 string `json:"sata5,omitempty"`
-
- VirtIO0 string `json:"virtio0,omitempty"`
- VirtIO1 string `json:"virtio1,omitempty"`
- VirtIO2 string `json:"virtio2,omitempty"`
- VirtIO3 string `json:"virtio3,omitempty"`
- VirtIO4 string `json:"virtio4,omitempty"`
- VirtIO5 string `json:"virtio5,omitempty"`
- VirtIO6 string `json:"virtio6,omitempty"`
- VirtIO7 string `json:"virtio7,omitempty"`
- VirtIO8 string `json:"virtio8,omitempty"`
- VirtIO9 string `json:"virtio9,omitempty"`
- VirtIO10 string `json:"virtio10,omitempty"`
- VirtIO11 string `json:"virtio11,omitempty"`
- VirtIO12 string `json:"virtio12,omitempty"`
- VirtIO13 string `json:"virtio13,omitempty"`
- VirtIO14 string `json:"virtio14,omitempty"`
- VirtIO15 string `json:"virtio15,omitempty"`
-
- Unused0 string `json:"unused0,omitempty"`
- Unused1 string `json:"unused1,omitempty"`
- Unused2 string `json:"unused2,omitempty"`
- Unused3 string `json:"unused3,omitempty"`
- Unused4 string `json:"unused4,omitempty"`
- Unused5 string `json:"unused5,omitempty"`
- Unused6 string `json:"unused6,omitempty"`
- Unused7 string `json:"unused7,omitempty"`
- Unused8 string `json:"unused8,omitempty"`
- Unused9 string `json:"unused9,omitempty"`
-
- // Network devices
- Net0 string `json:"net0,omitempty"`
- Net1 string `json:"net1,omitempty"`
- Net2 string `json:"net2,omitempty"`
- Net3 string `json:"net3,omitempty"`
- Net4 string `json:"net4,omitempty"`
- Net5 string `json:"net5,omitempty"`
- Net6 string `json:"net6,omitempty"`
- Net7 string `json:"net7,omitempty"`
- Net8 string `json:"net8,omitempty"`
- Net9 string `json:"net9,omitempty"`
-
- // NUMA topology
- Numa0 string `json:"numa0,omitempty"`
- Numa1 string `json:"numa1,omitempty"`
- Numa2 string `json:"numa2,omitempty"`
- Numa3 string `json:"numa3,omitempty"`
- Numa4 string `json:"numa4,omitempty"`
- Numa5 string `json:"numa5,omitempty"`
- Numa6 string `json:"numa6,omitempty"`
- Numa7 string `json:"numa7,omitempty"`
- Numa8 string `json:"numa8,omitempty"`
- Numa9 string `json:"numa9,omitempty"`
-
- // Host PCI devices
- HostPCI0 string `json:"hostpci0,omitempty"`
- HostPCI1 string `json:"hostpci1,omitempty"`
- HostPCI2 string `json:"hostpci2,omitempty"`
- HostPCI3 string `json:"hostpci3,omitempty"`
- HostPCI4 string `json:"hostpci4,omitempty"`
- HostPCI5 string `json:"hostpci5,omitempty"`
- HostPCI6 string `json:"hostpci6,omitempty"`
- HostPCI7 string `json:"hostpci7,omitempty"`
- HostPCI8 string `json:"hostpci8,omitempty"`
- HostPCI9 string `json:"hostpci9,omitempty"`
-
- // Serial devices
- Serial0 string `json:"serial0,omitempty"`
- Serial1 string `json:"serial1,omitempty"`
- Serial2 string `json:"serial2,omitempty"`
- Serial3 string `json:"serial3,omitempty"`
-
- // USB devices
- USB0 string `json:"usb0,omitempty"`
- USB1 string `json:"usb1,omitempty"`
- USB2 string `json:"usb2,omitempty"`
- USB3 string `json:"usb3,omitempty"`
- USB4 string `json:"usb4,omitempty"`
- USB5 string `json:"usb5,omitempty"`
- USB6 string `json:"usb6,omitempty"`
- USB7 string `json:"usb7,omitempty"`
- USB8 string `json:"usb8,omitempty"`
- USB9 string `json:"usb9,omitempty"`
- USB10 string `json:"usb10,omitempty"`
- USB11 string `json:"usb11,omitempty"`
- USB12 string `json:"usb12,omitempty"`
- USB13 string `json:"usb13,omitempty"`
- USB14 string `json:"usb14,omitempty"`
-
- Parallel0 string `json:"parallel0,omitempty"`
- Parallel1 string `json:"parallel1,omitempty"`
- Parallel2 string `json:"parallel2,omitempty"`
-
- // Cloud-init
- IPConfig0 string `json:"ipconfig0,omitempty"`
- IPConfig1 string `json:"ipconfig1,omitempty"`
- IPConfig2 string `json:"ipconfig2,omitempty"`
- IPConfig3 string `json:"ipconfig3,omitempty"`
- IPConfig4 string `json:"ipconfig4,omitempty"`
- IPConfig5 string `json:"ipconfig5,omitempty"`
- IPConfig6 string `json:"ipconfig6,omitempty"`
- IPConfig7 string `json:"ipconfig7,omitempty"`
- IPConfig8 string `json:"ipconfig8,omitempty"`
- IPConfig9 string `json:"ipconfig9,omitempty"`
-}
-
-type PendingConfiguration []PendingConfigItem
-
-type PendingConfigItem struct {
- Key string `json:"key,omitempty"`
- Delete *int `json:"delete,omitempty"`
- // Proxmox API doc says "Pending" & "Value" fields return string but in reality it could be anything
- Pending interface{} `json:"pending,omitempty"`
- Value interface{} `json:"value,omitempty"`
-}
-
-type VNet struct {
- Name string `json:"vnet,omitempty"`
- Type string `json:"type,omitempty"`
- Zone string `json:"zone,omitempty"`
- VlanAware int `json:"vlanaware,omitempty"`
- Tag uint16 `json:"tag,omitempty"`
-}
-
-type VNetOptions struct {
- Name string `json:"vnet"`
- Zone string `json:"zone"`
- Alias string `json:"alias,omitempty"`
- IsolatePorts bool `json:"isolate-ports,omitempty"`
- Tag uint32 `json:"tag,omitempty"` // Could be a VLAN or VXLAN tag
- Type string `json:"type,omitempty"` // Type must be set to "vnet"
- VlanAware bool `json:"vlanaware,omitempty"`
-}
-type NetRange struct {
- StartAddress string `json:"start-address,omitempty"`
- EndAddress string `json:"end-address,omitempty"`
-}
-type VNetSubnet struct {
- CIDR string `json:"cidr,omitempty"`
- Gateway string `json:"gateway,omitempty"`
- Netmask string `json:"mask,omitempty"`
- Type string `json:"type,omitempty"`
- Zone string `json:"zone,omitempty"`
- VNet string `json:"vnet,omitempty"`
- SNAT int `json:"snat,omitempty"`
- Network string `json:"network,omitempty"`
- ID string `json:"id,omitempty"`
- DhcpRange []NetRange `json:"dhcp-range,omitempty"`
-}
-type IPAM struct {
- Hostname string `json:"hostname,omitempty"`
- IP string `json:"ip,omitempty"`
- Mac string `json:"mac,omitempty"`
- Subnet string `json:"subnet,omitempty"`
- VMID string `json:"vmid,omitempty"`
- VNet string `json:"vnet,omitempty"`
- Zone string `json:"zone,omitempty"`
- Gateway int `json:"gateway,omitempty"`
-}
-
-type SDNZone struct {
- Name string `json:"zone"`
- Type string `json:"type"`
- DHCP string `json:"dhcp,omitempty"`
- DNS string `json:"dns,omitempty"`
- DNSZone string `json:"dnszone,omitempty"`
- IPAM string `json:"ipam,omitempty"`
- MTU int `json:"mtu,omitempty"`
- Nodes []string `json:"nodes,omitempty"`
- Pending bool `json:"pending,omitempty"`
- ReverseDNS string `json:"reversedns,omitempty"`
- State string `json:"state,omitempty"`
-}
-
-type SDNZoneOptions struct {
- Name string `json:"zone"`
- Type string `json:"type"`
- AdvertiseSubnets bool `json:"advertise-subnets,omitempty"`
- Bridge string `json:"bridge,omitempty"`
- BridgeDisableMACLearning bool `json:"bridge-disable-mac-learning,omitempty"`
- Controller string `json:"controller,omitempty"`
- DHCP string `json:"dhcp,omitempty"`
- DisableARPNDSuppression bool `json:"disable-arp-nd-suppression,omitempty"`
- DNS string `json:"dns,omitempty"`
- DNSZone string `json:"dnszone,omitempty"`
- DPID int `json:"dpid,omitempty"`
- ExitNodes string `json:"exit-nodes,omitempty"`
- ExitNodesLocalRouting bool `json:"exit-nodes-local-routing,omitempty"`
- ExitNodesPrimary string `json:"exit-nodes-primary,omitempty"`
- Fabric string `json:"fabric,omitempty"`
- IPAM string `json:"ipam,omitempty"`
- MAC string `json:"mac,omitempty"`
- MTU int `json:"mtu,omitempty"`
- Nodes string `json:"nodes,omitempty"`
- Peers string `json:"peers,omitempty"`
- ReverseDNS string `json:"reversedns,omitempty"`
- RTImport string `json:"rt-import,omitempty"`
- Tag uint `json:"tag,omitempty"`
- VLANProtocol string `json:"vlan-protocol,omitempty"`
- VRFVXLAN int `json:"vrf-vxlan,omitempty"`
- VXLANPort uint16 `json:"vxlan-port,omitempty"`
-}
diff --git a/go-proxmox/types_test.go b/go-proxmox/types_test.go
deleted file mode 100644
index f017188..0000000
--- a/go-proxmox/types_test.go
+++ /dev/null
@@ -1,276 +0,0 @@
-package proxmox
-
-import (
- "encoding/json"
- "errors"
- "fmt"
- "testing"
-
- "github.com/stretchr/testify/assert"
-)
-
-func TestStringOrUint64(t *testing.T) {
- cases := []struct {
- input interface{}
- expected StringOrUint64
- err error
- }{
- {
- "",
- StringOrUint64(0),
- nil,
- }, {
- "0",
- StringOrUint64(0),
- nil,
- }, {
- 0,
- StringOrUint64(0),
- nil,
- }, {
- "00",
- StringOrUint64(0),
- nil,
- }, {
- "0.0",
- StringOrUint64(0),
- nil,
- }, {
- "1",
- StringOrUint64(1),
- nil,
- }, {
- 1,
- StringOrUint64(1),
- nil,
- }, {
- "1.0",
- StringOrUint64(1),
- nil,
- }, {
- 1.0,
- StringOrUint64(1),
- nil,
- }, {
- 01,
- StringOrUint64(1),
- nil,
- }, {
- "01.0",
- StringOrUint64(1),
- nil,
- }, {
- 01.0,
- StringOrUint64(1),
- nil,
- }, {
- 0.1,
- StringOrUint64(0),
- nil,
- }, {
- "bad-parse-1234-value", // parse error
- StringOrUint64(0),
- errors.New("failed to match ^[0-9.]*$: bad-parse-1234-value"),
- },
- }
-
- type s struct {
- Value StringOrUint64
- }
-
- for _, test := range cases {
- var value string
- switch v := test.input.(type) {
- case string:
- value = fmt.Sprintf("\"%s\"", v)
- case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64:
- value = fmt.Sprintf("%d", v)
- default:
- value = fmt.Sprintf("%f", v)
- }
- m := `{
- "value": ` + value + `
-}
-`
- var unmarshall s
- assert.Equal(t, test.err, json.Unmarshal([]byte(m), &unmarshall))
- assert.Equal(t, test.expected, unmarshall.Value)
- }
-}
-
-func TestStringOrFloat64(t *testing.T) {
- cases := []struct {
- input interface{}
- expected StringOrFloat64
- err error
- }{
- {
- "",
- StringOrFloat64(0),
- nil,
- }, {
- "0",
- StringOrFloat64(0),
- nil,
- }, {
- 0,
- StringOrFloat64(0),
- nil,
- }, {
- "00",
- StringOrFloat64(0),
- nil,
- }, {
- "0.0",
- StringOrFloat64(0),
- nil,
- }, {
- "1",
- StringOrFloat64(1),
- nil,
- }, {
- 1,
- StringOrFloat64(1),
- nil,
- }, {
- "1.0",
- StringOrFloat64(1),
- nil,
- }, {
- 1.0,
- StringOrFloat64(1),
- nil,
- }, {
- 01,
- StringOrFloat64(1),
- nil,
- }, {
- "01.0",
- StringOrFloat64(1),
- nil,
- }, {
- 01.0,
- StringOrFloat64(1),
- nil,
- }, {
- 0.1,
- StringOrFloat64(0.1),
- nil,
- }, {
- "bad-parse-1234-value", // parse error
- StringOrFloat64(0),
- errors.New("failed to match ^[0-9.]*$: bad-parse-1234-value"),
- },
- }
-
- type s struct {
- Value StringOrFloat64
- }
-
- for _, test := range cases {
- var value string
- switch v := test.input.(type) {
- case string:
- value = fmt.Sprintf("\"%s\"", v)
- case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64:
- value = fmt.Sprintf("%d", v)
- default:
- value = fmt.Sprintf("%f", v)
- }
- m := `{
- "value": ` + value + `
-}
-`
- var unmarshall s
- assert.Equal(t, test.err, json.Unmarshal([]byte(m), &unmarshall))
- assert.Equal(t, test.expected, unmarshall.Value)
- }
-}
-func TestStringOrInt(t *testing.T) {
- cases := []struct {
- input interface{}
- expected StringOrInt
- err error
- }{
- {
- "",
- StringOrInt(0),
- nil,
- }, {
- "0",
- StringOrInt(0),
- nil,
- }, {
- 0,
- StringOrInt(0),
- nil,
- }, {
- "00",
- StringOrInt(0),
- nil,
- }, {
- "0.0",
- StringOrInt(0),
- nil,
- }, {
- "1",
- StringOrInt(1),
- nil,
- }, {
- 1,
- StringOrInt(1),
- nil,
- }, {
- "1.0",
- StringOrInt(1),
- nil,
- }, {
- 1.0,
- StringOrInt(1),
- nil,
- }, {
- 01,
- StringOrInt(1),
- nil,
- }, {
- "01.0",
- StringOrInt(1),
- nil,
- }, {
- 01.0,
- StringOrInt(1),
- nil,
- }, {
- 0.1,
- StringOrInt(0),
- nil,
- }, {
- "bad-parse-1234-value", // parse error
- StringOrInt(0),
- errors.New("failed to match ^[0-9.]*$: bad-parse-1234-value"),
- },
- }
-
- type s struct {
- Value StringOrInt
- }
-
- for _, test := range cases {
- var value string
- switch v := test.input.(type) {
- case string:
- value = fmt.Sprintf("\"%s\"", v)
- case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64:
- value = fmt.Sprintf("%d", v)
- default:
- value = fmt.Sprintf("%f", v)
- }
- m := `{
- "value": ` + value + `
-}
-`
- var unmarshall s
- assert.Equal(t, test.err, json.Unmarshal([]byte(m), &unmarshall))
- assert.Equal(t, test.expected, unmarshall.Value)
- }
-}
diff --git a/go-proxmox/virtual_machine.go b/go-proxmox/virtual_machine.go
deleted file mode 100644
index 7051941..0000000
--- a/go-proxmox/virtual_machine.go
+++ /dev/null
@@ -1,735 +0,0 @@
-package proxmox
-
-import (
- "context"
- "fmt"
- "net/url"
- "os"
- "path/filepath"
- "strings"
- "time"
-
- "github.com/diskfs/go-diskfs/backend/file"
- "github.com/diskfs/go-diskfs/filesystem/iso9660"
-)
-
-const (
- StatusVirtualMachineRunning = "running"
- StatusVirtualMachineStopped = "stopped"
- StatusVirtualMachinePaused = "paused"
-
- UserDataISOFormat = "user-data-%d.iso"
- TagCloudInit = "cloud-init"
- TagSeperator = ";"
-
- volumeIdentifier = "cidata"
- blockSize = 2048
-)
-
-// DefaultAgentWaitInterval is the polling interval when waiting for agent exec commands
-var DefaultAgentWaitInterval = 100 * time.Millisecond
-
-func (v *VirtualMachine) New(c *Client, nodeName string, vmid int) {
- v.client = c
- v.Node = nodeName
- v.VMID = StringOrUint64(vmid)
-}
-
-func (v *VirtualMachine) Ping(ctx context.Context) error {
- return v.client.Get(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/status/current", v.Node, v.VMID), &v)
-}
-
-func (v *VirtualMachine) Config(ctx context.Context, options ...VirtualMachineOption) (*Task, error) {
- var upid UPID
- data := make(map[string]interface{})
- for _, opt := range options {
- data[opt.Name] = opt.Value
- }
- err := v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/config", v.Node, v.VMID), data, &upid)
- return NewTask(upid, v.client), err
-}
-
-func (v *VirtualMachine) TermProxy(ctx context.Context) (term *Term, err error) {
- return term, v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/termproxy", v.Node, v.VMID), nil, &term)
-}
-
-func (v *VirtualMachine) VNCProxy(ctx context.Context, config *VNCConfig) (vnc *VNC, err error) {
- return vnc, v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/vncproxy?", v.Node, v.VMID), config, &vnc)
-}
-
-func (v *VirtualMachine) HasTag(value string) bool {
- if v.VirtualMachineConfig == nil {
- return false
- }
-
- if v.VirtualMachineConfig.Tags == "" {
- return false
- }
-
- if v.VirtualMachineConfig.TagsSlice == nil {
- v.SplitTags()
- }
-
- for _, tag := range v.VirtualMachineConfig.TagsSlice {
- if tag == value {
- return true
- }
- }
-
- return false
-}
-
-func (v *VirtualMachine) AddTag(ctx context.Context, value string) (*Task, error) {
- if v.HasTag(value) {
- return nil, ErrNoop
- }
-
- if v.VirtualMachineConfig.TagsSlice == nil {
- v.SplitTags()
- }
-
- v.VirtualMachineConfig.TagsSlice = append(v.VirtualMachineConfig.TagsSlice, value)
- v.VirtualMachineConfig.Tags = strings.Join(v.VirtualMachineConfig.TagsSlice, TagSeperator)
-
- return v.Config(ctx, VirtualMachineOption{
- Name: "tags",
- Value: v.VirtualMachineConfig.Tags,
- })
-}
-
-func (v *VirtualMachine) RemoveTag(ctx context.Context, value string) (*Task, error) {
- if !v.HasTag(value) {
- return nil, ErrNoop
- }
-
- if v.VirtualMachineConfig.TagsSlice == nil {
- v.SplitTags()
- }
-
- for i, tag := range v.VirtualMachineConfig.TagsSlice {
- if tag == value {
- v.VirtualMachineConfig.TagsSlice = append(
- v.VirtualMachineConfig.TagsSlice[:i],
- v.VirtualMachineConfig.TagsSlice[i+1:]...,
- )
- }
- }
-
- v.VirtualMachineConfig.Tags = strings.Join(v.VirtualMachineConfig.TagsSlice, TagSeperator)
- return v.Config(ctx, VirtualMachineOption{
- Name: "tags",
- Value: v.VirtualMachineConfig.Tags,
- })
-}
-
-func (v *VirtualMachine) SplitTags() {
- v.VirtualMachineConfig.TagsSlice = strings.Split(v.VirtualMachineConfig.Tags, TagSeperator)
-}
-
-// CloudInit takes four yaml docs as a string and make an ISO, upload it to the data store as -user-data.iso and will
-// mount it as a CD-ROM to be used with nocloud cloud-init. This is NOT how proxmox expects a user to do cloud-init
-// which can be found here: https://pve.proxmox.com/wiki/Cloud-Init_Support#:~:text=and%20meta.-,Cloud%2DInit%20specific%20Options,-cicustom%3A%20%5Bmeta
-// If you want to use the proxmox implementation you'll need to use the cloudinit APIs https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/cloudinit
-func (v *VirtualMachine) CloudInit(ctx context.Context, device, userdata, metadata, vendordata, networkconfig string) error {
- isoName := fmt.Sprintf(UserDataISOFormat, v.VMID)
- // create userdata iso file on the local fs
- isofilename, err := makeCloudInitISO(isoName, userdata, metadata, vendordata, networkconfig)
- if err != nil {
- return err
- }
-
- defer func() {
- // _ = os.Remove(iso.Name())
- }()
-
- node, err := v.client.Node(ctx, v.Node)
- if err != nil {
- return err
- }
-
- storage, err := node.StorageISO(ctx)
- if err != nil {
- return err
- }
-
- task, err := storage.Upload("iso", isofilename)
- if err != nil {
- return err
- }
-
- // iso should only be < 5mb so wait for it and then mount it
- if err := task.WaitFor(ctx, 5); err != nil {
- return err
- }
-
- _, err = v.AddTag(ctx, MakeTag(TagCloudInit))
- if err != nil && !IsErrNoop(err) {
- return err
- }
-
- task, err = v.Config(ctx, VirtualMachineOption{
- Name: device,
- Value: fmt.Sprintf("%s:iso/%s,media=cdrom", storage.Name, isoName),
- }, VirtualMachineOption{
- Name: "boot",
- Value: fmt.Sprintf("%s;%s", v.VirtualMachineConfig.Boot, device),
- })
- if err != nil {
- return err
- }
-
- return task.WaitFor(ctx, 2)
-}
-
-func makeCloudInitISO(filename, userdata, metadata, vendordata, networkconfig string) (isopath string, err error) {
- isopath = filepath.Join(os.TempDir(), filename)
-
- isoFile, err := os.Create(isopath)
- if err != nil {
- return "", err
- }
-
- if err := isoFile.Close(); err != nil {
- return "", err
- }
-
- iso, err := file.OpenFromPath(isopath, false)
- if err != nil {
- return "", err
- }
-
- defer func() {
- err = iso.Close()
- }()
-
- fs, err := iso9660.Create(iso, 0, 0, blockSize, "")
- if err != nil {
- return "", err
- }
-
- if err = fs.Mkdir("/"); err != nil {
- return "", err
- }
-
- cifiles := map[string]string{
- "user-data": userdata,
- "meta-data": metadata,
- }
- if vendordata != "" {
- cifiles["vendor-data"] = vendordata
- }
- if networkconfig != "" {
- cifiles["network-config"] = networkconfig
- }
-
- for filename, content := range cifiles {
- rw, err := fs.OpenFile("/"+filename, os.O_CREATE|os.O_RDWR)
- if err != nil {
- return "", err
- }
-
- if _, err = rw.Write([]byte(content)); err != nil {
- return "", err
- }
- }
-
- if err = fs.Finalize(iso9660.FinalizeOptions{
- RockRidge: true,
- VolumeIdentifier: volumeIdentifier,
- }); err != nil {
- return "", err
- }
-
- return
-}
-
-func (v *VirtualMachine) TermWebSocket(term *Term) (chan []byte, chan []byte, chan error, func() error, error) {
- p := fmt.Sprintf("/nodes/%s/qemu/%d/vncwebsocket?port=%d&vncticket=%s",
- v.Node, v.VMID, term.Port, url.QueryEscape(term.Ticket))
-
- return v.client.TermWebSocket(p, term)
-}
-
-// VNCWebSocket copy/paste when calling to get the channel names right
-// send, recv, errors, closer, errors := vm.VNCWebSocket(vnc)
-// for this to work you need to first set up a serial terminal on your vm https://pve.proxmox.com/wiki/Serial_Terminal
-func (v *VirtualMachine) VNCWebSocket(vnc *VNC) (chan []byte, chan []byte, chan error, func() error, error) {
- p := fmt.Sprintf("/nodes/%s/qemu/%d/vncwebsocket?port=%d&vncticket=%s",
- v.Node, v.VMID, vnc.Port, url.QueryEscape(vnc.Ticket))
-
- return v.client.VNCWebSocket(p, vnc)
-}
-
-func (v *VirtualMachine) IsRunning() bool {
- return v.Status == StatusVirtualMachineRunning && (v.QMPStatus == "" || v.QMPStatus == StatusVirtualMachineRunning)
-}
-
-func (v *VirtualMachine) Start(ctx context.Context) (task *Task, err error) {
- var upid UPID
- if err = v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/status/start", v.Node, v.VMID), nil, &upid); err != nil {
- return nil, err
- }
-
- return NewTask(upid, v.client), nil
-}
-
-func (v *VirtualMachine) IsStopped() bool {
- return v.Status == StatusVirtualMachineStopped && (v.Lock != "suspended")
-}
-
-func (v *VirtualMachine) Reset(ctx context.Context) (task *Task, err error) {
- var upid UPID
- if err = v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/status/reset", v.Node, v.VMID), nil, &upid); err != nil {
- return nil, err
- }
-
- return NewTask(upid, v.client), nil
-}
-
-func (v *VirtualMachine) Shutdown(ctx context.Context) (task *Task, err error) {
- var upid UPID
- if err = v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/status/shutdown", v.Node, v.VMID), nil, &upid); err != nil {
- return nil, err
- }
-
- return NewTask(upid, v.client), nil
-}
-
-func (v *VirtualMachine) Stop(ctx context.Context) (task *Task, err error) {
- var upid UPID
- if err = v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/status/stop", v.Node, v.VMID), nil, &upid); err != nil {
- return nil, err
- }
-
- return NewTask(upid, v.client), nil
-}
-
-func (v *VirtualMachine) IsPaused() bool {
- return v.Status == StatusVirtualMachineRunning && v.QMPStatus == StatusVirtualMachinePaused
-}
-
-func (v *VirtualMachine) Pause(ctx context.Context) (task *Task, err error) {
- var upid UPID
- if err = v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/status/suspend", v.Node, v.VMID), nil, &upid); err != nil {
- return nil, err
- }
-
- return NewTask(upid, v.client), nil
-}
-
-func (v *VirtualMachine) IsHibernated() bool {
- return v.Status == StatusVirtualMachineStopped && v.Lock == "suspended"
-}
-
-func (v *VirtualMachine) Hibernate(ctx context.Context) (task *Task, err error) {
- var upid UPID
- if err = v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/status/suspend", v.Node, v.VMID), map[string]string{"todisk": "1"}, &upid); err != nil {
- return nil, err
- }
-
- return NewTask(upid, v.client), nil
-}
-
-func (v *VirtualMachine) Resume(ctx context.Context) (task *Task, err error) {
- var upid UPID
- if err = v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/status/resume", v.Node, v.VMID), nil, &upid); err != nil {
- return nil, err
- }
-
- return NewTask(upid, v.client), nil
-}
-
-func (v *VirtualMachine) Reboot(ctx context.Context) (task *Task, err error) {
- var upid UPID
- if err = v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/status/reboot", v.Node, v.VMID), nil, &upid); err != nil {
- return nil, err
- }
-
- return NewTask(upid, v.client), nil
-}
-
-func (v *VirtualMachine) Delete(ctx context.Context) (task *Task, err error) {
- if ok, err := v.deleteCloudInitISO(ctx); err != nil || !ok {
- return nil, err
- }
-
- var upid UPID
- if err = v.client.Delete(ctx, fmt.Sprintf("/nodes/%s/qemu/%d", v.Node, v.VMID), &upid); err != nil {
- return nil, err
- }
-
- return NewTask(upid, v.client), nil
-}
-
-func (v *VirtualMachine) deleteCloudInitISO(ctx context.Context) (ok bool, err error) {
- if v.HasTag(MakeTag(TagCloudInit)) {
- node, err := v.client.Node(ctx, v.Node)
- if err != nil {
- return false, err
- }
- isoStorage, err := node.StorageISO(ctx)
- if err != nil {
- return false, err
- }
-
- var iso *ISO
- iso, err = isoStorage.ISO(ctx, fmt.Sprintf(UserDataISOFormat, v.VMID))
- if err != nil {
- // skipping, iso not found return no error.
- return true, nil
- }
- task, err := iso.Delete(ctx)
- if err != nil {
- return false, err
- }
- if err := task.WaitFor(ctx, 5); err != nil {
- return false, err
- }
- }
-
- return true, nil
-}
-
-func (v *VirtualMachine) Migrate(
- ctx context.Context,
- params *VirtualMachineMigrateOptions,
-) (task *Task, err error) {
- var upid UPID
-
- if params == nil {
- params = &VirtualMachineMigrateOptions{}
- }
-
- if err = v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/migrate", v.Node, v.VMID), params, &upid); err != nil {
- return nil, err
- }
-
- return NewTask(upid, v.client), nil
-}
-
-func (v *VirtualMachine) Clone(ctx context.Context, params *VirtualMachineCloneOptions) (newid int, task *Task, err error) {
- var upid UPID
-
- if params == nil {
- params = &VirtualMachineCloneOptions{}
- }
-
- if params.NewID == 0 {
- cluster, err := v.client.Cluster(ctx)
- if err != nil {
- return newid, nil, err
- }
-
- newid, err = cluster.NextID(ctx)
- if err != nil {
- return newid, nil, err
- }
- params.NewID = newid
- } else {
- newid = params.NewID
- }
-
- if err := v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/clone", v.Node, v.VMID), params, &upid); err != nil {
- return newid, nil, err
- }
-
- return newid, NewTask(upid, v.client), nil
-}
-
-func (v *VirtualMachine) ResizeDisk(ctx context.Context, disk, size string) (*Task, error) {
- var upid UPID
-
- if err := v.client.Put(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/resize", v.Node, v.VMID), map[string]string{
- "disk": disk,
- "size": size,
- }, &upid); err != nil {
- return nil, err
- }
-
- return NewTask(upid, v.client), nil
-}
-
-func (v *VirtualMachine) UnlinkDisk(ctx context.Context, diskID string, force bool) (task *Task, err error) {
- var upid UPID
-
- params := map[string]string{"idlist": diskID}
- if force {
- params["force"] = "1"
- }
- err = v.client.Put(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/unlink", v.Node, v.VMID), params, &upid)
- if err != nil {
- return
- }
-
- return NewTask(upid, v.client), nil
-}
-
-func (v *VirtualMachine) MoveDisk(ctx context.Context, disk string, params *VirtualMachineMoveDiskOptions) (task *Task, err error) {
- var upid UPID
-
- if params == nil {
- params = &VirtualMachineMoveDiskOptions{}
- }
-
- if disk != "" {
- params.Disk = disk
- }
-
- err = v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/move_disk", v.Node, v.VMID), params, &upid)
- if err != nil {
- return
- }
-
- return NewTask(upid, v.client), nil
-}
-
-func (v *VirtualMachine) AgentGetNetworkIFaces(ctx context.Context) (iFaces []*AgentNetworkIface, err error) {
- networks := map[string][]*AgentNetworkIface{}
- err = v.client.Get(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/agent/network-get-interfaces", v.Node, v.VMID), &networks)
- if err != nil {
- return
- }
- if result, ok := networks["result"]; ok {
- for _, iface := range result {
- if iface.Name == "lo" {
- continue
- }
- iFaces = append(iFaces, iface)
- }
- }
-
- return
-}
-
-func (v *VirtualMachine) WaitForAgent(ctx context.Context, seconds int) error {
- timeout := time.After(time.Duration(seconds) * time.Second)
- ticker := time.NewTicker(DefaultWaitInterval)
- defer ticker.Stop()
-
- for {
- _, err := v.AgentOsInfo(ctx)
- if err == nil {
- return nil
- }
- if !strings.Contains(err.Error(), "500 QEMU guest agent is not running") {
- return err
- }
-
- select {
- case <-timeout:
- return ErrTimeout
- case <-ticker.C:
- }
- }
-}
-
-func (v *VirtualMachine) AgentExec(ctx context.Context, command []string, inputData string) (pid int, err error) {
- tmpdata := map[string]interface{}{}
- err = v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/agent/exec", v.Node, v.VMID),
- map[string]interface{}{
- "command": command,
- "input-data": inputData,
- },
- &tmpdata)
-
- p := tmpdata["pid"]
- if p == nil {
- return 0, fmt.Errorf("no pid returned from agent exec command")
- }
- pid = int(p.(float64))
- return
-}
-
-func (v *VirtualMachine) AgentExecStatus(ctx context.Context, pid int) (status *AgentExecStatus, err error) {
- err = v.client.Get(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/agent/exec-status?pid=%d", v.Node, v.VMID, pid), &status)
- if err != nil {
- return nil, err
- }
-
- return
-}
-
-func (v *VirtualMachine) WaitForAgentExecExit(ctx context.Context, pid, seconds int) (*AgentExecStatus, error) {
- timeout := time.After(time.Duration(seconds) * time.Second)
- ticker := time.NewTicker(DefaultAgentWaitInterval)
- defer ticker.Stop()
-
- for {
- status, err := v.AgentExecStatus(ctx, pid)
- if err != nil {
- return nil, err
- }
- if status.Exited != 0 {
- return status, nil
- }
-
- select {
- case <-timeout:
- return nil, ErrTimeout
- case <-ticker.C:
- }
- }
-}
-
-func (v *VirtualMachine) AgentOsInfo(ctx context.Context) (info *AgentOsInfo, err error) {
- results := map[string]*AgentOsInfo{}
- err = v.client.Get(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/agent/get-osinfo", v.Node, v.VMID), &results)
- if err != nil {
- return
- }
-
- var ok bool
- info, ok = results["result"]
- if !ok {
- err = fmt.Errorf("result is empty")
- }
-
- return
-}
-
-func (v *VirtualMachine) AgentSetUserPassword(ctx context.Context, password string, username string) error {
- return v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/agent/set-user-password", v.Node, v.VMID), map[string]string{"password": password, "username": username}, nil)
-}
-
-func (v *VirtualMachine) SendKey(ctx context.Context, key string) error {
- data := map[string]interface{}{"key": key}
- return v.client.Put(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/sendkey", v.Node, v.VMID), data, nil)
-}
-
-func (v *VirtualMachine) GetFirewallIPSet(ctx context.Context) (ipsets []*FirewallIPSet, err error) {
- return ipsets, v.client.Get(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/firewall/ipset", v.Node, v.VMID), &ipsets)
-}
-
-func (v *VirtualMachine) NewFirewallIPSet(ctx context.Context, ipset FirewallIPSetCreationOption) error {
- return v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/firewall/ipset", v.Node, v.VMID), ipset, nil)
-}
-
-func (v *VirtualMachine) DeleteFirewallIPSet(ctx context.Context, name string, force bool) error {
- return v.client.Delete(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/firewall/ipset/%s", v.Node, v.VMID, name), map[string]interface{}{"force": force})
-}
-
-func (v *VirtualMachine) GetFirewallIPSetEntries(ctx context.Context, name string) (entries []*FirewallIPSetEntry, err error) {
- return entries, v.client.Get(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/firewall/ipset/%s", v.Node, v.VMID, name), &entries)
-}
-
-func (v *VirtualMachine) NewFirewallIPSetEntry(ctx context.Context, name string, entry FirewallIPSetEntryCreationOption) error {
- return v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/firewall/ipset/%s", v.Node, v.VMID, name), entry, nil)
-}
-
-func (v *VirtualMachine) DeleteFirewallIPSetEntry(ctx context.Context, name string, cidr string, digest string) error {
- return v.client.Delete(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/firewall/ipset/%s/%s", v.Node, v.VMID, name, cidr), map[string]interface{}{
- "digest": digest,
- })
-}
-
-func (v *VirtualMachine) GetFirewallIPSetEntry(ctx context.Context, name string, cidr string) (entry *FirewallIPSetEntry, err error) {
- err = v.client.Get(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/firewall/ipset/%s/%s", v.Node, v.VMID, name, cidr), &entry)
- return
-}
-
-func (v *VirtualMachine) UpdateFirewallIPSetEntry(ctx context.Context, name string, cidr string, entry *FirewallIPSetEntryUpdateOption) error {
- return v.client.Put(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/firewall/ipset/%s/%s", v.Node, v.VMID, name, cidr), entry, nil)
-}
-
-func (v *VirtualMachine) FirewallOptionGet(ctx context.Context) (firewallOption *FirewallVirtualMachineOption, err error) {
- err = v.client.Get(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/firewall/options", v.Node, v.VMID), firewallOption)
- return
-}
-
-func (v *VirtualMachine) FirewallOptionSet(ctx context.Context, firewallOption *FirewallVirtualMachineOption) error {
- return v.client.Put(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/firewall/options", v.Node, v.VMID), firewallOption, nil)
-}
-
-func (v *VirtualMachine) FirewallGetRules(ctx context.Context) (rules []*FirewallRule, err error) {
- err = v.client.Get(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/firewall/rules", v.Node, v.VMID), &rules)
- return
-}
-
-func (v *VirtualMachine) FirewallRulesCreate(ctx context.Context, rule *FirewallRule) error {
- return v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/firewall/rules", v.Node, v.VMID), rule, nil)
-}
-
-func (v *VirtualMachine) FirewallRulesUpdate(ctx context.Context, rule *FirewallRule) error {
- return v.client.Put(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/firewall/rules/%d", v.Node, v.VMID, rule.Pos), rule, nil)
-}
-
-func (v *VirtualMachine) FirewallRulesDelete(ctx context.Context, rulePos int) error {
- return v.client.Delete(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/firewall/rules/%d", v.Node, v.VMID, rulePos), nil)
-}
-
-func (v *VirtualMachine) NewSnapshot(ctx context.Context, name string) (task *Task, err error) {
- var upid UPID
- if err = v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/snapshot", v.Node, v.VMID), map[string]string{"snapname": name}, &upid); err != nil {
- return nil, err
- }
-
- return NewTask(upid, v.client), nil
-}
-
-func (v *VirtualMachine) Snapshots(ctx context.Context) (snapshots []*Snapshot, err error) {
- err = v.client.Get(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/snapshot", v.Node, v.VMID), &snapshots)
- return
-}
-
-func (v *VirtualMachine) SnapshotRollback(ctx context.Context, name string) (task *Task, err error) {
- var upid UPID
- if err = v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/snapshot/%s/rollback", v.Node, v.VMID, name), nil, &upid); err != nil {
- return nil, err
- }
-
- return NewTask(upid, v.client), nil
-}
-
-// RRDData takes a timeframe enum and an optional consolidation function
-// usage: vm.RRDData(HOURLY) or vm.RRDData(HOURLY, AVERAGE)
-func (v *VirtualMachine) RRDData(ctx context.Context, timeframe Timeframe, consolidationFunction ...ConsolidationFunction) (rrddata []*RRDData, err error) {
- u := url.URL{Path: fmt.Sprintf("/nodes/%s/qemu/%d/rrddata", v.Node, v.VMID)}
-
- // consolidation functions are variadic because they're optional, but Proxmox only allows one cf parameter
- params := url.Values{}
- if len(consolidationFunction) > 0 {
- if len(consolidationFunction) != 1 {
- return nil, fmt.Errorf("only one consolidation function allowed")
- }
-
- params.Add("cf", string(consolidationFunction[0]))
- }
-
- params.Add("timeframe", string(timeframe))
- u.RawQuery = params.Encode()
-
- err = v.client.Get(ctx, u.String(), &rrddata)
- return
-}
-
-func (v *VirtualMachine) ConvertToTemplate(ctx context.Context) (task *Task, err error) {
- var upid UPID
- if err = v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/template", v.Node, v.VMID), nil, &upid); err != nil {
- return nil, err
- }
- return NewTask(upid, v.client), nil
-}
-
-func (v *VirtualMachine) UnmountCloudInitISO(ctx context.Context, device string) error {
- if !v.HasTag(MakeTag(TagCloudInit)) {
- return nil
- }
-
- _, err := v.Config(ctx, VirtualMachineOption{
- Name: device,
- Value: "none,media=cdrom",
- })
- if err != nil {
- return err
- }
-
- if _, err = v.deleteCloudInitISO(ctx); err != nil {
- return err
- }
- return nil
-}
-
-func (v *VirtualMachine) Pending(ctx context.Context) (pending *PendingConfiguration, err error) {
- err = v.client.Get(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/pending", v.Node, v.VMID), &pending)
- return
-}
diff --git a/go-proxmox/virtual_machine_config.go b/go-proxmox/virtual_machine_config.go
deleted file mode 100644
index 1030521..0000000
--- a/go-proxmox/virtual_machine_config.go
+++ /dev/null
@@ -1,137 +0,0 @@
-package proxmox
-
-import (
- "reflect"
- "strconv"
- "strings"
-)
-
-func (vmc *VirtualMachineConfig) mergeIndexedDevices(prefix string) map[string]string {
- deviceMap := make(map[string]string)
- t := reflect.TypeOf(*vmc)
- v := reflect.ValueOf(*vmc)
- count := v.NumField()
-
- for i := 0; i < count; i++ {
- fn := t.Field(i).Name
- fv := v.Field(i).String()
- if fv == "" {
- continue
- }
- if strings.HasPrefix(fn, prefix) {
- // Ignore non-numeric suffixes like SCSIHW
- suffix := strings.TrimPrefix(fn, prefix)
- if _, err := strconv.Atoi(suffix); err != nil {
- continue
- }
- deviceMap[strings.ToLower(fn)] = fv
- }
- }
-
- return deviceMap
-}
-
-func (vmc *VirtualMachineConfig) MergeIDEs() map[string]string {
- if nil == vmc.IDEs {
- vmc.IDEs = vmc.mergeIndexedDevices("IDE")
- }
- return vmc.IDEs
-}
-
-func (vmc *VirtualMachineConfig) MergeSCSIs() map[string]string {
- if nil == vmc.SCSIs {
- vmc.SCSIs = vmc.mergeIndexedDevices("SCSI")
- }
- return vmc.SCSIs
-}
-
-func (vmc *VirtualMachineConfig) MergeSATAs() map[string]string {
- if nil == vmc.SATAs {
- vmc.SATAs = vmc.mergeIndexedDevices("SATA")
- }
- return vmc.SATAs
-}
-
-func (vmc *VirtualMachineConfig) MergeNets() map[string]string {
- if nil == vmc.Nets {
- vmc.Nets = vmc.mergeIndexedDevices("Net")
- }
- return vmc.Nets
-}
-
-func (vmc *VirtualMachineConfig) MergeVirtIOs() map[string]string {
- if nil == vmc.VirtIOs {
- vmc.VirtIOs = vmc.mergeIndexedDevices("VirtIO")
- }
- return vmc.VirtIOs
-}
-
-func (vmc *VirtualMachineConfig) MergeUnuseds() map[string]string {
- if nil == vmc.Unuseds {
- vmc.Unuseds = vmc.mergeIndexedDevices("Unused")
- }
- return vmc.Unuseds
-}
-
-func (vmc *VirtualMachineConfig) MergeSerials() map[string]string {
- if nil == vmc.Serials {
- vmc.Serials = vmc.mergeIndexedDevices("Serial")
- }
- return vmc.Serials
-}
-
-func (vmc *VirtualMachineConfig) MergeUSBs() map[string]string {
- if nil == vmc.USBs {
- vmc.USBs = vmc.mergeIndexedDevices("USB")
- }
- return vmc.USBs
-}
-
-func (vmc *VirtualMachineConfig) MergeHostPCIs() map[string]string {
- if nil == vmc.HostPCIs {
- vmc.HostPCIs = vmc.mergeIndexedDevices("HostPCI")
- }
- return vmc.HostPCIs
-}
-
-func (vmc *VirtualMachineConfig) MergeNumas() map[string]string {
- if nil == vmc.Numas {
- vmc.Numas = vmc.mergeIndexedDevices("Numa")
- }
- return vmc.Numas
-}
-
-func (vmc *VirtualMachineConfig) MergeParallels() map[string]string {
- if nil == vmc.Parallels {
- vmc.Parallels = vmc.mergeIndexedDevices("Parallel")
- }
- return vmc.Parallels
-}
-
-func (vmc *VirtualMachineConfig) MergeIPConfigs() map[string]string {
- if nil == vmc.IPConfigs {
- vmc.IPConfigs = vmc.mergeIndexedDevices("IPConfig")
- }
- return vmc.IPConfigs
-}
-
-func (vmc *VirtualMachineConfig) MergeDisks() map[string]string {
- mergedDisks := make(map[string]string)
-
- for k, v := range vmc.MergeIDEs() {
- mergedDisks[k] = v
- }
-
- for k, v := range vmc.MergeSCSIs() {
- mergedDisks[k] = v
- }
-
- for k, v := range vmc.MergeSATAs() {
- mergedDisks[k] = v
- }
-
- for k, v := range vmc.MergeVirtIOs() {
- mergedDisks[k] = v
- }
- return mergedDisks
-}
diff --git a/go-proxmox/virtual_machine_config_test.go b/go-proxmox/virtual_machine_config_test.go
deleted file mode 100644
index 6ed6ab6..0000000
--- a/go-proxmox/virtual_machine_config_test.go
+++ /dev/null
@@ -1,222 +0,0 @@
-package proxmox
-
-import (
- "testing"
-
- "github.com/stretchr/testify/assert"
-)
-
-func TestVirtualMachineConfig_MergeIDEs(t *testing.T) {
- config := &VirtualMachineConfig{
- IDE0: "local:100/vm-100-disk-0.qcow2",
- IDE1: "local:100/vm-100-disk-1.qcow2",
- IDE2: "local:iso/debian-12.iso,media=cdrom",
- }
-
- ides := config.MergeIDEs()
- assert.NotNil(t, ides)
- assert.Len(t, ides, 3)
- assert.Equal(t, "local:100/vm-100-disk-0.qcow2", ides["ide0"])
- assert.Equal(t, "local:100/vm-100-disk-1.qcow2", ides["ide1"])
- assert.Equal(t, "local:iso/debian-12.iso,media=cdrom", ides["ide2"])
-
- // Test idempotency - calling again should return the same map
- ides2 := config.MergeIDEs()
- assert.Equal(t, ides, ides2)
-}
-
-func TestVirtualMachineConfig_MergeSCSIs(t *testing.T) {
- config := &VirtualMachineConfig{
- SCSI0: "local-lvm:vm-100-disk-0,size=32G",
- SCSI1: "local-lvm:vm-100-disk-1,size=64G",
- SCSI10: "local-lvm:vm-100-disk-10,size=128G",
- }
-
- scsis := config.MergeSCSIs()
- assert.NotNil(t, scsis)
- assert.Len(t, scsis, 3)
- assert.Equal(t, "local-lvm:vm-100-disk-0,size=32G", scsis["scsi0"])
- assert.Equal(t, "local-lvm:vm-100-disk-1,size=64G", scsis["scsi1"])
- assert.Equal(t, "local-lvm:vm-100-disk-10,size=128G", scsis["scsi10"])
-
- // Test idempotency
- scsis2 := config.MergeSCSIs()
- assert.Equal(t, scsis, scsis2)
-}
-
-func TestVirtualMachineConfig_MergeSATAs(t *testing.T) {
- config := &VirtualMachineConfig{
- SATA0: "local-lvm:vm-100-disk-0,size=32G",
- SATA1: "local-lvm:vm-100-disk-1,size=64G",
- }
-
- satas := config.MergeSATAs()
- assert.NotNil(t, satas)
- assert.Len(t, satas, 2)
- assert.Equal(t, "local-lvm:vm-100-disk-0,size=32G", satas["sata0"])
- assert.Equal(t, "local-lvm:vm-100-disk-1,size=64G", satas["sata1"])
-}
-
-func TestVirtualMachineConfig_MergeNets(t *testing.T) {
- config := &VirtualMachineConfig{
- Net0: "virtio=00:11:22:33:44:55,bridge=vmbr0",
- Net1: "virtio=AA:BB:CC:DD:EE:FF,bridge=vmbr1",
- }
-
- nets := config.MergeNets()
- assert.NotNil(t, nets)
- assert.Len(t, nets, 2)
- assert.Equal(t, "virtio=00:11:22:33:44:55,bridge=vmbr0", nets["net0"])
- assert.Equal(t, "virtio=AA:BB:CC:DD:EE:FF,bridge=vmbr1", nets["net1"])
-}
-
-func TestVirtualMachineConfig_MergeVirtIOs(t *testing.T) {
- config := &VirtualMachineConfig{
- VirtIO0: "local-lvm:vm-100-disk-0,size=32G",
- VirtIO1: "local-lvm:vm-100-disk-1,size=64G",
- }
-
- virtios := config.MergeVirtIOs()
- assert.NotNil(t, virtios)
- assert.Len(t, virtios, 2)
- assert.Equal(t, "local-lvm:vm-100-disk-0,size=32G", virtios["virtio0"])
- assert.Equal(t, "local-lvm:vm-100-disk-1,size=64G", virtios["virtio1"])
-}
-
-func TestVirtualMachineConfig_MergeUnuseds(t *testing.T) {
- config := &VirtualMachineConfig{
- Unused0: "local-lvm:vm-100-disk-0",
- Unused1: "local-lvm:vm-100-disk-1",
- }
-
- unuseds := config.MergeUnuseds()
- assert.NotNil(t, unuseds)
- assert.Len(t, unuseds, 2)
- assert.Equal(t, "local-lvm:vm-100-disk-0", unuseds["unused0"])
- assert.Equal(t, "local-lvm:vm-100-disk-1", unuseds["unused1"])
-}
-
-func TestVirtualMachineConfig_MergeSerials(t *testing.T) {
- config := &VirtualMachineConfig{
- Serial0: "socket",
- Serial1: "/dev/ttyS1",
- }
-
- serials := config.MergeSerials()
- assert.NotNil(t, serials)
- assert.Len(t, serials, 2)
- assert.Equal(t, "socket", serials["serial0"])
- assert.Equal(t, "/dev/ttyS1", serials["serial1"])
-}
-
-func TestVirtualMachineConfig_MergeUSBs(t *testing.T) {
- config := &VirtualMachineConfig{
- USB0: "host=1234:5678",
- USB1: "host=8765:4321",
- }
-
- usbs := config.MergeUSBs()
- assert.NotNil(t, usbs)
- assert.Len(t, usbs, 2)
- assert.Equal(t, "host=1234:5678", usbs["usb0"])
- assert.Equal(t, "host=8765:4321", usbs["usb1"])
-}
-
-func TestVirtualMachineConfig_MergeHostPCIs(t *testing.T) {
- config := &VirtualMachineConfig{
- HostPCI0: "0000:01:00.0",
- HostPCI1: "0000:02:00.0,pcie=1",
- }
-
- hostpcis := config.MergeHostPCIs()
- assert.NotNil(t, hostpcis)
- assert.Len(t, hostpcis, 2)
- assert.Equal(t, "0000:01:00.0", hostpcis["hostpci0"])
- assert.Equal(t, "0000:02:00.0,pcie=1", hostpcis["hostpci1"])
-}
-
-func TestVirtualMachineConfig_MergeNumas(t *testing.T) {
- config := &VirtualMachineConfig{
- Numa0: "cpus=0-1,memory=2048",
- Numa1: "cpus=2-3,memory=2048",
- }
-
- numas := config.MergeNumas()
- assert.NotNil(t, numas)
- assert.Len(t, numas, 2)
- assert.Equal(t, "cpus=0-1,memory=2048", numas["numa0"])
- assert.Equal(t, "cpus=2-3,memory=2048", numas["numa1"])
-}
-
-func TestVirtualMachineConfig_MergeParallels(t *testing.T) {
- config := &VirtualMachineConfig{
- Parallel0: "/dev/parport0",
- }
-
- parallels := config.MergeParallels()
- assert.NotNil(t, parallels)
- assert.Len(t, parallels, 1)
- assert.Equal(t, "/dev/parport0", parallels["parallel0"])
-}
-
-func TestVirtualMachineConfig_MergeIPConfigs(t *testing.T) {
- config := &VirtualMachineConfig{
- IPConfig0: "ip=192.168.1.10/24,gw=192.168.1.1",
- IPConfig1: "ip=10.0.0.10/24,gw=10.0.0.1",
- }
-
- ipconfigs := config.MergeIPConfigs()
- assert.NotNil(t, ipconfigs)
- assert.Len(t, ipconfigs, 2)
- assert.Equal(t, "ip=192.168.1.10/24,gw=192.168.1.1", ipconfigs["ipconfig0"])
- assert.Equal(t, "ip=10.0.0.10/24,gw=10.0.0.1", ipconfigs["ipconfig1"])
-}
-
-func TestVirtualMachineConfig_MergeDisks(t *testing.T) {
- config := &VirtualMachineConfig{
- IDE0: "local:100/vm-100-disk-0.qcow2",
- SCSI0: "local-lvm:vm-100-disk-1,size=32G",
- SATA0: "local-lvm:vm-100-disk-2,size=64G",
- VirtIO0: "local-lvm:vm-100-disk-3,size=128G",
- }
-
- disks := config.MergeDisks()
- assert.NotNil(t, disks)
- assert.Len(t, disks, 4)
- assert.Equal(t, "local:100/vm-100-disk-0.qcow2", disks["ide0"])
- assert.Equal(t, "local-lvm:vm-100-disk-1,size=32G", disks["scsi0"])
- assert.Equal(t, "local-lvm:vm-100-disk-2,size=64G", disks["sata0"])
- assert.Equal(t, "local-lvm:vm-100-disk-3,size=128G", disks["virtio0"])
-}
-
-func TestVirtualMachineConfig_MergeDisks_Empty(t *testing.T) {
- config := &VirtualMachineConfig{}
-
- disks := config.MergeDisks()
- assert.NotNil(t, disks)
- assert.Len(t, disks, 0)
-}
-
-func TestVirtualMachineConfig_MergeIDEs_Empty(t *testing.T) {
- config := &VirtualMachineConfig{}
-
- ides := config.MergeIDEs()
- assert.NotNil(t, ides)
- assert.Len(t, ides, 0)
-}
-
-func TestVirtualMachineConfig_MergeIndexedDevices_IgnoresNonNumeric(t *testing.T) {
- // This tests that fields like SCSIHW (which starts with SCSI but has non-numeric suffix)
- // are correctly ignored by the merge function
- config := &VirtualMachineConfig{
- SCSI0: "local-lvm:vm-100-disk-0,size=32G",
- SCSIHW: "virtio-scsi-pci",
- }
-
- scsis := config.MergeSCSIs()
- assert.NotNil(t, scsis)
- assert.Len(t, scsis, 1) // Should only have SCSI0, not SCSIHW
- assert.Equal(t, "local-lvm:vm-100-disk-0,size=32G", scsis["scsi0"])
- _, hasSCSIHW := scsis["scsihw"]
- assert.False(t, hasSCSIHW, "SCSIHW should not be included in merge")
-}
diff --git a/go-proxmox/virtual_machine_test.go b/go-proxmox/virtual_machine_test.go
deleted file mode 100644
index a3e9f88..0000000
--- a/go-proxmox/virtual_machine_test.go
+++ /dev/null
@@ -1,374 +0,0 @@
-package proxmox
-
-import (
- "context"
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- "github.com/luthermonson/go-proxmox/tests/mocks"
-)
-
-func TestVirtualMachine_Ping(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- vm := VirtualMachine{
- client: client,
- VMID: 101,
- Node: "node1",
- }
-
- assert.Nil(t, vm.Ping(ctx))
- assert.Equal(t, StringOrUint64(101), vm.VMID)
-}
-
-func TestVirtualMachine_RRDData(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- vm := VirtualMachine{
- client: client,
- VMID: 101,
- Node: "node1",
- }
-
- rdddata, err := vm.RRDData(ctx, TimeframeHour)
- assert.Nil(t, err)
- assert.Len(t, rdddata, 70)
-}
-
-func TestVirtualMachineClone(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- vmTemplate := VirtualMachine{
- client: client,
- Node: "node1",
- Template: true,
- VMID: 101,
- }
- cloneOptions := VirtualMachineCloneOptions{
- NewID: 102,
- }
- newID, _, err := vmTemplate.Clone(ctx, &cloneOptions)
- assert.Nil(t, err)
- assert.Equal(t, cloneOptions.NewID, newID)
-}
-
-func TestVirtualMachineCloneWithoutNewID(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- vmTemplate := VirtualMachine{
- client: client,
- Node: "node1",
- Template: true,
- VMID: 101,
- }
- cloneOptions := VirtualMachineCloneOptions{}
- newID, _, err := vmTemplate.Clone(ctx, &cloneOptions)
- assert.Nil(t, err)
- assert.Equal(t, 100, newID)
-}
-
-func TestVirtualMachineState(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- runningVM := VirtualMachine{
- Status: "running",
- QMPStatus: "running",
- }
- assert.False(t, runningVM.IsStopped())
- assert.False(t, runningVM.IsPaused())
- assert.False(t, runningVM.IsHibernated())
- assert.True(t, runningVM.IsRunning())
- stoppedVM := VirtualMachine{
- Status: "stopped",
- QMPStatus: "stopped",
- }
- assert.True(t, stoppedVM.IsStopped())
- assert.False(t, stoppedVM.IsPaused())
- assert.False(t, stoppedVM.IsHibernated())
- assert.False(t, stoppedVM.IsRunning())
- pausedVM := VirtualMachine{
- Status: "running",
- QMPStatus: "paused",
- }
- assert.False(t, pausedVM.IsStopped())
- assert.True(t, pausedVM.IsPaused())
- assert.False(t, pausedVM.IsHibernated())
- assert.False(t, pausedVM.IsRunning())
- hibernatedVM := VirtualMachine{
- Status: "stopped",
- QMPStatus: "stopped",
- Lock: "suspended",
- }
- assert.False(t, hibernatedVM.IsStopped())
- assert.False(t, hibernatedVM.IsPaused())
- assert.True(t, hibernatedVM.IsHibernated())
- assert.False(t, hibernatedVM.IsRunning())
-}
-
-func TestVirtualMachineStateWithoutQMPStatus(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- runningVM := VirtualMachine{
- Status: "running",
- }
- assert.False(t, runningVM.IsStopped())
- assert.False(t, runningVM.IsPaused())
- assert.False(t, runningVM.IsHibernated())
- assert.True(t, runningVM.IsRunning())
- stoppedVM := VirtualMachine{
- Status: "stopped",
- }
- assert.True(t, stoppedVM.IsStopped())
- assert.False(t, stoppedVM.IsPaused())
- assert.False(t, stoppedVM.IsHibernated())
- assert.False(t, stoppedVM.IsRunning())
- hibernatedVM := VirtualMachine{
- Status: "stopped",
- Lock: "suspended",
- }
- assert.False(t, hibernatedVM.IsStopped())
- assert.False(t, hibernatedVM.IsPaused())
- assert.True(t, hibernatedVM.IsHibernated())
- assert.False(t, hibernatedVM.IsRunning())
-}
-
-
-func TestVirtualMachine_Config(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- vm := VirtualMachine{
- client: client,
- VMID: 100,
- Node: "node1",
- }
-
- // Config() with options updates the config and returns a task
- task, err := vm.Config(ctx, VirtualMachineOption{Name: "tags", Value: "test;demo"})
- assert.Nil(t, err)
- assert.NotNil(t, task)
- assert.Equal(t, "node1", task.Node)
- assert.Equal(t, "qmconfig", task.Type)
- assert.Equal(t, "100", task.ID)
-}
-
-func TestVirtualMachine_Start(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- vm := VirtualMachine{
- client: client,
- VMID: 100,
- Node: "node1",
- }
-
- task, err := vm.Start(ctx)
- assert.Nil(t, err)
- assert.NotNil(t, task)
- assert.Equal(t, "node1", task.Node)
- assert.Equal(t, "qmstart", task.Type)
- assert.Equal(t, "100", task.ID)
-}
-
-func TestVirtualMachine_Stop(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- vm := VirtualMachine{
- client: client,
- VMID: 100,
- Node: "node1",
- }
-
- task, err := vm.Stop(ctx)
- assert.Nil(t, err)
- assert.NotNil(t, task)
- assert.Equal(t, "node1", task.Node)
- assert.Equal(t, "qmstop", task.Type)
- assert.Equal(t, "100", task.ID)
-}
-
-func TestVirtualMachine_Shutdown(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- vm := VirtualMachine{
- client: client,
- VMID: 100,
- Node: "node1",
- }
-
- task, err := vm.Shutdown(ctx)
- assert.Nil(t, err)
- assert.NotNil(t, task)
- assert.Equal(t, "node1", task.Node)
- assert.Equal(t, "qmshutdown", task.Type)
- assert.Equal(t, "100", task.ID)
-}
-
-func TestVirtualMachine_Reboot(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- vm := VirtualMachine{
- client: client,
- VMID: 100,
- Node: "node1",
- }
-
- task, err := vm.Reboot(ctx)
- assert.Nil(t, err)
- assert.NotNil(t, task)
- assert.Equal(t, "node1", task.Node)
- assert.Equal(t, "qmreboot", task.Type)
- assert.Equal(t, "100", task.ID)
-}
-
-func TestVirtualMachine_Reset(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- vm := VirtualMachine{
- client: client,
- VMID: 100,
- Node: "node1",
- }
-
- task, err := vm.Reset(ctx)
- assert.Nil(t, err)
- assert.NotNil(t, task)
- assert.Equal(t, "node1", task.Node)
- assert.Equal(t, "qmreset", task.Type)
- assert.Equal(t, "100", task.ID)
-}
-
-func TestVirtualMachine_Pause(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- vm := VirtualMachine{
- client: client,
- VMID: 100,
- Node: "node1",
- }
-
- task, err := vm.Pause(ctx)
- assert.Nil(t, err)
- assert.NotNil(t, task)
- assert.Equal(t, "node1", task.Node)
- assert.Equal(t, "qmsuspend", task.Type)
- assert.Equal(t, "100", task.ID)
-}
-
-func TestVirtualMachine_Resume(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- vm := VirtualMachine{
- client: client,
- VMID: 100,
- Node: "node1",
- }
-
- task, err := vm.Resume(ctx)
- assert.Nil(t, err)
- assert.NotNil(t, task)
- assert.Equal(t, "node1", task.Node)
- assert.Equal(t, "qmresume", task.Type)
- assert.Equal(t, "100", task.ID)
-}
-
-func TestVirtualMachine_Delete(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- vm := VirtualMachine{
- client: client,
- VMID: 999,
- Node: "node1",
- }
-
- task, err := vm.Delete(ctx)
- assert.Nil(t, err)
- assert.NotNil(t, task)
- assert.Equal(t, "node1", task.Node)
- assert.Equal(t, "qmdestroy", task.Type)
- assert.Equal(t, "999", task.ID)
-}
-
-func TestVirtualMachine_Snapshots(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- vm := VirtualMachine{
- client: client,
- VMID: 100,
- Node: "node1",
- }
-
- snapshots, err := vm.Snapshots(ctx)
- assert.Nil(t, err)
- assert.NotNil(t, snapshots)
- assert.Len(t, snapshots, 3)
- assert.Equal(t, "current", snapshots[0].Name)
- assert.Equal(t, "snap1", snapshots[1].Name)
- assert.Equal(t, "Before upgrade", snapshots[1].Description)
- assert.Equal(t, "snap2", snapshots[2].Name)
-}
-
-func TestVirtualMachine_NewSnapshot(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- vm := VirtualMachine{
- client: client,
- VMID: 100,
- Node: "node1",
- }
-
- task, err := vm.NewSnapshot(ctx, "test-snapshot")
- assert.Nil(t, err)
- assert.NotNil(t, task)
- assert.Equal(t, "node1", task.Node)
- assert.Equal(t, "qmsnapshot", task.Type)
- assert.Equal(t, "100", task.ID)
-}
-
-func TestVirtualMachine_SnapshotRollback(t *testing.T) {
- mocks.On(mockConfig)
- defer mocks.Off()
- client := mockClient()
- ctx := context.Background()
- vm := VirtualMachine{
- client: client,
- VMID: 100,
- Node: "node1",
- }
-
- task, err := vm.SnapshotRollback(ctx, "snap1")
- assert.Nil(t, err)
- assert.NotNil(t, task)
- assert.Equal(t, "node1", task.Node)
- assert.Equal(t, "qmrollback", task.Type)
- assert.Equal(t, "100", task.ID)
-}
diff --git a/go.mod b/go.mod
index 9b96ab8..a5f3476 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
module github.com/UNHCSC/pve-koth
-go 1.24.7
+go 1.25
require (
github.com/BurntSushi/toml v1.5.0
@@ -10,7 +10,8 @@ require (
github.com/gofiber/fiber/v2 v2.52.10
github.com/gofiber/template/html/v2 v2.1.3
github.com/golang-jwt/jwt/v5 v5.3.0
- github.com/luthermonson/go-proxmox v0.2.3
+ github.com/gorilla/websocket v1.5.3
+ github.com/luthermonson/go-proxmox v0.3.2
github.com/stretchr/testify v1.10.0
github.com/z46-dev/go-logger v0.0.0-20250326164502-928461111cea
github.com/z46-dev/gomysql v0.0.0-20251125024913-d4c93b06ec11
@@ -34,7 +35,6 @@ require (
github.com/gofiber/template v1.8.3 // indirect
github.com/gofiber/utils v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
- github.com/gorilla/websocket v1.5.3 // indirect
github.com/jinzhu/copier v0.4.0 // indirect
github.com/klauspost/compress v1.18.2 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
diff --git a/go.sum b/go.sum
index 628ba7f..e03b57f 100644
--- a/go.sum
+++ b/go.sum
@@ -48,8 +48,6 @@ github.com/gofiber/template v1.8.3 h1:hzHdvMwMo/T2kouz2pPCA0zGiLCeMnoGsQZBTSYgZx
github.com/gofiber/template v1.8.3/go.mod h1:bs/2n0pSNPOkRa5VJ8zTIvedcI/lEYxzV3+YPXdBvq8=
github.com/gofiber/template/html/v2 v2.1.3 h1:n1LYBtmr9C0V/k/3qBblXyMxV5B0o/gpb6dFLp8ea+o=
github.com/gofiber/template/html/v2 v2.1.3/go.mod h1:U5Fxgc5KpyujU9OqKzy6Kn6Qup6Tm7zdsISR+VpnHRE=
-github.com/gofiber/utils v1.1.0 h1:vdEBpn7AzIUJRhe+CiTOJdUcTg4Q9RK+pEa0KPbLdrM=
-github.com/gofiber/utils v1.1.0/go.mod h1:poZpsnhBykfnY1Mc0KeEa6mSHrS3dV0+oBWyeQmb2e0=
github.com/gofiber/utils v1.2.0 h1:NCaqd+Efg3khhN++eeUUTyBz+byIxAsmIjpl8kKOMIc=
github.com/gofiber/utils v1.2.0/go.mod h1:poZpsnhBykfnY1Mc0KeEa6mSHrS3dV0+oBWyeQmb2e0=
github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo=
@@ -86,8 +84,8 @@ github.com/klauspost/compress v1.18.2 h1:iiPHWW0YrcFgpBYhsA6D1+fqHssJscY/Tm/y2Uq
github.com/klauspost/compress v1.18.2/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
-github.com/luthermonson/go-proxmox v0.2.3 h1:NAjUJ5Jd1ynIK6UHMGd/VLGgNZWpGXhfL+DBmAVSEaA=
-github.com/luthermonson/go-proxmox v0.2.3/go.mod h1:oyFgg2WwTEIF0rP6ppjiixOHa5ebK1p8OaRiFhvICBQ=
+github.com/luthermonson/go-proxmox v0.3.2 h1:/zUg6FCl9cAABx0xU3OIgtDtClY0gVXxOCsrceDNylc=
+github.com/luthermonson/go-proxmox v0.3.2/go.mod h1:oyFgg2WwTEIF0rP6ppjiixOHa5ebK1p8OaRiFhvICBQ=
github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg=
github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
@@ -122,39 +120,27 @@ github.com/z46-dev/go-logger v0.0.0-20250326164502-928461111cea h1:pidQXljD41B5s
github.com/z46-dev/go-logger v0.0.0-20250326164502-928461111cea/go.mod h1:TV0UzNpGgVs2dJxJCQStnqpUqkaUKvworn5uXxKkIC0=
github.com/z46-dev/gomysql v0.0.0-20251125024913-d4c93b06ec11 h1:a9mv8grsKxg+2Pz6IrpBWwp67aeFAvkSaJir0DYpovw=
github.com/z46-dev/gomysql v0.0.0-20251125024913-d4c93b06ec11/go.mod h1:IFQuHX0/6DQdiOFE8zVdrCLPQB4Q+3WhisAZh2RnOew=
-golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q=
-golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4=
golang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=
golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=
-golang.org/x/exp v0.0.0-20251125195548-87e1e737ad39 h1:DHNhtq3sNNzrvduZZIiFyXWOL9IWaDPHqTnLJp+rCBY=
-golang.org/x/exp v0.0.0-20251125195548-87e1e737ad39/go.mod h1:46edojNIoXTNOhySWIWdix628clX9ODXwPsQuG6hsK0=
golang.org/x/exp v0.0.0-20251209150349-8475f28825e9 h1:MDfG8Cvcqlt9XXrmEiD4epKn7VJHZO84hejP9Jmp0MM=
golang.org/x/exp v0.0.0-20251209150349-8475f28825e9/go.mod h1:EPRbTFwzwjXj9NpYyyrvenVh9Y+GFeEvMNh7Xuz7xgU=
-golang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk=
-golang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc=
golang.org/x/mod v0.31.0 h1:HaW9xtz0+kOcWKwli0ZXy79Ix+UW/vOfmWI5QVd2tgI=
+golang.org/x/mod v0.31.0/go.mod h1:43JraMp9cGx1Rx3AqioxrbrhNsLl2l/iNAvuBkrezpg=
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
-golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
-golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
+golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sys v0.0.0-20210331175145-43e1dd70ce54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
-golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
-golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU=
-golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254=
golang.org/x/term v0.38.0 h1:PQ5pkm/rLO6HnxFR7N2lJHOZX6Kez5Y1gDSJla6jo7Q=
-golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
-golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
+golang.org/x/term v0.38.0/go.mod h1:bSEAKrOT1W+VSu9TSCMtoGEOUcKxOKgl3LE5QEF/xVg=
golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=
golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=
-golang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ=
-golang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ=
golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA=
+golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/koth/koth.go b/koth/koth.go
index 1707499..9563027 100644
--- a/koth/koth.go
+++ b/koth/koth.go
@@ -18,6 +18,7 @@ import (
"github.com/UNHCSC/pve-koth/db"
"github.com/UNHCSC/pve-koth/proxmoxAPI"
"github.com/UNHCSC/pve-koth/ssh"
+ "github.com/luthermonson/go-proxmox"
"github.com/z46-dev/go-logger"
)
@@ -119,6 +120,12 @@ func CreateNewCompWithLogger(request *db.CreateCompetitionRequest, logSink Progr
localLog = wrapLoggerSafe(localLog)
localLog.Statusf("Creating new competition: %s\n", request.CompetitionName)
+ templateLookup, lookupErr := ensureTemplateLookup(request)
+ if lookupErr != nil {
+ localLog.Errorf("Invalid container template configuration: %v\n", lookupErr)
+ err = lookupErr
+ return
+ }
// 1. Create structs & Data Dir(s)
localLog.Status("Creating data directories...")
@@ -192,15 +199,6 @@ func CreateNewCompWithLogger(request *db.CreateCompetitionRequest, logSink Progr
SSHPrivKeyPath: filepath.Join(dataDir, "ssh", "id_rsa"),
ContainerRestrictions: db.ContainerRestrictions{
HostnamePrefix: fmt.Sprintf("koth-%s", request.CompetitionID),
- RootPassword: request.ContainerSpecs.RootPassword,
- Template: request.ContainerSpecs.TemplatePath,
- StoragePool: request.ContainerSpecs.StoragePool,
- GatewayIPv4: request.ContainerSpecs.GatewayIPv4,
- Nameserver: request.ContainerSpecs.NameServerIPv4,
- SearchDomain: request.ContainerSpecs.SearchDomain,
- StorageGB: request.ContainerSpecs.StorageSizeGB,
- MemoryMB: request.ContainerSpecs.MemoryMB,
- Cores: request.ContainerSpecs.Cores,
IndividualCIDR: config.Config.Network.ContainerCIDR,
},
IsPrivate: !request.Privacy.Public,
@@ -298,6 +296,12 @@ func CreateNewCompWithLogger(request *db.CreateCompetitionRequest, logSink Progr
teamNetworks[team.ID].ipsByName[sanitizedName] = hostIP.String()
teamNetworks[team.ID].ipOrder = append(teamNetworks[team.ID].ipOrder, hostIP.String())
+ var templateSpec db.ContainerSpecTemplate
+ if templateSpec, err = ResolveContainerSpecTemplate(templateLookup, templateCfg.ContainerSpecsTemplate); err != nil {
+ localLog.Errorf("Failed to resolve template for %s: %v\n", templateCfg.Name, err)
+ return
+ }
+
var plan = &containerPlan{
team: team,
name: templateCfg.Name,
@@ -306,19 +310,19 @@ func CreateNewCompWithLogger(request *db.CreateCompetitionRequest, logSink Progr
ipAddress: hostIP.String(),
setupScripts: append([]string(nil), templateCfg.SetupScript...),
options: &proxmoxAPI.ContainerCreateOptions{
- TemplatePath: request.ContainerSpecs.TemplatePath,
- StoragePool: request.ContainerSpecs.StoragePool,
+ TemplatePath: templateSpec.TemplatePath,
+ StoragePool: templateSpec.StoragePool,
Hostname: fmt.Sprintf("%s-team-%d-%s", comp.ContainerRestrictions.HostnamePrefix, teamIndex+1, templateCfg.Name),
- RootPassword: request.ContainerSpecs.RootPassword,
+ RootPassword: templateSpec.RootPassword,
RootSSHPublicKey: publicKey,
- StorageSizeGB: request.ContainerSpecs.StorageSizeGB,
- MemoryMB: request.ContainerSpecs.MemoryMB,
- Cores: request.ContainerSpecs.Cores,
- GatewayIPv4: request.ContainerSpecs.GatewayIPv4,
+ StorageSizeGB: templateSpec.StorageSizeGB,
+ MemoryMB: templateSpec.MemoryMB,
+ Cores: templateSpec.Cores,
+ GatewayIPv4: config.Config.Network.ContainerGateway,
IPv4Address: hostIP.String(),
CIDRBlock: config.Config.Network.ContainerCIDR,
- NameServer: request.ContainerSpecs.NameServerIPv4,
- SearchDomain: request.ContainerSpecs.SearchDomain,
+ NameServer: config.Config.Network.ContainerNameserver,
+ SearchDomain: config.Config.Network.ContainerSearchDomain,
},
}
@@ -452,26 +456,18 @@ func provisionContainerPlan(ctx context.Context, log ProgressLogger, plan *conta
}
}
- log.Statusf("Waiting for container %d (%s) to come online...", createResult.CTID, plan.ipAddress)
- if err = ssh.WaitOnline(plan.ipAddress); err != nil {
- log.Errorf("Container %d did not come online: %v\n", createResult.CTID, err)
- return entry, err
- }
-
- var conn *ssh.SSHConnection
- if conn, err = ssh.ConnectOnceReadyWithRetry("root", plan.ipAddress, 22, 5, ssh.WithPrivateKey([]byte(privateKey))); err != nil {
- log.Errorf("Failed to connect to container %d via SSH: %v\n", createResult.CTID, err)
- return entry, err
- }
- defer conn.Close()
-
if ctx != nil {
if ctxErr := ctx.Err(); ctxErr != nil {
return entry, ctxErr
}
}
- if err = runSetupScripts(log, conn, comp, plan, network, publicFolderURL, artifactBaseURL, enableAdvancedLogging); err != nil {
+ if err = waitForConsoleReady(api, createResult.Container, plan.options.RootPassword); err != nil {
+ log.Errorf("Container %d console not ready: %v\n", createResult.CTID, err)
+ return entry, err
+ }
+
+ if err = runSetupScripts(log, api, createResult.Container, comp, plan, network, publicFolderURL, artifactBaseURL, enableAdvancedLogging); err != nil {
return entry, err
}
@@ -498,7 +494,7 @@ func provisionContainerPlan(ctx context.Context, log ProgressLogger, plan *conta
return entry, nil
}
-func runSetupScripts(log ProgressLogger, conn *ssh.SSHConnection, comp *db.Competition, plan *containerPlan, network *teamNetwork, publicFolderURL, artifactBaseURL string, logEnv bool) (err error) {
+func runSetupScripts(log ProgressLogger, api *proxmoxAPI.ProxmoxAPI, ct *proxmox.Container, comp *db.Competition, plan *containerPlan, network *teamNetwork, publicFolderURL, artifactBaseURL string, logEnv bool) (err error) {
if len(plan.setupScripts) == 0 {
log.Statusf("No setup scripts defined for %s; skipping.", plan.options.Hostname)
return nil
@@ -519,7 +515,6 @@ func runSetupScripts(log ProgressLogger, conn *ssh.SSHConnection, comp *db.Compe
var (
exitCode int
- output string
command = ssh.LoadAndRunScript(scriptURL, token, envs)
)
@@ -529,13 +524,14 @@ func runSetupScripts(log ProgressLogger, conn *ssh.SSHConnection, comp *db.Compe
log.Statusf("Executing setup script %s on %s...", scriptPath, plan.options.Hostname)
}
- if exitCode, _, err = conn.SendWithOutput(command); err != nil {
+ var stderr, stdout string
+ if stdout, stderr, exitCode, err = api.RawExecuteWithRetries(ct, "root", plan.options.RootPassword, command, 2); err != nil {
log.Errorf("Failed to execute setup script %s on %s: %v\n", scriptPath, plan.options.Hostname, err)
return
}
if logEnv {
- log.Statusf("Setup script %s exited with code %d, output: %s", scriptPath, exitCode, output)
+ log.Statusf("Setup script %s exited with code %d, stdout: %s, stderr: %s", scriptPath, exitCode, stdout, stderr)
} else {
log.Statusf("Setup script %s exited with code %d.", scriptPath, exitCode)
}
@@ -546,15 +542,22 @@ func runSetupScripts(log ProgressLogger, conn *ssh.SSHConnection, comp *db.Compe
return
}
- if err = conn.Reset(); err != nil {
- log.Errorf("Failed to reset SSH session for %s: %v\n", plan.options.Hostname, err)
- return
- }
}
return nil
}
+func waitForConsoleReady(api *proxmoxAPI.ProxmoxAPI, ct *proxmox.Container, rootPassword string) error {
+ const attempts = 5
+ for i := 0; i < attempts; i++ {
+ if _, _, exitCode, err := api.RawExecuteWithRetries(ct, "root", rootPassword, "echo KOTH_READY", 0); err == nil && exitCode == 0 {
+ return nil
+ }
+ time.Sleep(time.Second * time.Duration(i+1))
+ }
+ return fmt.Errorf("container console not ready for raw execution")
+}
+
func buildScriptEnv(comp *db.Competition, plan *containerPlan, network *teamNetwork, publicFolderURL string) map[string]any {
var envs = map[string]any{
"KOTH_COMP_ID": comp.SystemID,
@@ -909,3 +912,56 @@ func sanitizeRelativePath(relative string) string {
return relative
}
+
+func ensureTemplateLookup(request *db.CreateCompetitionRequest) (map[string]db.ContainerSpecTemplate, error) {
+ if request == nil {
+ return nil, fmt.Errorf("competition request is nil")
+ }
+ if request.TemplateLookup != nil {
+ return request.TemplateLookup, nil
+ }
+ lookup, err := BuildContainerSpecTemplateIndex(request.ContainerSpecsTemplates)
+ if err != nil {
+ return nil, err
+ }
+ request.TemplateLookup = lookup
+ return lookup, nil
+}
+
+func BuildContainerSpecTemplateIndex(raw map[string]db.ContainerSpecTemplate) (map[string]db.ContainerSpecTemplate, error) {
+ if len(raw) == 0 {
+ return nil, fmt.Errorf("containerSpecsTemplates must include at least one entry")
+ }
+
+ index := make(map[string]db.ContainerSpecTemplate, len(raw))
+ for name, tpl := range raw {
+ key := strings.TrimSpace(name)
+ if key == "" {
+ return nil, fmt.Errorf("containerSpecsTemplates contains an empty name")
+ }
+ if _, exists := index[key]; exists {
+ return nil, fmt.Errorf("duplicate container template name %q", key)
+ }
+ index[key] = tpl
+ }
+
+ return index, nil
+}
+
+func ResolveContainerSpecTemplate(index map[string]db.ContainerSpecTemplate, rawName string) (db.ContainerSpecTemplate, error) {
+ if len(index) == 0 {
+ return db.ContainerSpecTemplate{}, fmt.Errorf("containerSpecsTemplates is not defined")
+ }
+
+ name := strings.TrimSpace(rawName)
+ if name == "" {
+ return db.ContainerSpecTemplate{}, fmt.Errorf("container config missing containerSpecsTemplate reference")
+ }
+
+ tpl, ok := index[name]
+ if !ok {
+ return db.ContainerSpecTemplate{}, fmt.Errorf("template %q is not defined", name)
+ }
+
+ return tpl, nil
+}
diff --git a/koth/redeploy.go b/koth/redeploy.go
index b2ecbcb..f7da306 100644
--- a/koth/redeploy.go
+++ b/koth/redeploy.go
@@ -11,7 +11,6 @@ import (
"github.com/UNHCSC/pve-koth/config"
"github.com/UNHCSC/pve-koth/db"
"github.com/UNHCSC/pve-koth/proxmoxAPI"
- "github.com/UNHCSC/pve-koth/ssh"
"github.com/luthermonson/go-proxmox"
)
@@ -91,14 +90,6 @@ func redeployContainer(log ProgressLogger, id int64, startAfter, enableAdvancedL
}
var publicKey = strings.TrimSpace(string(publicKeyData))
- var privateKey []byte
- if comp.SSHPrivKeyPath == "" {
- return fmt.Errorf("competition %s missing SSH private key", comp.SystemID)
- }
- if privateKey, err = os.ReadFile(comp.SSHPrivKeyPath); err != nil {
- return fmt.Errorf("read ssh private key: %w", err)
- }
-
if strings.TrimSpace(record.IPAddress) == "" {
return fmt.Errorf("container %d missing recorded IP address", record.PVEID)
}
@@ -117,6 +108,11 @@ func redeployContainer(log ProgressLogger, id int64, startAfter, enableAdvancedL
return fmt.Errorf("build team network: %w", err)
}
+ var templateSpec db.ContainerSpecTemplate
+ if templateSpec, err = ResolveContainerSpecTemplate(req.TemplateLookup, cfg.ContainerSpecsTemplate); err != nil {
+ return fmt.Errorf("resolve template for %s: %w", cfg.Name, err)
+ }
+
plan := &containerPlan{
team: team,
name: cfg.Name,
@@ -125,19 +121,19 @@ func redeployContainer(log ProgressLogger, id int64, startAfter, enableAdvancedL
ipAddress: record.IPAddress,
setupScripts: append([]string(nil), cfg.SetupScript...),
options: &proxmoxAPI.ContainerCreateOptions{
- TemplatePath: comp.ContainerRestrictions.Template,
- StoragePool: comp.ContainerRestrictions.StoragePool,
+ TemplatePath: templateSpec.TemplatePath,
+ StoragePool: templateSpec.StoragePool,
Hostname: fmt.Sprintf("%s-team-%d-%s", comp.ContainerRestrictions.HostnamePrefix, teamIndex+1, cfg.Name),
- RootPassword: comp.ContainerRestrictions.RootPassword,
+ RootPassword: templateSpec.RootPassword,
RootSSHPublicKey: publicKey,
- StorageSizeGB: comp.ContainerRestrictions.StorageGB,
- MemoryMB: comp.ContainerRestrictions.MemoryMB,
- Cores: comp.ContainerRestrictions.Cores,
- GatewayIPv4: comp.ContainerRestrictions.GatewayIPv4,
+ StorageSizeGB: templateSpec.StorageSizeGB,
+ MemoryMB: templateSpec.MemoryMB,
+ Cores: templateSpec.Cores,
+ GatewayIPv4: config.Config.Network.ContainerGateway,
IPv4Address: record.IPAddress,
CIDRBlock: config.Config.Network.ContainerCIDR,
- NameServer: comp.ContainerRestrictions.Nameserver,
- SearchDomain: comp.ContainerRestrictions.SearchDomain,
+ NameServer: config.Config.Network.ContainerNameserver,
+ SearchDomain: config.Config.Network.ContainerSearchDomain,
},
}
@@ -184,17 +180,11 @@ func redeployContainer(log ProgressLogger, id int64, startAfter, enableAdvancedL
return fmt.Errorf("failed to start container: %w", err)
}
- if err = ssh.WaitOnline(plan.ipAddress); err != nil {
- return fmt.Errorf("container %d did not come online: %w", record.PVEID, err)
- }
-
- var conn *ssh.SSHConnection
- if conn, err = ssh.ConnectOnceReadyWithRetry("root", plan.ipAddress, 22, 5, ssh.WithPrivateKey(privateKey)); err != nil {
- return fmt.Errorf("failed to connect to container %d via SSH: %w", record.PVEID, err)
+ if err = waitForConsoleReady(api, newContainer, plan.options.RootPassword); err != nil {
+ return fmt.Errorf("container %d console not ready: %w", record.PVEID, err)
}
- defer conn.Close()
- if err = runSetupScripts(log, conn, comp, plan, network, publicFolderURL, artifactBaseURL, enableAdvancedLogging); err != nil {
+ if err = runSetupScripts(log, api, newContainer, comp, plan, network, publicFolderURL, artifactBaseURL, enableAdvancedLogging); err != nil {
return err
}
diff --git a/koth/scoring.go b/koth/scoring.go
index 1fc694e..be47ed7 100644
--- a/koth/scoring.go
+++ b/koth/scoring.go
@@ -121,13 +121,16 @@ func loadCompetitionDefinition(comp *db.Competition) (*db.CreateCompetitionReque
return nil, fmt.Errorf("parse competition config: %w", err)
}
+ if _, err = ensureTemplateLookup(&req); err != nil {
+ return nil, fmt.Errorf("template lookup: %w", err)
+ }
+
return &req, nil
}
func scoreCompetition(comp *db.Competition) (err error) {
var (
req *db.CreateCompetitionRequest
- privKey []byte
compNet *net.IPNet
logPrefix = fmt.Sprintf("competition %s", comp.SystemID)
)
@@ -152,14 +155,6 @@ func scoreCompetition(comp *db.Competition) (err error) {
return fmt.Errorf("%s network invalid: %w", logPrefix, err)
}
- if comp.SSHPrivKeyPath == "" {
- return fmt.Errorf("%s missing SSH private key path", logPrefix)
- }
-
- if privKey, err = os.ReadFile(comp.SSHPrivKeyPath); err != nil {
- return fmt.Errorf("%s failed to read SSH key: %w", logPrefix, err)
- }
-
publicFolderURL := competitionPublicFolderURL(comp)
artifactBaseURL := buildCompetitionArtifactBase(externalBaseURL(), comp.SystemID)
@@ -184,7 +179,7 @@ func scoreCompetition(comp *db.Competition) (err error) {
return
}
- teamScore, containerResults, teamErr := scoreTeam(comp, team, teamIndex, req.TeamContainerConfigs, network, publicFolderURL, artifactBaseURL, privKey)
+ teamScore, containerResults, teamErr := scoreTeam(comp, team, teamIndex, req.TeamContainerConfigs, network, publicFolderURL, artifactBaseURL, req)
if teamErr != nil {
scoringLog.Errorf("team %s scoring had errors: %v\n", team.Name, teamErr)
}
@@ -229,7 +224,7 @@ func buildTeamNetwork(compSubnet *net.IPNet, teamIndex int, configs []db.TeamCon
return network, nil
}
-func scoreTeam(comp *db.Competition, team *db.Team, teamIndex int, configs []db.TeamContainerConfig, network *teamNetwork, publicFolderURL, artifactBaseURL string, privateKey []byte) (int, []containerScoreResult, error) {
+func scoreTeam(comp *db.Competition, team *db.Team, teamIndex int, configs []db.TeamContainerConfig, network *teamNetwork, publicFolderURL, artifactBaseURL string, req *db.CreateCompetitionRequest) (int, []containerScoreResult, error) {
if team == nil || len(configs) == 0 {
return 0, nil, nil
}
@@ -248,6 +243,12 @@ func scoreTeam(comp *db.Competition, team *db.Team, teamIndex int, configs []db.
continue
}
+ templateSpec, specErr := ResolveContainerSpecTemplate(req.TemplateLookup, containerCfg.ContainerSpecsTemplate)
+ if specErr != nil {
+ scoringLog.Errorf("failed to resolve template %s for %s: %v\n", containerCfg.ContainerSpecsTemplate, containerCfg.Name, specErr)
+ continue
+ }
+
plan := &containerPlan{
team: team,
name: containerCfg.Name,
@@ -255,7 +256,8 @@ func scoreTeam(comp *db.Competition, team *db.Team, teamIndex int, configs []db.
order: order,
ipAddress: ipAddress,
options: &proxmoxAPI.ContainerCreateOptions{
- Hostname: fmt.Sprintf("%s-team-%d-%s", comp.ContainerRestrictions.HostnamePrefix, teamIndex+1, containerCfg.Name),
+ Hostname: fmt.Sprintf("%s-team-%d-%s", comp.ContainerRestrictions.HostnamePrefix, teamIndex+1, containerCfg.Name),
+ RootPassword: templateSpec.RootPassword,
},
}
@@ -271,7 +273,7 @@ func scoreTeam(comp *db.Competition, team *db.Team, teamIndex int, configs []db.
wg.Add(1)
go func(cfg db.TeamContainerConfig, plan *containerPlan) {
defer wg.Done()
- score, detail := scoreContainer(comp, plan, network, publicFolderURL, artifactBaseURL, cfg.ScoringScript, cfg.ScoringSchema, privateKey)
+ score, detail := scoreContainer(comp, plan, network, publicFolderURL, artifactBaseURL, cfg.ScoringScript, cfg.ScoringSchema)
mu.Lock()
total += score
results = append(results, detail)
@@ -283,7 +285,7 @@ func scoreTeam(comp *db.Competition, team *db.Team, teamIndex int, configs []db.
return total, results, nil
}
-func scoreContainer(comp *db.Competition, plan *containerPlan, network *teamNetwork, publicFolderURL, artifactBaseURL string, scoringScripts []string, checks []db.ScoringCheck, privateKey []byte) (int, containerScoreResult) {
+func scoreContainer(comp *db.Competition, plan *containerPlan, network *teamNetwork, publicFolderURL, artifactBaseURL string, scoringScripts []string, checks []db.ScoringCheck) (int, containerScoreResult) {
var result containerScoreResult
if plan != nil {
result.Name = plan.name
@@ -336,59 +338,55 @@ func scoreContainer(comp *db.Competition, plan *containerPlan, network *teamNetw
defer RevokeAccessToken(token)
}
- var conn *ssh.SSHConnection
- var err error
+ record, recErr := containerRecordForTeam(plan.team.ID, plan.name)
+ if recErr != nil {
+ scoringLog.Errorf("failed to load container record for %s: %v\n", plan.options.Hostname, recErr)
+ return 0, result
+ }
+ if record == nil {
+ scoringLog.Statusf("Container %s not provisioned; treating checks as failed\n", plan.options.Hostname)
+ return 0, result
+ }
- if len(scoringScripts) > 0 {
- if conn, err = connectForScoring(plan.ipAddress, privateKey); err != nil {
- scoringLog.Errorf("failed to connect to %s (%s): %v\n", plan.options.Hostname, plan.ipAddress, err)
- }
- if conn == nil {
- scoringLog.Statusf("Container %s (%s) is offline or unreachable; scoring will treat checks as failed\n", plan.options.Hostname, plan.ipAddress)
- }
+ ct, ctErr := api.Container(int(record.PVEID))
+ if ctErr != nil {
+ scoringLog.Errorf("failed to load container %s (CTID %d): %v\n", plan.options.Hostname, record.PVEID, ctErr)
+ return 0, result
}
- if conn != nil {
- defer conn.Close()
- for _, scriptPath := range scoringScripts {
- scriptPath = strings.TrimSpace(scriptPath)
- if scriptPath == "" {
- continue
- }
+ for _, scriptPath := range scoringScripts {
+ scriptPath = strings.TrimSpace(scriptPath)
+ if scriptPath == "" {
+ continue
+ }
- scriptURL := buildArtifactFileURL(artifactBaseURL, scriptPath)
- command := ssh.LoadAndRunScript(scriptURL, token, envs)
-
- exitCode, output, execErr := conn.SendWithOutput(command)
- if execErr != nil {
- scoringLog.Errorf("failed to execute scoring script %s on %s: %v\n", scriptPath, plan.options.Hostname, execErr)
- } else if exitCode != 0 {
- scoringLog.Errorf("scoring script %s exited %d on %s\nOutput:\n%s\n", scriptPath, exitCode, plan.options.Hostname, summarizeScriptOutput(string(output)))
- } else if payload, parseErr := parseCheckPayload(output); parseErr != nil {
- scoringLog.Errorf("invalid scoring payload from %s (%s): %v\n", plan.options.Hostname, scriptPath, parseErr)
- } else {
- for rawID, passed := range payload {
- id := strings.TrimSpace(rawID)
- if id == "" {
- continue
- }
- index, known := schemaIndex[id]
- if !known {
- scoringLog.Statusf("scoring script %s reported unknown check %s on %s; ignoring\n", scriptPath, id, plan.options.Hostname)
- continue
- }
- if reported[id] {
- scoringLog.Statusf("scoring script %s reported duplicate result for check %s on %s; keeping first result\n", scriptPath, id, plan.options.Hostname)
- continue
- }
- reported[id] = true
- result.Checks[index].Passed = passed
- }
- }
+ scriptURL := buildArtifactFileURL(artifactBaseURL, scriptPath)
+ command := ssh.LoadAndRunScript(scriptURL, token, envs)
- if resetErr := conn.Reset(); resetErr != nil {
- scoringLog.Errorf("failed to reset SSH session on %s: %v\n", plan.options.Hostname, resetErr)
- break
+ stdout, stderr, exitCode, execErr := api.RawExecuteWithRetries(ct, "root", plan.options.RootPassword, command, 2)
+ if execErr != nil {
+ scoringLog.Errorf("failed to execute scoring script %s on %s: %v\n", scriptPath, plan.options.Hostname, execErr)
+ } else if exitCode != 0 {
+ scoringLog.Errorf("scoring script %s exited %d on %s\nStdout:\n%s\nStderr:\n%s\n", scriptPath, exitCode, plan.options.Hostname, summarizeScriptOutput(stdout), summarizeScriptOutput(stderr))
+ } else if payload, parseErr := parseCheckPayload([]byte(stdout)); parseErr != nil {
+ scoringLog.Errorf("invalid scoring payload from %s (%s): %v\nStdout:\n%s\nStderr:\n%s\n", plan.options.Hostname, scriptPath, parseErr, summarizeScriptOutput(stdout), summarizeScriptOutput(stderr))
+ } else {
+ for rawID, passed := range payload {
+ id := strings.TrimSpace(rawID)
+ if id == "" {
+ continue
+ }
+ index, known := schemaIndex[id]
+ if !known {
+ scoringLog.Statusf("scoring script %s reported unknown check %s on %s; ignoring\n", scriptPath, id, plan.options.Hostname)
+ continue
+ }
+ if reported[id] {
+ scoringLog.Statusf("scoring script %s reported duplicate result for check %s on %s; keeping first result\n", scriptPath, id, plan.options.Hostname)
+ continue
+ }
+ reported[id] = true
+ result.Checks[index].Passed = passed
}
}
}
@@ -485,14 +483,18 @@ func containerStatusForTeam(teamID int64, configName string) (string, error) {
return strings.TrimSpace(results[0].Status), nil
}
-func connectForScoring(ip string, privateKey []byte) (*ssh.SSHConnection, error) {
- var lastErr error
- for attempt := 0; attempt < 3; attempt++ {
- var conn *ssh.SSHConnection
- if conn, lastErr = ssh.Connect("root", ip, 22, ssh.WithPrivateKey(privateKey)); lastErr == nil {
- return conn, nil
- }
- time.Sleep(time.Second * time.Duration(attempt+1))
+func containerRecordForTeam(teamID int64, configName string) (*db.Container, error) {
+ filter := gomysql.NewFilter().
+ KeyCmp(db.Containers.FieldBySQLName("team_id"), gomysql.OpEqual, teamID).
+ And().
+ KeyCmp(db.Containers.FieldBySQLName("container_config_name"), gomysql.OpEqual, strings.TrimSpace(configName))
+
+ results, err := db.Containers.SelectAllWithFilter(filter)
+ if err != nil {
+ return nil, err
+ }
+ if len(results) == 0 {
+ return nil, nil
}
- return nil, lastErr
+ return results[0], nil
}
diff --git a/proxmoxAPI/api.go b/proxmoxAPI/api.go
index 6f90267..22c8165 100644
--- a/proxmoxAPI/api.go
+++ b/proxmoxAPI/api.go
@@ -5,19 +5,30 @@ import (
"crypto/tls"
"fmt"
"net/http"
+ "strings"
"sync"
+ "time"
"github.com/UNHCSC/pve-koth/config"
"github.com/luthermonson/go-proxmox"
)
type ProxmoxAPI struct {
- createLock sync.Mutex
- client *proxmox.Client
- bg context.Context
- Nodes []*proxmox.Node
- Cluster *proxmox.Cluster
- nodeRotator int
+ createLock sync.Mutex
+ client *proxmox.Client
+ bg context.Context
+ Nodes []*proxmox.Node
+ Cluster *proxmox.Cluster
+ nodeRotator int
+ tokenUser string
+ apiHost string
+ apiPort string
+ username string
+ password string
+ InsecureSkipVerify bool
+ httpClient *http.Client
+ ConnectTimeout time.Duration
+ CommandTimeout time.Duration
}
type ProxmoxAPICreateResult struct {
@@ -31,20 +42,38 @@ type ProxmoxAPIBulkCreateResult struct {
}
func InitProxmox() (api *ProxmoxAPI, err error) {
+ var (
+ tlsConfig = &tls.Config{InsecureSkipVerify: true}
+ transport = &http.Transport{TLSClientConfig: tlsConfig}
+ httpClient = &http.Client{
+ Transport: transport,
+ Timeout: 30 * time.Second,
+ }
+ )
+
api = &ProxmoxAPI{
client: proxmox.NewClient(
fmt.Sprintf("https://%s:%s/api2/json", config.Config.Proxmox.Hostname, config.Config.Proxmox.Port),
proxmox.WithHTTPClient(&http.Client{
- Transport: &http.Transport{
- TLSClientConfig: &tls.Config{
- InsecureSkipVerify: true,
- },
- },
+ Transport: transport,
}),
proxmox.WithAPIToken(config.Config.Proxmox.TokenID, config.Config.Proxmox.Secret),
),
- bg: context.Background(),
- Nodes: make([]*proxmox.Node, 0),
+ bg: context.Background(),
+ Nodes: make([]*proxmox.Node, 0),
+ apiHost: config.Config.Proxmox.Hostname,
+ apiPort: config.Config.Proxmox.Port,
+ username: config.Config.Proxmox.Username,
+ password: config.Config.Proxmox.Password,
+ InsecureSkipVerify: true,
+ httpClient: httpClient,
+ ConnectTimeout: 30 * time.Second,
+ CommandTimeout: 5 * time.Minute,
+ }
+ if token := config.Config.Proxmox.TokenID; token != "" {
+ if parts := strings.SplitN(token, "!", 2); len(parts) > 0 {
+ api.tokenUser = parts[0]
+ }
}
if api.Cluster, err = api.client.Cluster(api.bg); err != nil {
diff --git a/proxmoxAPI/ct.go b/proxmoxAPI/ct.go
index 4470b42..72a6d96 100644
--- a/proxmoxAPI/ct.go
+++ b/proxmoxAPI/ct.go
@@ -269,3 +269,45 @@ func (api *ProxmoxAPI) ListContainers(node *proxmox.Node) (containers []*proxmox
containers, err = node.Containers(api.bg)
return
}
+
+func determineTerminalUser(existing, desired, tokenUser string) string {
+ if existing != "" {
+ return existing
+ }
+
+ user := desired
+ if user == "" {
+ user = tokenUser
+ }
+
+ if user == "" {
+ return ""
+ }
+
+ if sep := strings.Index(user, "!"); sep > 0 {
+ user = user[:sep]
+ }
+
+ if !strings.Contains(user, "@") {
+ user = fmt.Sprintf("%s@pam", user)
+ }
+
+ return user
+}
+
+func (api *ProxmoxAPI) RawExecuteWithRetries(ct *proxmox.Container, username, password, command string, numRetries int) (stdout string, stderr string, exitCode int, err error) {
+ for i := range numRetries + 1 {
+ if stdout, stderr, exitCode, err = api.RawExecute(ct, username, password, command); err == nil {
+ if i > 0 {
+ // fmt.Printf("Raw execute on container %d succeeded after %d retries.\n", ct.VMID, i-1)
+ }
+
+ return
+ }
+
+ // fmt.Printf("Raw execute on container %d failed: %v. Retrying (%d/%d)...\n", ct.VMID, err, i+1, numRetries)
+ time.Sleep(time.Second * (time.Duration(i) + 1))
+ }
+
+ return
+}
diff --git a/proxmoxAPI/termexec.go b/proxmoxAPI/termexec.go
new file mode 100644
index 0000000..8e3588d
--- /dev/null
+++ b/proxmoxAPI/termexec.go
@@ -0,0 +1,620 @@
+package proxmoxAPI
+
+import (
+ "context"
+ "crypto/tls"
+ "encoding/base64"
+ "encoding/json"
+ "fmt"
+ "io"
+ "net/http"
+ "net/url"
+ "regexp"
+ "strconv"
+ "strings"
+ "time"
+
+ "github.com/gorilla/websocket"
+ "github.com/luthermonson/go-proxmox"
+)
+
+const (
+ kothBeginMarker = "__KOTH_BEGIN__"
+ kothSplitMarker = "__KOTH_SPLIT__"
+ kothDoneMarker = "__KOTH_DONE__"
+ kothRCMarker = "__KOTH_RC="
+)
+
+type termProxySession struct {
+ Port proxmox.StringOrInt `json:"port"`
+ Ticket string `json:"ticket"`
+ User string `json:"user"`
+}
+
+func (api *ProxmoxAPI) RawExecute(ct *proxmox.Container, username, password, command string) (stdout string, stderr string, exitCode int, err error) {
+ var (
+ nodeName string
+ host string
+ vmid int
+ )
+
+ if nodeName, host, vmid, err = api.resolveNodeAndHost(ct); err != nil {
+ return
+ }
+
+ baseCtx := api.bg
+ if baseCtx == nil {
+ baseCtx = context.Background()
+ }
+
+ connectCtx, cancelConnect := context.WithTimeout(baseCtx, api.getConnectTimeout())
+ defer cancelConnect()
+
+ var (
+ authTicket string
+ csrfToken string
+ )
+ if authTicket, csrfToken, err = api.loginTicket(connectCtx, host); err != nil {
+ err = fmt.Errorf("failed to obtain PVE ticket: %w", err)
+ return
+ }
+
+ var session *termProxySession
+ if session, err = api.openTermProxy(connectCtx, host, nodeName, vmid, authTicket, csrfToken); err != nil {
+ err = fmt.Errorf("failed to open termproxy: %w", err)
+ return
+ }
+
+ wsCtx, cancelWS := context.WithTimeout(baseCtx, api.getConnectTimeout())
+ defer cancelWS()
+
+ var conn *websocket.Conn
+ if conn, err = api.dialVNCWebSocket(wsCtx, host, nodeName, vmid, session, authTicket); err != nil {
+ err = fmt.Errorf("failed to dial console websocket: %w", err)
+ return
+ }
+ defer conn.Close()
+
+ terminalUser := determineTerminalUser(session.User, api.username, api.tokenUser)
+ if terminalUser == "" {
+ err = fmt.Errorf("failed to determine terminal user for handshake")
+ return
+ }
+
+ cmdCtx, cancelCmd := context.WithTimeout(baseCtx, api.getCommandTimeout())
+ defer cancelCmd()
+
+ stdout, stderr, exitCode, err = api.runInteractiveCommand(cmdCtx, conn, terminalUser, session.Ticket, username, password, command)
+ return
+}
+
+func (api *ProxmoxAPI) resolveNodeAndHost(ct *proxmox.Container) (nodeName string, host string, vmid int, err error) {
+ if ct == nil {
+ err = fmt.Errorf("container is nil")
+ return
+ }
+
+ vmid = int(ct.VMID)
+ if vmid <= 0 {
+ err = fmt.Errorf("container VMID is invalid")
+ return
+ }
+
+ nodeName = strings.TrimSpace(ct.Node)
+ if nodeName == "" {
+ var node *proxmox.Node
+ if node, err = api.NodeForContainer(vmid); err == nil && node != nil {
+ nodeName = node.Name
+ }
+ }
+
+ if nodeName == "" {
+ err = fmt.Errorf("could not determine node for container %d", vmid)
+ return
+ }
+
+ host = nodeName
+ if api.apiHost != "" && strings.EqualFold(api.apiHost, nodeName) {
+ host = api.apiHost
+ }
+
+ return
+}
+
+func (api *ProxmoxAPI) loginTicket(ctx context.Context, host string) (ticket, csrf string, err error) {
+ if api.username == "" || api.password == "" {
+ err = fmt.Errorf("missing proxmox username/password for ticket login")
+ return
+ }
+
+ form := url.Values{}
+ form.Set("username", api.username)
+ form.Set("password", api.password)
+
+ req, reqErr := http.NewRequestWithContext(ctx, http.MethodPost, fmt.Sprintf("https://%s:%s/api2/json/access/ticket", host, api.port()), strings.NewReader(form.Encode()))
+ if reqErr != nil {
+ err = reqErr
+ return
+ }
+
+ req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
+
+ var resp *http.Response
+ if resp, err = api.restClient().Do(req); err != nil {
+ return
+ }
+
+ defer resp.Body.Close()
+
+ if resp.StatusCode != http.StatusOK {
+ var body []byte
+ body, _ = io.ReadAll(resp.Body)
+ err = fmt.Errorf("ticket request failed (%s): %s", resp.Status, string(body))
+ return
+ }
+
+ var parsed struct {
+ Data struct {
+ Ticket string `json:"ticket"`
+ CSRF string `json:"CSRFPreventionToken"`
+ } `json:"data"`
+ }
+
+ if err = json.NewDecoder(resp.Body).Decode(&parsed); err != nil {
+ return
+ }
+
+ ticket = parsed.Data.Ticket
+ csrf = parsed.Data.CSRF
+
+ if ticket == "" || csrf == "" {
+ err = fmt.Errorf("received empty ticket or CSRF token from Proxmox")
+ }
+
+ return
+}
+
+func (api *ProxmoxAPI) openTermProxy(ctx context.Context, host, node string, vmid int, ticket, csrf string) (session *termProxySession, err error) {
+ req, reqErr := http.NewRequestWithContext(ctx, http.MethodPost, fmt.Sprintf("https://%s:%s/api2/json/nodes/%s/lxc/%d/termproxy", host, api.port(), node, vmid), nil)
+ if reqErr != nil {
+ err = reqErr
+ return
+ }
+
+ req.Header.Set("Cookie", fmt.Sprintf("PVEAuthCookie=%s", ticket))
+ req.Header.Set("CSRFPreventionToken", csrf)
+
+ var resp *http.Response
+ if resp, err = api.restClient().Do(req); err != nil {
+ return
+ }
+
+ defer resp.Body.Close()
+
+ if resp.StatusCode != http.StatusOK {
+ var body []byte
+ body, _ = io.ReadAll(resp.Body)
+ err = fmt.Errorf("termproxy request failed (%s): %s", resp.Status, string(body))
+ return
+ }
+
+ var parsed struct {
+ Data termProxySession `json:"data"`
+ }
+
+ if err = json.NewDecoder(resp.Body).Decode(&parsed); err != nil {
+ return
+ }
+
+ if parsed.Data.Ticket == "" || parsed.Data.Port == 0 {
+ err = fmt.Errorf("termproxy response missing ticket or port")
+ return
+ }
+
+ session = &parsed.Data
+ return
+}
+
+func (api *ProxmoxAPI) dialVNCWebSocket(ctx context.Context, host, node string, vmid int, session *termProxySession, authTicket string) (conn *websocket.Conn, err error) {
+ if session == nil {
+ err = fmt.Errorf("termproxy session is nil")
+ return
+ }
+
+ u := fmt.Sprintf("wss://%s:%s/api2/json/nodes/%s/lxc/%d/vncwebsocket?port=%d&vncticket=%s",
+ host, api.port(), node, vmid, int(session.Port), url.QueryEscape(session.Ticket))
+
+ dialer := &websocket.Dialer{
+ Proxy: http.ProxyFromEnvironment,
+ HandshakeTimeout: api.getConnectTimeout(),
+ TLSClientConfig: api.tlsConfig(),
+ }
+
+ headers := http.Header{}
+ headers.Set("Cookie", fmt.Sprintf("PVEAuthCookie=%s", authTicket))
+ headers.Set("Origin", fmt.Sprintf("https://%s:%s", host, api.port()))
+ headers.Set("User-Agent", "pve-koth/termexec")
+
+ conn, _, err = dialer.DialContext(ctx, u, headers)
+ return
+}
+
+func (api *ProxmoxAPI) runInteractiveCommand(ctx context.Context, conn *websocket.Conn, termUser, termTicket, containerUser, containerPass, command string) (stdout, stderr string, exitCode int, err error) {
+ if conn == nil {
+ err = fmt.Errorf("websocket connection is nil")
+ return
+ }
+
+ if err = api.performHandshake(ctx, conn, termUser, termTicket); err != nil {
+ return
+ }
+
+ keepAliveCtx, cancel := context.WithCancel(ctx)
+ defer cancel()
+ go api.keepAlive(keepAliveCtx, conn)
+
+ if err = api.ensureConsoleLogin(ctx, conn, containerUser, containerPass); err != nil {
+ return
+ }
+
+ stdout, stderr, exitCode, err = api.executeAndCollect(ctx, conn, command)
+ return
+}
+
+func (api *ProxmoxAPI) performHandshake(ctx context.Context, conn *websocket.Conn, termUser, termTicket string) (err error) {
+ if termUser == "" || termTicket == "" {
+ err = fmt.Errorf("missing terminal user or ticket for handshake")
+ return
+ }
+
+ if err = api.sendFrame(ctx, conn, []byte(fmt.Sprintf("%s:%s\n", termUser, termTicket))); err != nil {
+ return
+ }
+
+ var msg []byte
+ if msg, err = api.readMessage(ctx, conn); err != nil {
+ return
+ }
+
+ if strings.TrimSpace(string(msg)) != "OK" {
+ err = fmt.Errorf("terminal handshake not acknowledged: %s", strings.TrimSpace(string(msg)))
+ return
+ }
+
+ // Set a sensible default terminal size; the console protocol expects a resize frame early.
+ if err = api.sendFrame(ctx, conn, []byte("1:32:120:")); err != nil {
+ return
+ }
+
+ return
+}
+
+func (api *ProxmoxAPI) ensureConsoleLogin(ctx context.Context, conn *websocket.Conn, user, pass string) (err error) {
+ if user == "" {
+ err = fmt.Errorf("container login user is required")
+ return
+ }
+
+ // Nudge the console to show a prompt.
+ _ = api.sendInput(ctx, conn, "\n")
+
+ var buffer strings.Builder
+
+ for {
+ var msg []byte
+ if msg, err = api.readMessage(ctx, conn); err != nil {
+ return
+ }
+
+ text := stripANSI(string(msg))
+ buffer.WriteString(text)
+
+ lower := strings.ToLower(buffer.String())
+ if strings.Contains(lower, "login:") {
+ buffer.Reset()
+ if err = api.sendInput(ctx, conn, fmt.Sprintf("%s\n", user)); err != nil {
+ return
+ }
+ continue
+ }
+
+ if strings.Contains(lower, "password:") {
+ buffer.Reset()
+ if err = api.sendInput(ctx, conn, fmt.Sprintf("%s\n", pass)); err != nil {
+ return
+ }
+ continue
+ }
+
+ if strings.Contains(lower, "login incorrect") || strings.Contains(lower, "authentication failure") {
+ err = fmt.Errorf("failed to authenticate to container console as %s", user)
+ return
+ }
+
+ if hasShellPrompt(buffer.String()) {
+ return
+ }
+
+ if ctx.Err() != nil {
+ err = ctx.Err()
+ return
+ }
+ }
+}
+
+func (api *ProxmoxAPI) executeAndCollect(ctx context.Context, conn *websocket.Conn, command string) (stdout, stderr string, exitCode int, err error) {
+ wrapped := buildWrappedCommand(command)
+ if err = api.sendInput(ctx, conn, wrapped); err != nil {
+ return
+ }
+
+ var output strings.Builder
+
+ for {
+ var msg []byte
+ if msg, err = api.readMessage(ctx, conn); err != nil {
+ return
+ }
+
+ output.Write(msg)
+
+ if strings.Contains(output.String(), kothDoneMarker) {
+ break
+ }
+
+ if ctx.Err() != nil {
+ err = ctx.Err()
+ return
+ }
+ }
+
+ stdout, stderr, exitCode, err = parseCommandOutput(output.String())
+ return
+}
+
+func (api *ProxmoxAPI) keepAlive(ctx context.Context, conn *websocket.Conn) {
+ ticker := time.NewTicker(25 * time.Second)
+ defer ticker.Stop()
+
+ for {
+ select {
+ case <-ctx.Done():
+ return
+ case <-ticker.C:
+ _ = api.sendFrame(ctx, conn, []byte("2"))
+ }
+ }
+}
+
+func (api *ProxmoxAPI) sendInput(ctx context.Context, conn *websocket.Conn, data string) error {
+ payload := append([]byte(fmt.Sprintf("0:%d:", len(data))), []byte(data)...)
+ return api.sendFrame(ctx, conn, payload)
+}
+
+func (api *ProxmoxAPI) sendFrame(ctx context.Context, conn *websocket.Conn, payload []byte) error {
+ if ctx.Err() != nil {
+ return ctx.Err()
+ }
+
+ deadline := time.Now().Add(5 * time.Second)
+ if d, ok := ctx.Deadline(); ok && time.Until(d) < 5*time.Second {
+ deadline = d
+ }
+
+ _ = conn.SetWriteDeadline(deadline)
+ return conn.WriteMessage(websocket.BinaryMessage, payload)
+}
+
+func (api *ProxmoxAPI) readMessage(ctx context.Context, conn *websocket.Conn) (msg []byte, err error) {
+ defer func() {
+ if r := recover(); r != nil {
+ err = fmt.Errorf("websocket read panic: %v", r)
+ _ = conn.Close()
+ }
+ }()
+
+ if ctx.Err() != nil {
+ return nil, ctx.Err()
+ }
+
+ deadline := time.Now().Add(api.getCommandTimeout())
+ if d, ok := ctx.Deadline(); ok {
+ deadline = d
+ }
+
+ cancelRead := make(chan struct{})
+ defer close(cancelRead)
+
+ // If the context is canceled before the read returns, force the read to unblock.
+ go func() {
+ select {
+ case <-ctx.Done():
+ _ = conn.SetReadDeadline(time.Now())
+ case <-cancelRead:
+ }
+ }()
+
+ _ = conn.SetReadDeadline(deadline)
+
+ var mType int
+ if mType, msg, err = conn.ReadMessage(); err != nil {
+ _ = conn.Close()
+ if ctx.Err() != nil {
+ err = ctx.Err()
+ }
+ return
+ }
+
+ if mType == websocket.CloseMessage {
+ err = fmt.Errorf("websocket closed")
+ _ = conn.Close()
+ return
+ }
+
+ return
+}
+
+func buildWrappedCommand(command string) string {
+ cmdB64 := base64.StdEncoding.EncodeToString([]byte(command))
+
+ innerScript := fmt.Sprintf("#!/bin/sh\ncmd_b64='%s'\ncmd=$(echo \"$cmd_b64\" | base64 -d)\nprintf '%s\\n'\n{ eval \"$cmd\"; } 1>/tmp/koth_out 2>/tmp/koth_err\nrc=$?\nprintf '%s%%s__\\n' \"$rc\"\ncat /tmp/koth_out\nprintf '%s\\n'\ncat /tmp/koth_err\nprintf '%s\\n'\nrm -f /tmp/koth_out /tmp/koth_err\n", cmdB64, kothBeginMarker, kothRCMarker, kothSplitMarker, kothDoneMarker)
+ wrapperB64 := base64.StdEncoding.EncodeToString([]byte(innerScript))
+
+ return fmt.Sprintf("wrap_b64='%s'; printf '%%s' \"$wrap_b64\" | base64 -d | sh\n", wrapperB64)
+}
+
+func parseCommandOutput(raw string) (stdout, stderr string, exitCode int, err error) {
+ cleaned := stripANSI(raw)
+ cleaned = strings.ReplaceAll(cleaned, "\r", "")
+
+ beginIdx := strings.LastIndex(cleaned, kothBeginMarker)
+ doneIdx := strings.LastIndex(cleaned, kothDoneMarker)
+
+ // Fallback: if we never saw markers, return everything as stdout with rc 0.
+ if beginIdx == -1 && doneIdx == -1 {
+ stdout = strings.TrimSpace(cleaned)
+ stderr = ""
+ exitCode = 0
+ return
+ }
+
+ if beginIdx == -1 && doneIdx != -1 {
+ beginIdx = 0
+ }
+
+ if doneIdx == -1 || doneIdx <= beginIdx {
+ err = fmt.Errorf("failed to locate command markers in console output")
+ return
+ }
+
+ segment := cleaned[beginIdx+len(kothBeginMarker) : doneIdx]
+
+ exitCode = -1
+
+ if rcIdx := strings.Index(segment, kothRCMarker); rcIdx >= 0 {
+ rcSection := segment[rcIdx+len(kothRCMarker):]
+ if nl := strings.Index(rcSection, "__"); nl >= 0 {
+ rcText := strings.TrimSpace(rcSection[:nl])
+ if parsed, convErr := strconv.Atoi(rcText); convErr == nil {
+ exitCode = parsed
+ }
+ rcSection = rcSection[nl+2:]
+ }
+ if nl := strings.Index(rcSection, "\n"); nl >= 0 {
+ segment = rcSection[nl+1:]
+ } else {
+ segment = rcSection
+ }
+ }
+
+ splitIdx := strings.Index(segment, kothSplitMarker)
+ if splitIdx == -1 {
+ // Fallback: if we got an exit code but no split marker, treat the whole payload as stdout.
+ stdout = strings.TrimPrefix(segment, "\n")
+ stderr = ""
+ if exitCode == -1 {
+ exitCode = 0
+ }
+ return
+ }
+
+ stdout = segment[:splitIdx]
+ stderr = segment[splitIdx+len(kothSplitMarker):]
+
+ stdout = strings.TrimPrefix(stdout, "\n")
+ stderr = strings.TrimPrefix(stderr, "\n")
+
+ if exitCode == -1 {
+ exitCode = 0
+ }
+
+ return
+}
+
+func stripANSI(s string) string {
+ var (
+ ansiPattern = regexp.MustCompile(`\x1b\[[0-9;?]*[A-Za-z]`)
+ controlChars = regexp.MustCompile(`[\x00-\x09\x0b-\x1f\x7f]`)
+ resetPattern = regexp.MustCompile(`\x1b\]0;.*\x07`)
+ osCommandRepl = regexp.MustCompile(`\x1b\[[>=][0-9;]*`)
+ )
+
+ s = ansiPattern.ReplaceAllString(s, "")
+ s = resetPattern.ReplaceAllString(s, "")
+ s = osCommandRepl.ReplaceAllString(s, "")
+ s = controlChars.ReplaceAllString(s, "")
+
+ return s
+}
+
+func hasShellPrompt(s string) bool {
+ clean := stripANSI(s)
+ lines := strings.Split(clean, "\n")
+
+ for i := len(lines) - 1; i >= 0; i-- {
+ line := strings.TrimSpace(lines[i])
+ if line == "" {
+ continue
+ }
+
+ if strings.HasSuffix(line, "#") || strings.HasSuffix(line, "$") {
+ return true
+ }
+ }
+
+ return false
+}
+
+func (api *ProxmoxAPI) restClient() *http.Client {
+ if api.httpClient != nil {
+ if api.httpClient.Timeout == 0 {
+ api.httpClient.Timeout = api.getConnectTimeout()
+ }
+ return api.httpClient
+ }
+
+ api.httpClient = &http.Client{
+ Transport: &http.Transport{
+ TLSClientConfig: api.tlsConfig(),
+ },
+ Timeout: api.getConnectTimeout(),
+ }
+
+ return api.httpClient
+}
+
+func (api *ProxmoxAPI) tlsConfig() *tls.Config {
+ if api.httpClient != nil {
+ if transport, ok := api.httpClient.Transport.(*http.Transport); ok && transport.TLSClientConfig != nil {
+ return transport.TLSClientConfig
+ }
+ }
+
+ return &tls.Config{
+ InsecureSkipVerify: api.InsecureSkipVerify,
+ }
+}
+
+func (api *ProxmoxAPI) port() string {
+ if api.apiPort != "" {
+ return api.apiPort
+ }
+
+ return "8006"
+}
+
+func (api *ProxmoxAPI) getConnectTimeout() time.Duration {
+ if api.ConnectTimeout > 0 {
+ return api.ConnectTimeout
+ }
+
+ return 30 * time.Second
+}
+
+func (api *ProxmoxAPI) getCommandTimeout() time.Duration {
+ if api.CommandTimeout > 0 {
+ return api.CommandTimeout
+ }
+
+ return time.Minute
+}
diff --git a/public/views/dashboard.html b/public/views/dashboard.html
index e047bc2..33a23b3 100644
--- a/public/views/dashboard.html
+++ b/public/views/dashboard.html
@@ -34,6 +34,114 @@ Operations console
+ {{with .ResourceInfo}}
+
+
+
+
Resource restrictions & information
+
Container guardrails · Network capacity
+
Operators can constrain what container builds get deployed and keep an eye on available /16 networks.
+
+
+ Gateway · {{ .Network.Gateway }}
+ Nameserver · {{ .Network.Nameserver }} · Search domain · {{ .Network.SearchDomain }}
+
+
+
+
+
+
+
Container restrictions
+
Allowed resources
+
+
Drive predictable builds
+
+
+
+
Allowed templates
+
+ {{if .Restrictions.AllowedLXCTemplates}}
+ {{range .Restrictions.AllowedLXCTemplates}}
+ {{.}}
+ {{end}}
+ {{else}}
+ Any template allowed
+ {{end}}
+
+
+
+
Allowed storage pools
+
+ {{if .Restrictions.AllowedStoragePools}}
+ {{range .Restrictions.AllowedStoragePools}}
+ {{.}}
+ {{end}}
+ {{else}}
+ Any pool allowed
+ {{end}}
+
+
+
+
+
Max CPU
+
{{.Restrictions.MaxCPUCores}}
+
+
+
Max RAM (MB)
+
{{.Restrictions.MaxMemoryMB}}
+
+
+
Max disk (MB)
+
{{.Restrictions.MaxDiskMB}}
+
+
+
+
+
+
+
+
Network resources
+
Competition subnet pool
+
+
Pool · {{ .Network.PoolCIDR }}
+
+ Blocks carved as /{{.Network.CompetitionPrefix}} networks. Team prefixes are /{{.Network.TeamPrefix}}.
+
+
+ Subnets used
+ {{ .Network.UsedSubnets }}/{{ .Network.TotalSubnets }}
+
+
+
+ {{ .Network.FreeSubnets }} free
+ {{printf "%.1f" .Network.UsagePercent}}% used
+
+
+
+
+
- Gateway
+ - {{ .Network.Gateway }}
+
+
+
- Nameserver
+ - {{ .Network.Nameserver }}
+
+
+
- Search domain
+ - {{ .Network.SearchDomain }}
+
+
+
- Container CIDR
+ - /{{ .Network.ContainerCIDR }}
+
+
+
+
+
+ {{end}}
+
Competitions
diff --git a/ssh/commandHelpers.go b/ssh/commandHelpers.go
index 4658bdd..1390bb8 100644
--- a/ssh/commandHelpers.go
+++ b/ssh/commandHelpers.go
@@ -15,6 +15,13 @@ func SetEnvs(envs map[string]any) (result string) {
}
func LoadAndRunScript(scriptURL, accessToken string, envs map[string]any) (fullCommandlet string) {
- fullCommandlet = fmt.Sprintf("wget --no-check-certificate --header='Cookie: Authorization=%s' -qO- '%s' | %s bash -s --", accessToken, scriptURL, SetEnvs(envs))
- return
+ envPrefix := SetEnvs(envs)
+ if envPrefix != "" {
+ envPrefix += " "
+ }
+
+ download := fmt.Sprintf("if command -v curl >/dev/null 2>&1; then curl -fsSLk --header \"Cookie: Authorization=%s\" \"%s\"; elif command -v wget >/dev/null 2>&1; then wget --no-check-certificate --header='Cookie: Authorization=%s' -qO- '%s'; else echo \"curl or wget required\" >&2; exit 1; fi", accessToken, scriptURL, accessToken, scriptURL)
+
+ fullCommandlet = fmt.Sprintf("%s| %sbash -s --", download, envPrefix)
+ return fullCommandlet
}
diff --git a/tests/pvect_test.go b/tests/pvect_test.go
index 6e27ad9..07f476d 100644
--- a/tests/pvect_test.go
+++ b/tests/pvect_test.go
@@ -261,3 +261,93 @@ func TestContainerBulkOperations(t *testing.T) {
}(i)
}
}
+
+func TestRawExec(t *testing.T) {
+ setup(t)
+ defer cleanup(t)
+
+ if !config.Config.Proxmox.Testing.Enabled {
+ t.Skip("Proxmox testing environment is not enabled; skipping test")
+ }
+
+ var (
+ err error
+ env *ProxmoxTestingEnvironment
+ stdout, stderr string
+ exitCode int
+ failStdout, failErr string
+ failCode int
+ )
+
+ if env, err = proxmoxEnvironmentSetup(t, false, false, []string{"koth-test-raw-exec"}, false); err != nil {
+ t.Fatalf("failed to setup proxmox testing environment: %v", err)
+ }
+
+ defer env.Cleanup(t)
+
+ if stdout, stderr, exitCode, err = env.api.RawExecuteWithRetries(env.results[0].Container, "root", env.configs[0].RootPassword, "whoami", 2); err != nil {
+ t.Fatalf("failed to execute raw command: %v", err)
+ }
+
+ t.Logf("Raw execution stdout: %s", stdout)
+ t.Logf("Raw execution stderr: %s", stderr)
+
+ assert.Equal(t, 0, exitCode, "expected exit code to be success")
+ assert.Equal(t, "root", strings.TrimSpace(stdout), "expected stdout to be 'root'")
+ assert.Equal(t, "", strings.TrimSpace(stderr), "expected stderr to be empty")
+
+ if failStdout, failErr, failCode, err = env.api.RawExecuteWithRetries(env.results[0].Container, "root", env.configs[0].RootPassword, "sh -lc 'echo boom >&2; exit 42'", 2); err != nil {
+ t.Fatalf("failed to execute failing raw command: %v", err)
+ }
+
+ t.Logf("Failing raw execution stdout: %s", failStdout)
+ t.Logf("Failing raw execution stderr: %s", failErr)
+
+ assert.Equal(t, 42, failCode, "expected exit code to be 42")
+ assert.Equal(t, "", strings.TrimSpace(failStdout), "expected stdout to be empty on failure")
+ assert.Equal(t, "boom", strings.TrimSpace(failErr), "expected stderr to contain error message")
+}
+
+func TestRawExecWithBuiltCommand(t *testing.T) {
+ setup(t)
+ defer cleanup(t)
+
+ if !config.Config.Proxmox.Testing.Enabled {
+ t.Skip("Proxmox testing environment is not enabled; skipping test")
+ }
+
+ var (
+ err error
+ env *ProxmoxTestingEnvironment
+ stdout, stderr string
+ exitCode int
+ commandEnvs map[string]any
+ artifact string
+ )
+
+ if env, err = proxmoxEnvironmentSetup(t, false, true, []string{"koth-test-raw-exec-built"}, false); err != nil {
+ t.Fatalf("failed to setup proxmox testing environment: %v", err)
+ }
+
+ defer env.Cleanup(t)
+
+ if commandEnvs, err = env.EnvsFor(0); err != nil {
+ t.Fatalf("failed to get environment variables for command execution: %v", err)
+ }
+
+ if artifact, err = readPublicFileContents("artifact.txt"); err != nil {
+ t.Fatalf("failed to read artifact contents: %v", err)
+ }
+
+ command := ssh.LoadAndRunScript(fmt.Sprintf("http://%s/koth-test-envs.sh", net.JoinHostPort(ssh.MustLocalIP(), env.webPort)), env.reqToken(), commandEnvs)
+ if stdout, stderr, exitCode, err = env.api.RawExecuteWithRetries(env.results[0].Container, "root", env.configs[0].RootPassword, command, 2); err != nil {
+ t.Fatalf("failed to execute built command via raw exec: %v", err)
+ }
+
+ t.Logf("Raw built command stdout: %s", stdout)
+ t.Logf("Raw built command stderr: %s", stderr)
+
+ assert.Equal(t, 0, exitCode, "expected built command to succeed")
+ assert.Equal(t, strings.TrimSpace(artifact), strings.TrimSpace(stdout), "expected output to match artifact contents")
+ assert.Equal(t, "", strings.TrimSpace(stderr), "expected stderr to be empty")
+}