NetApp Manageability SDK OLH - master : Programming Guide : SDK Core APIs : C and C++ Core APIs : Input Output Element Management APIs for C and C++


Input Output Element Management APIs for C and C++
The Input Output Element Management APIs are used to set the value to, or retrieve the value from, the input output (I/O) element. I/O elements are similar to XML containers; they have a name-value pair. You can nest them arbitrarily within other elements.
This page contains information about the Input Output Element Management APIs for C and C++, including the description and syntax, and the input, input types, input description, and input return values.
na_child_add
Prototype
na_elem_t* na_child_add(na_elem_t* elt, na_elem_t* childelt);
Description
Adds the nested child element childelt to the parent element elt.
All nested elements are unordered and are accessed by their name. However, this API adds the child element to the end of the nested element list.
Return value
•
•
na_child_add_int
Prototype
na_elem_t* na_child_add_int(na_elem_t * elt, const char * name, int value);
Description
•
•
Return value
•
•
na_child_add_int64
Prototype
na_elem_t * na_child_add_int64(na_elem_t * e, const char * name, int64_t value);
Description
•
•
Return value
•
•
na_child_add_uint32
Prototype
na_elem_t* na_child_add_uint32(na_elem_t * e, const char * name, uint32_t value);
Description
•
•
Return value
•
•
na_child_add_uint64
Prototype
na_elem_t * na_child_add_uint64(na_elem_t * e, const char * name, uint64_t value);
Description
•
•
Return value
•
•
na_child_add_string
Prototype
na_elem_t* na_child_add_string(na_elem_t* elt, const char* name, const char* value);
Description
•
•
Return value
•
•
na_child_add_string_encrypted
Prototype
na_elem_t* na_child_add_string_encrypted(na_elem_t* elt, const char* name, const char* value, const char* key);
Description
◦
◦
Encrypts the data contained in the value with the encryption key.
◦
Return value
◦
◦
na_elem_set_content
Prototype
int na_elem_set_content(na_elem_t* elt, const char* value);
Description
Sets or modifies the value of the given element.
The value to be set can only be of string type. If a non-string value is required to be set, then it should be converted to string first and then passed to this API.
Return value
◦
1 (TRUE) on success
◦
0 (FALSE) on failure
na_child_get_bool
Prototype
bool_t na_child_get_bool(na_elem_t * elt, const char * name, bool_t deflt);
Description
Gets the boolean value of the given child element, which is nested under the element elt.
Return value
◦
◦
The default value deflt, under the following conditions:
▪
▪
◦
◦
na_child_get_int
Prototype
int na_child_get_int(na_elem_t * elt, const char * name, int deflt);
Description
Gets the integer value of the given child element, which is nested under the element elt.
Return value
◦
◦
The default value deflt, under the following conditions:
▪
▪
na_child_get_int64
Prototype
int64_t na_child_get_int64(na_elem_t * e, const char * name, int64_t deflt)
Description
Gets the 64-bit integer value of the given child element, which is nested under the element elt.
Return value
◦
◦
The default value deflt, under the following conditions:
▪
▪
na_child_get_uint32
Prototype
uint32_t na_child_get_uint32(na_elem_t * e, const char * name, uint32_t deflt);
Description
Gets the 32-bit unsigned integer value of the given child element, which is nested under element elt.
Return value
◦
◦
The default value deflt, under the following conditions:
▪
▪
na_child_get_uint64
Prototype
uint64_t na_child_get_uint64(na_elem_t * e, const char * name, uint64_t deflt);
Description
Gets the 64-bit unsigned integer value of the given child element, which is nested under the element elt.
Return value
◦
◦
The default value deflt, under the following conditions:
▪
▪
na_child_get_string
Prototype
const char* na_child_get_string(na_elem_t* elt, const char* name);
Description
Gets the string value of the given child element, which is nested under the element elt.
Return value
◦
◦
na_child_get_string_encrypted
Prototype
char* na_child_get_string_encrypted(na_elem_t* elt, const char* name, const char* key);
Description
Gets the decrypted string value of the given child element, which is nested under element elt.
The string is decrypted using the given key. The default key is used if the given key is NULL. The system allocates memory for the decrypted data. You must explicitly free it with na_free() after the API call is over.
Return value
◦
◦
na_elem_child
Prototype
na_elem_t* na_elem_child(na_elem_t* elt, const char* eltname);
Description
Gets the child element address, which is nested under the element elt.
Return value
◦
◦
na_elem_get_content
Prototype
const char* na_elem_get_content(na_elem_t * elt);
Description
Gets the content of the element elt.
Return value
◦
◦
na_elem_get_name
Prototype
const char* na_elem_get_name(na_elem_t * e);
Description
Gets the name of the element.
Return value
◦
◦
◦
na_elem_has_children
Prototype
int na_elem_has_children(na_elem_t* elt);
Description
Checks whether the element has any nested elements within it.
Return value
◦
1 (TRUE) if the element has any children
◦
0 (FALSE) if the element has no children
na_encrypt_basic
Prototype
void na_encrypt_basic(const char *key, const char* input, char * output, int nbytes);
Description
◦
◦
Assumptions:
◦
◦
Return value
None
na_child_iterator
Prototype
na_elem_iter_t na_child_iterator(na_elem_t* elt);
Description
Sets an iterator for traversing the child elements of elt.
You call na_iterator_next() on this iterator to walk through the nested element list.
Return value
The element iterator for looping through the children of an element
na_iterator_next
Prototype
na_elem_t* na_iterator_next(na_elem_iter_t* tag);
Description
Repeatedly iterates through all the children of elt for a given tag returned by the na_child_iterator(elt).
Return value
The next item from an iterator
na_zapi_get_elem_from_raw_xmlinput
Prototype
na_elem_t* na_zapi_get_elem_from_raw_xmlinput(char * val);
Description
Retrieves the API element from a raw XML input.
Return value
The pointer to the API element for a given raw XML
na_elem_sprintf
Prototype
char* na_elem_sprintf(na_elem_t* elt);
Description
Gets the content of the input output element in XML format and writes into a string buffer.
You should free the returned buffer using na_free().
Return value
◦
◦
NULL on failure
Parent topic: C and C++ Core APIs

Was this topic helpful? Send comments to NetApp.