Advertisement
Guest User

Untitled

a guest
Jun 21st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.46 KB | None | 0 0
  1.  
  2. my $node_to_ports = {};
  3.  
  4. for my $node (@appliances){
  5.     $node_to_ports->{$node} = {};
  6.  
  7.     (my $code, $port) = $rest->call( "GET", "node/$node/ports", {} );
  8.  
  9.     foreach my $port (@{$port->{items}}) {
  10.         $node_to_ports->{$node}->{$port->{id}} = $port;
  11.    
  12.         # So in etwa ...
  13.         my $port_reporting = $rest->call( "GET", "port/$port->{id}/fasel", {} );
  14.        
  15.         $node_to_ports->{$node}->{$port->{id}}->{reporting} = $port_reporting;
  16.     }
  17. }
  18.  
  19. print Dumper($node_to_ports);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement