I am getting error : Error: Extra content at the end of the document when I am trying to attach storage policy to dataset. What I am doing wrong?
sub storage_policy {
# Reading the server object
my $server = $_[0];
my $input = NaElement->new("storage-service-dataset-modify");
$input->child_add_string("dataset-name-or-id", $dfmval);
$input->child_add_string("operation-type", attach);
$input->child_add_string("storage-service-name-or-id", $storage_policy);
# invoking the api and printing the xml ouput
my $output = $server->invoke($input);
print "\n$output\n";
print( "Error : " . $output->results_reason() . "\n" ) and exit(-2)
if ( $output->results_status() eq "failed" );
print "\nResult: " . result( $output->results_status() ) . "\n";
}
Thanks, Petr