public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Lorenz Stechauner <l.stechauner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v3 storage 2/2] pvesm: using $API instead of PVE::API2::Storage
Date: Thu, 21 Oct 2021 14:49:19 +0200	[thread overview]
Message-ID: <20211021124919.87618-2-l.stechauner@proxmox.com> (raw)
In-Reply-To: <20211021124919.87618-1-l.stechauner@proxmox.com>

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
---
 PVE/CLI/pvesm.pm | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/PVE/CLI/pvesm.pm b/PVE/CLI/pvesm.pm
index 94847cd..78fc51b 100755
--- a/PVE/CLI/pvesm.pm
+++ b/PVE/CLI/pvesm.pm
@@ -523,43 +523,45 @@ my $print_status = sub {
     PVE::CLIFormatter::print_api_result($data, $schema, $order, $options);
 };
 
+my $API = 'PVE::API2::Storage';
+
 our $cmddef = {
-    add => [ "PVE::API2::Storage::Config", 'create', ['type', 'storage'] ],
-    set => [ "PVE::API2::Storage::Config", 'update', ['storage'] ],
-    remove => [ "PVE::API2::Storage::Config", 'delete', ['storage'] ],
-    status => [ "PVE::API2::Storage::Status", 'index', [], { node => $nodename },
+    add => [ "${API}::Config", 'create', ['type', 'storage'] ],
+    set => [ "${API}::Config", 'update', ['storage'] ],
+    remove => [ "${API}::Config", 'delete', ['storage'] ],
+    status => [ "${API}::Status", 'index', [], { node => $nodename },
 	        $print_status, $PVE::RESTHandler::standard_output_options ],
-    list => [ "PVE::API2::Storage::Content", 'index', ['storage'], { node => $nodename },
+    list => [ "${API}::Content", 'index', ['storage'], { node => $nodename },
 	      $print_content, $PVE::RESTHandler::standard_output_options ],
-    alloc => [ "PVE::API2::Storage::Content", 'create', ['storage', 'vmid', 'filename', 'size'],
+    alloc => [ "${API}::Content", 'create', ['storage', 'vmid', 'filename', 'size'],
 	       { node => $nodename }, sub {
 		   my $volid = shift;
 		   print "successfully created '$volid'\n";
 	       }],
-    free => [ "PVE::API2::Storage::Content", 'delete', ['volume'],
+    free => [ "${API}::Content", 'delete', ['volume'],
 	      { node => $nodename } ],
     scan => {
-	nfs => [ "PVE::API2::Storage::Scan", 'nfsscan', ['server'], { node => $nodename },
+	nfs => [ "${API}::Scan", 'nfsscan', ['server'], { node => $nodename },
 		 $print_api_result, $PVE::RESTHandler::standard_output_options ],
-	cifs => [ "PVE::API2::Storage::Scan", 'cifsscan', ['server'], { node => $nodename },
+	cifs => [ "${API}::Scan", 'cifsscan', ['server'], { node => $nodename },
 		  $print_api_result, $PVE::RESTHandler::standard_output_options ],
-	glusterfs => [ "PVE::API2::Storage::Scan", 'glusterfsscan', ['server'], { node => $nodename },
+	glusterfs => [ "${API}::Scan", 'glusterfsscan', ['server'], { node => $nodename },
 		       $print_api_result, $PVE::RESTHandler::standard_output_options ],
-	iscsi => [ "PVE::API2::Storage::Scan", 'iscsiscan', ['portal'], { node => $nodename },
+	iscsi => [ "${API}::Scan", 'iscsiscan', ['portal'], { node => $nodename },
 		   $print_api_result, $PVE::RESTHandler::standard_output_options ],
-	lvm => [ "PVE::API2::Storage::Scan", 'lvmscan', [], { node => $nodename },
+	lvm => [ "${API}::Scan", 'lvmscan', [], { node => $nodename },
 		 $print_api_result, $PVE::RESTHandler::standard_output_options ],
-	lvmthin => [ "PVE::API2::Storage::Scan", 'lvmthinscan', ['vg'], { node => $nodename },
+	lvmthin => [ "${API}::Scan", 'lvmthinscan', ['vg'], { node => $nodename },
 		     $print_api_result, $PVE::RESTHandler::standard_output_options ],
 	pbs => [
-	    "PVE::API2::Storage::Scan",
+	    "${API}::Scan",
 	    'pbsscan',
 	    ['server', 'username'],
 	    { node => $nodename },
 	    $print_api_result,
 	    $PVE::RESTHandler::standard_output_options,
 	],
-	zfs => [ "PVE::API2::Storage::Scan", 'zfsscan', [], { node => $nodename },
+	zfs => [ "${API}::Scan", 'zfsscan', [], { node => $nodename },
 		 $print_api_result, $PVE::RESTHandler::standard_output_options ],
     },
     nfsscan => { alias => 'scan nfs' },
-- 
2.30.2





  reply	other threads:[~2021-10-21 12:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21 12:49 [pve-devel] [PATCH v3 storage 1/2] fix #3633: pvesm: use print_api_result Lorenz Stechauner
2021-10-21 12:49 ` Lorenz Stechauner [this message]
2021-10-21 12:50 ` Lorenz Stechauner
2021-10-25 14:17 ` Dominik Csapak
2021-10-27  9:55   ` Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211021124919.87618-2-l.stechauner@proxmox.com \
    --to=l.stechauner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal