]> git.proxmox.com Git - pve-container.git/commitdiff
add 'tags' option
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 31 Oct 2019 12:36:26 +0000 (13:36 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 20 Nov 2019 18:13:25 +0000 (19:13 +0100)
this is useful as meta information for e.g., provisioning or config
management systems

adding the info also to the 'status' api call to make it easier to show
it in the gui

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PVE/LXC.pm
src/PVE/LXC/Config.pm

index d27140f7e4b7e3b677f7f8652c5cc3cbbbbeb64b..4efc8df9e2b74315c8593a12cb75855a484f87c4 100644 (file)
@@ -160,6 +160,11 @@ our $vmstatus_return_properties = {
        description => "The current config lock, if any.",
        type => 'string',
        optional => 1,
+    },
+    tags => {
+       description => "The current configured tags, if any.",
+       type => 'string',
+       optional => 1,
     }
 };
 
@@ -199,6 +204,7 @@ sub vmstatus {
        $d->{cpus} = $cpucount if !$d->{cpus};
 
        $d->{lock} = $conf->{lock} || '';
+       $d->{tags} = $conf->{tags} if defined($conf->{tags});
 
        if ($d->{pid}) {
            my $res = get_container_disk_usage($vmid, $d->{pid});
index c34a8922b9725e724522425b7573fdbc2c70fb8a..ffc591101fd3d5402e2372ce72cd0e9af3fb563b 100644 (file)
@@ -474,6 +474,11 @@ my $confdesc = {
        format => 'pve-volume-id',
        description => 'Script that will be exectued during various steps in the containers lifetime.',
     },
+    tags => {
+       type => 'string', format => 'pve-tag-list',
+       description => 'Tags of the Container. This is only meta information.',
+       optional => 1,
+    },
 };
 
 my $valid_lxc_conf_keys = {