So you are using <charts/> as an empty element tag. The documentation says that charts is an optional element, but you are saying that is required as an empty element tag.
However, I do not see a way to add an empty element tag to the XML using the SDK methods. If I use this:
my $charts = NetAppApi::NaElement->new("charts");
my $perf_view = NetAppApi::NaElement->new("perf-view");
$perf_view->child_add_string("view-name", $name);
$perf_view->child_add($charts);
my $view = NetAppApi::NaElement->new("view");
$view->child_add($perf_view);
my $create = NetAppApi::NaElement->new("perf-view-create");
$create->child_add($view)
To submit the XML:
$VAR1 = bless( {
'content' => '',
'name' => 'perf-view-create',
'children' => [
bless( {
'content' => '',
'name' => 'view',
'children' => [
bless( {
'content' => '',
'name' => 'perf-view',
'children' => [
bless( {
'content' => 'Flash Cache lnn99 (extended)',
'name' => 'view-name',
'children' => [],
'attrvals' => [],
'attrkeys' => []
}, 'NetAppApi::NaElement' ),
bless( {
'content' => '',
'name' => 'charts',
'children' => [],
'attrvals' => [],
'attrkeys' => []
}, 'NetAppApi::NaElement' )
],
'attrvals' => [],
'attrkeys' => []
}, 'NetAppApi::NaElement' )
],
'attrvals' => [],
'attrkeys' => []
}, 'NetAppApi::NaElement' )
],
'attrvals' => [],
'attrkeys' => []
}, 'NetAppApi::NaElement' );
Then I get an undefined error in response:
$VAR1 = bless( {
'content' => '',
'name' => 'results',
'children' => [],
'attrvals' => [
'',
'13001',
'failed'
],
'attrkeys' => [
'reason',
'errno',
'status'
]
}, 'NetAppApi::NaElement' );
So that is not a valid way to specify an empty element tag.
If I add a chart then my error just changes to the level below, the first named chart generates an error that there are no lines specified (again this should be optional).
So I don't think that the empty element tag <charts/> should be required, and enforced, by the filer. This is more than just a documentation issue. I guess I could work around it for now, but I will need to know how to add the empty element tag to the NaElement object. Is there an SDK method to do that?
Thanks,
Chris