/makehtml-id-157.html#scrolltoc
$result = $zfssa->call('GET','/api/storage/v1/pools');
=cut Raw JSON result
{
"pools":
[
{
"profile": "mirror3",
"name": "platinum",
"asn": "2f4aeeb3-b670-ee53-e0a7-d8e0ae410749"
}
]
}
=cut
# Pools is an array within our JSON result
@pools = @{ $result->{pools} };
foreach $pool (@pools) {
print $pool->{name};
}
# plat
crolltoc
# Our JSON parameters
$param = {
"name": "initial-backup"
};
$result = $zfssa->call('POST','/api/storage/v1/pools/gold/projects/default/snapshots',$param);
=cut Raw JSON result
{
"sn
package Oracle::ZFSSA::Client;
use 5.008;
use strict;
use warnings;
use LWP::UserAgent;
use JSON;
our $VERSION = '0.01';
# HTTP Return Codes
use HTTP::Status qw(:constants);
sub new {
my $cl
'X-Auth-Key' => $self->{password},
'Content-Type' => 'application/json; charset=utf-8'];
my $r = HTTP::Request->new('POST', $url, $header);
my $ua = LWP::UserAgen
ass;
return $self;
}
sub call {
my ($self,$method,$uri,$json) = @_;
$json = JSON->new->utf8->encode($json) if (defined($json));
my $url = $self->{url} . $uri;
my $header = ['X-Auth-