From 736d4b606eeaa55db119d262df57dda5b7aedaa2 Mon Sep 17 00:00:00 2001 From: Marcin Haba Date: Tue, 30 May 2023 15:46:13 +0200 Subject: [PATCH] baculum: Add server parameter to list vsphere datastores endpoint --- .../API/Pages/API/PluginVSphereListDatastores.php | 7 ++++++- gui/baculum/protected/API/openapi_baculum.json | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gui/baculum/protected/API/Pages/API/PluginVSphereListDatastores.php b/gui/baculum/protected/API/Pages/API/PluginVSphereListDatastores.php index 3b3fd4856..6a237b5a9 100644 --- a/gui/baculum/protected/API/Pages/API/PluginVSphereListDatastores.php +++ b/gui/baculum/protected/API/Pages/API/PluginVSphereListDatastores.php @@ -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]; diff --git a/gui/baculum/protected/API/openapi_baculum.json b/gui/baculum/protected/API/openapi_baculum.json index e7408dd7b..986b77eda 100644 --- a/gui/baculum/protected/API/openapi_baculum.json +++ b/gui/baculum/protected/API/openapi_baculum.json @@ -10046,6 +10046,15 @@ "schema": { "type": "string" } + }, + { + "name": "server", + "in": "query", + "required": false, + "description": "VMware server name", + "schema": { + "type": "string" + } } ] } -- 2.47.3