NetApp Manageability SDK OLH - master : Programming Guide : Perl API bindings : Session Management APIs for Perl bindings


Session Management APIs for Perl bindings
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.
NaServer::set_style
Prototype
set_style($style)
Description
Sets the authentication mechanism to be used for communicating with the given server.
•
HOSTS—to use the hosts.equiv file on the storage system to determine access rights.
•
LOGIN—to provide user name and password information. You can set the user name by using the API set_admin_user.
•
CERTIFICATE —to use certificates to authenticate clients who attempt to connect to a server, without using login credentials. This style automatically sets HTTPS as the transport mechanism. You can use this authentication mechanism for clustered Data ONTAP 8.2 and OnCommand Unified Manager 5.0.2, 5.1, and 5.2.
and NaServer::set_hostname_verification().
Return value
•
•
NaServer::get_style
Prototype
get_style()
Description
Retrieves the configured authentication style.
Return value
The authentication style
Following are the supported values:
HOSTS
LOGIN
CERTIFICATE
NaServer::set_port
Prototype
set_port($port)
Description
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 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 ONTAP or OnCommand Unified Manager does
not have the default port settings.
Return value
None
NaServer::get_port
Prototype
get_port()
Description
Retrieves the port number used for invoking API commands.
Return value
The port number
NaServer::set_admin_user
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.
Return value
None
NaServer::set_server_type
Prototype
set_server_type($type)
Description
Sets the type of system you are connecting to.
FILER —to connect to a NetApp storage system.
DFM—to connect to an OnCommand Unified Manager 5.2 or earlier server.
OCUM- to connect to an OnCommand Unified Manager 6.0 or later server.
Return value
•
•
NaServer::get_server_type
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:
•
•
•
NaServer::set_transport_type
Prototype
set_transport_type($type)
Description
Set the connection transport type.
•
•
The default transport type is HTTPS. For secure transport, use HTTPS as the transport type.
For server type OCUM, only HTTPS is supported and is set as default.
Return value
•
•
NaServer::get_transport_type
Prototype
get_transport_type()
Description
Retrieves the connection transport type.
Return value
The connection transport type
Following are the supported values:
HTTP
HTTPS
NaServer::set_debug_style
Prototype
set_debug_style($debug_style)
Description
Sets the debug style for the given server context.
Return value
•
•
NaServer::set_vfiler
Prototype
set_vfiler($vfiler)
Description
Sets the name of the vFiler unit on which the 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.
Return value
•
•
NaServer::set_vserver
Prototype
set_vserver($ vsrv)
Description
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.
Return value
•
•
NaServer::get_vserver
Prototype
get_vserver()
Description
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.
Return value
Name of the SVM
NaServer::use_https
Prototype
use_https()
Description
Determines whether HTTPS is enabled.
Return value
•
•
NaServer::set_timeout
Prototype
set_timeout($timeout)
Description
Sets the connection timeout value, in seconds, for the given server context.
Return value
None
NaServer::get_timeout
Prototype
get_timeout()
Description
Retrieves the connection timeout value for the given server context.
Return value
The connection timeout value in seconds
NaServer::set_client_cert_and_key
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.
Return value
•
•
NaServer::set_server_cert_verification
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.
•
1 if the server certificate verification is to be enabled.
•
0 if the server certificate verification is to be disabled.
Return value
•
•
NaServer::is_server_cert_verification_enabled
Prototype
is_server_cert_verification_enabled()
Description
Determines whether server certificate verification is enabled.
Return value
•
•
NaServer::set_ca_certs
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.
Return value
•
•
NaServer::set_hostname_verification
Prototype
set_hostname_verification($enable)
Description
Enables or disables hostname verification during server certificate verification.
TRUE if the hostname verification is to be enabled.
FALSE if the hostname verification is to be disabled.
Return value
•
•
NaServer::is_hostname_verification_enabled
Prototype
is_hostname_verification_enabled()
Description
Determines whether hostname verification is enabled.
Return value
•
•
NaServer::set_application_name
Prototype
set_application_name($app_name)
Description
Sets the name of the client application that initiates an operation using ONTAP APIs, and requires a response from the 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.
Return value
None
NaServer::get_application_name
Prototype
get_application_name()
Description
Gets the name of the client application.
Return value
•
•
NaServer::set_bindings_validation
Prototype
set_bindings_validation($enable)
Description
Enables or disables API bindings validation (which is enabled by default) for ONTAP or OnCommand Unified Manager server.
Return value
None
NaServer::set_bindings_family
Prototype
set_bindings_family($family)
Description
Set the API family of ONTAP or OnCommand Unified Manager server for API bindings validation. The bindings validation must already be enabled using NaServer::set_bindings_validation().
Return value
None
Parent topic: Perl API bindings

Was this topic helpful? Send comments to NetApp.