From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id B23AE6D504 for ; Tue, 28 Sep 2021 08:32:41 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A11AE9C4A for ; Tue, 28 Sep 2021 08:32:41 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id BE5E29C41 for ; Tue, 28 Sep 2021 08:32:40 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 977F1421EF for ; Tue, 28 Sep 2021 08:32:40 +0200 (CEST) From: Lorenz Stechauner To: pve-devel@lists.proxmox.com Date: Tue, 28 Sep 2021 08:32:32 +0200 Message-Id: <20210928063232.824257-2-l.stechauner@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210928063232.824257-1-l.stechauner@proxmox.com> References: <20210928063232.824257-1-l.stechauner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.411 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [pvesm.pm] Subject: [pve-devel] [PATCH v2 storage 2/2] pvesm: using $API instead of PVE::API2::Storage X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 06:32:41 -0000 Signed-off-by: Lorenz Stechauner --- 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 6c0a1b2..28be91c 100755 --- a/PVE/CLI/pvesm.pm +++ b/PVE/CLI/pvesm.pm @@ -511,43 +511,45 @@ my $print_api_result = sub { PVE::CLIFormatter::print_api_result($data, $schema, undef, $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_api_result, $PVE::RESTHandler::standard_output_options ], - list => [ "PVE::API2::Storage::Content", 'index', ['storage'], { node => $nodename }, + list => [ "${API}::Content", 'index', ['storage'], { node => $nodename }, $print_api_result, $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