Utilities for NetApp drivers.
This module contains common utilities to be used by one or more
NetApp drivers to achieve the desired functionality.
-
class OpenStackInfo
Bases: object
OS/distribution, release, and version.
NetApp uses these fields as content for EMS log entry.
-
PACKAGE_NAME = 'python-cinder'
-
info()
-
check_apis_on_cluster(na_server, api_list=[])
Checks api availability and permissions on cluster.
Checks api availability and permissions for executing user.
Returns a list of failed apis.
-
convert_es_fmt_to_uuid(es_label)
Converts e-series name format to uuid.
-
convert_uuid_to_es_fmt(uuid_str)
Converts uuid to e-series compatible name format.
-
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
|
-
decode_base32_to_hex(base32_string)
Decodes base32 string to hex string.
-
encode_hex_to_base32(hex_string)
Encodes hex to base32 bit as per RFC4648.
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, netapp_backend, app_version, server_type='cluster')
Provide ems with volume stats for the requester.
Parameters: | server_type – cluster or 7mode. |
-
resolve_hostname(hostname)
Resolves host name to IP address.
-
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.