[pve-devel] [PATCH manager 1/2] api: subscription: add return schema for 'GET' api

Dominik Csapak d.csapak at proxmox.com
Mon Oct 21 11:15:41 CEST 2024


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 at 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





More information about the pve-devel mailing list