Utilities for NetApp drivers.
This module contains common utilities to be used by one or more
NetApp drivers to achieve the desired functionality.
-
create_api_request(api_name, query=None, des_result=None, additional_elems=None, is_iter=False, record_step=50, tag=None)
Creates a NetApp api request.
Parameters: |
- api_name – api name string
- query – api query as dict
- des_result – desired result as dict
- additional_elems – dict other than query and des_result
- is_iter – is iterator api
- record_step – records at a time for iter api
- tag – next tag for iter api
|
Provides extra specs associated with volume.
-
invoke_api(na_server, api_name, api_family='cm', query=None, des_result=None, additional_elems=None, is_iter=False, records=0, tag=None, timeout=0, tunnel=None)
Invokes any given api call to a NetApp server.
Parameters: |
- na_server – na_server instance
- api_name – api name string
- api_family – cm or 7m
- query – api query as dict
- des_result – desired result as dict
- additional_elems – dict other than query and des_result
- is_iter – is iterator api
- records – limit for records, 0 for infinite
- timeout – timeout seconds
- tunnel – tunnel entity, vserver or vfiler name
|
-
provide_ems(requester, server, stats, netapp_backend, server_type='cluster')
Provide ems with volume stats for the requester.
Parameters: | server_type – cluster or 7mode. |
-
set_safe_attr(*args, **kwargs)
Sets the attribute in a thread safe manner.
Returns if new val was set on attribute.
If attr already had the value then False.
-
to_bool(val)
Converts true, yes, y, 1 to True, False otherwise.
-
validate_instantiation(**kwargs)
Checks if a driver is instantiated other than by the unified driver.
Helps check direct instantiation of netapp drivers.
Call this function in every netapp block driver constructor.