The Input Output (I/O) element in Perl is represented by the NaElement class. The I/O elements are similar to XML containers; they have a name-value pair. You can nest them arbitrarily within other I/O elements.
The I/O Management APIs are used to create I/O elements, and to set the value to or retrieve the value from the I/O elements.
This page contains information about the Input Output Management APIs for Perl, including the description and syntax, and the input, input types, input description, and input return values.
Prototype
new($name, $value)
Description
Constructs a new I/O element with the given name and value.
|
Input |
Description |
|
$name |
The name of the element. |
|
$value |
The value of the element to be created. This parameter is optional for the typedefs and the API names. |
Return value
The NaElement object
Prototype
child_add($elt)
Description
Adds the element $elt to the children list of the current object of the type NaElement.
This can be used to add any input element, its typedef, and the elements of the typedef.
|
Input |
Description |
|
$elt |
The object of NaElement. |
Return value
None
Prototype
child_add_string($name, $value)
Description
Creates a new object of NaElement for the given $name and $value.
Adds the new object as a child element to the current object of the type NaElement.
|
Input |
Description |
|
$name |
The name of the element. |
|
$value |
The value to be assigned to the element. |
Return value
None
Prototype
child_add_string_encrypted($name, $value, $key)
Description
Creates a new object of NaElement for the given $name.
Encrypts $value with the key $key and adds it to the new object.
Adds the new object as a child element to the current object of type NaElement.
Both the client-side and the server-side should know the value of $key to encrypt and decrypt $value appropriately. You use the API child_get_string_encrypted to decrypt the value.
|
Input |
Description |
|
$name |
The name of the element. |
|
$value |
The value to be assigned to the element. |
|
$key |
The encryption key. |
Return value
None
Prototype
set_content($content)
Description
Sets the value of an element to $content.
|
Input |
Description |
|
$content |
The value to be set to the current object. |
Return value
None
Prototype
child_get($name)
Description
Gets the child element named $name from the current object.
You can nest the elements arbitrarily and the returned element can have other child elements.
|
Input |
Description |
|
$name |
The name of the child element. |
Return value
The NaElement named $name
undef if no child element is found
Prototype
child_get_int($name)
Description
Gets the child $name from the current object and returns its value as an integer
|
Input |
Description |
|
$name |
The name of the child element. |
Return value
The value of the child element
undef if no child element is found
Prototype
child_get_string($name)
Description
Gets the child named $name from the current object and returns its value.
If there is no child named $name, undef is returned.
|
Input |
Description |
|
$name |
The name of the child element. |
Return value
The value of the child element
undef if no child element is found
Prototype
child_get_string_encrypted($name, $key)
Description
Gets the child named $name from the current object.
Retrieves its value and decrypts it with the key $key.
Returns the decrypted value.
|
Input |
Description |
|
$name |
The name of the child element. |
|
$key |
The decryption key. |
Return value
The decrypted value of the child element
undef if no child element is found
Prototype
children_get()
Description
Returns the list of children as an array.
Return value
The array of object of the type NaElement
Prototype
has_children()
Description
Checks whether the current element has any child element.
Return value
1 if the element has a child element
0 if no child element is found
Prototype
sprintf()
Description
Prints the current element and its child elements recursively in the XML format.
You can use this API for debugging purposes.
Return value
The XML string containing the element and its child elements
Prototype
parse_raw_xml($xml_str)
Description
Retrieves the API element from raw XML input.
Return value
|
Input |
Description |
|
$xml_str |
The raw XML input string. |
Return value
The NaElement object containing the Data ONTAP API input data on success
The NaElement object containing the reason for failure
Prototype
toEncodedString()
Description
Encodes a string containing special characters like ampersand (&), less than (<), greater than (>), single quote ('), and double quote (").
This is mainly useful while passing string values containing special characters like '&' and '<','>' to any core API. The special characters can result in unexpected parsing of XML data; therefore, they need to be handled appropriately.
Return value
The encoded string in XML format