* [pve-devel] [PATCH qemu-server 1/1] status: add some missing description for status return properties
2024-10-21 9:15 [pve-devel] [PATCH qemu-server/container/manager] add some missing return schema descriptions Dominik Csapak
@ 2024-10-21 9:15 ` Dominik Csapak
2024-10-24 13:53 ` [pve-devel] applied: " Thomas Lamprecht
2024-10-21 9:15 ` [pve-devel] [PATCH container 1/1] status: add some missing descriptions " Dominik Csapak
` (2 subsequent siblings)
3 siblings, 1 reply; 11+ messages in thread
From: Dominik Csapak @ 2024-10-21 9:15 UTC (permalink / raw)
To: pve-devel
i omitted the 'disk' property, since it's non functional currently,
since we don't query the disk usage here (complicated to calculate,
depending on the storage, or requires guest agent support, which is also
non-trivial)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
PVE/QemuServer.pm | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index b26da505..e6df6091 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2764,11 +2764,39 @@ our $vmstatus_return_properties = {
optional => 1,
renderer => 'bytes',
},
+ diskread => {
+ description => "The amount of bytes the guest read from it's disks since the process"
+ ." start in bytes.",
+ type => 'integer',
+ optional => 1,
+ renderer => 'bytes',
+ },
+ diskwrite => {
+ description => "The amount of bytes the guest wrote to it's disks since the process"
+ ." start in bytes.",
+ type => 'integer',
+ optional => 1,
+ renderer => 'bytes',
+ },
name => {
description => "VM name.",
type => 'string',
optional => 1,
},
+ netin => {
+ description => "The amount of traffic that was sent to the guest since the process start,"
+ ." in bytes.",
+ type => 'integer',
+ optional => 1,
+ renderer => 'bytes',
+ },
+ netin => {
+ description => "The amount of traffic that was sent from the guest since the process start,"
+ ." in bytes.",
+ type => 'integer',
+ optional => 1,
+ renderer => 'bytes',
+ },
qmpstatus => {
description => "VM run state from the 'query-status' QMP monitor command.",
type => 'string',
@@ -2810,6 +2838,12 @@ our $vmstatus_return_properties = {
type => 'string',
optional => 1,
},
+ template => {
+ description => "Determines if the guest is a template.",
+ type => 'boolean',
+ optional => 1,
+ default => 0,
+ },
};
my $last_proc_pid_stat;
--
2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* [pve-devel] [PATCH container 1/1] status: add some missing descriptions for status return properties
2024-10-21 9:15 [pve-devel] [PATCH qemu-server/container/manager] add some missing return schema descriptions Dominik Csapak
2024-10-21 9:15 ` [pve-devel] [PATCH qemu-server 1/1] status: add some missing description for status return properties Dominik Csapak
@ 2024-10-21 9:15 ` Dominik Csapak
2024-10-24 12:20 ` [pve-devel] applied: " Thomas Lamprecht
2024-10-21 9:15 ` [pve-devel] [PATCH manager 1/2] api: subscription: add return schema for 'GET' api Dominik Csapak
2024-10-21 9:15 ` [pve-devel] [PATCH manager 2/2] api: cluster/resources: add missing return properties Dominik Csapak
3 siblings, 1 reply; 11+ messages in thread
From: Dominik Csapak @ 2024-10-21 9:15 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/PVE/LXC.pm | 43 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 42 insertions(+), 1 deletion(-)
diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index c49551d..ca76dae 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -139,17 +139,52 @@ our $vmstatus_return_properties = {
optional => 1,
renderer => 'bytes',
},
+ disk => {
+ description => "Used root image space for the container.",
+ type => 'integer',
+ optional => 1,
+ renderer => 'bytes',
+ minimum => 0,
+ },
maxdisk => {
description => "Root disk size in bytes.",
type => 'integer',
optional => 1,
renderer => 'bytes',
},
+ diskread => {
+ description => "The amount of bytes the guest read from it's disks since the process"
+ ." start in bytes. (Note: This info is not available for all storage types.)",
+ type => 'integer',
+ optional => 1,
+ renderer => 'bytes',
+ },
+ diskwrite => {
+ description => "The amount of bytes the guest wrote to it's disks since the process"
+ ." start in bytes. (Note: This info is not available for all storage types.)",
+ type => 'integer',
+ optional => 1,
+ renderer => 'bytes',
+ },
name => {
description => "Container name.",
type => 'string',
optional => 1,
},
+ netin => {
+ description => "The amount of traffic that was sent to the guest since the process start,"
+ ." in bytes.",
+ type => 'integer',
+ optional => 1,
+ renderer => 'bytes',
+ },
+ netin => {
+ description => "The amount of traffic that was sent from the guest since the process start,"
+ ." in bytes.",
+ type => 'integer',
+ optional => 1,
+ renderer => 'bytes',
+ },
uptime => {
description => "Uptime.",
type => 'integer',
@@ -170,7 +205,13 @@ our $vmstatus_return_properties = {
description => "The current configured tags, if any.",
type => 'string',
optional => 1,
- }
+ },
+ template => {
+ description => "Determines if the guest is a template.",
+ type => 'boolean',
+ optional => 1,
+ default => 0,
+ },
};
sub vmstatus {
--
2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* [pve-devel] applied: [PATCH container 1/1] status: add some missing descriptions for status return properties
2024-10-21 9:15 ` [pve-devel] [PATCH container 1/1] status: add some missing descriptions " Dominik Csapak
@ 2024-10-24 12:20 ` Thomas Lamprecht
2024-10-24 15:05 ` Dominik Csapak
0 siblings, 1 reply; 11+ messages in thread
From: Thomas Lamprecht @ 2024-10-24 12:20 UTC (permalink / raw)
To: Proxmox VE development discussion, Dominik Csapak
Am 21/10/2024 um 11:15 schrieb Dominik Csapak:
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> src/PVE/LXC.pm | 43 ++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 42 insertions(+), 1 deletion(-)
>
applied, thanks! FYI: I had to fix a duplicate key (see below) and made a few
small adjustments to the wording (not just your additions) as a separate follow-up.
> + netin => {
> + description => "The amount of traffic that was sent to the guest since the process start,"
> + ." in bytes.",
> + type => 'integer',
> + optional => 1,
> + renderer => 'bytes',
> + },
> + netin => {
changed this to netout and folded that into your commit.
> + description => "The amount of traffic that was sent from the guest since the process start,"
> + ." in bytes.",
> + type => 'integer',
> + optional => 1,
> + renderer => 'bytes',
> + },
> uptime => {
> description => "Uptime.",
> type => 'integer',
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [pve-devel] applied: [PATCH container 1/1] status: add some missing descriptions for status return properties
2024-10-24 12:20 ` [pve-devel] applied: " Thomas Lamprecht
@ 2024-10-24 15:05 ` Dominik Csapak
2024-10-24 15:12 ` Thomas Lamprecht
0 siblings, 1 reply; 11+ messages in thread
From: Dominik Csapak @ 2024-10-24 15:05 UTC (permalink / raw)
To: Thomas Lamprecht, Proxmox VE development discussion
On 10/24/24 14:20, Thomas Lamprecht wrote:
> Am 21/10/2024 um 11:15 schrieb Dominik Csapak:
>> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
>> ---
>> src/PVE/LXC.pm | 43 ++++++++++++++++++++++++++++++++++++++++++-
>> 1 file changed, 42 insertions(+), 1 deletion(-)
>>
>
>
> applied, thanks! FYI: I had to fix a duplicate key (see below) and made a few
> small adjustments to the wording (not just your additions) as a separate follow-up.
>
>> + netin => {
>> + description => "The amount of traffic that was sent to the guest since the process start,"
>> + ." in bytes.",
>> + type => 'integer',
>> + optional => 1,
>> + renderer => 'bytes',
>> + },
>> + netin => {
>
> changed this to netout and folded that into your commit.
uff, thanks for that. seems i was too fast with the copy&paste...
i wonder if our check target could catch something like that, but
probably not i guess
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [pve-devel] applied: [PATCH container 1/1] status: add some missing descriptions for status return properties
2024-10-24 15:05 ` Dominik Csapak
@ 2024-10-24 15:12 ` Thomas Lamprecht
0 siblings, 0 replies; 11+ messages in thread
From: Thomas Lamprecht @ 2024-10-24 15:12 UTC (permalink / raw)
To: Dominik Csapak, Proxmox VE development discussion
Am 24/10/2024 um 17:05 schrieb Dominik Csapak:
> On 10/24/24 14:20, Thomas Lamprecht wrote:
>> Am 21/10/2024 um 11:15 schrieb Dominik Csapak:
>>> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
>>> ---
>>> src/PVE/LXC.pm | 43 ++++++++++++++++++++++++++++++++++++++++++-
>>> 1 file changed, 42 insertions(+), 1 deletion(-)
>>>
>>
>>
>> applied, thanks! FYI: I had to fix a duplicate key (see below) and made a few
>> small adjustments to the wording (not just your additions) as a separate follow-up.
>>
>>> + netin => {
>>> + description => "The amount of traffic that was sent to the guest since the process start,"
>>> + ." in bytes.",
>>> + type => 'integer',
>>> + optional => 1,
>>> + renderer => 'bytes',
>>> + },
>>> + netin => {
>>
>> changed this to netout and folded that into your commit.
>
> uff, thanks for that. seems i was too fast with the copy&paste...
>
yeah, no worries, I just thought fixing that up on applying was overall
quicker compared to requesting a v2 (that I then might overlook/forget for
a few days).
> i wonder if our check target could catch something like that, but
> probably not i guess
Would be nice if perl could warn about those things, FWIW perlcritic does
not catches this either and perl just takes the last value.
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* [pve-devel] [PATCH manager 1/2] api: subscription: add return schema for 'GET' api
2024-10-21 9:15 [pve-devel] [PATCH qemu-server/container/manager] add some missing return schema descriptions Dominik Csapak
2024-10-21 9:15 ` [pve-devel] [PATCH qemu-server 1/1] status: add some missing description for status return properties Dominik Csapak
2024-10-21 9:15 ` [pve-devel] [PATCH container 1/1] status: add some missing descriptions " Dominik Csapak
@ 2024-10-21 9:15 ` Dominik Csapak
2024-10-24 15:02 ` [pve-devel] applied: " Thomas Lamprecht
2024-10-21 9:15 ` [pve-devel] [PATCH manager 2/2] api: cluster/resources: add missing return properties Dominik Csapak
3 siblings, 1 reply; 11+ messages in thread
From: Dominik Csapak @ 2024-10-21 9:15 UTC (permalink / raw)
To: pve-devel
This was missing, but it mostly well defined since we're using the rust
bindings here. I copied most descriptions over from the PBS api, except
the ones only existing here (like sockets and level)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
PVE/API2/Subscription.pm | 67 +++++++++++++++++++++++++++++++++++++++-
1 file changed, 66 insertions(+), 1 deletion(-)
diff --git a/PVE/API2/Subscription.pm b/PVE/API2/Subscription.pm
index 9e5459e4..49286a05 100644
--- a/PVE/API2/Subscription.pm
+++ b/PVE/API2/Subscription.pm
@@ -120,7 +120,72 @@ __PACKAGE__->register_method ({
node => get_standard_option('pve-node'),
},
},
- returns => { type => 'object'},
+ returns => {
+ type => 'object',
+ additionalProperties => 0,
+ properties => {
+ status => {
+ type => 'string',
+ enum => [qw(new notfound active invalid expired suspended)],
+ description => "The current subscription status.",
+ },
+ checktime => {
+ type => 'integer',
+ description => 'Timestamp of the last check done.',
+ optional => 1,
+ },
+ key => {
+ type => 'string',
+ description => 'The subscription key, if set and permitted to access.',
+ optional => 1,
+ },
+ level => {
+ type => 'string',
+ description => 'A short code for the subscription level.',
+ optional => 1,
+ },
+ message => {
+ type => 'string',
+ description => 'A more human readable status message.',
+ optional => 1,
+ },
+ nextduedate => {
+ type => 'string',
+ description => 'Next due date of the set subscription.',
+ optional => 1,
+ },
+ productname => {
+ type => 'string',
+ description => 'Human readable productname of the set subscription.',
+ optional => 1,
+ },
+ regdate => {
+ type => 'string',
+ description => 'Register date of the set subscription.',
+ optional => 1,
+ },
+ serverid => {
+ type => 'string',
+ description => 'The server ID, if permitted to access.',
+ optional => 1,
+ },
+ signature => {
+ type => 'string',
+ description => 'Signature for offline keys',
+ optional => 1,
+ },
+ sockets => {
+ type => 'integer',
+ description => 'The number of sockets for this host.',
+ optional => 1,
+ },
+ url => {
+ type => 'string',
+ description => 'URL to the web shop.',
+ optional => 1,
+ },
+ },
+ },
code => sub {
my ($param) = @_;
--
2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* [pve-devel] [PATCH manager 2/2] api: cluster/resources: add missing return properties
2024-10-21 9:15 [pve-devel] [PATCH qemu-server/container/manager] add some missing return schema descriptions Dominik Csapak
` (2 preceding siblings ...)
2024-10-21 9:15 ` [pve-devel] [PATCH manager 1/2] api: subscription: add return schema for 'GET' api Dominik Csapak
@ 2024-10-21 9:15 ` Dominik Csapak
2024-10-24 15:02 ` [pve-devel] applied: " Thomas Lamprecht
3 siblings, 1 reply; 11+ messages in thread
From: Dominik Csapak @ 2024-10-21 9:15 UTC (permalink / raw)
To: pve-devel
used the same description as for the guests.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
PVE/API2/Cluster.pm | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/PVE/API2/Cluster.pm b/PVE/API2/Cluster.pm
index 04387ab4..5ae390bf 100644
--- a/PVE/API2/Cluster.pm
+++ b/PVE/API2/Cluster.pm
@@ -295,6 +295,20 @@ __PACKAGE__->register_method({
optional => 1,
renderer => 'bytes',
},
+ netin => {
+ description => "The amount of traffic that was sent to the guest since it's"
+ ." start, in bytes. (type in qemu,lxc)",
+ type => 'integer',
+ optional => 1,
+ renderer => 'bytes',
+ },
+ netin => {
+ description => "The amount of traffic that was sent from the guest since it's"
+ ." start, in bytes. (type in qemu,lxc)",
+ type => 'integer',
+ optional => 1,
+ renderer => 'bytes',
+ },
level => {
description => "Support level (when type == node).",
type => 'string',
@@ -325,6 +339,20 @@ __PACKAGE__->register_method({
renderer => 'bytes',
minimum => 0,
},
+ diskread => {
+ description => "The amount of bytes the guest read from it's disks since the"
+ ." process start in bytes. (type in qemu,lxc)",
+ type => 'integer',
+ optional => 1,
+ renderer => 'bytes',
+ },
+ diskwrite => {
+ description => "The amount of bytes the guest wrote to it's disks since the"
+ ." process start in bytes. (type in qemu,lxc)",
+ type => 'integer',
+ optional => 1,
+ renderer => 'bytes',
+ },
content => {
description => "Allowed storage content types (when type == storage).",
type => 'string',
@@ -345,6 +373,12 @@ __PACKAGE__->register_method({
type => 'integer',
optional => 1,
},
+ template => {
+ description => "Determines if the guest is a template. (type in qemu,lxc)",
+ type => 'boolean',
+ optional => 1,
+ default => 0,
+ },
},
},
},
--
2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 11+ messages in thread