The session management APIs are used to open the server connection, and to set and retrieve the server session parameters, such as transport type, authentication style.
This page contains information about the Session Management APIs for Python, including the description and syntax, and the input, input types, input description, and input return values.
set_style(style)
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.
|
None on failure
get_style()
Retrieves the configured authentication style.
The authentication style.
Following are the supported values:
HOSTS
LOGIN
CERTIFICATE
set_port(port)
Sets the port number on which the API commands need to be invoked with the given server.
|
Input |
Description |
|
port |
The port number that is to be set. |
void
get_port()
Retrieves the port number used for invoking API commands.
The port number
set_admin_user(user,passwd)
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. |
void
set_server_type(type)
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. |
None on success
The NaElement object that contains the reason for failure
get_server_type()
Retrieves the value of the server-type.
The type of the given server.
Following are the possible return values:
FILER
DFM
set_transport_type(type)
Set the connection transport type.
|
Input |
Description |
|
type |
The connection transport type. Following are the supported values:
|
None on success
The NaElement object that contains the reason for failure
get_transport_type()
Retrieves the connection transport type.
The connection transport type
Following are the supported values:
HTTP
HTTPS
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. |
None 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
NaServer.set_vserver(srv, vsrv)
Sets the name of the Vserver to which a Cluster API need to be tunneled from a Cluster Management Interface.
|
Input |
Description |
|
srv |
The pointer to the server context. |
|
vsrv |
The name of the Vserver that is to be set. |
1 on success
0 on failure
NaServer.get_vserver()
Gets the name of the Vserver to which a Cluster API need to be tunneled from a Cluster Management Interface.
Name of the Vserver
use_https()
Determines whether HTTPS is enabled.
1 if HTTPS is enabled
0 if HTTPS is not enabled
invoke(api, [argname, argval] ...)
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. |
The NaElement object
invoke_elem(elt)
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. |
The NaElement object
set_timeout(timeout)
Sets the connection timeout value, in seconds, for the given server context.
|
Input |
Description |
|
timeout |
The timeout value that is to be set. |
void
get_timeout()
Retrieves the connection timeout value for the given server context.
The connection timeout value in seconds
set_client_cert_and_key (cert, key)
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 certificate. | ||
|
key |
The name of the file in PEM format that contains the private key.
|
void
set_server_cert_verification(enable)
EEnables 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
None
set_ca_certs(CAfile)
Specifies the certificates that belong to the trusted Certificate Authorities, and the certificates that are used to verify the remote server certificate.
|
Input |
Description |
|
CAfile |
The name of the file that contains the certificate of the trusted Certificate Authorities in PEM format. The file can contain several certificates from the trusted Certificate Authorities. |
void
is_server_cert_verification_enabled()
Determines whether server certificate verification is enabled or not.
True if server certificate verification is enabled.
False if server certificate verification is not enabled.
set_hostname_verification(enable)
Enables or disables hostname verification during server certificate verification.
|
Input |
Description |
|
enable |
The status of the hostname certificate validation
|
None
is_hostname_verification_enabled()
Determines whether hostname verification is enabled.
True if hostname verification is enabled.
False if hostname verification is not enabled.