[pve-devel] [PATCH docs v2 2/5] update static files to include ha rules api endpoints
Daniel Kral
d.kral at proxmox.com
Fri Jun 20 16:31:40 CEST 2025
Signed-off-by: Daniel Kral <d.kral at proxmox.com>
---
This patch is more of a show-case how the static files changed.
changes since v1:
- NEW!
api-viewer/apidata.js | 363 +++++++++++++++++++++++++++++++++++++
ha-manager.1-synopsis.adoc | 138 ++++++++++++++
2 files changed, 501 insertions(+)
diff --git a/api-viewer/apidata.js b/api-viewer/apidata.js
index 57f5942..9f0f28a 100644
--- a/api-viewer/apidata.js
+++ b/api-viewer/apidata.js
@@ -7805,6 +7805,369 @@ const apiSchema = [
"path" : "/cluster/ha/groups",
"text" : "groups"
},
+ {
+ "children" : [
+ {
+ "info" : {
+ "DELETE" : {
+ "allowtoken" : 1,
+ "description" : "Delete HA rule.",
+ "method" : "DELETE",
+ "name" : "delete_rule",
+ "parameters" : {
+ "additionalProperties" : 0,
+ "properties" : {
+ "rule" : {
+ "description" : "HA rule identifier.",
+ "format" : "pve-configid",
+ "type" : "string",
+ "typetext" : "<string>"
+ }
+ }
+ },
+ "permissions" : {
+ "check" : [
+ "perm",
+ "/",
+ [
+ "Sys.Console"
+ ]
+ ]
+ },
+ "protected" : 1,
+ "returns" : {
+ "type" : "null"
+ }
+ },
+ "GET" : {
+ "allowtoken" : 1,
+ "description" : "Read HA rule.",
+ "method" : "GET",
+ "name" : "read_rule",
+ "parameters" : {
+ "additionalProperties" : 0,
+ "properties" : {
+ "rule" : {
+ "description" : "HA rule identifier.",
+ "format" : "pve-configid",
+ "type" : "string",
+ "typetext" : "<string>"
+ }
+ }
+ },
+ "permissions" : {
+ "check" : [
+ "perm",
+ "/",
+ [
+ "Sys.Audit"
+ ]
+ ]
+ },
+ "returns" : {
+ "properties" : {
+ "rule" : {
+ "description" : "HA rule identifier.",
+ "format" : "pve-configid",
+ "type" : "string"
+ },
+ "type" : {
+ "type" : "string"
+ }
+ },
+ "type" : "object"
+ }
+ },
+ "PUT" : {
+ "allowtoken" : 1,
+ "description" : "Update HA rule.",
+ "method" : "PUT",
+ "name" : "update_rule",
+ "parameters" : {
+ "additionalProperties" : 0,
+ "properties" : {
+ "affinity" : {
+ "description" : "Describes whether the services are supposed to be kept on separate nodes, or are supposed to be kept together on the same node.",
+ "enum" : [
+ "separate",
+ "together"
+ ],
+ "instance-types" : [
+ "colocation"
+ ],
+ "optional" : 1,
+ "type" : "string",
+ "type-property" : "type"
+ },
+ "comment" : {
+ "description" : "HA rule description.",
+ "maxLength" : 4096,
+ "optional" : 1,
+ "type" : "string",
+ "typetext" : "<string>"
+ },
+ "delete" : {
+ "description" : "A list of settings you want to delete.",
+ "format" : "pve-configid-list",
+ "maxLength" : 4096,
+ "optional" : 1,
+ "type" : "string",
+ "typetext" : "<string>"
+ },
+ "digest" : {
+ "description" : "Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications.",
+ "maxLength" : 64,
+ "optional" : 1,
+ "type" : "string",
+ "typetext" : "<string>"
+ },
+ "nodes" : {
+ "description" : "List of cluster node names with optional priority.",
+ "format" : "pve-ha-group-node-list",
+ "instance-types" : [
+ "location"
+ ],
+ "optional" : 1,
+ "type" : "string",
+ "type-property" : "type",
+ "typetext" : "<node>[:<pri>]{,<node>[:<pri>]}*",
+ "verbose_description" : "List of cluster node members, where a priority can be given to each node. A resource bound to a group will run on the available nodes with the highest priority. If there are more nodes in the highest priority class, the services will get distributed to those nodes. The priorities have a relative meaning only. The higher the number, the higher the priority."
+ },
+ "rule" : {
+ "description" : "HA rule identifier.",
+ "format" : "pve-configid",
+ "optional" : 0,
+ "type" : "string",
+ "typetext" : "<string>"
+ },
+ "services" : {
+ "description" : "List of HA resource IDs. This consists of a list of resource types followed by a resource specific name separated with a colon (example: vm:100,ct:101).",
+ "format" : "pve-ha-resource-id-list",
+ "optional" : 1,
+ "type" : "string",
+ "typetext" : "<type>:<name>{,<type>:<name>}*"
+ },
+ "state" : {
+ "default" : "enabled",
+ "description" : "State of the HA rule.",
+ "enum" : [
+ "enabled",
+ "disabled"
+ ],
+ "optional" : 1,
+ "type" : "string"
+ },
+ "strict" : {
+ "default" : 0,
+ "description" : "Describes whether the location rule is mandatory or optional.",
+ "instance-types" : [
+ "location"
+ ],
+ "optional" : 1,
+ "type" : "boolean",
+ "type-property" : "type",
+ "typetext" : "<boolean>",
+ "verbose_description" : "Describes whether the location rule is mandatory or optional.\nA mandatory location rule makes services be restricted to the defined nodes. If none of the nodes are available, the service will be stopped.\nAn optional location rule makes services prefer to be on the defined nodes. If none of the nodes are available, the service may run on any other node."
+ },
+ "type" : {
+ "description" : "HA rule type.",
+ "enum" : [
+ "colocation",
+ "location"
+ ],
+ "type" : "string"
+ }
+ },
+ "type" : "object"
+ },
+ "permissions" : {
+ "check" : [
+ "perm",
+ "/",
+ [
+ "Sys.Console"
+ ]
+ ]
+ },
+ "protected" : 1,
+ "returns" : {
+ "type" : "null"
+ }
+ }
+ },
+ "leaf" : 1,
+ "path" : "/cluster/ha/rules/{rule}",
+ "text" : "{rule}"
+ }
+ ],
+ "info" : {
+ "GET" : {
+ "allowtoken" : 1,
+ "description" : "Get HA rules.",
+ "method" : "GET",
+ "name" : "index",
+ "parameters" : {
+ "additionalProperties" : 0,
+ "properties" : {
+ "service" : {
+ "description" : "Limit the returned list to rules affecting the specified service.",
+ "optional" : 1,
+ "type" : "string",
+ "typetext" : "<string>"
+ },
+ "state" : {
+ "description" : "Limit the returned list to the specified rule state.",
+ "enum" : [
+ "enabled",
+ "disabled"
+ ],
+ "optional" : 1,
+ "type" : "string"
+ },
+ "type" : {
+ "description" : "Limit the returned list to the specified rule type.",
+ "enum" : [
+ "colocation",
+ "location"
+ ],
+ "optional" : 1,
+ "type" : "string"
+ }
+ }
+ },
+ "permissions" : {
+ "check" : [
+ "perm",
+ "/",
+ [
+ "Sys.Audit"
+ ]
+ ]
+ },
+ "returns" : {
+ "items" : {
+ "links" : [
+ {
+ "href" : "{rule}",
+ "rel" : "child"
+ }
+ ],
+ "properties" : {
+ "rule" : {
+ "type" : "string"
+ }
+ },
+ "type" : "object"
+ },
+ "type" : "array"
+ }
+ },
+ "POST" : {
+ "allowtoken" : 1,
+ "description" : "Create HA rule.",
+ "method" : "POST",
+ "name" : "create_rule",
+ "parameters" : {
+ "additionalProperties" : 0,
+ "properties" : {
+ "affinity" : {
+ "description" : "Describes whether the services are supposed to be kept on separate nodes, or are supposed to be kept together on the same node.",
+ "enum" : [
+ "separate",
+ "together"
+ ],
+ "instance-types" : [
+ "colocation"
+ ],
+ "optional" : 1,
+ "type" : "string",
+ "type-property" : "type"
+ },
+ "comment" : {
+ "description" : "HA rule description.",
+ "maxLength" : 4096,
+ "optional" : 1,
+ "type" : "string",
+ "typetext" : "<string>"
+ },
+ "nodes" : {
+ "description" : "List of cluster node names with optional priority.",
+ "format" : "pve-ha-group-node-list",
+ "instance-types" : [
+ "location"
+ ],
+ "optional" : 1,
+ "type" : "string",
+ "type-property" : "type",
+ "typetext" : "<node>[:<pri>]{,<node>[:<pri>]}*",
+ "verbose_description" : "List of cluster node members, where a priority can be given to each node. A resource bound to a group will run on the available nodes with the highest priority. If there are more nodes in the highest priority class, the services will get distributed to those nodes. The priorities have a relative meaning only. The higher the number, the higher the priority."
+ },
+ "rule" : {
+ "description" : "HA rule identifier.",
+ "format" : "pve-configid",
+ "optional" : 0,
+ "type" : "string",
+ "typetext" : "<string>"
+ },
+ "services" : {
+ "description" : "List of HA resource IDs. This consists of a list of resource types followed by a resource specific name separated with a colon (example: vm:100,ct:101).",
+ "format" : "pve-ha-resource-id-list",
+ "optional" : 0,
+ "type" : "string",
+ "typetext" : "<type>:<name>{,<type>:<name>}*"
+ },
+ "state" : {
+ "default" : "enabled",
+ "description" : "State of the HA rule.",
+ "enum" : [
+ "enabled",
+ "disabled"
+ ],
+ "optional" : 1,
+ "type" : "string"
+ },
+ "strict" : {
+ "default" : 0,
+ "description" : "Describes whether the location rule is mandatory or optional.",
+ "instance-types" : [
+ "location"
+ ],
+ "optional" : 1,
+ "type" : "boolean",
+ "type-property" : "type",
+ "typetext" : "<boolean>",
+ "verbose_description" : "Describes whether the location rule is mandatory or optional.\nA mandatory location rule makes services be restricted to the defined nodes. If none of the nodes are available, the service will be stopped.\nAn optional location rule makes services prefer to be on the defined nodes. If none of the nodes are available, the service may run on any other node."
+ },
+ "type" : {
+ "description" : "HA rule type.",
+ "enum" : [
+ "colocation",
+ "location"
+ ],
+ "type" : "string"
+ }
+ },
+ "type" : "object"
+ },
+ "permissions" : {
+ "check" : [
+ "perm",
+ "/",
+ [
+ "Sys.Console"
+ ]
+ ]
+ },
+ "protected" : 1,
+ "returns" : {
+ "type" : "null"
+ }
+ }
+ },
+ "leaf" : 0,
+ "path" : "/cluster/ha/rules",
+ "text" : "rules"
+ },
{
"children" : [
{
diff --git a/ha-manager.1-synopsis.adoc b/ha-manager.1-synopsis.adoc
index 0e4c5ab..540c7ca 100644
--- a/ha-manager.1-synopsis.adoc
+++ b/ha-manager.1-synopsis.adoc
@@ -193,6 +193,144 @@ Delete resource configuration.
HA resource ID. This consists of a resource type followed by a resource specific name, separated with colon (example: vm:100 / ct:100). For virtual machines and containers, you can simply use the VM or CT id as a shortcut (example: 100).
+*ha-manager rules add* `<type> <rule> --services <string>` `[OPTIONS]`
+
+Create HA rule.
+
+`<type>`: `<colocation | location>` ::
+
+HA rule type.
+
+`<rule>`: `<string>` ::
+
+HA rule identifier.
+
+`--comment` `<string>` ::
+
+HA rule description.
+
+`--services` `<type>:<name>{,<type>:<name>}*` ::
+
+List of HA resource IDs. This consists of a list of resource types followed by a resource specific name separated with a colon (example: vm:100,ct:101).
+
+`--state` `<disabled | enabled>` ('default =' `enabled`)::
+
+State of the HA rule.
+
+
+
+
+`Conditional options:`
+
+`[type=colocation]` ;;
+
+`--affinity` `<separate | together>` ::
+
+Describes whether the services are supposed to be kept on separate nodes, or are supposed to be kept together on the same node.
+
+`[type=location]` ;;
+
+`--nodes` `<node>[:<pri>]{,<node>[:<pri>]}*` ::
+
+List of cluster node names with optional priority.
+
+`--strict` `<boolean>` ('default =' `0`)::
+
+Describes whether the location rule is mandatory or optional.
+
+*ha-manager rules config* `[OPTIONS]` `[FORMAT_OPTIONS]`
+
+Get HA rules.
+
+`--service` `<string>` ::
+
+Limit the returned list to rules affecting the specified service.
+
+`--state` `<disabled | enabled>` ::
+
+Limit the returned list to the specified rule state.
+
+`--type` `<colocation | location>` ::
+
+Limit the returned list to the specified rule type.
+
+*ha-manager rules list* `[OPTIONS]` `[FORMAT_OPTIONS]`
+
+Get HA rules.
+
+`--service` `<string>` ::
+
+Limit the returned list to rules affecting the specified service.
+
+`--state` `<disabled | enabled>` ::
+
+Limit the returned list to the specified rule state.
+
+`--type` `<colocation | location>` ::
+
+Limit the returned list to the specified rule type.
+
+*ha-manager rules remove* `<rule>`
+
+Delete HA rule.
+
+`<rule>`: `<string>` ::
+
+HA rule identifier.
+
+*ha-manager rules set* `<type> <rule>` `[OPTIONS]`
+
+Update HA rule.
+
+`<type>`: `<colocation | location>` ::
+
+HA rule type.
+
+`<rule>`: `<string>` ::
+
+HA rule identifier.
+
+`--comment` `<string>` ::
+
+HA rule description.
+
+`--delete` `<string>` ::
+
+A list of settings you want to delete.
+
+`--digest` `<string>` ::
+
+Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications.
+
+`--services` `<type>:<name>{,<type>:<name>}*` ::
+
+List of HA resource IDs. This consists of a list of resource types followed by a resource specific name separated with a colon (example: vm:100,ct:101).
+
+`--state` `<disabled | enabled>` ('default =' `enabled`)::
+
+State of the HA rule.
+
+
+
+
+`Conditional options:`
+
+`[type=colocation]` ;;
+
+`--affinity` `<separate | together>` ::
+
+Describes whether the services are supposed to be kept on separate nodes, or are supposed to be kept together on the same node.
+
+`[type=location]` ;;
+
+`--nodes` `<node>[:<pri>]{,<node>[:<pri>]}*` ::
+
+List of cluster node names with optional priority.
+
+`--strict` `<boolean>` ('default =' `0`)::
+
+Describes whether the location rule is mandatory or optional.
+
*ha-manager set* `<sid>` `[OPTIONS]`
Update resource configuration.
--
2.39.5
More information about the pve-devel
mailing list