From: Marcin Haba Date: Mon, 13 Mar 2023 10:12:42 +0000 (+0100) Subject: baculum: Add restore_host parameter to vsphere plugin datastores API endpoint X-Git-Tag: Release-13.0.3~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50540cf09c689fabeb528ddb177a37724a4c9457;p=thirdparty%2Fbacula.git baculum: Add restore_host parameter to vsphere plugin datastores API endpoint --- diff --git a/gui/baculum/protected/API/Pages/API/PluginVSphereListDatastores.php b/gui/baculum/protected/API/Pages/API/PluginVSphereListDatastores.php index 62ffb483b..9c0fd505a 100644 --- a/gui/baculum/protected/API/Pages/API/PluginVSphereListDatastores.php +++ b/gui/baculum/protected/API/Pages/API/PluginVSphereListDatastores.php @@ -60,12 +60,17 @@ class PluginVSphereListDatastores extends ConsoleOutputQueryPage { return; } + $misc = $this->getModule('misc'); $out_format = ConsoleOutputPage::OUTPUT_FORMAT_RAW; 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: '; + $plugin = 'vsphere:'; + if (!empty($restore_host)) { + $plugin .= ' restore_host="' . $restore_host . '"'; + } $out = new \StdClass; $out->output = []; $params = ['client' => $client, 'plugin' => $plugin]; diff --git a/gui/baculum/protected/API/openapi_baculum.json b/gui/baculum/protected/API/openapi_baculum.json index e1c3685c3..5ceb4e003 100644 --- a/gui/baculum/protected/API/openapi_baculum.json +++ b/gui/baculum/protected/API/openapi_baculum.json @@ -8691,6 +8691,15 @@ }, { "$ref": "#/components/parameters/Output" + }, + { + "name": "restore_host", + "in": "query", + "required": false, + "description": "VMware restore host", + "schema": { + "type": "string" + } } ] }