summaryrefslogtreecommitdiff
path: root/PVE/API2/Network/SDN/Zones/Status.pm
diff options
context:
space:
mode:
authorThomas Lamprecht <t.lamprecht@proxmox.com>2023-05-25 18:10:14 +0200
committerThomas Lamprecht <t.lamprecht@proxmox.com>2023-05-25 18:18:57 +0200
commit6029cbb071c3722c717eebbafaf1b373f3edaadc (patch)
tree456d7aff44d2ae220d1671f77da7528174d53fe6 /PVE/API2/Network/SDN/Zones/Status.pm
parentcead0f28af4aceee83af6636d4f5ffb2d2f6c6b1 (diff)
separate packaging and source build system
like almost all of our repos do nowadays, modern git can detect such things on rebase so in development stuff should be hopefully not too much affected by this. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Diffstat (limited to 'PVE/API2/Network/SDN/Zones/Status.pm')
-rw-r--r--PVE/API2/Network/SDN/Zones/Status.pm111
1 files changed, 0 insertions, 111 deletions
diff --git a/PVE/API2/Network/SDN/Zones/Status.pm b/PVE/API2/Network/SDN/Zones/Status.pm
deleted file mode 100644
index 17de68f..0000000
--- a/PVE/API2/Network/SDN/Zones/Status.pm
+++ /dev/null
@@ -1,111 +0,0 @@
-package PVE::API2::Network::SDN::Zones::Status;
-
-use strict;
-use warnings;
-
-use File::Path;
-use File::Basename;
-use PVE::Tools;
-use PVE::INotify;
-use PVE::Cluster;
-use PVE::API2::Network::SDN::Zones::Content;
-use PVE::RESTHandler;
-use PVE::RPCEnvironment;
-use PVE::JSONSchema qw(get_standard_option);
-use PVE::Exception qw(raise_param_exc);
-
-use base qw(PVE::RESTHandler);
-
-__PACKAGE__->register_method ({
- subclass => "PVE::API2::Network::SDN::Zones::Content",
- path => '{zone}/content',
-});
-
-__PACKAGE__->register_method ({
- name => 'index',
- path => '',
- method => 'GET',
- description => "Get status for all zones.",
- permissions => {
- description => "Only list entries where you have 'SDN.Audit'",
- user => 'all',
- },
- protected => 1,
- proxyto => 'node',
- parameters => {
- additionalProperties => 0,
- properties => {
- node => get_standard_option('pve-node')
- },
- },
- returns => {
- type => 'array',
- items => {
- type => "object",
- properties => {
- zone => get_standard_option('pve-sdn-zone-id'),
- status => {
- description => "Status of zone",
- type => 'string',
- enum => ['available', 'pending', 'error'],
- },
- },
- },
- links => [ { rel => 'child', href => "{zone}" } ],
- },
- code => sub {
- my ($param) = @_;
-
- my $rpcenv = PVE::RPCEnvironment::get();
- my $authuser = $rpcenv->get_user();
-
- my $localnode = PVE::INotify::nodename();
-
- my $res = [];
-
- my ($zone_status, $vnet_status) = PVE::Network::SDN::status();
-
- foreach my $id (sort keys %{$zone_status}) {
- my $item->{zone} = $id;
- $item->{status} = $zone_status->{$id}->{'status'};
- push @$res, $item;
- }
-
- return $res;
- }});
-
-__PACKAGE__->register_method ({
- name => 'diridx',
- path => '{zone}',
- method => 'GET',
- description => "",
- permissions => {
- check => ['perm', '/sdn/zones/{zone}', ['SDN.Audit'], any => 1],
- },
- parameters => {
- additionalProperties => 0,
- properties => {
- node => get_standard_option('pve-node'),
- zone => get_standard_option('pve-sdn-zone-id'),
- },
- },
- returns => {
- type => 'array',
- items => {
- type => "object",
- properties => {
- subdir => { type => 'string' },
- },
- },
- links => [ { rel => 'child', href => "{subdir}" } ],
- },
- code => sub {
- my ($param) = @_;
- my $res = [
- { subdir => 'content' },
- ];
-
- return $res;
- }});
-
-1;