[pve-devel] applied: [PATCH ha-manager] document api result for ha resources
Thomas Lamprecht
t.lamprecht at proxmox.com
Mon Sep 17 14:48:07 CEST 2018
On 9/17/18 10:33 AM, Dominik Csapak wrote:
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
> src/PVE/API2/HA/Resources.pm | 39 ++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 38 insertions(+), 1 deletion(-)
>
> diff --git a/src/PVE/API2/HA/Resources.pm b/src/PVE/API2/HA/Resources.pm
> index 47c34cd..6b51515 100644
> --- a/src/PVE/API2/HA/Resources.pm
> +++ b/src/PVE/API2/HA/Resources.pm
> @@ -106,7 +106,44 @@ __PACKAGE__->register_method ({
> { completion => \&PVE::HA::Tools::complete_sid }),
> },
> },
> - returns => {},
> + returns => {
> + type => 'object',
> + properties => {
> + sid => get_standard_option('pve-ha-resource-or-vm-id'),
> + digest => {
> + type => 'string',
> + description => 'Can be used to prevent concurrent modifications.',
> + },
> + type => {
> + type => 'string',
> + description => 'The type of the resources.',
> + },
> + state => {
> + type => 'string',
> + enum => ['started', 'stopped', 'enabled', 'disabled', 'ignored'],
> + optional => 1,
> + description => "Requested resource state.",
> + },
> + group => get_standard_option('pve-ha-group-id', { optional => 1, }),
> + max_restart => {
> + description => "Maximal number of tries to restart the service on".
> + " a node after its start failed.",
> + type => 'integer',
> + optional => 1,
> + },
> + max_relocate => {
> + description => "Maximal number of service relocate tries when a".
> + " service failes to start.",
> + type => 'integer',
> + optional => 1,
> + },
> + comment => {
> + description => "Description.",
> + type => 'string',
> + optional => 1,
> + },
> + },
> + },
> code => sub {
> my ($param) = @_;
>
>
applied, but I wonder if it would make sense to have an
PVE::SectionConfig->listSchema();
helper, similar to the updateSchema() and createSchema() helpers, then we could do:
PVE::HA::Resources->listSchema();
here instead, be done with it and stay in sync automatically?
Could also be used in other place which just return data defined from a SectionConfig
derived class...
More information about the pve-devel
mailing list