The session management APIs are used to open the server connection, and to set and retrieve the server session parameters, such as transport type and authentication style.
This page contains information about the Session Management APIs for Perl, including the description and syntax, and the input, input types, input description, and input return values.
Prototype
set_style($style)
Description
Sets the authentication mechanism to be used for communicating with the given server.
Input |
Description |
$style |
The authentication style Following are the supported values:
To authenticate the server, server certificate verification and hostname verification is required. For more information, see the APIs NaServer::set_client_cert_and_key(), NaServer::set_ca_certs(), NaServer::set_server_cert_verification(), and NaServer::set_hostname_verification(). |
Return value
undef on success
The NaElement object that contains the reason for failure
Prototype
get_style()
Description
Retrieves the configured authentication style.
Return value
The authentication style
Following are the supported values:
HOSTS
LOGIN
CERTIFICATE
set_port($port)
Sets the port on which the API commands need to be invoked for the given server context.
Following is the default port on the storage system for Data ONTAP API communication:
HTTP=80
HTTPS=443
Following is the default port on the server for OnCommand Unified Manager Core Package 5.2 or earlier for API communication:
HTTP=8080
HTTPS=8488
Following is the only supported and default port on the server for OnCommand Unified Manager 6.0 or later for API communication:
HTTPS=443
You must invoke this API to set the port, if Data ONTAP or OnCommand Unified Manager does not have the default port settings.
Input |
Description |
$port |
The port number that is to be set |
Return value
None
get_port()
Retrieves the port number used for invoking API commands.
The port number
Prototype
set_admin_user($user,$passwd)
Description
Sets the administrator user name and password for a server context.
This API is used if style=LOGIN.
Input |
Description |
$user |
The user name |
$passwd |
The password |
Return value
None
Prototype
set_server_type($type)
Description
Sets the type of system you are connecting to.
Input |
Description |
$type |
The server-type to be set Following are the supported values:
The default server type is FILER. |
Return value
undef on success
The NaElement object that contains the reason for failure
Prototype
get_server_type()
Description
Retrieves the value of the server-type.
Return Value
The type of the given server.
Following are the possible return values:
FILER
DFM
OCUM
Prototype
set_transport_type($type)
Description
Set the connection transport type.
Input |
Description |
$type |
The connection transport type Following are the supported values:
For server type OCUM, only HTTPS is supported and is set as default. |
Return value
undef on success
The NaElement object that contains the reason for failure
Prototype
get_transport_type()
Description
Retrieves the connection transport type.
Return value
The connection transport type
Following are the supported values:
HTTP
HTTPS
set_sslv3($enable)
Enables or disables SSLv3 protocol for use over HTTPS transport. SSLv3 protocol is disabled by default.
Input |
Description |
$enable |
Status of SSLv3 Following are the supported values: • 1 if the SSLv3 is to be enabled. • 0 if the SSLv3 is to be disabled. |
None
set_debug_style($debug_style)
Sets the debug style for the given server context.
Input |
Description |
$debug_style |
The debug style that is to be set It takes the value NA_PRINT_DONT_PARSE. If set to NA_PRINT_DONT_PARSE, then the raw XML input and output of the API are printed. |
undef on success
The NaServer object that contains the reason for failure
set_vfiler($vfiler)
Sets the name of the vFiler unit on which the Data ONTAP API commands need to be invoked.
After you set the command, all the API commands are executed on the vFiler unit through the actual storage system.
This API supports the vFiler tunneling feature.
Input |
Description |
$vfiler |
The name of the vFiler unit that is to be set |
1 on success
0 on failure
set_vserver($vsrv)
Sets the name of the Storage Virtual Machine (SVM, formerly known as Vserver) to which a Cluster API need to be tunneled from a Cluster Management Interface.
Input |
Description |
$vsrv |
The name of the SVM that is to be set |
1 on success
0 on failure
get_vserver()
Gets the name of the Storage Virtual Machine (SVM, formerly known as Vserver) to which a Cluster API need to be tunneled from a Cluster Management Interface.
Name of the SVM
Prototype
get_http_version()
Description
Retrieves the HTTP version.
Return value
1.0
1.1
Prototype
set_http_version($$)
Description
Sets the HTTP version for API communication.
Input |
Description |
$http_version |
Following are the supported values:
|
Prototype
use_https()
Description
Determines whether HTTPS is enabled.
Return value
1 if HTTPS is enabled
0 if HTTPS is not enabled
Prototype
invoke($api, [$argname, $argval] ...)
Description
Invokes any API on the given server.
This function takes the API name as the first argument. If the API has any input element, type it as input argument name-value pairs. This function takes only an odd number of arguments.
All the input elements are assembled and sent to the server.
Input |
Description |
$api |
The name of the API to be invoked |
$argname |
The input element name |
$argval |
The input element value |
Return value
The NaElement object
Prototype
invoke_elem($elt)
Description
Invokes any API on the given server.
Creates an input output element for the API to be invoked. All the input elements of the API should be added to this input output element using NaElement::child_add*.
Input |
Description |
elt |
An object of NaElement |
Return value
The NaElement object
Prototype
set_timeout($timeout)
Description
Sets the connection timeout value, in seconds, for the given server context.
Input |
Description |
$timeout |
The timeout value that is to be set |
Return value
None
Prototype
get_timeout()
Description
Retrieves the connection timeout value for the given server context.
Return value
The connection timeout value in seconds
Prototype
set_client_cert_and_key ($cert, $key, $passwd)
Description
Sets the client's certificate and private key files that are required during the Secure Sockets Layer (SSL) session.
Input |
Description |
$cert |
The name of the file in Privacy Enhanced Mail (PEM) format that contains the client certificate To set intermediate certificates and root certificate, you can use the NaServer::set_ca_certs() API. |
$key |
The name of the file in PEM format that contains the private key If key=NULL, the certificate file is used in place of the key. |
$passwd |
The password to access the private key file The value is undef if the private key file is not password-protected. |
Return value
undef on success
The NaElement object that contains the reason for failure
Prototype
set_server_cert_verification($enable)
Description
Enables or disables the server certificate verification by the client.
When the authentication style is set to CERTIFICATE, server certificate verification is enabled by default. Otherwise, you have to set the transport type to HTTPS, and then provide the trusted CA certificates by using the NaServer::set_ca_certs() API to verify the server certificate.
Hostname verification is enabled by default during server certificate verification.
Input |
Description |
enable |
The status of the server certificate validation Following are the supported values:
|
Return value
undef on success
The NaElement object that contains the reason for failure
Prototype
is_server_cert_verification_enabled()
Description
Determines whether server certificate verification is enabled.
Return value
1 if server certificate verification is enabled
0 if server certificate verification is disabled
Prototype
set_ca_certs($CAfile)
Description
Sets the location of trusted certificates that is used for server certificate verification during SSL session.
You can use the APIs NaServer::set_ca_certs() and NaServer::set_client_cert_and_key()to build the client certificate chain that is sent to the server.
Input |
Description |
$CAfile |
The name of the file that contains the certificate of the trusted Certificate Authorities in PEM format |
Return value
undef on success
The NaElement object that contains the reason for failure
Prototype
set_hostname_verification($enable)
Description
Enables or disables hostname verification during server certificate verification.
Input |
Description |
$enable |
The status of the hostname certificate validation
|
Return value
undef on success
The NaElement object that contains the reason for failure
Prototype
is_hostname_verification_enabled()
Description
Determines whether hostname verification is enabled.
Return value
1 if hostname verification is enabled
0 if hostname verification is disabled
Prototype
set_application_name($app_name)
Description
Sets the name of the client application that initiates an operation using Data ONTAP APIs, and requires a response from the Data ONTAP server.
The name of the client application helps you track the actions performed by the application on the server. This information is logged in the server audit log file.
Input |
Description |
| $app_name | The name of the client application that is to be set |
Return value
None
Prototype
get_application_name()
Description
Gets the name of the client application.
Return value
Name of the client application if set using NaServer::set_application_name()
Empty string if not set