]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Add server parameter to list vsphere datastores endpoint
authorMarcin Haba <marcin.haba@bacula.pl>
Tue, 30 May 2023 13:46:13 +0000 (15:46 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Thu, 1 Jun 2023 11:20:55 +0000 (13:20 +0200)
gui/baculum/protected/API/Pages/API/PluginVSphereListDatastores.php
gui/baculum/protected/API/openapi_baculum.json

index 3b3fd4856fca34697c4c3d87967b789492187eec..6a237b5a940d676743e98d36679d79983be4138e 100644 (file)
@@ -65,12 +65,17 @@ class PluginVSphereListDatastores extends ConsoleOutputQueryPage {
                if ($this->Request->contains('output') && $this->isOutputFormatValid($this->Request['output'])) {
                        $out_format = $this->Request['output'];
                }
-               $restore_host = $this->Request->contains('restore_host') && $misc->isValidName($this->Request['restore_host'])? $this->Request['restore_host'] : '';
 
                $plugin = 'vsphere:';
+               $server = $this->Request->contains('server') && $misc->isValidName($this->Request['server'])? $this->Request['server'] : '';
+               if (!empty($server)) {
+                       $plugin .= ' server="' . $server . '"';
+               }
+               $restore_host = $this->Request->contains('restore_host') && $misc->isValidName($this->Request['restore_host'])? $this->Request['restore_host'] : '';
                if (!empty($restore_host)) {
                        $plugin .= ' restore_host="' . $restore_host . '"';
                }
+
                $out = new \StdClass;
                $out->output = [];
                $params = ['client' => $client, 'plugin' => $plugin];
index e7408dd7bbe43c798c7282a9281bd597c1e07538..986b77edae188827391d2928b60a7143a034aa19 100644 (file)
                                                "schema": {
                                                        "type": "string"
                                                }
+                                       },
+                                       {
+                                               "name": "server",
+                                               "in": "query",
+                                               "required": false,
+                                               "description": "VMware server name",
+                                               "schema": {
+                                                       "type": "string"
+                                               }
                                        }
                                ]
                        }