From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 2/2] api: fill in nodeconfig schema
Date: Thu, 17 Mar 2022 11:26:02 +0100 [thread overview]
Message-ID: <20220317102603.49426-3-w.bumiller@proxmox.com> (raw)
In-Reply-To: <20220317102603.49426-1-w.bumiller@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
---
PVE/API2/NodeConfig.pm | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/PVE/API2/NodeConfig.pm b/PVE/API2/NodeConfig.pm
index 9c48bcdb..961cd345 100644
--- a/PVE/API2/NodeConfig.pm
+++ b/PVE/API2/NodeConfig.pm
@@ -11,25 +11,25 @@ use base qw(PVE::RESTHandler);
my $node_config_schema = PVE::NodeConfig::get_nodeconfig_schema();
my $node_config_keys = [ sort keys %$node_config_schema ];
-my $node_config_properties = {
- delete => {
- type => 'string', format => 'pve-configid-list',
- description => "A list of settings you want to delete.",
- optional => 1,
- },
+my $node_config_return_properties = {
digest => {
type => 'string',
description => 'Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.',
maxLength => 40,
optional => 1,
},
+ %$node_config_schema,
+};
+my $node_config_properties = {
+ delete => {
+ type => 'string', format => 'pve-configid-list',
+ description => "A list of settings you want to delete.",
+ optional => 1,
+ },
node => get_standard_option('pve-node'),
+ %$node_config_return_properties,
};
-foreach my $opt (keys %{$node_config_schema}) {
- $node_config_properties->{$opt} = $node_config_schema->{$opt};
-}
-
__PACKAGE__->register_method({
name => 'get_config',
path => '',
@@ -54,7 +54,7 @@ __PACKAGE__->register_method({
},
returns => {
type => "object",
- properties => {},
+ properties => $node_config_return_properties,
},
code => sub {
my ($param) = @_;
--
2.30.2
next prev parent reply other threads:[~2022-03-17 10:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-17 10:26 [pve-devel] [PATCH manager+common 0/2] drop custom node config parser Wolfgang Bumiller
2022-03-17 10:26 ` [pve-devel] [PATCH manager 1/2] nodeconfig: use common " Wolfgang Bumiller
2022-03-17 13:27 ` [pve-devel] applied: " Thomas Lamprecht
2022-03-17 10:26 ` Wolfgang Bumiller [this message]
2022-03-17 13:28 ` [pve-devel] applied: [PATCH manager 2/2] api: fill in nodeconfig schema Thomas Lamprecht
2022-03-17 10:26 ` [pve-devel] [PATCH common] schema: parse_config: optionally collect comments Wolfgang Bumiller
2022-03-17 11:27 ` [pve-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220317102603.49426-3-w.bumiller@proxmox.com \
--to=w.bumiller@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox