diff --git a/cgi-bin/get_networks b/cgi-bin/get_networks index 0bc7ba3c..f20ec7dc 100644 --- a/cgi-bin/get_networks +++ b/cgi-bin/get_networks @@ -20,6 +20,24 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) my $anvil = Anvil::Tools->new(); +sub handle_invalid_uuid +{ + my $parameters = shift; + my $name = $parameters->{name}; + my $uuid = $parameters->{uuid}; + + $anvil->Log->entry({ + source => $THIS_FILE, + line => __LINE__, + level => 0, + 'print' => 1, + priority => "err", + key => "error_0160", + variables => { name => $name, uuid => $uuid } + }); + $anvil->nice_exit({ exit_code => 1 }); +} + $anvil->Get->switches; # Temporary; for debugging @@ -42,6 +60,29 @@ $anvil->Database->get_anvils(); print $anvil->Template->get({file => "shared.html", name => "json_headers", show_name => 0})."\n"; +my $anvil_uuid = $anvil->data->{cgi}{anvil_uuid}{value}; +my $anvil_uuid_variable_name = "anvil UUID"; + my $response_body = {}; +if ($anvil_uuid) +{ + if (exists $anvil->data->{anvils}{anvil_uuid}{$anvil_uuid}) + { + + } + else + { + handle_invalid_uuid({ name => $anvil_uuid_variable_name, uuid => $anvil_uuid }); + } +} +else +{ + handle_invalid_uuid({ name => $anvil_uuid_variable_name, uuid => $anvil_uuid }); +} + +my @host_uuids = ( + $anvil->data->{anvils}{anvil_uuid}{} +) + print JSON->new->utf8->encode($response_body)."\n";