|
|
@ -55,8 +55,14 @@ sub main {
|
|
|
|
$client->set_verbose($opts->{verbose});
|
|
|
|
$client->set_verbose($opts->{verbose});
|
|
|
|
# domain_id
|
|
|
|
# domain_id
|
|
|
|
my $dom = $client->request("GET", "/api/domains/?domain=".$opts->{domain});
|
|
|
|
my $dom = $client->request("GET", "/api/domains/?domain=".$opts->{domain});
|
|
|
|
|
|
|
|
my $dom_id;
|
|
|
|
if ($dom->as_hash->{total_count} == 1) {
|
|
|
|
if ($dom->as_hash->{total_count} == 1) {
|
|
|
|
my $dom_id = $dom->as_hash->{_embedded}->{'ngcp:domains'}->{id};
|
|
|
|
my $tmp = $dom->as_hash->{_embedded}->{'ngcp:domains'};
|
|
|
|
|
|
|
|
if (ref $tmp eq 'ARRAY') {
|
|
|
|
|
|
|
|
$dom_id = $tmp[0]->{id};
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$dom_id = $tmp->{id};
|
|
|
|
|
|
|
|
}
|
|
|
|
usage("Domain not found") unless $dom_id;
|
|
|
|
usage("Domain not found") unless $dom_id;
|
|
|
|
$uri .= $dom_id;
|
|
|
|
$uri .= $dom_id;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|