PyU4V.univmax_conn

Creates the connection with the Unisphere for PowerMax instance.

univmax_conn.py.

class PyU4V.univmax_conn.U4VConn(username=None, password=None, server_ip=None, port=None, verify=None, u4v_version='101', interval=5, retries=200, array_id=None, application_type='PyU4V-10.1.0.1', remote_array=None, remote_array_2=None, proxies=None)[source]

Bases: object

U4VConn.

close_session()[source]

Close the current rest session.

set_array_id(array_id)[source]

Set the array serial number.

Parameters:

array_id – the array serial number – str

set_requests_timeout(timeout_value)[source]

Set the requests timeout.

Parameters:

timeout_value – the new timeout value – int

validate_unisphere()[source]

Check that the minimum version of Unisphere is in-use.

If the version of Unisphere used does not meet minimum requirements the application will exit gracefully.

Raises:

SystemExit

PyU4V.common

common.py.

class PyU4V.common.CommonFunctions(rest_client)[source]

Bases: object

CommonFunctions.

build_target_uri(**kwargs)[source]

Build the target URI.

This function calls into _build_uri() for access outside this class.

Key version:

Unisphere version – int

Key no_version:

if versionless uri – bool

Key category:

resource category e.g. sloprovisioning – str

Key resource_level:

resource level e.g. storagegroup – str

Key resource_level_id:

resource level id – str

Key resource_type:

optional name of resource – str

Key resource_type_id:

optional name of resource – str

Key resource:

optional name of resource – str

Key resource_id:

optional name of resource – str

Key object_type:

optional name of resource – str

Key object_type_id:

optional name of resource – str

Returns:

target URI – str

static check_epoch_timestamp(in_epoch_timestamp)[source]

Check that the timestamp is in the correct format

Parameters:

in_epoch_timestamp – timestamp e.g. 1554332400 – str

static check_ipv4(ipv4)[source]

Check if a given string is a valid ipv6 address

Parameters:

ipv4 – ipv4 address – str

Returns:

string is valid ipv4 address – bool

static check_ipv6(ipv6)[source]

Check if a given string is a valid ipv6 address

Parameters:

ipv6 – ipv6 address – str

Returns:

string is valid ipv6 address – bool

static check_status_code_success(operation, status_code, message)[source]

Check if a status code indicates success.

Parameters:
  • operation – operation being performed – str

  • status_code – status code – int

  • message – server response – str

Raises:

VolumeBackendAPIException

static check_timestamp(in_timestamp)[source]

Check that the timestamp is in the correct format

Parameters:

in_timestamp – timestamp e.g. 2020-11-24 15:00 – str

static convert_to_snake_case(camel_case_string)[source]

Convert a string from camel case to snake case.

Parameters:

camel_case_string – string for formatting – str

Returns:

snake case variant – str

create_resource(*args, **kwargs)[source]

Create a resource.

Key version:

Unisphere version – int

Key no_version:

if versionless uri – bool

Key category:

resource category e.g. sloprovisioning – str

Key resource_level:

resource level e.g. storagegroup – str

Key resource_level_id:

resource level id – str

Key resource_type:

optional name of resource – str

Key resource_type_id:

optional name of resource – str

Key resource:

optional name of resource – str

Key resource_id:

optional name of resource – str

Key object_type:

optional name of resource – str

Key object_type_id:

optional name of resource – str

Key payload:

query parameters – dict

Returns:

resource object – dict

delete_resource(*args, **kwargs)[source]

Delete a resource.

Key version:

Unisphere version – int

Key no_version:

if versionless uri – bool

Key category:

resource category e.g. sloprovisioning – str

Key resource_level:

resource level e.g. storagegroup – str

Key resource_level_id:

resource level id – str

Key resource_type:

optional name of resource – str

Key resource_type_id:

optional name of resource – str

Key resource:

optional name of resource – str

Key resource_id:

optional name of resource – str

Key object_type:

optional name of resource – str

Key object_type_id:

optional name of resource – str

Key payload:

query parameters

download_file(**kwargs)[source]

Download a file.

Key version:

Unisphere version – int

Key no_version:

if versionless uri – bool

Key category:

resource category e.g. sloprovisioning – str

Key resource_level:

resource level e.g. storagegroup – str

Key resource_level_id:

resource level id – str

Key resource_type:

optional name of resource – str

Key resource_type_id:

optional name of resource – str

Key resource:

optional name of resource – str

Key resource_id:

optional name of resource – str

Key object_type:

optional name of resource – str

Key object_type_id:

optional name of resource – str

Key payload:

query parameters – dict

Returns:

file info including binary data – dict

Raises:

ValueError

get_array(array_id)[source]

Get array details.

Parameters:

array_id – array id – str

Returns:

array details – dict

get_array_list(filters=None)[source]

Return a list of arrays.

Parameters:

filters – optional filters – dict

Returns:

arrays ids – list

get_iterator_page_list(iterator_id, start, end)[source]

Get a page of results from an iterator instance.

Parameters:
  • iterator_id – iterator id – str

  • start – the start number – int

  • end – the end number – int

Returns:

iterator page results – dict

get_iterator_results(rest_response)[source]

Get all results from all pages of an iterator if count > 1000.

Parameters:

rest_response – response JSON from REST API – dict

Returns:

all results – dict

get_job_by_id(job_id)[source]

Get details of a specific job.

Parameters:

job_id – job id – str

Returns:

job details – dict

get_request(target_uri, resource_type, params=None)[source]

Send a GET request to the array.

Parameters:
  • target_uri – target uri – str

  • resource_type – the resource type, e.g. maskingview – str

  • params – optional filter params – dict

Returns:

resource_object – dict

Raises:

ResourceNotFoundException

get_resource(*args, **kwargs)[source]

Get resource details from the array.

Key version:

Unisphere version – int

Key no_version:

if versionless uri – bool

Key category:

resource category e.g. sloprovisioning – str

Key resource_level:

resource level e.g. storagegroup – str

Key resource_level_id:

resource level id – str

Key resource_type:

optional name of resource – str

Key resource_type_id:

optional name of resource – str

Key resource:

optional name of resource – str

Key resource_id:

optional name of resource – str

Key object_type:

optional name of resource – str

Key object_type_id:

optional name of resource – str

Key params:

query parameters – dict

Returns:

resource object – dict

get_uni_version()[source]

Get the unisphere version from the server.

Returns:

version and major_version e.g. “V10.0.0.0”, “100” – str, str

get_uni_version_info()[source]

Get the unisphere version from the server.

Returns:

{‘version’: ‘T10.1.0.468’, ‘api_version’: ‘101’, ‘supported_api_versions’: [‘101’, ‘100’, ‘92’]} – dict

get_v3_or_newer_array_list(filters=None)[source]

Return a list of V3 or newer arrays in the environment.

Parameters:

filters – optional filters – dict

Returns:

arrays ids – list

is_array_v4(array_id)[source]

Check to see if array is a v4

Parameters:

array_id – the array serial number

Returns:

bool

modify_resource(*args, **kwargs)[source]

Modify a resource.

Key version:

Unisphere version – int

Key no_version:

if versionless uri – bool

Key category:

resource category e.g. sloprovisioning – str

Key resource_level:

resource level e.g. storagegroup – str

Key resource_level_id:

resource level id – str

Key resource_type:

optional name of resource – str

Key resource_type_id:

optional name of resource – str

Key resource:

optional name of resource – str

Key resource_id:

optional name of resource – str

Key object_type:

optional name of resource – str

Key object_type_id:

optional name of resource – str

Key payload:

query parameters

Returns:

resource object – dict

upload_file(**kwargs)[source]

Upload a file.

Key version:

Unisphere version – int

Key no_version:

if versionless uri – bool

Key category:

resource category e.g. sloprovisioning – str

Key resource_level:

resource level e.g. storagegroup – str

Key resource_level_id:

resource level id – str

Key resource_type:

optional name of resource – str

Key resource_type_id:

optional name of resource – str

Key resource:

optional name of resource – str

Key resource_id:

optional name of resource – str

Key object_type:

optional name of resource – str

Key object_type_id:

optional name of resource – str

Key form_data:

multipart form data – dict

Returns:

response success details – dict

wait_for_job(operation, status_code, job)[source]

Check if call is async, wait for it to complete.

Parameters:
  • operation – operation being performed – str

  • status_code – status code – int

  • job – job id – str

Returns:

task details – list

Raises:

VolumeBackendAPIException

wait_for_job_complete(job)[source]

Given the job wait for it to complete.

Parameters:

job – job details – dict

Returns:

response code, result, status, task details – int, str, str, list

Raises:

VolumeBackendAPIException

PyU4V.metro_dr

metro_dr.py.

class PyU4V.metro_dr.MetroDRFunctions(array_id, rest_client)[source]

Bases: object

Metro DR Functions.

convert_to_metrodr_environment(storage_group_name, environment_name, metro_r1_array_id=None, _async=True)[source]

Converts existing R2–Async–R11–Metro–R2 to Metro DR Environment.

Automatically adds recovery RDFG between Metro R2 and Async R2.

Parameters:
  • storage_group_name – storage group name containing source devices – str

  • environment_name – name of Metro Dr Environment up to 16 characters– str

  • metro_r1_array_id – 12 Digit Serial Number of R1 Array for SRDF Metro Source Array, optional – int

  • _async – if call should be executed asynchronously or synchronously – bool

Returns:

details of newly created metro dr environment – dict

create_metrodr_environment(storage_group_name, environment_name, metro_r1_array_id, metro_r2_array_id, dr_array_id, dr_replication_mode, metro_r2_storage_group_name=None, dr_storage_group_name=None, force_new_metro_r1_dr_rdfg=True, force_new_metro_r2_dr_rdfg=True, _async=True)[source]

Protects Non-SRDF Storage Group with Metro and DR legs.

Note: This function is set to run as an Asynchronous job on the server by default as there is the potential for this task to take a few minutes. Storage Groups and SRDF groups are created automatically for the user end result is R2–SRDF/A–R11–Metro–R2.

Parameters:
  • storage_group_name – name of storage group containing devices to be replicated in Metro DR environment – str

  • environment_name – name of Metro Dr Environment up to 16 characters– str

  • metro_r1_array_id – 12 Digit Serial Number of R1 Array for SRDF Metro Source Array – int

  • metro_r2_array_id – 12 Digit Serial Number of SRDF Metro R2 Array – int

  • dr_array_id – 12 Digit Serial Number of Disaster Recovery Array, replication – int

  • dr_replication_mode – Asynchronous or AdaptiveCopyDisk – str

  • metro_r2_storage_group_name – Name for R2 Storage Group of metro SRDF pairing, only used if R2 group naming is required to be different from source - str

  • dr_storage_group_name – Name for Storage Group at DR, only used if group naming is required to be different from source - str

  • force_new_metro_r1_dr_rdfg – whether or not to create a new RDFG to be created for Metro R1 array to DR array, or will autoselect from existing – bool

  • force_new_metro_r2_dr_rdfg – whether or not to create a new RDFG to be created for Metro R2 array to DR array, or will autoselect from existing – bool

  • _async – if call should be executed asynchronously or synchronously – bool

Returns:

details of newly created metro dr environment– dict

delete_metrodr_environment(environment_name, remove_r1_dr_rdfg=False, force=False, metro_r1_array_id=None)[source]

Deletes Metro DR Environment.

SRDF replication will remain in place for Metro and SRDF/A configuration, be default this function simply removes the standby SRDF group for Metro DR environment on R2 site. If you intend to remove SRDF replication completely, suspend and delete SRDF pairings using suspend_storage_group_srdf and suspend_storage_group_srdf functions.

Parameters:
  • environment_name – name of Metro Dr Environment up to 16 characters– str

  • remove_r1_dr_rdfg – override default behavior and delete R11-R2 RDFG from metro R1 side – bool

  • force – required True if deleting R1 DR group – bool

  • metro_r1_array_id – 12 Digit Serial of Metro R1 source array – str

get_metrodr_environment_details(environment_name, array_id=None, config=True)[source]

Get details for metro DR environment.

Parameters:
  • environment_name – Unique name to identify Metro DR environment – str

  • array_id – 12 Digit Serial Number of Array – int

  • config – return full environment config details or summary – bool

Returns:

details of the metro dr environments – dict

get_metrodr_environment_list(array_id=None)[source]

Gets a list of metro dr environments.

Parameters:

array_id – 12 Digit Serial Number of Array – int

Returns:

list of metro dr environments –list

modify_metrodr_environment(environment_name, action, metro=False, dr=False, keep_r2=False, force=False, symforce=False, _async=False, dr_replication_mode=None)[source]

Performs Functions to modify state of MetroDR environment.

Parameters:
  • environment_name – name of Metro Dr Environment up to 16 characters– str

  • action – action to be performed on Environment, Establish, Failover, Failback, Restore, SetMode, Split, UpdateR1 –str

  • metro – directs action towards R11–R21 Metro Device leg of Metro DR environment – bool

  • dr – directs action towards Device Pairs on Disaster Recovery leg of Metro DR environment – bool

  • keep_r2 – Used with Suspend Option, Ensures that the R2 data on Metro remains available to host – bool

  • force – forces operation to complete, used with caution, not recommended as part of fully automated workflow –bool

  • symforce – forces operation to complete, used with caution, requires ALLOW_SRDF_SYMFORCE parameter to be set in solutions enabler options file, default is not enabled,not recommended as part of fully automated workflow – bool

  • _async – if call should be executed asynchronously or synchronously – bool

  • dr_replication_mode – set mode of DR link, AdaptiveCopyDisk or Asynchronous – str

Returns:

details of metro dr environment and state – dict

PyU4V.migration

migration.py.

class PyU4V.migration.MigrationFunctions(array_id, rest_client)[source]

Bases: object

MigrationFunctions.

create_migration_environment(target_array_id)[source]

Create a new migration environment between two arrays.

Creates a new migration environment between two arrays for use with non disruptive migrations

Parameters:

target_array_id – target array id – str

Returns:

migration environment info – dict

create_storage_group_migration(storage_group_name, target_array_id, srp_id=None, port_group_id=None, no_compression=False, pre_copy=False, validate=False)[source]

Create a migration session for a storage group.

Parameters:
  • storage_group_name – storage group id – str

  • target_array_id – target array id – str

  • srp_id – storage resource pool id – str

  • port_group_id – port group id – str

  • no_compression – dont use compression – bool

  • pre_copy – use pre copy – bool

  • validate – validate – bool

Returns:

new storage group – dict

delete_migration_environment(target_array_id)[source]

Delete migration environment.

Given a target array will delete migration environment, used once all migrations are complete

Parameters:

target_array_id – target array id – str

delete_storage_group_migration(storage_group_name)[source]

Given a name, delete the storage group migration session.

Parameters:

storage_group_name – storage group id – str

get_array_migration_capabilities(array_id=None)[source]

Check what migration facilities are available.

Returns:

array capabilities – dict

get_environment(target_array_id)[source]

Given a name, return migration environment details.

Parameters:

target_array_id – target array id – str

Returns:

environment details – dict

get_environment_list()[source]

Get list of all migration environments.

Returns:

environments – list

get_migration_info(array_id=None)[source]

Return migration information for an array.

Returns:

migration info – dict

get_storage_group(storage_group_name)[source]

Given a name, return storage group migrations details.

Parameters:

storage_group_name – storage group id – str

Returns:

storage group details – dict

get_storage_group_list(include_migrations=False)[source]

Get list of all storage groups or migrating storage groups.

Parameters:

include_migrations – return only SGs with migration sessions – bool

Returns:

storage groups or migrating storage groups – list

get_storage_groups()[source]

Get all storage groups and migrating storage groups.

Returns:

storage groups and migrating storage groups – dict

modify_storage_group_migration(storage_group_name, action, options=None, _async=False)[source]

Modify the state of a storage group’s migration session.

Valid migrations options are ‘Cutover’, ‘Sync’, ‘Commit’, ‘Recover’, and ‘ReadyTgt’.

Parameters:
  • storage_group_name – storage group id – str

  • action – migration action – str

  • options – migration options, example: {cutover’: {‘force’: True}} – dict

  • _async – if call should be async – bool

Returns:

modified storage group info – dict

PyU4V.performance

performance.py.

class PyU4V.performance.PerformanceFunctions(array_id, rest_client)[source]

Bases: object

PerformanceFunctions.

backup_performance_database(array_id=None, filename='', last_day_of_diagnostic=False, named_real_time_traces=False)[source]

Backup an array performance database.

Backup of a performance database is a recommended practice. The backup performance database option is available for one or more storage systems, regardless of their registration status.

By default, only Trending & Planning (Historical) data is backed up. The performance databases backups should be stored in a safe location. Performance database backups can be restored. For more information on restoring backups please see Unisphere for PowerMax official documentation, for now only performing backups is supported via REST.

Note: Underscores will be stripped from any filename provided, this is due to Unisphere restricting the length of the filename string when underscores are provided.

The backup filename format will be as follows when viewed in Unisphere:

{array_id}_{date}{time}_{TZ}_{filename}_SPABackup.dat

Parameters:
  • array_id – array id – str

  • filename – performance backup file name – str

  • last_day_of_diagnostic – Last day of Diagnostics, this option is not recommended for recurring backups – bool

  • named_real_time_traces – Named Real Time Traces, this option is not recommended for recurring backups – bool

Raises:

exception.VolumeBackendAPIException

disable_diagnostic_data_collection(array_id=None)[source]

Disable an array from diagnostic performance data gathering.

Note: Disabling diagnostic performance data gathering will also disable real-time data gathering.

Parameters:

array_id – array id – str

Raises:

VolumeBackendAPIException

disable_real_time_data_collection(array_id=None)[source]

Disable an array from real-time performance data gathering.

Parameters:

array_id – array_id – str

Raises:

VolumeBackendAPIException

enable_diagnostic_data_collection(array_id=None)[source]

Register an array for diagnostic performance data gathering.

Parameters:

array_id – array id – str

Raises:

VolumeBackendAPIException

enable_real_time_data_collection(array_id=None, storage_group_list=None, file=False)[source]

Register an array for real-time performance data gathering.

Note: Real-time performance data is not supported for arrays running HyperMax OS.

Parameters:
  • array_id – array id – str

  • storage_group_list – comma separated list of storage groups to be registered for real time stats collection e.g. ‘sg1, sg2’ – str

  • file – register file collection for performance –bool

Raises:

VolumeBackendAPIException

extract_timestamp_keys(array_id=None, category=None, director_id=None, key_tgt_id=None)[source]

Retrieve the timestamp keys for a given performance asset.

Note: If a director key timestamp is required, set this as the key_tgt_id, the input parameter director_id is only required for port key extraction.

Parameters:
  • array_id – array id – str

  • category – performance category – str

  • director_id – director id – str

  • key_tgt_id – object id for the timestamp required – str

Returns:

timestamp in milliseconds since epoch – str

static format_metrics(metrics)[source]

Format metrics input for inclusion in REST request.

Take metric parameters and format them correctly to be used in REST request body. Valid input types are string and list.

Parameters:

metrics – metric(s) – str or list

Returns:

metrics – list

Raises:

InvalidInputException

format_time_input(array_id=None, category=None, director_id=None, key_tgt_id=None, start_time=None, end_time=None)[source]

Format time range for use in the request object.

Use cases are: 1. If start is set but not end, set end to most recent timestamp 2. If end is set but not start, set start time to first available 3. If neither are set, use most recent timestamp 4. If both are set, skip if conditions and check input is valid

Note: If a director key timestamp is required, set this as the key_tgt_id, the input parameter director_id is only required for port key extraction. A category is only required when timestamp extraction is required.

Parameters:
  • array_id – array id – str

  • category – performance category – str

  • director_id – director id (for port key extraction only) – str

  • key_tgt_id – object id for the timestamp required – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

Returns:

start time, end time (tuple) – str, str

Raises:

InvalidInputException

generate_threshold_settings_csv(output_csv_path, category=None)[source]

Generate a csv file with threshold settings.

Creates a CSV file with current alert configuration for the given unisphere instance category, metric, first_threshold, second_threshold, alert_user, kpi.

Parameters:
  • output_csv_path – filename for CSV to be generated – str

  • category – threshold specific category – str

get_array_keys()[source]

List Arrays registered for performance data collection.

Returns:

Arrays with first and last available dates – list

get_array_registration_details(array_id=None)[source]

Get array performance registration details.

This call will return information about both diagnostic and real-time performance registration along with the diagnostic collection interval in minutes.

Parameters:

array_id – array id – str

Returns:

array performance registration details – dict

get_array_stats(metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List performance data for specified array for giving time range.

Parameters:
  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_backend_director_keys(array_id=None)[source]

List BE directors for the given array.

Parameters:

array_id – array id – str

Returns:

BE directors with first and last available dates – list

get_backend_director_stats(director_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given BE director.

Parameters:
  • director_id – director id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_backend_emulation_keys(array_id=None)[source]

List BE emulations for the given array.

Parameters:

array_id – array id – str

Returns:

BE emulation info with first and last available dates – list

get_backend_emulation_stats(emulation_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given BE emulation.

Parameters:
  • emulation_id – emulation id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_backend_port_keys(director_id, array_id=None)[source]

List BE ports for the given array.

Parameters:
  • director_id – array id – str

  • array_id – director id – str

Returns:

BE port info with first and last available dates – list

get_backend_port_stats(director_id, port_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given BE port.

Parameters:
  • director_id – director id – str

  • port_id – port id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_board_keys(array_id=None)[source]

List boards for the given array.

Parameters:

array_id – array id – str

Returns:

board info with first and last available dates – list

get_board_stats(board_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given board.

Parameters:
  • board_id – board id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_cache_partition_keys(array_id=None)[source]

List cache partitions for the given array.

Parameters:

array_id – array id – str

Returns:

cache partition info with first and last available dates – list

get_cache_partition_perf_stats(cache_partition_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given cache partition.

Parameters:
  • cache_partition_id – cache partition id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_cloud_provider_keys(array_id=None)[source]

List cache partitions for the given array.

Parameters:

array_id – array id – str

Returns:

cache partition info with first and last available dates – list

get_cloud_provider_stats(cloud_provider_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given cache partition.

Parameters:
  • cloud_provider_id – cache partition id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_days_to_full(array_id=None, array_to_full=False, srp_to_full=False, thin_pool_to_full=False)[source]

Get days to full information.

Requires at least 10 Days of Performance data, available categories are ‘Array’, ‘SRP’, and ‘ThinPool’.

Parameters:
  • array_id – array id – str

  • array_to_full – get array days to full info – bool

  • srp_to_full – get storage resource pool days to full info – bool

  • thin_pool_to_full – get thin pool days to full info – bool

Returns:

days to full information – list

get_device_group_keys(array_id=None)[source]

List device groups for the given array.

Parameters:

array_id – array id – str

Returns:

device group info with first and last available dates – list

get_device_group_stats(device_group_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given device group.

Parameters:
  • device_group_id – device group id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_disk_group_keys(array_id=None)[source]

List disk groups for the given array.

Parameters:

array_id – array id – str

Returns:

disk info with first and last available dates – list

get_disk_group_stats(disk_group_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given disk group.

Parameters:
  • disk_group_id – disk group id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_eds_director_keys(array_id=None)[source]

List EDS directors for the given array.

Parameters:

array_id – array id – str

Returns:

EDS director info with first and last available dates – list

get_eds_director_stats(director_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given EDS director.

Parameters:
  • director_id – director id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_eds_emulation_keys(array_id=None)[source]

List EDS emulations for the given array.

Parameters:

array_id – array id – str

Returns:

EDS emulation info with first and last available dates – list

get_eds_emulation_stats(emulation_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given EDS emulation.

Parameters:
  • emulation_id – emulation id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_em_director_keys(array_id=None)[source]

List EM directors for the given array.

Parameters:

array_id – array id – str

Returns:

EDS director info with first and last available dates – list

get_em_director_stats(director_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given EM director.

Parameters:
  • director_id – director id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_endpoint_keys(array_id=None)[source]

List endpoints for the given array.

Parameters:

array_id – array_id: array id – str

Returns:

Endpoint info with first and last available dates – list

get_endpoint_stats(endpoint_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given iSCSI target.

Parameters:
  • endpoint_id – iSCSI target id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_external_disk_keys(array_id=None)[source]

List external disks for the given array.

Parameters:

array_id – array id – str

Returns:

external disks with first and last available dates – list

get_external_disk_stats(disk_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given external disk.

Parameters:
  • disk_id – disk id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_ficon_emulation_keys(array_id=None)[source]

List FICON emulations for the given array.

Parameters:

array_id – array id – str

Returns:

FICON emulation info with first and last available dates – list

get_ficon_emulation_stats(ficon_emulation_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given FICON emulation.

Parameters:
  • ficon_emulation_id – FICON emulation id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_ficon_emulation_thread_keys(array_id=None)[source]

List FICON emulation threads for the given array.

Parameters:

array_id – array id – str

Returns:

FICON emulation thread info with first and last available dates – list

get_ficon_emulation_thread_stats(ficon_emulation_thread_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given FICON emulation thread.

Parameters:
  • ficon_emulation_thread_id – FICON emulation thread id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_ficon_port_thread_keys(array_id=None)[source]

List FICON port threads for the given array.

Parameters:

array_id – array id – str

Returns:

FICON port info with first and last available dates – list

get_ficon_port_thread_stats(ficon_port_thread_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given FICON port thread.

Parameters:
  • ficon_port_thread_id – FICON port thread id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_frontend_director_keys(array_id=None)[source]

List FE directors for the given array.

Parameters:

array_id – array id – str

Returns:

FE directors with first and last available dates – list

get_frontend_director_stats(director_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given FE director.

Parameters:
  • director_id – director id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_frontend_emulation_keys(array_id=None)[source]

List FE emulations for the given array.

Parameters:

array_id – array id – str

Returns:

BE emulation info with first and last available dates – list

get_frontend_emulation_stats(emulation_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given FE emulation.

Parameters:
  • emulation_id – emulation id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_frontend_port_keys(director_id, array_id=None)[source]

List FE ports for the given array.

Parameters:
  • director_id – array id – str

  • array_id – director id – str

Returns:

FE port info with first and last available dates – list

get_frontend_port_stats(director_id, port_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given FE port.

Parameters:
  • director_id – director id – str

  • port_id – port id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_host_keys(array_id=None, start_time=None, end_time=None)[source]

List active hosts for the given array by time range.

Only active hosts from within the specified time range are returned. If no time range is provided, start and end times from array level are used.

Parameters:
  • array_id – array id – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

Returns:

host info with first and last available dates – list

get_host_stats(host_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given host.

Performance details will only be returned if the host was active during the specified time range. If no time range is provided, start and end times from array level are used.

Parameters:
  • host_id – host id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_im_director_keys(array_id=None)[source]

List IM directors for the given array.

Parameters:

array_id – array id – str

Returns:

IM directors with first and last available dates – list

get_im_director_stats(director_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given IM director.

Parameters:
  • director_id – director id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_im_emulation_keys(array_id=None)[source]

List IM emulations for the given array.

Parameters:

array_id – array id – str

Returns:

IM emulation info with first and last available dates – list

get_im_emulation_stats(emulation_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given IM emulation.

Parameters:
  • emulation_id – emulation id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_initiator_perf_keys(array_id=None, start_time=None, end_time=None)[source]

List active initiators for the given array by time range

Only active initiators from within the specified time range are returned. If no time range is provided, start and end times from array level are used.

Parameters:
  • array_id – array id – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

Returns:

host info with first and last available dates – list

get_initiator_stats(initiator_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given initiator.

Performance details will only be returned if the initiator was active during the specified time range. If no time range is provided, start and end times from array level are used.

Parameters:
  • initiator_id – initiator id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_ip_interface_keys(array_id=None)[source]

List IP interfaces for the given array.

Parameters:

array_id – array id – str

Returns:

IP interface info with first and last available dates – list

get_ip_interface_stats(ip_interface_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given IP interface.

Parameters:
  • ip_interface_id – IP interface id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_iscsi_target_keys(**kwargs)
get_iscsi_target_stats(**kwargs)
get_last_available_timestamp(array_id=None)[source]

Get the last recorded performance timestamp.

Parameters:

array_id – array_id: array id – str

Returns:

timestamp – int

Raises:

ResourceNotFoundException

get_masking_view_keys(array_id=None)[source]

List masking views for the given array.

Parameters:

array_id – array id – str

Returns:

masking view info with first and last available dates – list

get_masking_view_stats(masking_view_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given masking view.

Parameters:
  • masking_view_id – masking view id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_performance_categories_list(array_id=None)[source]

Get the list of supported performance categories.

Parameters:

array_id – array id – str

Returns:

categories – list

get_performance_key_list(category, array_id=None, director_id=None, storage_group_id=None, storage_container_id=None, storage_resource_id=None, start_time=None, end_time=None)[source]

Get performance key list for a given performance category.

Parameters:
  • category – performance category – str

  • array_id – array id – str

  • director_id – director id – str

  • storage_group_id – storage group id – str

  • storage_container_id – storage container id – str

  • storage_resource_id – storage resource id – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

Returns:

category performance keys – list

Raises:

InvalidInputException

get_performance_metrics_list(category, kpi_only=False, array_id=None)[source]

For a given category, return the list of valid metrics.

Parameters:
  • category – performance category – str

  • kpi_only – if only KPI metrics should be returned – bool

  • array_id – array id – str

Returns:

metrics – list

get_performance_stats(category, metrics, data_format='Average', array_id=None, request_body=None, start_time=None, end_time=None, recency=None)[source]

Retrieve the performance statistics for a given category and object.

Parameters:
  • category – category id – str

  • array_id – array id – str

  • metrics – performance metrics, options are individual metrics, a list of metrics, ‘KPI’ for KPI metrics only, and ‘ALL’ for all metrics – str/list

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • request_body – request params and object IDs – dict

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

Raises:

VolumeBackendAPIException, InvalidInputException

get_port_group_keys(array_id=None)[source]

List port group for the given array.

Parameters:

array_id – array_id: array id – str

Returns:

port group info with first and last available

get_port_group_stats(port_group_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given port group.

Parameters:
  • port_group_id – port group id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_rdf_director_keys(array_id=None)[source]

List RDF directors for the given array.

Parameters:

array_id – array id – str

Returns:

RDF directors with first and last available dates – list

get_rdf_director_stats(director_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given RDF director.

Parameters:
  • director_id – director id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_rdf_emulation_keys(array_id=None)[source]

List RDF emulations for the given array.

Parameters:

array_id – array id – str

Returns:

RDF emulation info with first and last available dates – list

get_rdf_emulation_stats(emulation_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given RDF emulation.

Parameters:
  • emulation_id – emulation id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_rdf_port_keys(director_id, array_id=None)[source]

List RDF ports for the given array.

Parameters:
  • director_id – array id – str

  • array_id – director id – str

Returns:

RDF port info with first and last available dates – list

get_rdf_port_stats(director_id, port_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given RDF port.

Parameters:
  • director_id – director id – str

  • port_id – port id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_rdfa_keys(array_id=None)[source]

List RDFA groups for the given array.

Parameters:

array_id – array_id: array id – str

Returns:

RDFA info with first and last available dates – list

get_rdfa_stats(rdfa_group_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given RDFA group.

Parameters:
  • rdfa_group_id – RDFA group id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_rdfs_keys(array_id=None)[source]

List RDFS groups for the given array.

Parameters:

array_id – array_id: array id – str

Returns:

RDFS info with first and last available dates – list

get_rdfs_stats(rdfs_group_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given RDFS group.

Parameters:
  • rdfs_group_id – RDFS group id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_sdnas_filesystem_keys(array_id=None)[source]

List SDNAS Filesystems for the given array.

Parameters:

array_id – array id – str

Returns:

SDNAS Filesystem info with first and last available dates – list

get_sdnas_filesystem_stats(sdnas_filesystem_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given SDNAS Filesystem.

Parameters:
  • sdnas_filesystem_id – SDNAS Filesystem id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_sdnas_interface_keys(array_id=None)[source]

List SDNAS Interfaces for the given array.

Parameters:

array_id – array id – str

Returns:

SDNAS Interface info with first and last available dates – list

get_sdnas_interface_stats(sdnas_interface_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given SDNAS Interface.

Parameters:
  • sdnas_interface_id – SDNAS Interface id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_sdnas_node_keys(array_id=None)[source]

List SDNAS Nodes for the given array.

Parameters:

array_id – array id – str

Returns:

SDNAS Interface info with first and last available dates – list

get_sdnas_node_stats(sdnas_node_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given SDNAS Node.

Parameters:
  • sdnas_node_id – SDNAS Node id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_sdnas_server_keys(array_id=None)[source]

List SDNAS Servers for the given array.

Parameters:

array_id – array id – str

Returns:

SDNAS Interface info with first and last available dates – list

get_sdnas_server_stats(sdnas_server_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given SDNAS Server.

Parameters:
  • sdnas_server_id – SDNAS Server id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_storage_container_keys(array_id=None)[source]

List storage containers for the given array.

Parameters:

array_id – array id – str

Returns:

storage container info with first and last available dates – list

get_storage_container_stats(storage_container_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given storage container.

Parameters:
  • storage_container_id – storage container id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_storage_group_keys(array_id=None)[source]

List storage groups for the given array.

Parameters:

array_id – array id – str

Returns:

storage container info with first and last available dates – list

get_storage_group_stats(storage_group_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given storage group.

Parameters:
  • storage_group_id – storage group id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_storage_resource_keys(array_id=None)[source]

List storage resources for the given array.

Parameters:

array_id – array id – str

Returns:

storage resource info with first and last available dates – list

get_storage_resource_pool_keys(array_id=None)[source]

List storage resource pools for the given array.

Parameters:

array_id – array id – str

Returns:

storage resource pool info with first and last available dates – list

get_storage_resource_pool_stats(srp_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given storage resource pools.

Parameters:
  • srp_id – storage resource pool id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_storage_resource_stats(storage_container_id, storage_resource_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given storage resource.

Parameters:
  • storage_container_id – storage container id – str

  • storage_resource_id – storage resource id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_thin_pool_keys(array_id=None)[source]

List thin pools for the given array.

Parameters:

array_id – array id – str

Returns:

thin pools with first and last available dates – list

get_thin_pool_stats(thin_pool_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given thin pool.

Parameters:
  • thin_pool_id – thin pool id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

get_threshold_categories(array_id=None)[source]

Get a list of performance threshold categories.

Parameters:

array_id – array serial number – str

Returns:

performance threshold categories – list

get_threshold_category_settings(category, array_id=None)[source]

Get performance threshold category settings.

Parameters:
  • category – category id – str

  • array_id – array serial number – str

Returns:

category settings – dict

static get_timestamp_by_hour(start_time=None, end_time=None, hours_difference=None)[source]

Get timestamp difference in hours from supplied time.

If start time is provided but not end time, the time difference will be after the start time.

If end time is provided but not start time, the time difference will be before the end time.

If neither start or end time are provided, or both are incorrectly provided, the time difference is from the current time.

Parameters:
  • start_time – timestamp in milliseconds since epoch – int

  • end_time – timestamp in milliseconds since epoch – int

  • hours_difference – difference in hours – int

Returns:

timestamp in milliseconds since epoch – str

get_volume_stats(array_id=None, volume_range_start=None, volume_range_end=None, storage_group_list=None, metrics=None, start_time=None, end_time=None, recency=None, data_format=None)[source]

List Performance data for volume level statistics.

Note: This function can gather statistics for up to 10,000 volumes or 100 Storage groups per call, time range can not exceed 1 hour/60 minutes .

Parameters:
  • volume_range_start – 5 digit device id of first device in range – str

  • volume_range_end – 5 digit device id of last device in range – str

  • storage_group_list – list of up to 100 storage groups – str or list

  • metrics – performance metrics to retrieve, if not specified all available metrics will return by default– str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

List zHyperLink Ports for the given array.

Parameters:

array_id – array id – str

Returns:

thin pools with first and last available dates – list

List time range performance data for given zHyperLink Port.

Parameters:
  • zhyperlink_port_id – zHyperLink Port id – str

  • metrics – performance metrics to retrieve – str or list

  • array_id – array id – str

  • data_format – response data format ‘Average’ or ‘Maximum’ – str

  • start_time – timestamp in milliseconds since epoch – str

  • end_time – timestamp in milliseconds since epoch – str

  • recency – check recency of timestamp in minutes – int

Returns:

performance metrics – dict

is_array_diagnostic_performance_registered(array_id=None)[source]

Check if an array is registered for diagnostic performance data.

Parameters:

array_id – array id – str

Returns:

is diagnostic registered – bool

is_array_performance_registered(**kwargs)
is_array_real_time_performance_registered(array_id=None)[source]

Check if an array is registered for real-time performance data.

Parameters:

array_id – array id – str

Returns:

is real-time registered – bool

is_timestamp_current(timestamp, minutes=None)[source]

Check if the timestamp is less than a user specified set of minutes.

If no minutes value is provided, self.recency is used. Seven minutes is recommended to provide a small amount of time for the STP daemon to record the next set of metrics in five minute intervals.

Parameters:
  • timestamp – timestamp in milliseconds since epoch – int

  • minutes – timestamp recency in minutes – int

Returns:

if timestamp is less than recency value – bool

set_array_id(array_id)[source]

Set the array id.

Parameters:

array_id – array id – str

set_recency(minutes)[source]

Set the recency value in minutes.

Parameters:

minutes – recency minutes – int

set_thresholds_from_csv(csv_file_path, kpi_only=True)[source]

Set performance thresholds using a CSV file.

Reads CSV file and sets performance threshold metrics on the values contained within. The following headers are required: category, metric, firstthreshold, secondthreshold, notify, kpi

It is advisable to generate the CSV file from the function performance.generate_threshold_settings_csv() and edit those values within that you would like to change.

Parameters:
  • csv_file_path – path to CSV file – str

  • kpi_only – set only KPI thresholds – bool

set_timestamp(timestamp)[source]

Set the performance timestamp.

Parameters:

timestamp – the performance timestamp – str

update_threshold_settings(category, metric, first_threshold, second_threshold, alert=True, first_threshold_occurrences=3, first_threshold_samples=5, first_threshold_severity='WARNING', second_threshold_occurrences=3, second_threshold_samples=5, second_threshold_severity='CRITICAL')[source]

Edit an existing global threshold across all arrays.

Parameters:
  • category – category id – str

  • metric – performance metric – str

  • first_threshold – first threshold value – int

  • second_threshold – second threshold value – int

  • alert – alert on/off – bool

  • first_threshold_occurrences – error occurrences – int

  • first_threshold_samples – error samples – int

  • first_threshold_severity – error severity, valid values are ‘INFORMATION’, ‘WARNING’, and ‘CRITICAL’ – str

  • second_threshold_occurrences – error occurrences – int

  • second_threshold_samples – error samples – int

  • second_threshold_severity – error severity, valid values are ‘INFORMATION’, ‘WARNING’, and ‘CRITICAL’ – str

Returns:

operation success details – dict

validate_category(category, array_id=None)[source]

Check that a supplied category is valid.

Parameters:
  • category – performance category – str

  • array_id – array id – str

Raises:

InvalidInputException

PyU4V.provisioning

provisioning.py.

class PyU4V.provisioning.ProvisioningFunctions(array_id, rest_client)[source]

Bases: object

ProvisioningFunctions.

add_child_storage_group_to_parent_group(child_storage_group, parent_storage_group)[source]

Add a storage group to a parent storage group.

This method adds an existing storage group to another storage group, i.e. cascaded storage groups.

Parameters:
  • child_storage_group – child storage group id – str

  • parent_storage_group – parent storage group id – str

Returns:

storage group details – dict

add_existing_volume_to_storage_group(storage_group_id, vol_ids, _async=False, remote_array_1_id=None, remote_array_1_sgs=None, remote_array_2_id=None, remote_array_2_sgs=None, starting_lun_address=None)[source]

Expand an existing storage group by adding existing volumes.

Parameters:
  • storage_group_id – storage group id – str

  • vol_ids – volume device id(s) – str or list

  • _async – if call should be async – bool

  • remote_array_1_id – 12 digit serial number of remote array, optional – str

  • remote_array_1_sgs – list of storage groups on remote array to add Remote device, Unisphere instance must be local to R1 storage group otherwise volumes will only be added to the local group – str or list

  • remote_array_2_id – optional digit serial number of remote array, only used in multihop SRDF, e.g. R11, or R1 - R21 - R2 optional – str

  • remote_array_2_sgs – storage groups on remote array, optional – str or list

  • starting_lun_address – HLU address of starting lun for volumes – int

Returns:

storage group details – dict

add_new_volume_to_storage_group(storage_group_id, num_vols, vol_size, cap_unit, _async=False, vol_name=None, create_new_volumes=None, remote_array_1_id=None, remote_array_1_sgs=None, remote_array_2_id=None, remote_array_2_sgs=None, enable_mobility_id=False, emulation_type='FBA', append_vol_id=False, starting_lun_address=None)[source]

Expand an existing storage group by adding new volumes.

Parameters:
  • storage_group_id – storage group id – str

  • num_vols – number of volumes to be created – int

  • vol_size – the volume size – str

  • cap_unit – capacity unit (MB, GB, TB, CYL) – str

  • _async – if call should be async – bool

  • vol_name – name to give to the volume, optional – str

  • create_new_volumes – new volumes only, no ro-use – bool

  • remote_array_1_id – 12 digit serial number of remote array, optional – str

  • remote_array_1_sgs – list of storage groups on remote array to add Remote device, Unisphere instance must be local to R1 storage group otherwise volumes will only be added to the local group – str or list

  • remote_array_2_id – optional digit serial number of remote array, only used in multihop SRDF, e.g. R11, or R1 - R21 - R2 optional – str

  • remote_array_2_sgs – storage groups on remote array, optional – str or list

  • enable_mobility_id – enables unique volume WWN not tied to array serial number – bool

  • emulation_type – device emulation type (CKD, FBA) – str

  • append_vol_id – append volume id to the volume name, optional – bool

  • starting_lun_address – HLU address of starting lun for volumes – int

Returns:

storage group details – dict

create_cu_image(split_id: str, cu_number: str, cu_ssid: str, cu_base_address: str, vol_id: str)[source]

Creates a new CU image under the specified split. :param split_id: split id – str :param cu_number: cu image number – str :param cu_ssid: cu image ssid – str :param cu_base_address: cu image ssid – str :param vol_id volume device id be mapped to the cu – str :returns: None

create_empty_port_group(port_group_id, port_group_protocol=None, _async=None)[source]

Create an empty port group.

Parameters:
  • port_group_id – name of the new port group – str

  • port_group_protocol – required for V4 only one of [SCSI_FC, iSCSI , NVMe_TCP] – str

  • _async – if call should be async – bool

Returns:

new port group details – dict

create_empty_storage_group(srp_id, storage_group_id, service_level, workload, disable_compression=False, _async=False, snapshot_policy_ids=None, emulation_type='FBA')[source]

Create an empty storage group.

Set the disable_compression flag for disabling compression on an All Flash array (where compression is on by default).

Parameters:
  • srp_id – SRP id – str

  • storage_group_id – storage group id – str

  • service_level – service level id – str

  • workload – workload id – str

  • disable_compression – disable compression – bool

  • _async – if call should be async – bool

  • snapshot_policy_ids – list of one or more snapshot policies to associate with storage group – list

  • emulation_type – device emulation type (CKD, FBA) – str

Returns:

storage group details – dict

create_host(host_name, initiator_list=None, host_flags=None, init_file=None, _async=False)[source]

Create a host with the given initiators.

Accepts either initiator_list, e.g. [10000000ba873cbf, 10000000ba873cba], or file. The initiators must not be associated with another host. An empty host can also be created by not passing any initiator ids.

Parameters:
  • host_name – name of the new host – str

  • initiator_list – list of initiators – list

  • host_flags – optional host flags to apply – dict

  • init_file – path to file containing initiator names – str

  • _async – if call should be _async – bool

Returns:

new host details – dict

create_host_group(host_group_id, host_list, host_flags=None, _async=False)[source]

Create a host group containing the given hosts.

Parameters:
  • host_group_id – name of the new host group – str

  • host_list – hosts – list

  • host_flags – optional host flags to apply – dict

  • _async – if call should be async – bool

Returns:

new host group details – dict

create_masking_view_existing_components(port_group_name, masking_view_name, storage_group_name, host_name=None, host_group_name=None, _async=False, starting_lun_address=None)[source]

Create a new masking view using existing groups.

Must enter either a host name or a host group name, but not both.

Parameters:
  • port_group_name – name of the port group – str

  • masking_view_name – name of the new masking view – str

  • storage_group_name – name of the storage group – str

  • host_name – name of the host (initiator group) – str

  • host_group_name – name of host group – str

  • _async – if command should be run asynchronously – bool

  • starting_lun_address – HLU address of starting lun for volumes – int

Returns:

masking view details – dict

Raises:

InvalidInputException

create_multiport_port_group(**kwargs)
create_new_port_group(port_group_id, dir_port_list, port_group_protocol=None)[source]

Create a new port group with one or more ports.

Parameters:
  • port_group_id – name of the new port group – str

  • dir_port_list – port dicts Example: [{‘directorId’: director_id, ‘portId’: port_id}] – list

  • port_group_protocol – required for V4 only. one of [SCSI_FC, iSCSI, NVMe_TCP]

Returns:

new port group details – dict

create_non_empty_storage_group(srp_id, storage_group_id, service_level, workload, num_vols, vol_size, cap_unit, disable_compression=False, _async=False, vol_name=None, snapshot_policy_ids=None, enable_mobility_id=False, emulation_type='FBA')[source]

Create a new storage group with the specified volumes.

Generates a dictionary for json formatting and calls the create_sg function to create a new storage group with the specified volumes. Set the disable_compression flag for disabling compression on an All Flash array (where compression is on by default).

Parameters:
  • srp_id – SRP id – str

  • storage_group_id – storage group id – str

  • service_level – service level id – str

  • workload – workload id – str

  • num_vols – number of volumes to be created – int

  • vol_size – the volume size – str

  • cap_unit – capacity unit (MB, GB, TB, CYL) – str

  • disable_compression – disable compression – bool

  • _async – if call should be async – bool

  • vol_name – name to give to the volume, optional – str

  • snapshot_policy_ids – list of one or more snapshot policies to associate with storage group – list

  • enable_mobility_id – enables unique volume WWN not tied to array serial number – bool

  • emulation_type – device emulation type (CKD, FBA) – str

Returns:

storage group details – dict

create_port_group(**kwargs)
create_port_group_from_file(file_name, port_group_id, port_group_protocol=None)[source]

Given a file with director:port pairs, create a portgroup.

Each director:port pair must be on a new line. Example director:port - FA-1D:4.

Parameters:
  • file_name – path to the file – str

  • port_group_id – name for the port group – str

  • port_group_protocol – required for V4 only. one of [SCSI_FC, iSCSI, NVMe_TCP] – str

Returns:

new port group details – dict

create_storage_group(srp_id, sg_id, slo=None, workload=None, do_disable_compression=False, num_vols=0, vol_size=0, cap_unit='GB', allocate_full=False, _async=False, vol_name=None, snapshot_policy_ids=None, enable_mobility_id=False, emulation_type='FBA', append_vol_id=False)[source]

Create a storage group with optional volumes on create operation.

Parameters:
  • srp_id – SRP id – str

  • sg_id – storage group id – str

  • slo – service level id – str

  • workload – workload id – str

  • do_disable_compression – disable compression – bool

  • num_vols – number of volumes to be created – int

  • vol_size – the volume size – int

  • cap_unit – capacity unit (MB, GB, TB, CYL) – str

  • allocate_full – allocate full capacity – bool

  • _async – if call should be async – bool

  • vol_name – name to give to the volume, optional – str

  • snapshot_policy_ids – list of one or more snapshot policies to associate with storage group – list

  • enable_mobility_id – enables unique volume WWN not tied to array serial number – bool

  • emulation_type – device emulation type (CKD, FBA) – str

  • append_vol_id – append volume id to the volume name, optional – bool

Returns:

storage group details – dict

create_volume_from_storage_group_return_id(volume_name, storage_group_id, vol_size, cap_unit='GB', enable_mobility_id=False, emulation_type='FBA')[source]

Create a new volume in the given storage group.

Parameters:
  • volume_name – volume name – str

  • storage_group_id – storage group id – str

  • vol_size – volume size – str

  • cap_unit – capacity unit (MB, GB, TB, CYL) – str

  • enable_mobility_id – enables unique volume WWN not tied to array serial number – bool

  • emulation_type – device emulation type (CKD, FBA) – str

Returns:

device id – str

deallocate_volume(device_id)[source]

Deallocate all tracks on a volume.

Necessary before deletion. Please note that it is not possible to know exactly when a de-allocation is complete. This method will return when the array has accepted the request for de-allocation; the de-allocation itself happens as a background task on the array.

Parameters:

device_id – device id – str

Returns:

volume details – dict

delete_host(host_id)[source]

Delete a given host.

Cannot delete if associated with a masking view.

Parameters:

host_id – name of the host – str

delete_host_group(host_group_id)[source]

Delete a given host group.

Cannot delete if associated with a masking view.

Parameters:

host_group_id – name of the hostgroup – str

delete_masking_view(maskingview_name)[source]

Delete a masking view.

Parameters:

maskingview_name – masking view name – str

delete_port_group(port_group_id)[source]

Delete a port group.

Parameters:

port_group_id – name of the port group – str

delete_storage_group(storage_group_id)[source]

Delete a given storage group.

A storage group cannot be deleted if it is associated with a masking view.

Parameters:

storage_group_id – storage group id – str

delete_volume(device_id)[source]

Delete a volume.

Parameters:

device_id – device id – str

extend_volume(device_id, new_size, _async=False, rdf_group_num=None)[source]

Extend a volume.

Parameters:
  • device_id – device id – str

  • new_size – the new size for the device – int

  • _async – if call should be async – bool

  • rdf_group_num – RDF group number to extend R2 device in same operation – int

Returns:

volume details – dict

find_host_lun_id_for_volume(masking_view_id, device_id)[source]

Find the host_lun_id for a volume in a masking view.

Parameters:
  • masking_view_id – masking view id – str

  • device_id – the device id – str

Returns:

host lun id – str

find_low_volume_utilization(low_utilization_percentage, csvname)[source]

Find volumes under a certain utilization threshold.

Function to find volumes under a specified percentage, (e.g. find volumes with utilization less than 10%) - may be long running as will check all sg on array and all storage group. Only identifies volumes in storage group, note if volume is in more than one sg it may show up more than once.

Parameters:
  • low_utilization_percentage – low utilization percent – int

  • csvname – filename for CSV output file – str

find_volume_device_id(volume_name)[source]

Given a volume identifier, find the corresponding device_id.

Parameters:

volume_name – the volume name – str

Returns:

device id – str

find_volume_identifier(device_id)[source]

Get the volume identifier of a volume.

Parameters:

device_id – device id – str

Returns:

volume identifier – str

static format_director_port(director, port)[source]

Format separate director port into single string.

Parameters:
  • director – director e.g. FA-2D – str

  • port – port e.g. 4 – str

Returns:

formatted director:port string –str

get_active_masking_view_connections()[source]

Get list of active connections from any masking view.

Returns:

masking view name, connection details – str, list

get_any_director_port(**kwargs)
get_array(array_id=None)[source]

Query for details of an array from SLOPROVISIONING endpoint.

Parameters:

array_id – array serial number – str

Returns:

array details – dict

get_available_initiator(director_type=None)[source]

Get an available initiator.

Parameters:

director_type – director type filter – str

Returns:

single available initiator – str

get_available_initiator_list(director_type=None)[source]

Get list of available initiators.

Parameters:

director_type – director type filter – str

Returns:

single available initiator – str

get_available_initiator_wwn_as_list()[source]

Get an available initiator wwn string in a list.

Returns:

single available initiator wwn – list

get_child_storage_groups_from_parent(parent_name)[source]

Get child storage group list from parent storage group.

Parameters:

parent_name – parent sg name – str

Returns:

child sg details – list

get_compressibility_report(srp_id)[source]

Get a specified SRP Compressibility Report.

Parameters:

srp_id – srp id – str

Returns:

compressibility reports – list

get_cu_image(split_id: str, cu_ssid: str)[source]

Get details of a specified CU Image. :param split_id: split id – str :param cu_ssid: cu image ssid – str :returns: CU Image details – dict

get_cu_image_list(split_id: str)[source]

Get list of CU Image SSIDs within a specific FICON Split. :param split_id: split id – str :returns: CU Image ssids – list

get_cu_image_volume(split_id: str, cu_ssid: str, vol_id: str)[source]

Get details of a volume mapped to a specified CU Image. :param split_id: split id – str :param cu_ssid: cu image ssid – str :pamam vol_id volume device id to be mapped to the cu – str :returns: volume details – dict

get_cu_image_volumes(split_id: str, cu_ssid: str)[source]

Get list of Volumes from a specified CU Image. :param split_id: split id – str :param cu_ssid: cu image ssid – str :returns: Volume ids – list

get_director(**kwargs)
get_director_list(**kwargs)
get_director_port(**kwargs)
get_director_port_list(**kwargs)
get_element_from_masking_view(maskingview_name, portgroup=False, host=False, storagegroup=False)[source]

Return the name of the specified element from a masking view.

Parameters:
  • maskingview_name – masking view name – str

  • portgroup – port group name – str

  • host – the host name – str

  • storagegroup – storage group name – str

Returns:

specified element name – str

Raises:

ResourceNotFoundException

get_fa_directors(**kwargs)
get_host(host_id)[source]

Get details on a host on the array.

Parameters:

host_id – the name of the host – str

Returns:

host details – dict

get_host_from_masking_view(masking_view_id)[source]

Given a masking view, get the associated host or host group.

Parameters:

masking_view_id – name of the masking view – str

Returns:

host id – str

get_host_group(host_group_id)[source]

Get details on a host group on the array.

Parameters:

host_group_id – name of the host group – str

Returns:

host group details – dict

get_host_group_list(filters=None)[source]

Get list of host group(s) on the array.

See unisphere documentation for applicable filters.

Parameters:

filters – optional list of filters – dict

Returns:

host group list – list

get_host_list(filters=None)[source]

Get list of the hosts on the array.

See documentation for applicable filters.

Parameters:

filters – optional list of filters – dict

Returns:

hosts – list

get_in_use_initiator(director_type=None)[source]

Get an initiator that is in use.

Parameters:

director_type – director type filter – str

Returns:

single in-use initiator – str

get_in_use_initiator_list_from_array()[source]

Get the list of initiators which are in-use from the array.

Gets the list of initiators from the array which are in hosts/ initiator groups.

Returns:

in-use initiators – list

get_initiator(initiator_id)[source]

Get details of an initiator.

Parameters:

initiator_id – initiator id – str

Returns:

initiator details – dict

get_initiator_group_from_initiator(initiator)[source]

Given an initiator, get its corresponding initiator group, if any.

Parameters:

initiator – the initiator id – str

Returns:

found initiator group name – str or None

get_initiator_ids_from_host(host_id)[source]

Get initiator details from a host.

Parameters:

host_id – name of the host – str

Returns:

initiator IDs – list

get_initiator_list(params=None)[source]

Retrieve initiator list from the array.

Parameters:

params – optional params – dict

Returns:

initiators – list

get_iscsi_ip_address_and_iqn(**kwargs)
get_masking_view(masking_view_name)[source]

Get details of a masking view.

Parameters:

masking_view_name – the masking view name – str

Returns:

masking view details – dict

get_masking_view_connections(masking_view_id, filters=None)[source]

Get all connection information for a given masking view.

Parameters:
  • masking_view_id – masking view id – str

  • filters – optional filter parameters – dict

Returns:

masking view connection dicts – list

get_masking_view_from_storage_group(storage_group)[source]

Get the associated masking views from a given storage group.

Parameters:

storage_group – name of the storage group – str

Returns:

Masking views – list

get_masking_view_list(filters=None)[source]

Get a masking view or list of masking views.

See unisphere documentation for possible filters.

Parameters:

filters – filters – dict

Returns:

masking views – list

get_masking_views_by_initiator_group(initiator_group_name)[source]

Given a host (initiator group), retrieve the masking view name.

Retrieve the list of masking views associated with the given initiator group.

Parameters:

initiator_group_name – name of the initiator group – str

Returns:

masking view names – list

get_masking_views_from_host(host_id)[source]

Retrieve masking view information for a specified host.

Parameters:

host_id – name of the host – str

Returns:

masking views – list

get_masking_views_from_host_group(host_group_id)[source]

Retrieve masking view information for a specified host group.

Parameters:

host_group_id – name of the host – str

Returns:

masking views – list

get_masking_views_from_storage_group(storagegroup)[source]

Return any masking views associated with a storage group.

Parameters:

storagegroup – storage group name – str

Returns:

masking view list – list

get_num_vols_in_storage_group(storage_group_name)[source]

Get the number of volumes in a storage group.

Parameters:

storage_group_name – storage group name – str

Returns:

number of volumes – int

get_port_group(port_group_id)[source]

Get port group details.

Parameters:

port_group_id – name of the portgroup – str

Returns:

port group details – dict

get_port_group_common_masking_views(port_group_name, initiator_group_name)[source]

Get common masking views for a given port group and initiator group.

Parameters:
  • port_group_name – port group name – str

  • initiator_group_name – initiator group name – str

Returns:

masking views - list

get_port_group_from_masking_view(masking_view_id)[source]

Given a masking view, get the associated port group.

Parameters:

masking_view_id – masking view name – str

Returns:

name of the port group – str

get_port_group_list(filters=None)[source]

Get port group details.

Parameters:

filters – optional filters – dict

Returns:

port groups – list

get_port_identifier(**kwargs)
get_port_list(filters=None)[source]

Query for a list of Symmetrix port keys.

Note a mixture of Front end, back end and RDF port specific values are not allowed. See UniSphere documentation for possible values.

Parameters:

filters – optional filters e.g. {‘vnx_attached’: ‘true’} – dict

Returns:

port key dicts – list

get_ports_from_port_group(port_group)[source]

Get a list of port identifiers from a port group.

Parameters:

port_group – name of the portgroup – list

Returns:

port ids – list

get_service_level(service_level_id)[source]

Get details on a specific service level.

Parameters:

service_level_id – service level agreement – str

Returns:

service level details – dict

get_service_level_list(filters=None)[source]

Retrieve the list of service levels from the array.

Parameters:

filters – optional filters – dict

Returns:

service level names – list

get_size_of_device_on_array(device_id)[source]

Get the size of the volume from the array.

Parameters:

device_id – device id – str

Returns:

size – float

get_split(split_id: str)[source]

Get details of a specified FICON split. :param split_id: split id – str :returns: split details – dict

get_split_list()[source]

Get list of FICON splits from array. :returns: split ids – list

get_srp(srp)[source]

Get details on a specific SRP.

Parameters:

srp – storage resource pool id – str

Returns:

srp details – dict

get_srp_list(filters=None)[source]

Get a list of available SRPs on a given array.

Parameters:

filters – filter parameters – dict

Returns:

SRPs – list

get_storage_group(storage_group_name)[source]

Given a name, return storage group details.

Parameters:

storage_group_name – name of the storage group – str

Returns:

storage group details – dict

get_storage_group_demand_report(srp_id=None)[source]

Get the storage group demand report.

Get the storage group demand report from Unisphere.

Parameters:

srp_id – id of the Storage Resource Pool – str

Returns:

demand report – dict

get_storage_group_from_masking_view(masking_view_id)[source]

Given a masking view, get the associated storage group.

Parameters:

masking_view_id – masking view name – str

Returns:

name of the storage group – str

get_storage_group_from_volume(volume_id)[source]

Retrieve storage group information for a specified volume.

Parameters:

volume_id – device id – str

Returns:

storage groups – list

get_storage_group_list(filters=None)[source]

Return a list of storage groups.

Parameters:

filters – filter parameters e.g. {‘is_link_target’: True} see API documentation https://developer.dell.com/ for full list of available filters– dict

Returns:

storage groups – list

get_target_wwns_from_port_group(**kwargs)
get_volume(device_id)[source]

Get a volume from array.

Parameters:

device_id – device id – str

Returns:

volume details – dict

get_volume_effective_wwn_details(vol_list, output_file_name=None)[source]

Get the effective wwn for a list of vols.

Get volume details for a list of volume device ids.

Parameters:
  • vol_list – device id(s) – list

  • output_file_name – name of the output file – str

Returns:

volume details list (nested) – list

get_volume_list(filters=None)[source]

Get list of volumes from array.

Parameters:

filters – filters parameters – dict

Returns:

device ids – list

get_volumes_from_storage_group(storage_group_id)[source]

Retrieve volume information associated with a given storage group.

Parameters:

storage_group_id – storage group id – name

Returns:

device ids – list

get_workload_settings()[source]

Get valid workload options from array.

Returns:

workload settings – list

is_child_storage_group_in_parent_storage_group(child_name, parent_name)[source]

Check if a child storage group is a member of a parent group.

Parameters:
  • child_name – child sg name – str

  • parent_name – parent sg name – str

Returns:

bool

is_compression_capable()[source]

Check if array is compression capable.

Returns:

bool

is_initiator_in_host(initiator)[source]

Check to see if a given initiator is already assigned to a host.

Parameters:

initiator – the initiator ID – str

Returns:

if initiator is assigned – bool

is_volume_in_storage_group(device_id, storage_group_id)[source]

See if a volume is a member of the given storage group.

Parameters:
  • device_id – device id – str

  • storage_group_id – storage group id – name

Returns:

bool

modify_cu_image(split_id: str, cu_ssid: str, assign_alias_dict=None, remove_alias_dict=None, map_start_address=None, map_volume_list=None, unmap_volume_list=None)[source]

Modify an existing cu image. :param split_id: split id – str :param cu_ssid: cu image ssid – str :param assign_alias_dict: alias range to be assigned – dict :param remove_alias_dict: alias range to be removed – dict :param map_start_address: :param map_volume_list: volumes to be mapped – list :param unmap_volume_list: volumes to be unmapped – list

modify_host(host_id, host_flag_dict=None, remove_init_list=None, add_init_list=None, new_name=None)[source]

Modify an existing host.

Only one parameter can be modified at a time.

Parameters:
  • host_id – host name – str

  • host_flag_dict – host flags – dict

  • remove_init_list – initiators to be removed – list

  • add_init_list – initiators to be added – list

  • new_name – new host name – str

Returns:

modified host details – dict

modify_host_group(host_group_id, host_flag_dict=None, remove_host_list=None, add_host_list=None, new_name=None)[source]

Modify an existing host group.

Only one parameter can be modified at a time.

Parameters:
  • host_group_id – name of the host group – str

  • host_flag_dict – host flags – dict

  • remove_host_list – hosts to be removed – list

  • add_host_list – hosts to be added – list

  • new_name – new name of the host group – str

Returns:

modified host group details – dict

modify_initiator(initiator_id, remove_masking_entry=None, replace_init=None, rename_alias=None, set_fcid=None, initiator_flags=None)[source]

Modify an initiator.

Only one parameter can be edited at a time.

Parameters:
  • initiator_id – initiator id – str

  • remove_masking_entry – ‘true’ or ‘false’ – str

  • replace_init – new initiator id – str

  • rename_alias – (‘new node name’, ‘new port name’) – tuple

  • set_fcid – fcid – str

  • initiator_flags – initiator flags to set – dict

Returns:

modified initiator details – dict

modify_port_group(port_group_id, remove_port=None, add_port=None, rename_port_group=None)[source]

Modify an existing port group.

Only one parameter can be modified at a time.

Parameters:
  • port_group_id – name of the port group – str

  • remove_port – port details (director_id, port_id) – tuple

  • add_port – port details (director_id, port_id) – tuple

  • rename_port_group – new port group name – str

Returns:

modified port group details – dict

modify_service_level(service_level_id, new_name)[source]

Modify an SLO.

Currently, the only modification permitted is renaming.

Parameters:
  • service_level_id – current name of the service level – str

  • new_name – new name for the – str

Returns:

modified service level details – dict

modify_storage_group(storage_group_id, payload)[source]

Modify a storage group.

Parameters:
  • storage_group_id – storage group id – str

  • payload – request payload – dict

Returns:

modified storage group details – dict

move_volumes_between_storage_groups(device_ids, source_storagegroup_name, target_storagegroup_name, force=False, _async=False)[source]

Move volumes to a different storage group.

Requires force set to True if volume is in a masking view.

Parameters:
  • device_ids – volume device id(s) – str or list

  • source_storagegroup_name – originating storage group name – str

  • target_storagegroup_name – destination storage group name – str

  • force – force flag – bool

  • _async – if call should be async – bool

Returns:

storage group details – dict

remove_child_storage_group_from_parent_group(child_storage_group, parent_storage_group)[source]

Remove a storage group from its parent storage group.

This method removes a child storage group from its parent group.

Parameters:
  • child_storage_group – child storage group id – str

  • parent_storage_group – parent storage group id – str

Returns:

storage group details – dict

remove_volume_from_storage_group(storage_group_id, vol_id, _async=False, remote_array_1_id=None, remote_array_1_sgs=None, remote_array_2_id=None, remote_array_2_sgs=None, terminate_snapshots=False)[source]

Remove a volume from a given storage group.

Parameters:
  • storage_group_id – storage group id – str

  • vol_id – device id – str

  • _async – if call should be async – bool

  • remote_array_1_id – 12 digit serial number of remote array, optional – str

  • remote_array_1_sgs – list of storage groups on remote array to add Remote device, Unisphere instance must be local to R1 storage group otherwise volumes will only be added to the local group – str or list

  • remote_array_2_id – optional digit serial number of remote array, only used in multihop SRDF, e.g. R11, or R1 - R21 - R2 optional – str

  • remote_array_2_sgs – storage groups on remote array, optional – str or list

  • terminate_snapshots – terminate any snapshots on volume when removing from storage group – bool

Returns:

storage group details – dict

rename_masking_view(masking_view_id, new_name)[source]

Rename an existing masking view.

Currently, the only supported modification is “rename”.

Parameters:
  • masking_view_id – current name of the masking view – str

  • new_name – new name of the masking view – str

Returns:

modified masking view details – dict

rename_volume(device_id, new_name, append_vol_id=False)[source]

Rename a volume.

Parameters:
  • device_id – device id – str

  • new_name – new name for the volume – str

  • append_vol_id – append volume id to the volume name, optional – bool

set_host_io_limit_iops_or_mbps(storage_group, iops, dynamic_distribution, mbps=None)[source]

Set the Host IO Limits on an existing storage group.

Parameters:
  • storage_group – storage group id – str

  • iops – IO per second, min Value 100, must be specified as multiple of 100 – int

  • dynamic_distribution – ‘Always’, ‘Never’, ‘OnFailure’ – str

  • mbps – MB per second, min Value 100, must be specified as multiple of 100 – int

Returns:

storage group details – dict

update_storage_group_qos(storage_group_id, qos_specs)[source]

Update the storage group instance with QoS details.

If maxIOPS or maxMBPS is in qos_specs, then DistributionType can be modified in addition to maxIOPs or/and maxMBPS. If maxIOPS or maxMBPS is NOT in qos_specs, we check to see if either is set in Storage Group. If so, then DistributionType can be modified. Example qos specs: {‘maxIOPS’: ‘4000’, ‘maxMBPS’: ‘4000’, ‘DistributionType’: ‘Dynamic’}

Parameters:
  • storage_group_id – storage group id – str

  • qos_specs – qos specifications – dict

Returns:

storage group details – dict

PyU4V.real_time

real_time.py.

class PyU4V.real_time.RealTimeFunctions(array_id, rest_client)[source]

Bases: object

PerformanceFunctions.

static format_metrics(metrics)[source]

Format metrics input for inclusion in REST request.

Take metric parameters and format them correctly to be used in REST request body. Valid input types are string and list.

Parameters:

metrics – metric(s) – str or list

Returns:

metrics – list

Raises:

InvalidInputException

get_array_keys()[source]

Get array IDs which are registered for real-time data.

Returns:

array IDs – list

get_array_metrics()[source]

Get array real-time performance metrics.

Returns:

metrics – list

get_array_stats(start_date, end_date, metrics, array_id=None)[source]

List real-time data for specified array.

Parameters:
  • start_date – timestamp in milliseconds since epoch – int

  • end_date – timestamp in milliseconds since epoch – int

  • metrics – performance metrics, options are individual metrics, a list of metrics, or ‘ALL’ for all metrics – str/list

  • array_id – array serial number – str

Returns:

real-time performance data – dict

get_backend_director_keys(array_id=None)[source]

Get backend director IDs which are registered for real-time data.

Parameters:

array_id – array serial number – str

Returns:

backend director IDs – list

get_backend_director_metrics()[source]

Get backend director real-time performance metrics.

Returns:

metrics – list

get_backend_director_stats(start_date, end_date, metrics, instance_id, array_id=None)[source]

List real-time data for specified backend director.

Parameters:
  • start_date – timestamp in milliseconds since epoch – int

  • end_date – timestamp in milliseconds since epoch – int

  • metrics – performance metrics, options are individual metrics, a list of metrics, or ‘ALL’ for all metrics – str/list

  • instance_id – backend director id – str

  • array_id – array serial number – str

Returns:

real-time performance data – dict

get_backend_port_keys(array_id=None)[source]

Get backend dir/port IDs which are registered for real-time data.

Parameters:

array_id – array serial number – str

Returns:

backend port IDs – list

get_backend_port_metrics()[source]

Get backend port real-time performance metrics.

Returns:

metrics – list

get_backend_port_stats(start_date, end_date, metrics, instance_id, array_id=None)[source]

List real-time data for specified backend port.

Parameters:
  • start_date – timestamp in milliseconds since epoch – int

  • end_date – timestamp in milliseconds since epoch – int

  • metrics – performance metrics, options are individual metrics, a list of metrics, or ‘ALL’ for all metrics – str/list

  • instance_id – backend dir/port id – str

  • array_id – array serial number – str

Returns:

real-time performance data – dict

get_categories(array_id=None)[source]

Get a list of real-time supported performance categories.

Parameters:

array_id – array serial number – str

Returns:

categories – list

get_category_keys(category, array_id=None)[source]

Get category keys valid for real-time metrics collection.

Parameters:
  • category – real-time performance category – str

  • array_id – array serial number – str

Returns:

category keys – list

get_category_metrics(category, array_id=None)[source]

Get metrics available for a real-time performance category.

Parameters:
  • category – real-time performance category – str

  • array_id – array serial number – str

Returns:

metrics – list

get_external_director_keys(array_id=None)[source]

Get external director IDs which are registered for real-time data.

Parameters:

array_id – array serial number – str

Returns:

external director IDs – list

get_external_director_metrics()[source]

Get external director real-time performance metrics.

Returns:

metrics – list

get_external_director_stats(start_date, end_date, metrics, instance_id, array_id=None)[source]

List real-time data for specified external director.

Parameters:
  • start_date – timestamp in milliseconds since epoch – int

  • end_date – timestamp in milliseconds since epoch – int

  • metrics – performance metrics, options are individual metrics, a list of metrics, or ‘ALL’ for all metrics – str/list

  • instance_id – external director id – str

  • array_id – array serial number – str

Returns:

real-time performance data – dict

get_frontend_director_keys(array_id=None)[source]

Get frontend director IDs which are registered for real-time data.

Parameters:

array_id – array serial number – str

Returns:

frontend director IDs – list

get_frontend_director_metrics()[source]

Get frontend director real-time performance metrics.

Returns:

metrics – list

get_frontend_director_stats(start_date, end_date, metrics, instance_id, array_id=None)[source]

List real-time data for specified frontend director.

Parameters:
  • start_date – timestamp in milliseconds since epoch – int

  • end_date – timestamp in milliseconds since epoch – int

  • metrics – performance metrics, options are individual metrics, a list of metrics, or ‘ALL’ for all metrics – str/list

  • instance_id – backend director id – str

  • array_id – array serial number – str

Returns:

real-time performance data – dict

get_frontend_port_keys(array_id=None)[source]

Get frontend dir/port IDs which are registered for real-time data.

Parameters:

array_id – array serial number – str

Returns:

frontend port IDs – list

get_frontend_port_metrics()[source]

Get frontend port real-time performance metrics.

Returns:

metrics – list

get_frontend_port_stats(start_date, end_date, metrics, instance_id, array_id=None)[source]

List real-time data for specified frontend port.

Parameters:
  • start_date – timestamp in milliseconds since epoch – int

  • end_date – timestamp in milliseconds since epoch – int

  • metrics – performance metrics, options are individual metrics, a list of metrics, or ‘ALL’ for all metrics – str/list

  • instance_id – backend dir/port id – str

  • array_id – array serial number – str

Returns:

real-time performance data – dict

get_performance_data(start_date, end_date, category, metrics, array_id=None, instance_id=None)[source]

Retrieve real-time performance statistics for a given category.

Parameters:
  • start_date – timestamp in milliseconds since epoch – int

  • end_date – timestamp in milliseconds since epoch – int

  • category – category id – str

  • metrics – performance metrics, options are individual metrics, a list of metrics, or ‘ALL’ for all metrics – str/list

  • array_id – array serial number – str

  • instance_id – instance id – str

Returns:

real-time performance data – dict

get_rdf_director_keys(array_id=None)[source]

Get rdf director IDs which are registered for real-time data.

Parameters:

array_id – array serial number – str

Returns:

rdf director IDs – list

get_rdf_director_metrics()[source]

Get rdf director real-time performance metrics.

Returns:

metrics – list

get_rdf_director_stats(start_date, end_date, metrics, instance_id, array_id=None)[source]

List real-time data for specified backend director.

Parameters:
  • start_date – timestamp in milliseconds since epoch – int

  • end_date – timestamp in milliseconds since epoch – int

  • metrics – performance metrics, options are individual metrics, a list of metrics, or ‘ALL’ for all metrics – str/list

  • instance_id – rdf director id – str

  • array_id – array serial number – str

Returns:

real-time performance data – dict

get_rdf_port_keys(array_id=None)[source]

Get rdf dir/port IDs which are registered for real-time data.

Parameters:

array_id – array serial number – str

Returns:

rdf port IDs – list

get_rdf_port_metrics()[source]

Get rdf port real-time performance metrics.

Returns:

metrics – list

get_rdf_port_stats(start_date, end_date, metrics, instance_id, array_id=None)[source]

List real-time data for specified rdf port.

Parameters:
  • start_date – timestamp in milliseconds since epoch – int

  • end_date – timestamp in milliseconds since epoch – int

  • metrics – performance metrics, options are individual metrics, a list of metrics, or ‘ALL’ for all metrics – str/list

  • instance_id – rdf dir/port id – str

  • array_id – array serial number – str

Returns:

real-time performance data – dict

get_storage_group_keys(array_id=None)[source]

Get storage group IDs which are registered for real-time data.

Parameters:

array_id – array serial number – str

Returns:

backend director IDs – list

get_storage_group_metrics()[source]

Get storage group real-time performance metrics.

Returns:

metrics – list

get_storage_group_stats(start_date, end_date, metrics, instance_id, array_id=None)[source]

List real-time data for specified storage group.

Parameters:
  • start_date – timestamp in milliseconds since epoch – int

  • end_date – timestamp in milliseconds since epoch – int

  • metrics – performance metrics, options are individual metrics, a list of metrics, or ‘ALL’ for all metrics – str/list

  • instance_id – storage group id – str

  • array_id – array serial number – str

Returns:

real-time performance data – dict

get_timestamps(array_id=None)[source]

Get real-time performance timestamps for array(s).

Parameters:

array_id – array serial number – str

Returns:

array timestamp info – list

is_timestamp_current(timestamp, minutes=None)[source]

Check if the timestamp is less than a user specified set of minutes.

If no minutes value is provided, self.recency is used. Seven minutes is recommended to provide a small amount of time for the STP daemon to record the next set of metrics in five minute intervals.

Parameters:
  • timestamp – timestamp in milliseconds since epoch – int

  • minutes – timestamp recency in minutes – int

Returns:

if timestamp is less than recency value – bool

set_array_id(array_id)[source]

Set the array id.

Parameters:

array_id – array id – str

set_recency(minutes)[source]

Set the recency value in minutes.

Parameters:

minutes – recency minutes – int

PyU4V.replication

replication.py.

class PyU4V.replication.ReplicationFunctions(array_id, rest_client)[source]

Bases: object

ReplicationFunctions.

are_volumes_rdf_paired(remote_array, device_id, target_device, rdf_group)[source]

Check if a pair of volumes are RDF paired.

Parameters:
  • remote_array – remote array serial number – str

  • device_id – device id – str

  • target_device – target device id – str

  • rdf_group – rdf group number – int

Returns:

paired, state – bool, string

bulk_terminate_snapshots(storage_group_id, snap_name, keep_count=None, terminate_all_snapshots=False, snapset_id_and_older=None, force=False, array_id=None)[source]

Terminate Multiple snapshots in a bulk operation.

Parameters:
  • storage_group_id – Name of the storage group with snapshots –str

  • snap_name – optional name of snapshot to be terminated – str

  • terminate_all_snapshots – Value that terminates all snapshots – bool

  • keep_count – Value that terminates a number of snapshots so that there is only the specified number of most recent snapshots retained – int

  • snapset_id_and_older – Value that terminates all snapshots with the snapset id or older –str

  • force – Value that sets the force flag – bool

  • array_id – 12 digit array id – int

create_rdf_group(local_director_port_list, remote_array_id, label, local_rdfg_number, remote_rdfg_number, remote_director_port_list, array_id=None)[source]

Create a new RDF group between directors and ports on two PowerMax.

If this is the first connection between 2 arrays please ensure that you run get_rdf_remote_port_details and create the initial connection group using only the first source port you can extract details for one or more remote ports for the desired target array and feed into this function. Additional Ports can be added with modify_rdf_group function.

Parameters:
  • local_director_port_list – list of local directors and ports for group e.g [RF-1E:1, RF-2E:1] – list

  • remote_array_id – 12 digit serial number of remote array – str

  • label – label for group up to 10 characters – str

  • local_rdfg_number – rdfg for the local array – int

  • remote_rdfg_number – rdfg for the remote array – int

  • remote_director_port_list – list of remote directors and ports to group e.g [RF-1E:1, RF-2E:1] – list

  • array_id – 12 digit serial number of Source (R1) array, if no array is specified the array in config file or api connection will be default – str

create_storage_group_from_rdfg(storage_group_name, srdf_group_number, array_id=None, rdf_type=None, remote_storage_group_name=None)[source]

Creates management storage group from all devices in SRDF group.

Note SRDF management storage group will be created without a service level, it is assumed that this group is created solely for the purpose of managing SRDF device and replication state, devices in an SRDF group may span multiple applications and storage groups.

Parameters:
  • storage_group_name – Name of storage group – str

  • srdf_group_number – number of RDF group volumes are in – int

  • array_id – number of RDF group volumes are in – int

  • rdf_type – The SRDF type of the volumes in the SRDF group to be added to the Storage Group. Only needs to be populated if the SRDF group contains both RDF1 and RDF2 volumes valid values RDF1 or RDF2 – str

  • remote_storage_group_name – Name of remote storage group – str

create_storage_group_snapshot(storage_group_id, snap_name, ttl=None, hours=False, secure=False)[source]

Create a snapVx snapshot of a storage group.

To establish a new generation of an existing SnapVX snapshot for a source SG, use the same name as the existing snapshot for the new snapshot.

Parameters:
  • storage_group_id – source storage group id – str

  • snap_name – snapshot name – str

  • ttl – Time To Live – str

  • hours – if TTL is in hours instead of days – bool

  • secure – sets secure snapshot, snapshot created with secure option can not be deleted before ttl expires – bool

Returns:

snapshot details – dict

create_storage_group_srdf_pairings(storage_group_id, remote_sid, srdf_mode, establish=None, _async=False, rdfg_number=None, force_new_rdf_group=False)[source]

SRDF protect a storage group.

Valid modes are ‘Active’, ‘AdaptiveCopyDisk’, ‘Synchronous’, and ‘Asynchronous’.

Parameters:
  • storage_group_id – storage group id – str

  • remote_sid – remote array id – str

  • srdf_mode – replication mode – str

  • establish – establish srdf – bool

  • _async – if call should be async – bool

  • rdfg_number – rdf group number – int

  • force_new_rdf_group – if force command should be applied – bool

Returns:

storage group rdf details – dict

delete_rdf_group(srdf_group_number, array_id=None)[source]

Function to Delete SRDF groups between VMAX or PowerMax arrays.

Parameters:
  • srdf_group_number – number of RDF group to be deleted – int

  • array_id – 12 digit serial of array – str

delete_storage_group_snapshot(storage_group_id, snap_name, gen=0)[source]

Delete the snapshot of a storage group.

This is for arrays with microcode less than 5978.669.669. Please use delete_storage_group_snapshot_by_snap_id for microcode greater than 5978.669.669.

Parameters:
  • storage_group_id – storage group id – str

  • snap_name – snapshot name – str

  • gen – snapshot generation number – int

delete_storage_group_snapshot_by_snap_id(storage_group_id, snap_name, snap_id, force=False, array_id=None, symforce=False)[source]

Delete the snapshot of a storage group using the snap id.

Snap ids are only available on microcode 5978.669.669 and greater.

Parameters:
  • storage_group_id – storage group id – str

  • snap_name – snapshot name – str

  • snap_id – snapshot snap id – int

  • force – sets force flag – bool

  • array_id – 12 digit array id – int

  • symforce – sets symforce flag – bool

Returns:

dict

delete_storage_group_srdf(storage_group_id, srdf_group_number, filters=None)[source]

Delete srdf pairings for a given storage group.

Parameters:
  • storage_group_id – storage group id – str

  • srdf_group_number – srdf group number – int

  • filters – optional boolean filters, half_delete,hop2, force, symforce, star, bypass, keepR1, keepR2, usage example filters={‘keepR1’: ‘true’} – dict

Returns:

storage group rdf details – dict

establish_storage_group_srdf(storage_group_id, srdf_group_number, establish_options=None, _async=False)[source]

Establish io on the links for the given storage group.

Optional boolean parameters to set are ‘bypass’, ‘metroBias’, ‘star’, ‘hop2’, ‘force’, ‘symForce’, ‘full’.

Parameters:
  • storage_group_id – storage group id – str

  • srdf_group_number – srdf group number – int

  • establish_options – establish parameters – dict

  • _async – if call should be async – bool

Returns:

storage group rdf details – dict

failback_storage_group_srdf(storage_group_id, srdf_group_number, failback_options=None, _async=False)[source]

Failback a given storage group.

Optional boolean parameters to set are ‘bypass’, ‘recoverPoint’, ‘star’, ‘hop2’, ‘force’, ‘symForce’, ‘remote’.

Parameters:
  • storage_group_id – storage group id – str

  • srdf_group_number – srdf group number – int

  • failback_options – failback parameters – dict

  • _async – if call should be async – bool

Returns:

storage group rdf details – dict

failover_storage_group_srdf(storage_group_id, srdf_group_number, failover_options=None, _async=False)[source]

Failover a given storage group.

Optional boolean parameters to set are ‘bypass’, ‘star’, ‘restore’, ‘immediate’, ‘hop2’, ‘force’, ‘symForce’, ‘remote’, ‘establish’.

Parameters:
  • storage_group_id – storage group id – str

  • srdf_group_number – srdf group number – int

  • failover_options – failover parameters – dict

  • _async – if call should be async – bool

Returns:

storage group rdf details – dict

find_expired_snapvx_snapshots()[source]

Find all expired snapvx snapshots.

This is for arrays with microcode less than 5978.669.669. Please use find_expired_snapvx_snapshots_by_snap_ids for microcode greater than 5978.669.669.

Parses through all Snapshots for array and lists those that have snapshots where the expiration date has passed however snapshots have not been deleted as they have links.

Returns:

expired snapshot details – list

find_expired_snapvx_snapshots_by_snap_ids()[source]

Find all expired snapvx snapshots using snap id.

Snap ids are only available on microcode 5978.669.669 and greater.

Parses through all Snapshots for array and lists those that have snapshots where the expiration date has passed however snapshots have not been deleted as they have links.

Returns:

expired snapshot details – list

get_array_replication_capabilities(array_id=None)[source]

Check what replication facilities are available.

Returns:

replication capability details – dict

get_rdf_director_detail(director_id, array_id=None)[source]

Retrieves details for specified RDF_director.

Parameters:
  • director_id – identifier for director e.g. RF-1F – str

  • array_id – 12 digit serial number for PowerMax array – str

Returns:

director details –dict

get_rdf_director_list(array_id=None, filters=None)[source]

Finds out directors configured for SRDF on the specified array.

Parameters:
  • array_id – 12 digit serial number for PowerMax array – str

  • filters – optional filters - dict

Returns:

list of directors – list

get_rdf_director_port_details(director_id, port_id, array_id=None)[source]

Retrieves details of specified RDF ports.

Parameters:
  • director_id – identifier for director e.g. RF-1F – str

  • port_id – port number – int

  • array_id – 12 digit serial number for PowerMax array – str

Returns:

port details – dict

get_rdf_director_port_list(director_id, array_id=None, filters=None)[source]

Retrieves list of ports available on RDF_director.

Parameters:
  • director_id – identifier for director e.g. RF-1F – str

  • array_id – 12 digit serial number for PowerMax array – str

  • filters – optional filters – dict

Returns:

list of RDF ports – list

get_rdf_group(rdf_number, array_id=None)[source]

Get specific rdf group details.

Parameters:
  • rdf_number – rdf group number – int

  • array_id – array serial number – str

Returns:

rdf group details – dict

get_rdf_group_list(array_id=None, remote_symmetrix_id=None, rdf_mode=None, volume_count=None, group_type=None)[source]

Get rdf group list from array.

Parameters:
  • array_id – local array serial number – str

  • remote_symmetrix_id – Optional value that filters returned list to display only SRDF Groups between the local array and specified remote array, 12 Digit array_id e.g. 000297900330 – str

  • rdf_mode – Optional value that filters returned list to display only SRDF Groups of a specified RDF mode, Synchronous, Asynchronous, Active, or AdaptiveCopy – str

  • volume_count – Optional value that filters returned list to display only SRDF Groups that have a specified volume count – int

  • group_type – Optional value that filters returned list to display only SRDF Groups of a specified group type valid options are Witness, Global_Mirror, Data_Migration, VVOL_ASYNC, MetroDR_Metro, MetroDR_DR, Metro, Star_Normal, Star_Recovery, Sqar_Normal, Sqar_Recovery, PPRC, FILE_SYNC, FILE_ASYNC, Dynamic – str

Returns:

rdf group list – list

get_rdf_group_number(rdf_group_label)[source]

Given a group label, return the associated group number.

Parameters:

rdf_group_label – rdf group label – str

Returns:

rdf group number – int

get_rdf_group_volume(rdf_number, device_id)[source]

Get specific volume details, from an RDF group.

Parameters:
  • rdf_number – rdf group number – int

  • device_id – device id – str

Returns:

rdf group volume details – dict

get_rdf_group_volume_list(rdf_number)[source]

Get specific volume details, from an RDF group.

Parameters:

rdf_number – rdf group number – int

Returns:

device ids – list

get_rdf_port_remote_connections(director_id, port_id, array_id=None)[source]

Performs a scan of the RDF environment via specified port.

This function should be run on initial SRDF configuration once zoning or IP routing is configured, prior to first RDF group being configured.

Parameters:
  • director_id – identifier for director e.g. RF-1F – str

  • port_id – port number – int

  • array_id – 12 digit serial number for Source – str

Returns:

remote port details – dict

get_replication_enabled_storage_groups(array_id=None, has_srdf=None, has_snapshots=None, has_cloud_snapshots=None, is_link_target=None, has_snap_policies=None, has_clones=None)[source]

Return list of storage groups with replication.

Parameters:
  • has_snapshots – return only storage groups with snapshots

  • has_srdf – return only storage groups with SRDF

  • has_cloud_snapshots – Value that filters returned list to display Storage Groups that have Cloud Snapshots – bool

  • is_link_target – Value that filters returned list to display Storage Groups that are Link Targets – bool

  • has_snap_policies – Value that filters returned list to display Storage Groups that have Snapshot Policies – bool

  • has_clones – Value that filters returned list to display Storage Groups that have Clones – bool

Returns:

list of storage groups with associated replication

get_replication_info()[source]

Return replication information for an array.

Returns:

replication details – dict

get_snapshot_generation_details(sg_id, snap_name, gen_num)[source]

Get the details for a particular snapshot generation.

This is for arrays with microcode less than 5978.669.669. Please use get_snapshot_snap_id_details for microcode greater than 5978.669.669.

Parameters:
  • sg_id – storage group id – str

  • snap_name – snapshot name – str

  • gen_num – generation number – int

Returns:

snapshot generation details – dict

get_snapshot_snap_id_details(sg_id, snap_name, snap_id)[source]

Get the details for a particular snapshot snap_id.

Snap ids are only available on microcode 5978.669.669 and greater.

Parameters:
  • sg_id – storage group id – str

  • snap_name – snapshot name – str

  • snap_id – unique snap id – int

Returns:

snapshot snap id details – dict

get_storage_group_replication_details(storage_group_id, return_remote_sg_info=False, exclude_sl_snaps=False, exclude_manual_snaps=False)[source]

Given a storage group id, return storage group srdf info and snapshot information.

Parameters:
  • storage_group_id – storage group id – str

  • return_remote_sg_info – returns additional information for keys remote_storage_groups – bool

  • exclude_sl_snaps – excludes details of any service level snaps from the return – bool

  • exclude_manual_snaps – excludes details of any manual snaps from the return – bool

Returns:

storage group replication details – dict

get_storage_group_snapshot_generation_list(storage_group_id, snap_name)[source]

Get a snapshot and its generation count information for an sg.

This is for arrays with microcode less than 5978.669.669. Please use get_storage_group_snapshot_snap_id_list for microcode greater than 5978.669.669.

The most recent snapshot will have a gen number of 0. The oldest snapshot will have a gen number = genCount - 1 (i.e. if there are 4 generations of particular snapshot, the oldest will have a gen num of 3).

Parameters:
  • storage_group_id – name of the storage group – str

  • snap_name – the name of the snapshot – str

Returns:

generation numbers – list

get_storage_group_snapshot_list(storage_group_id)[source]

Get a list of snapshots associated with a storage group.

Parameters:

storage_group_id – storage group id – str

Returns:

snapshot ids – list

get_storage_group_snapshot_snap_id_list(storage_group_id, snap_name)[source]

Get a snapshot and its snap id information for an sg.

Each snapid is unique. These have replaced generations starting at U4P9.2. Snap ids are only available on microcode 5978.669.669 and greater.

Parameters:
  • storage_group_id – name of the storage group – str

  • snap_name – the name of the snapshot – str

Returns:

snapids – list

get_storage_group_srdf_details(storage_group_id, rdfg_num)[source]

Get the details for an rdf group on a particular storage group.

Parameters:
  • storage_group_id – replicated storage group id – str

  • rdfg_num – rdf group number – int

Returns:

storage group rdf details – dict

get_storage_group_srdf_group_list(storage_group_id, array_id=None)[source]

Get the rdf group numbers for a storage group.

Parameters:
  • storage_group_id – replicated storage group id – str

  • array_id – array serial number – str

Returns:

rdf group numbers – list

is_snapvx_licensed()[source]

Check if the snapVx feature is licensed and enabled.

Returns:

bool

is_volume_in_replication_session(device_id)[source]

Check if a volume is in a replication session.

NOTE: There may be a time delay between the snapshot creation and the object model update. See the following test for usage: tests.ci_tests.test_pyu4v_ci_replication.CITestReplication. test_is_volume_in_replication_session

Parameters:

device_id – device id – str

Returns:

snap vx target, snap vx source, rdf group – bool, bool, list

Link a snapshot to another storage group.

This is for arrays with microcode less than 5978.669.669. Please use link_snapshot_by_snap_id for microcode greater than 5978.669.669.

Target storage group will be created if it does not exist.

Parameters:
  • sg_id – storage group id – str

  • snap_name – snapshot name – str

  • link_sg_name – target storage group name – str

  • _async – if call should be async – bool

  • gen_num – snapshot generation number – int

Returns:

snapshot details – dict

Link a snapshot to another storage group using it’s snap id.

Snap ids are only available on microcode 5978.669.669 and greater.

Target storage group will be created if it does not exist.

Parameters:
  • sg_id – storage group id – str

  • link_sg_name – target storage group name – str

  • snap_name – snapshot name – str

  • snap_id – snapshot snap id – int

  • _async – if call should be async – bool

Returns:

snapshot details – dict

modify_rdf_group(action, srdf_group_number, array_id=None, port_list=None, label=None, dev_list=None, target_rdf_group=None, consistency_exempt=None)[source]

Function to Modify Ports, devices or change label of RDF group.

Function can be used to Add ports, move volumes between rdf groups, remove ports or rename RDF group.

Parameters:
  • action – add_ports, remove_ports, move – str

  • srdf_group_number – srdf group number for action on local array: int

  • array_id – 12 digit serial of array – str

  • port_list – list of ports to be added or removed e.g. [RF-1E:10, RF-2E:10] –list

  • label – label for group up to 10 characters – str

  • dev_list – list of volumes to be moved between RDF groups – list

  • target_rdf_group – rdfg group to move volumes to – int

  • consistency_exempt – ignore device for consistency checks – bool

modify_storage_group_snapshot(src_storage_grp_id, tgt_storage_grp_id, snap_name, link=False, unlink=False, restore=False, new_name=None, gen_num=0, _async=False, relink=False)[source]

Modify a storage group snapshot.

This is for arrays with microcode less than 5978.669.669. Please use modify_storage_group_snapshot_by_snap_id for microcode greater than 5978.669.669.

Please note that only one parameter can be modified at a time. Default action is not to create full copy.

Parameters:
  • src_storage_grp_id – name of the storage group – str

  • tgt_storage_grp_id – target sg id (Can be None) – str

  • snap_name – snapshot name – str

  • link – link action required – bool

  • unlink – unlink action required – bool

  • restore – restore action required – bool

  • new_name – new name for the snapshot – str

  • gen_num – generation number – int

  • _async – if call should be async – bool

  • relink – relink action required – bool

Returns:

modified storage group snapshot details – dict

modify_storage_group_snapshot_by_snap_id(src_storage_grp_id, tgt_storage_grp_id, snap_name, snap_id, link=False, unlink=False, restore=False, new_name=None, _async=False, relink=False, remote=False, force=False)[source]

Modify a storage group snapshot using it’s snap id.

Snap ids are only available on microcode 5978.669.669 and greater.

Please note that only one parameter can be modified at a time. Default action is not to create full copy

Parameters:
  • src_storage_grp_id – name of the storage group – str

  • tgt_storage_grp_id – target sg id (Can be None) – str

  • snap_name – snapshot name – str

  • snap_id – snap id – int

  • link – link action required – bool

  • unlink – unlink action required – bool

  • restore – restore action required – bool

  • new_name – new name for the snapshot – str

  • _async – if call should be async – bool

  • relink – relink action required – bool

  • remote – used when linking/relinking to established R1 Storage group,using this feature acknowledges that the data from snapshot will be transmitted to R2 site,removes the need to suspend/establish SRDF as part of link operation.Caution should be applied – bool

  • force – forces operation to succeed that would normally fail.Example terminate snapshots in SG where devices have been added,using symforce will bypass the device count check.Should be used with caution. – bool

Returns:

modified storage group snapshot details – dict

modify_storage_group_srdf(storage_group_id, action, srdf_group_number, options=None, _async=False)[source]

Modify the state of a rdf group.

This may be a long running task depending on the size of the SRDF group, can switch to async call if required. Available actions are ‘Establish’, ‘EnableConsistency’, ‘DisableConsistency’, ‘Split’, ‘Suspend’, ‘Restore’, ‘Resume’, ‘Failover’, ‘Failback’, ‘Swap’, ‘SetBias’, and ‘SetMode’.

Parameters:
  • storage_group_id – storage group id – str

  • action – the rdf action, note enable/disable consistency feature requires Unisphere 9.2.1.6 or higher – str

  • srdf_group_number – srdf group number – int

  • options – srdf options e.g. {setMode’: {‘mode’: ‘Asynchronous’}} – dict

  • _async – if call should be async – bool

Returns:

storage group rdf details – dict

rename_snapshot(sg_id, snap_name, new_name, gen_num=0)[source]

Rename an existing storage group snapshot.

This is for arrays with microcode less than 5978.669.669. Please use rename_snapshot_by_snap_id for microcode greater than 5978.669.669.

Parameters:
  • sg_id – storage group id – str

  • snap_name – snapshot name – str

  • new_name – new snapshot name – str

  • gen_num – snapshot generation number – int

Returns:

snapshot details – dict

rename_snapshot_by_snap_id(sg_id, snap_name, new_name, snap_id)[source]

Rename an existing storage group snapshot using it’s snap id.

Snap ids are only available on microcode 5978.669.669 and greater.

Parameters:
  • sg_id – storage group id – str

  • snap_name – snapshot name – str

  • new_name – new snapshot name – str

  • snap_id – snapshot snap id – int

Returns:

snapshot details – dict

restore_snapshot(sg_id, snap_name, gen_num=0)[source]

Restore a storage group to its snapshot.

This is for arrays with microcode less than 5978.669.669. Please use restore_snapshot_by_snap_id for microcode greater than 5978.669.669.

Parameters:
  • sg_id – storage group id – str

  • snap_name – snapshot name – str

  • gen_num – snapshot generation number – int

Returns:

snapshot details – dict

restore_snapshot_by_snap_id(sg_id, snap_name, snap_id)[source]

Restore a storage group to its snapshot using it’s snap id.

Snap ids are only available on microcode 5978.669.669 and greater.

Parameters:
  • sg_id – storage group id – str

  • snap_name – snapshot name – str

  • snap_id – snapshot snap id – int

Returns:

snapshot details – dict

suspend_storage_group_srdf(storage_group_id, srdf_group_number, suspend_options=None, _async=False)[source]

Suspend IO on the links for the given storage group.

Optional boolean parameters to set are “bypass”, “metroBias”, “star”, “immediate”, “hop2”, “consExempt”, “force”, “symForce”.

Parameters:
  • storage_group_id – storage group id – str

  • srdf_group_number – srdf group number – int

  • suspend_options – suspend parameters – dict

  • _async – if call should be async – bool

Returns:

storage group rdf details – dict

Unlink a snapshot from another storage group.

This is for arrays with microcode less than 5978.669.669. Please use unlink_snapshot_by_snap_id for microcode greater than 5978.669.669.

Parameters:
  • sg_id – storage group id – str

  • snap_name – snapshot name – str

  • unlink_sg_name – target storage group name – str

  • _async – if call should be async – bool

  • gen_num – snapshot generation number – int

Returns:

snapshot details – dict

Unlink a snapshot from another storage group using it’s snap id.

Snap ids are only available on microcode 5978.669.669 and greater.

Parameters:
  • sg_id – storage group id – str

  • unlink_sg_name – target storage group name – str

  • snap_name – snapshot name – str

  • snap_id – snapshot snap id – int

  • _async – if call should be async – bool

Returns:

snapshot details – dict

PyU4V.rest_requests

rest_requests.py.

class PyU4V.rest_requests.RestRequests(username, password, verify, base_url, interval, retries, application_type=None, proxies=None)[source]

Bases: object

RestRequests.

close_session()[source]

Close the current session.

establish_rest_session(headers=None)[source]

Establish a REST session.

Returns:

session – object

file_transfer_request(method, uri, timeout=None, download=False, r_obj=None, upload=False, form_data=None)[source]

Send a file transfer request via REST to the target API.

Valid methods are ‘POST’ and ‘PUT’.

Parameters:
  • method – request method – str

  • uri – target uri – str

  • timeout – optional timeout override – int

  • download – if download request – bool

  • r_obj – download request payload – dict

  • upload – if upload request – bool

  • form_data – upload multipart form data – dict

Returns:

server response, status code – dict, int

Raises:

InvalidInputException, VolumeBackendAPIException, Timeout, SSLError, ConnectionError, HTTPError

rest_request(target_url, method, params=None, request_object=None, timeout=None)[source]

Send a request to the target api.

Valid methods are ‘GET’, ‘POST’, ‘PUT’, ‘DELETE’.

Parameters:
  • target_url – target url –str

  • method – method – str

  • params – Additional URL parameters – dict

  • request_object – request payload – dict

  • timeout – optional timeout override – int

Returns:

server response, status code – dict, int

PyU4V.snapshot_policy

snapshot_policy.py.

class PyU4V.snapshot_policy.SnapshotPolicyFunctions(array_id, rest_client)[source]

Bases: object

associate_to_storage_groups(snapshot_policy_name, storage_group_names, _async=False)[source]

Associate a snapshot policy to storage group(s).

Parameters:
  • snapshot_policy_name – the snapshot policy name – str

  • storage_group_names – List of storage group names – list

  • _async – is the operation asynchronous – bool

Returns:

resource object – dict

create_snapshot_policy(snapshot_policy_name, interval, cloud_retention_days=None, cloud_provider_name=None, local_snapshot_policy_secure=False, local_snapshot_policy_snapshot_count=None, offset_mins=None, compliance_count_warning=None, compliance_count_critical=None, _async=False)[source]

Create a new snapshot policy.

Parameters:
  • snapshot_policy_name – the snapshot policy name – str

  • interval – The value of the interval counter for snapshot policy execution. Must be one of ‘10 Minutes’, ‘12 Minutes’, ‘15 Minutes’, ‘20 Minutes’, ‘30 Minutes’, ‘1 Hour’, ‘2 Hours’, ‘3 Hours’, ‘4 Hours’, ‘6 Hours’, ‘8 Hours’, ‘12 Hours’, ‘1 Day’, ‘7 Days’ – str

  • cloud_retention_days – part of cloud_snapshot_policy_details number of days to retain the policy – int

  • cloud_provider_name – part of cloud_snapshot_policy_details the cloud provider name – str

  • local_snapshot_policy_secure – secure snapshots may only be terminated after they expire or by Dell EMC support – bool

  • local_snapshot_policy_snapshot_count – the max snapshot count of the policy – int

  • offset_mins – Defines when, within the interval the snapshots will be taken for a specified Snapshot Policy. The offset must be less than the interval of the Snapshot Policy. For daily snapshots the offset is the number of minutes after midnight UTC, for weekly the offset is from midnight UTC on the Sunday. The format must be in minutes – int

  • compliance_count_warning – The Number of snapshots which are not failed or bad when compliance changes to warning. – int

  • compliance_count_critical – The Number of snapshots which are not failed or bad when compliance changes to critical. – int

  • _async – is the operation asynchronous – bool

Returns:

resource object – dict

delete_snapshot_policy(snapshot_policy_name)[source]

Delete a snapshot policy

Parameters:

snapshot_policy_name – the snapshot policy name – str

disassociate_from_storage_groups(snapshot_policy_name, storage_group_names, _async=False)[source]

Disassociate a snapshot policy from storage group(s).

Parameters:
  • snapshot_policy_name – the snapshot policy name – str

  • storage_group_names – List of storage group names – list

  • _async – is the operation asynchronous – bool

Returns:

resource object – dict

get_snapshot_policy(snapshot_policy_name)[source]

Given a snapshot policy name, return snapshot policy details.

Parameters:

snapshot_policy_name – name of the snapshot policy – str

Returns:

snapshot policy details – dict

get_snapshot_policy_compliance(storage_group_name, last_week=False, last_four_weeks=False, from_epoch=None, to_epoch=None, from_time_string=None, to_time_string=None)[source]

Get compliance attributes on a storage group.

Parameters:
  • storage_group_name – storage group name

  • last_week – compliance in last week – bool

  • last_four_weeks – compliance in last four weeks – bool

  • from_epoch – timestamp since epoch – str e.g 1606820929 (seconds)

  • to_epoch – timestamp since epoch – str e.g 1606820929 (seconds)

  • from_time_string – human readable date – str e.g 2020-12-01 15:00

  • to_time_string – human readable date – str e.g 2020-12-01 15:00

Returns:

resource – dict

get_snapshot_policy_compliance_epoch(storage_group_name, from_epoch=None, to_epoch=None)[source]

Get compliance attributes for the last four weeks.

Get compliance attributes on a storage group for the last four weeks

Parameters:
  • storage_group_name – storage group name

  • from_epoch – timestamp since epoch – str e.g 1606820929 (seconds)

  • to_epoch – timestamp since epoch – str e.g 1606820929 (seconds)

Returns:

resource – dict

get_snapshot_policy_compliance_human_readable_time(storage_group_name, from_time_string=None, to_time_string=None)[source]

Get compliance attributes for the last four weeks.

Get compliance attributes on a storage group for the last four weeks

Parameters:
  • storage_group_name – storage group name

  • from_time_string – human readable date – str e.g 2020-12-01 15:00

  • to_time_string – human readable date – str e.g 2020-12-01 15:00

Returns:

resource – dict

get_snapshot_policy_compliance_last_four_weeks(storage_group_name)[source]

Get compliance attributes for the last four weeks.

Get compliance attributes on a storage group for the last four weeks

Parameters:

storage_group_name – storage group name

Returns:

resource – dict

get_snapshot_policy_compliance_last_week(storage_group_name)[source]

Get compliance attributes on a storage group for the last week.

Parameters:

storage_group_name – storage group name

Returns:

resource – dict

get_snapshot_policy_list()[source]

Given a snapshot policy name, return snapshot policy details.

Returns:

snapshot policy names – list

get_snapshot_policy_storage_group_list(snapshot_policy_name)[source]

Get list of storage groups associated to specified snapshot policy.

Parameters:

snapshot_policy_name – name of the snapshot policy – str

Returns:

snapshot policy details – list

modify_snapshot_policy(snapshot_policy_name, action, interval=None, offset_mins=None, snapshot_count=None, compliance_count_warning=None, compliance_count_critical=None, storage_group_names=None, new_snapshot_policy_name=None, _async=False)[source]

Modify a snapshot policy

This can be action: [Modify, Suspend, Resume, AssociateToStorageGroups, DisassociateFromStorageGroups]. A modify of the snapshot policy or adding or removing storage groups associated with the policy.

Parameters:
  • snapshot_policy_name – the snapshot policy name – str

  • action – the modification action, must be one of ‘AssociateToStorageGroups’, ‘DisassociateFromStorageGroups’ ‘Modify’, ‘Suspend’, ‘Resume’ – str

  • interval – The value of the interval counter for snapshot policy execution. Must be one of ‘10 Minutes’, ‘12 Minutes’, ‘15 Minutes’, ‘20 Minutes’, ‘30 Minutes’, ‘1 Hour’, ‘2 Hours’, ‘3 Hours’, ‘4 Hours’, ‘6 Hours’, ‘8 Hours’, ‘12 Hours’, ‘1 Day’, ‘7 Days’ – str

  • offset_mins – The number of minutes after 00:00 on Monday to first run the service policy. The offset must be less than the interval of the Snapshot Policy. The format must be in minutes – int

  • snapshot_count – The maximum number of snapshots that should be maintained for a specified Snapshot Policy. The maximum count must be between 1 to 1024. – int

  • compliance_count_warning – The Number of snapshots which are not failed or bad when compliance changes to warning. The warning compliance count cannot be set to 0 and must be less than or equal to the maximum count of the Snapshot Policy. – int

  • compliance_count_critical – The Number of snapshots which are not failed or bad when compliance changes to critical. If the warning compliance count is also set, the critical compliance count must be less than or equal to that. – int

  • storage_group_names – List of storage group names – list

  • new_snapshot_policy_name – change the name if set – str

  • _async – is the operation asynchronous – bool

Returns:

resource object – dict

modify_snapshot_policy_properties(snapshot_policy_name, interval=None, offset_mins=None, snapshot_count=None, compliance_count_warning=None, compliance_count_critical=None, new_snapshot_policy_name=None, _async=False)[source]

Suspend a snapshot policy

Parameters:
  • snapshot_policy_name – the snapshot policy name – str

  • interval – The value of the interval counter for snapshot policy execution. Must be one of ‘10 Minutes’, ‘12 Minutes’, ‘15 Minutes’, ‘20 Minutes’, ‘30 Minutes’, ‘1 Hour’, ‘2 Hours’, ‘3 Hours’, ‘4 Hours’, ‘6 Hours’, ‘8 Hours’, ‘12 Hours’, ‘1 Day’, ‘7 Days’ – str

  • offset_mins – The number of minutes after 00:00 on Monday to first run the service policy. The offset must be less than the interval of the Snapshot Policy. The format must be in minutes – int

  • snapshot_count – The maximum number of snapshots that should be maintained for a specified Snapshot Policy. The maximum count must be between 1 to 1024. – int

  • compliance_count_warning – The Number of snapshots which are not failed or bad when compliance changes to warning. The warning compliance count cannot be set to 0 and must be less than or equal to the maximum count of the Snapshot Policy. – int

  • compliance_count_critical – The Number of snapshots which are not failed or bad when compliance changes to critical. If the warning compliance count is also set, the critical compliance count must be less than or equal to that. – int

  • new_snapshot_policy_name – change the name if set – str

  • _async – is the operation asynchronous – bool

Returns:

resource object – dict

resume_snapshot_policy(snapshot_policy_name, _async=False)[source]

Suspend a snapshot policy

Parameters:
  • snapshot_policy_name – the snapshot policy name – str

  • _async – is the operation asynchronous – bool

Returns:

resource object – dict

suspend_snapshot_policy(snapshot_policy_name, _async=False)[source]

Suspend a snapshot policy.

Parameters:
  • snapshot_policy_name – the snapshot policy name – str

  • _async – is the operation asynchronous – bool

Returns:

resource object – dict

static verify_combination(last_week, last_four_weeks, from_epoch, from_time_string)[source]

Verify the valid combinations for compliance.

Parameters:
  • last_week – compliance in last week – bool

  • last_four_weeks – compliance in last four weeks – bool

  • from_epoch – timestamp since epoch – str e.g 1606820929 (seconds)

  • from_time_string – human readable date – str e.g 2020-12-01 15:00

Returns:

msg or None – str

verify_from_epoch(from_epoch, to_epoch, to_time_string)[source]

Verify the the from_epoch param for compliance.

Parameters:
  • from_epoch – timestamp since epoch – str e.g 1606820929 (seconds)

  • to_epoch – timestamp since epoch – str e.g 1606820929 (seconds)

  • to_time_string – human readable date – str e.g 2020-12-01 15:00

Returns:

msg or None – str query_params – dict

verify_from_time_string(to_epoch, to_time_string, from_time_string)[source]

Verify the the from_time_string param for compliance.

Parameters:
  • to_epoch – timestamp since epoch – str e.g 1606820929 (seconds)

  • from_time_string – human readable date – str e.g 2020-12-01 15:00

  • to_time_string – human readable date – str e.g 2020-12-01 15:00

Returns:

msg or None – str query_params – dict

verify_input_params(last_week, last_four_weeks, from_epoch, to_epoch, from_time_string, to_time_string)[source]

Verify the input parameters for compliance.

Parameters:
  • last_week – compliance in last week – bool

  • last_four_weeks – compliance in last four weeks – bool

  • from_epoch – timestamp since epoch – str e.g 1606820929 (seconds)

  • to_epoch – timestamp since epoch – str e.g 1606820929 (seconds)

  • from_time_string – human readable date – str e.g 2020-12-01 15:00

  • to_time_string – human readable date – str e.g 2020-12-01 15:00

Returns:

msg or None – str query_params – dict

PyU4V.system

system.py.

class PyU4V.system.SystemFunctions(array_id, rest_client)[source]

Bases: object

SystemFunctions.

acknowledge_alert(alert_id)[source]

Acknowledges an alert.

Parameters:

alert_id – alert_id uniquely identifying alert on Unisphere system –str

Returns:

alert details – dict

change_local_user_password(username, current_password, new_password)[source]

Function to allow users to change password for local user accounts.

Requires minimum version of Unisphere 9.2.1.x and API account must have security admin role Change local user password. :param username: username for local account – str :param current_password: existing password for local account – str :param new_password: new password for local account – str

delete_alert(alert_id)[source]

Deletes Specified Alert.

Parameters:

alert_id – alert_id uniquely identifying alert on Unisphere system –str

delete_health_check(health_check_id, array_id=None)[source]

Delete a health check record.

Parameters:
  • health_check_id – health check id – str

  • array_id – array id – str

delete_snmp_trap_destination(snmp_id)[source]

Deletes specified SNMP trap receiver from configuration.

:param snmp_id unique identifier for snmp trap destination - str

download_all_settings(file_password, dir_path=None, file_name=None, array_id=None, return_binary=False)[source]

Download all settings.

Export settings feature allows the saving of a subset of system settings to a file. The exported settings have a generic format and do not contain any specific information regarding particular storage array or Unisphere instance, thus making it applicable in any environment.

The intention is to help users to port the system wide settings to another instance of Unisphere, and also to capture single array settings so that they can be applied to another storage array within single instance or another instance of Unisphere at any point of time.

  • All settings:
    • Unisphere settings:
      • Alert notifications

      • Performance metrics

      • Performance preferences

      • Performance user templates

    • System settings:
      • Alert policies

      • Alert level notifications

      • Performance thresholds

      • System thresholds

By default settings will be written to a zip file in the current working directory unless a supplied directory path and/or file name are provided. If any extension is provided in the file name it will be replaced with .zip before the data is written to file.

If instead the file writing process should be handled outside of PyU4V or uploaded directly to Unisphere without any file handling set return_binary to True. The response dict will have the settings binary data included in key ‘binary_data’.

Parameters:
  • file_password – password to sign file (required) – str

  • dir_path – file save location – str

  • file_name – zip file name – str

  • array_id – array id – str

  • return_binary – return settings binary data – bool

Returns:

download details – dict

download_audit_log_record(array_id=None, return_binary=False, dir_path=None, file_name=None, timeout=None)[source]

Download audit log record for the last week in PDF

Parameters:
  • array_id – array serial number – str

  • return_binary – return binary data instead of writing audit log record pdf to file – bool

  • dir_path – file write directory path – str

  • file_name – file name – str

  • timeout – timeout – int

Returns:

download details – dict

download_system_settings(file_password, dir_path=None, file_name=None, array_id=None, return_binary=False, exclude_alert_policy_settings=False, alert_level_notification_settings=False, exclude_system_threshold_settings=False, exclude_performance_threshold_settings=False)[source]

Export System settings.

  • System settings:
    • Alert policies

    • Alert level notifications

    • Performance thresholds

    • System thresholds

By default settings will be written to a zip file in the current working directory unless a supplied directory path and/or file name are provided. If any extension is provided in the file name it will be replaced with .zip before the data is written to file.

If instead the file writing process should be handled outside of PyU4V or uploaded directly to Unisphere without any file handling set return_binary to True. The response dict will have the settings binary data included in key ‘binary_data’.

Parameters:
  • file_password – password to sign file (required) – str

  • dir_path – file save location – str

  • file_name – zip file name – str

  • array_id – array id – str

  • return_binary – return settings binary data – bool

  • exclude_alert_policy_settings – exclude alert policy settings – bool

  • alert_level_notification_settings – exclude alert level notification settings – bool

  • exclude_system_threshold_settings – exclude system threshold settings – bool

  • exclude_performance_threshold_settings – exclude performance threshold settings – bool

Returns:

export details – dict

download_unisphere_settings(file_password, dir_path=None, file_name=None, return_binary=False, exclude_alert_notification_settings=False, exclude_performance_preference_settings=False, exclude_performance_user_templates=False, exclude_performance_metric_settings=False)[source]

Download Unisphere settings.

  • Unisphere settings:
    • Alert notifications

    • Performance metrics

    • Performance preferences

    • Performance user templates

By default settings will be written to a zip file in the current working directory unless a supplied directory path and/or file name are provided. If any extension is provided in the file name it will be replaced with .zip before the data is written to file.

If instead the file writing process should be handled outside of PyU4V or uploaded directly to Unisphere without any file handling set return_binary to True. The response dict will have the settings binary data included in key ‘binary_data’.

Parameters:
  • file_password – password to sign file (required) – str

  • dir_path – file save location – str

  • file_name – zip file name – str

  • return_binary – return settings binary data – bool

  • exclude_alert_notification_settings – exclude alert notification settings – bool

  • exclude_performance_preference_settings – exclude performance preference settings – bool

  • exclude_performance_user_templates – exclude performance user templates – bool

  • exclude_performance_metric_settings – exclude performance metric settings

Returns:

download details – dict

get_alert_details(alert_id)[source]

Gets the details of an alert.

Parameters:

alert_id – alert_id uniquely identifying alert on Unisphere system – str

Returns:

alert details – dict

get_alert_ids(array=None, _type=None, severity=None, state=None, created_date=None, _object=None, object_type=None, acknowledged=False, description=None)[source]

Get a list of Alert Ids.

Parameters for this function can be combined to create a search pattern based on multiple filters to target results.

Parameters:
  • array – filters returned list to display Alert Ids that are associated with the specified array e.g. “000213234443” or “<like>443” – str

  • _type – filters returned list to display Alert Ids that has the following type: ARRAY, PERFORMANCE, SERVER

  • severity – filters returned list to display only Alert Ids with specified severity: NORMAL, INFORMATION, MINOR, WARNING, CRITICAL, FATAL – str

  • state – filters returned list to display Alert Ids that has the following state: NEW, ACKNOWLEDGED, CLEARED – str

  • created_date – filters returned list to display Alert Ids that are greater than(“>1”), Less than(“<1”) or equal to the specified created_date “MMM-dd-yyyy HH:mm:ss.SSS” – str

  • _object – filters returned list to display Alert Ids that are associated with the specified array object e.g. equal to “object=SRP_3” – str

  • object_type – filters returned list to display Alert Ids that are associated with the specified array object type e.g. equal to “object_type=Director” – str

  • acknowledged – filters returned list to display Alert Ids that are acknowledged or not – bool

  • description – filters returned list to contain text matching description in body – str

Returns:

list of alert ids – list

get_alert_summary()[source]

Gets Alert Summary information.

Returns:

summary of alerts on system - dict

get_any_director_port(director, filters=None)[source]

Get a non-GuestOS port from a director.

Parameters:
  • director – director to search for ports with – str

  • filters – filters to apply when search for port – str

Returns:

port – int

get_audit_log_list(start_time, end_time, array_id=None, user_name=None, host_name=None, client_host=None, message=None, record_id=None, activity_id=None, application_id=None, application_version=None, task_id=None, process_id=None, vendor_id=None, os_type=None, os_revision=None, api_library=None, api_version=None, audit_class=None, action_code=None, function_class=None)[source]

Get a list of audit logs from Unisphere between start and end date.

Retrieve a list of audit logs from Unisphere, it is possible to filter this list through the input parameters. Due to the potential to return large amounts of results both start and end time are required.

Parameters:
  • start_time – timestamp in milliseconds since epoch – int

  • end_time – timestamp in milliseconds since epoch – int

  • array_id – array serial number – str

  • user_name – Optional value that filters returned list to display Audit Log Entries that contain the specified username only – str

  • host_name – Optional value that filters returned list to display Audit Log Entries that contain the specified host_name only – str

  • client_host – Optional value that filters returned list to display Audit Log Entries that contain the specified client_host only – str

  • message – Optional value that filters returned list to display Audit Log Entries that contain the specified message only – str

  • record_id – Optional value that filters returned list to display Audit Log Entries that have a matching record_id – int

  • activity_id – Optional value that filters returned list to display Audit Log Entries that contain the specified activity_id only – str

  • application_id – Optional value that filters returned list to display Audit Log Entries that contain the specified application_id only – str

  • application_version – Optional value that filters returned list to display Audit Log Entries that contain the specified application_version only – str

  • task_id – Optional value that filters returned list to display Audit Log Entries that contain the specified task_id only – str

  • process_id – Optional value that filters returned list to display Audit Log Entries that contain the specified process_id only – str

  • vendor_id – Optional value that filters returned list to display Audit Log Entries that contain the specified vendor_id only – str

  • os_type – Optional value that filters returned list to display Audit Log Entries that contain the specified os_type only – str

  • os_revision – Optional value that filters returned list to display Audit Log Entries that contain the specified os_revision only – str

  • api_library – Optional value that filters returned list to display Audit Log Entries that contain the specified api_library only – str

  • api_version – Optional value that filters returned list to display Audit Log Entries that contain the specified api_version only – str

  • audit_class – Optional value that filters returned list to display Audit Log Entries that contain the specified audit_class only – str

  • action_code – Optional value that filters returned list to display Audit Log Entries that contain the specified action_code only – str

  • function_class – Optional value that filters returned list to display Audit Log Entries that contain the specified function_class only – str

Returns:

audit logs – list

get_audit_log_record(record_id, array_id=None)[source]

Get audit log details for a specific record.

Parameters:
  • record_id – audit log record id – int

  • array_id – array serial number – str

Returns:

audit log record details – dict

get_director(director)[source]

Query for details of a director for a symmetrix.

Parameters:

director – the director ID e.g. FA-1D – str

Returns:

director details – dict

get_director_list(array_id=None, iscsi_only=False)[source]

Get a list of directors for a given array.

Parameters:
  • array_id – array serial number – str

  • iscsi_only – return only iSCSI directors – bool

Returns:

iSCSI directors – list

get_director_port(director, port_no)[source]

Get details of the symmetrix director port.

Parameters:
  • director – the director ID e.g. FA-1D – str

  • port_no – the port number e.g. 1 – str

Returns:

director port details – dict

get_director_port_list(director_id, array_id=None, filters=None)[source]

Get a list of director ports for a specified director.

Parameters:
  • director_id – director id – str

  • array_id – array id – str

  • filters – user inputted filters see documentation for details

Returns:

director ports – list

get_director_port_list_by_protocol_v4(directors, protocol='SCSI_FC')[source]

Get directors and ports for V4 by protocol.

In V4 the enabled_protocol can be one of NVMe_TCP SCSI_FC NVMe_FC RDF_FC iSCSI RDF_GigE

Parameters:
  • directors – directors – list

  • protocol – protocol – str

Returns:

port list

get_directory_port_iscsi_endpoint_list(director_id, iscsi_endpoint, array_id=None)[source]

Get a list of director ports for a specified director.

Parameters:
  • director_id – director id – str

  • iscsi_endpoint – if the port is an iSCSI target, applicable to front-end SE or OR directors only, default to not set – bool

  • array_id – array id – str

Returns:

director ports – list

get_disk_details(disk_id, array_id=None)[source]

Get details for specified disk id.

Parameters:
  • disk_id – disk id – str

  • array_id – array id – str

Returns:

disk details – dict

get_disk_id_list(array_id=None, failed=False)[source]

Get a list of disks ids installed.

Parameters:
  • array_id – array id – str

  • failed – if only failed disks should be returned – bool

Returns:

disk ids – list

get_fa_directors()[source]

Get all FA directors on the array.

Returns:

fa director strings – list

get_fc_director_port_list_v4(directors)[source]

Get FC directors and ports for V4.

In V4 the enabled_protocol = SCSI_FC

Parameters:

directors – directors – list

Returns:

port list

get_health_check_details(health_check_id, array_id=None)[source]

Gets details of individual health check.

Parameters:
  • health_check_id – health check id – str

  • array_id – array id – str

Returns:

health check details – dict

get_ip_interface(director_id, port_id, interface_id, array_id=None)[source]

Get IP interface details

Parameters:
  • director_id – director id – str

  • port_id – port id – str

  • interface_id – interface id – str

  • array_id – array id – str

Returns:

IP interface details – dict

get_ip_interface_list(director_id, port_id, array_id=None)[source]

Get a list of IP interfaces for a given array.

Parameters:
  • director_id – director id – str

  • port_id – port id – str

  • array_id – array id – str

Returns:

IP interfaces – list

get_iscsi_director_port_list_v4(directors)[source]

Get iSCSI directors and ports for V4.

In V4 the enabled_protocol = iSCSI

Parameters:

directors – directors – list

Returns:

port list

get_iscsi_ip_address_and_iqn(port_id)[source]

Get the ip addresses from the director port.

Parameters:

port_id – director port identifier – str

Returns:

ip addresses, iqn – list, str

get_management_server_resources()[source]

Get Details on Server Resources and REST Utilization.

returns: dictionary with details on server utilization –dict

get_nvme_director_port_list_v4(directors)[source]

Get NVMe directors and ports for V4.

In V4 the enabled_protocol = NVMe_FC :param directors: directors – list :returns: port list

get_or_directors()[source]

Get all OR directors on the array.

Returns:

or director strings – list

get_port_group(port_group_id)[source]

Get port group details.

Parameters:

port_group_id – name of the portgroup – str

Returns:

port group details – dict

get_port_identifier(director, port_no)[source]

Get the identifier (wwn) of the physical port.

Parameters:
  • director – the id of the director – str

  • port_no – the number of the port – str

Returns:

wwn (FC) or iqn (iscsi) – str or None

get_rdf_director_port_list_v4(directors)[source]

Get RDF directors and ports for V4.

In V4 the enabled_protocol = RDF_FC

Parameters:

directors – directors – list

Returns:

port list

get_rdf_gige_director_port_list_v4(directors)[source]

Get RDF GIGE directors and ports for V4.

In V4 the enabled_protocol = RDF_GigE

Parameters:

directors – directors – list

Returns:

port list

get_server_logging_level()[source]

Get Server logging level for Unisphere Server. returns: dict

get_snmp_trap_configuration()[source]

Returns the details of SNMP Trap Receivers.

:returns SNMP configuration information–dict

get_system_health(array_id=None)[source]

Query for system health information.

Parameters:

array_id – array id – str

Returns:

system health – dict

get_tagged_objects(tag_name)[source]

Get a list of objects with specified tag.

Parameters:

tag_name – tag name – str

Returns:

tags – list

get_tags(array_id=None, tag_name=None, storage_group_id=None, num_of_storage_groups=None, num_of_arrays=None)[source]

Query for a list of tag names.

The input parameters represent optional filters for the tag query, including any filters will apply that filter to the list of returned tags.

Parameters:
  • array_id – filter by array id – str

  • tag_name – filter by tag name – str

  • storage_group_id – filter by storage group id – str

  • num_of_storage_groups – filter by tags that are in x or greater amount of storage groups – int

  • num_of_arrays – filter by tags that in y or greater amount of arrays – int

Returns:

tags – list

get_target_wwns_from_port_group(port_group_id)[source]

Get the director ports’ WWNs.

Parameters:

port_group_id – the name of the port group – str

Returns:

target_wwns – target wwns for the port group – list

list_system_health_check(array_id=None)[source]

List previously run system health checks.

Parameters:

array_id – array id – str

Returns:

system health checks – list

perform_health_check(array_id=None, description=None)[source]

Initiate a environmental health check.

Parameters:
  • array_id – array id – str

  • description – description for health check, if not set this will default to ‘PyU4V-array_id-date-time’ – str

Returns:

health check property details – dict

refresh_array_details(array_id=None)[source]

Refresh Unisphere object model for specified array with latest configuration information.

Note, the usage of this call is restricted to run once every 5 minutes to avoid excessive usage. Usage if changes have been made from another Unipshere instance this call can be run to ensure systems are in sync.

Parameters:

array_id – The storage array ID – string

returns: None or Status Code 429 with message

set_director_port_online(director, port_no, port_online)[source]

Set Director Port online or offline.

Parameters:
  • director – the director ID e.g. FA-1D – str

  • port_no – the port number e.g. 1 – str

  • port_online – True will attempt to online port, false will offline port – bool

Returns:

director port details – dict

set_port_protocol(director, port_number, protocol, enable=True, array_id=None, _async=None)[source]

Enable or disable protocol on OR director ports.

Parameters:
  • director – Director Id e.g. OR-1C – str

  • port_number – Director Port Number – int

  • protocol

  • enable

  • array_id

Returns:

set_server_logging_level(server_log_level='WARN', restapi_logging_enabled=False)[source]

Get Server logging level for Unisphere Server. :param server_log_level - INFO, WARN, DEBUG – string :param restapi_logging_enabled - bool returns: dict

set_snmp_trap_destination(name, port, username=None, password=None, passphrase=None)[source]

Add new SNMP trap receiver to configuration.

Parameters:
  • name – Ipdaddress or DNS Name – str

  • port – port SNMP server recieves trap on –int

  • username – Username for SNMP v3Username for SNMP v3 –str

  • password – Password for SNMP v3 –str

  • passphrase – Passphrase for SNMP v3 –str

Returns:

update_snmp_trap_destination(snmp_id, name=None, port=None, username=None, password=None, passphrase=None)[source]

Update existing SNMP configuration item.

Parameters:
  • snmp_id – an id generated for a specific SNMP trap, use get_snmp_trap_configuration to find values – str

  • name – New IP address/hostname for the SNMP trap – str

  • port – New port number for the SNMP trap –str

  • username – Updated username for the SNMP trap –str

  • password – Updated password for SNMP trap –str

  • passphrase – Updated passphrase for SNMP trap –str

Returns:

dict

upload_settings(file_password, file_path=None, array_id=None, binary_data=None)[source]

Upload Unisphere and/or system settings to Unisphere.

Allows for importing a zip file or binary data that contains settings that were previously exported from Unisphere.

The settings that a file upload may include are:

  • All settings:
    • Unisphere settings:
      • Alert notifications

      • Performance metrics

      • Performance preferences

      • Performance user templates

    • System settings:
      • Alert policies

      • Alert level notifications

      • Performance thresholds

      • System thresholds

A password that was specified during export needs to be provided during import operation. This is to assure that the imported file has not been tampered with.

It is possible to upload system settings for more than one array, to do so pass a list of array IDs in to array_id input parameter. For Unisphere settings an array ID is not required.

Parameters:
  • file_password – password that file has been signed with – str

  • file_path – full file location – str

  • array_id – array id – str

  • binary_data – binary settings data – bytes

Returns:

upload details – dict

PyU4V.serviceability

serviceability.py.

class PyU4V.serviceability.ServiceabilityFunctions(array_id, rest_client)[source]

Bases: object

download_grab_files(array_id=None, node_name='Unisphere', return_binary=False, dir_path=None, file_name=None, timeout=None)[source]

Download serviceability logs

Parameters:
  • array_id – array serial number – str

  • node_name – Node name. Allowable values are Unisphere, Vasa0, Vasa1, Vasadb, Semgmt0, Semgmt1 – str

  • return_binary – return binary data instead of writing audit log record pdf to file – bool

  • dir_path – file write directory path, eg. “.” will write to script execution directory – str

  • file_name – file name, file exension .tar.gz will be applied by the function – str

  • timeout – timeout, recommend setting a long timeout value as grab file generation can take some time, e.g. 1000 – int

Returns:

download details – dict

get_application(array_id=None)[source]

Get a list of all embedded applications running on the array.

Parameters:

array_id – array id – str

Returns:

ApplicationInformation – dict

get_ip_configuration(array_id=None)[source]

Get current IPv4 information of U4P, VASA and SE and IPv6 information of U4P and SE.

Parameters:

array_id – array id – str

Returns:

IPInformation – dict

get_local_system()[source]

Get local powermax system serial number in the embedded environment with version v4 or higher. :returns: symmetrix id – dict

get_ntp_settings(array_id=None)[source]

Get current NTP server configuration.

Parameters:

array_id – array id – str

Returns:

ntp server – dict

get_solutions_enabler_application(array_id=None)[source]

Get a list of information on each SE node and get the access Id, this function also returns se_nethost configuration for client server access.

Parameters:

array_id – array id – str

Returns:

SEInformation – dict

get_solutions_enabler_configuration(array_id=None)[source]

Get SE base configuration values that are available in SE settings.

Parameters:

array_id – array id – str

Returns:

SEConfigInformation – dict

get_symavoid_settings(array_id=None)[source]

Get a list of available symmetrix and symavoid symmetrix.

Parameters:

array_id – array id – str

Returns:

UnisphereInformation – dict

get_unisphere_application_details(array_id=None)[source]

Get a list of information about Unisphere node. Get the access Id along with Unisphere server access.

Parameters:

array_id – array id – str

Returns:

UnisphereInformation – dict

get_unisphere_configuration(array_id=None)[source]

Get Unisphere configuration information.

Parameters:

array_id – array id – str

Returns:

ConfigArray – dict

import_custom_certificate(array_id=None, node_name=None, keyfile=None, certfile=None, trustfile=None)[source]

Import custom certificate.

Parameters:
  • array_id – array id – str

  • node_name – Specify the node name (Semgmt0/Semgmt1) for which this certificate is imported. – str

  • keyfile – Path to alternate key file all_key.pem. – str

  • certfile – Path to alternate certificate file all.pem. – str

  • trustfile – Path to alternate trust certificate file trust.pem. – str

Returns:

SECertificateInfo – dict

modify_nethosts(action, host_name, user, array_id=None)[source]

Add or remove user and host to nethosts file for client server configuration.

Current configuration can be checked with get_solutions_enabler_application() function

Parameters:
  • action – add or remove - str

  • host_name – name or ip of host to be added/rmoved to/from nethost file – str

  • user – username to be granted access – str

  • array_id – array_id – str

Returns:

net host configuration – dict

modify_ntp_settings(ntp_server, array_id=None)[source]

Set a new NTP server information.

This call will restart SMAS Service so Unisphere and REST will be unavailable while the configuration change takes effect please do not attempt any other calls until this has completed and changes have been verified.

Parameters:
  • ntp_server – ntp server URL –str

  • array_id – array id –str

Returns:

ntp server – dict

modify_solutions_enabler_configuration(array_id=None, allow_symforce=None, use_access_id=None)[source]

set SE configuration values.

Parameters:
  • array_id – array id – str

  • allow_symforce – Indicates whether users can specify -symforce when performing RDF control operations. The allowable values for this option are TRUE and FALSE. The default setting is FALSE. Changing this value requires unisphere to be restarted before it will take effect in the UI –bool

  • use_access_id – This option applies to Symmetrix Access Control. It specifies whether to use the access ID generated on client or server. Used only on the server side during client/server operations. Possible values are: CLIENT: The client access ID is used for every command performed. If a client access ID is not available the command will fail. SERVER: The server access ID is used for every command performed. ANY: If the client access ID is available it is used for every command performed. If it is not available then the server access ID is used. The default setting is SERVER. –str

Returns:

ConfigArray – dict

modify_unisphere_service_access(action, array_id=None)[source]

Enables Unisphere server access for remote support assistance.

Parameters:

action – Unisphere server access options such as AllowServerAccess and BlockServerAccess –str

Returns:

ntp server – dict

replace_self_signed_certificate(array_id=None, node_name=None)[source]

Replace SE Management Self signed certificate.

Parameters:
  • array_id – array id – str

  • node_name – Specify the node name (Semgmt0/Semgmt1) for which this self-signed certificate is created. – str

restart_unisphere_application(array_id=None)[source]

Restart the Unisphere server.

Please do not attempt any other calls until this has completed and changes have been verified.

Parameters:

array_id – array id –str

Returns:

will not return as Unisphere server restarts.

update_ip_configuration(array_id=None, action=None, natone_ip_address=None, natone_netmask=None, natone_gateway=None, nattwo_ip_address=None, nattwo_netmask=None, nattwo_gateway=None)[source]

Set new IPv4 information of U4P, VASA and SE. and set new IPv6 information of U4P and SE.

During the NAT IP PUT operation, the existing Unisphere/REST server will restart and with New IP address.

Please do not attempt any other calls until this has completed and changes have been verified.

Parameters:
  • array_id – array id – str

  • action – update Options to modify (UpdateIPV4 or UpdateIPV6) – str

  • natone_ip_address – primary ip address for unisphere instance connecting to port on node 1 of array either IPV4 or IPV6 – str

  • natone_netmask – netmask for natone ip address – str

  • natone_gateway – gateway for natone ip address IPv4 or IPv6 – str

  • nattwo_ip_address – secondary ip address for unisphere instance connecting to port on node 2 of array either IPV4 or IPV6 – str

  • nattwo_netmask – netmask for secondary IP connection either IPV4 or IPV6 – str

  • nattwo_gateway – gateway for secondary IP connection either IPV4 or IPV6 – str

Returns:

IPInformation – dict

update_symavoid_settings(array_id=None, action=None, symm_list=None)[source]

Add to symavoid list or remove a symmetrix from the symavoid list

Parameters:
  • array_id – array id – str

  • action – AddToSymmavoid or RemoveFromSymmavoid, case sensitive – str

  • symm_list – list of symms – list

Returns:

IPInformation – dict

PyU4V.clone

clone.py.

class PyU4V.clone.CloneFunctions(array_id, rest_client)[source]

Bases: object

Clone Functions.

create_clone(storage_group_id, target_storage_group_id, consistent=True, establish_terminate=False, array_id=None, force=False, star=False, skip=False)[source]

Create Clone.

Parameters:
  • storage_group_id – The Storage Group ID – string

  • consistent – creates the clone crash consistent using ECA technology – bool

  • establish_terminate – creates the clone and immediately terminates, very useful if you want to make an independent copy available immediately but don’t intend to use for restore purposes – bool

  • array_id – The storage array ID – string

  • target_storage_group_id – name of storage group to contain clone devices – string

  • force – Attempts to force the operation even though one or more volumes may not be in the normal, expected state(s) for the specified operation – bool

  • star – Acknowledge the volumes are in an SRDF/Star configuration – bool

  • skip – Skips the source locks action – bool

Returns:

dict

establish_clone(storage_group_id, target_storage_group_id, array_id=None, consistent=True, not_ready=False, vse=False, force=False, star=False, skip=False, _async=False)[source]

Perform establish against a clone storage group.

Parameters:
  • storage_group_id – The Storage Group ID – string

  • target_storage_group_id – name of storage group to contain clone devices – string

  • array_id – The storage array ID – string

  • consistent – creates the clone crash consistent using ECA technology – bool

  • not_ready – sets target storage group to not ready following establish operation – bool

  • vse – uses VSE close – bool

  • force – Attempts to force the operation even though one or more volumes may not be in the normal, expected state(s) for the specified operation – bool

  • star – Acknowledge the volumes are in an SRDF/Star configuration – bool

  • skip – Skips the source locks action – bool

  • _async – if call should be async – bool

Returns:

dict

get_clone_pairs_list(storage_group_id, array_id=None)[source]

Get Clone Pairs List. :param: array_id The storage array ID – string :param: storage_group_id The Storage Group ID – string :returns: count and list of clone pairs – dict

get_clone_storage_group_pair_details(storage_group_id, target_storage_group_id, array_id=None)[source]

Get Clone storage group pair details.

:param storage_group_id The Storage Group ID – string :param target_storage_group_id The Target Storage Group ID – string :param array_id The storage array ID – string

get_clone_target_storage_group_list(storage_group_id, array_id=None, target_storage_group=None, target_storage_group_volume_count=None, volume_pair_count=None, state=None, modified_tracks=None, src_protected_tracks=None, src_modified_tracks=None, background_copy=None, differential=None, precopy=None, vse=None)[source]

Get Clone target storage group list.

Parameters:
  • storage_group_id – The Storage Group ID – string

  • array_id – The storage array ID – string

  • target_storage_group – Value that filters returned list to include target storage groups equal to or like the provided name – string

  • target_storage_group_volume_count – Value that filters returned list to include target storage groups with the specified number of volumes – string

  • volume_pair_count – Value that filters returned list to include target storage groups with the specified number of volume pairs – string

  • state – Value that filters returned list to include target storage groups with pairs in the specified states – array

  • modified_tracks – Value that filters returned list to include target storage groups with the specified modified tracks – string

  • src_protected_tracks – Value that filters returned list to include target storage groups with the specified src protected tracks – str

  • src_modified_tracks – Value that filters returned list to include target storage groups with the specified src modified tracks – string

  • background_copy – Value that filters returned list to include target storage groups with background copy flag – boolean

  • differential – Value that filters returned list to include target storage groups with differential flag – boolean

  • precopy – Value that filters returned list to include target storage groups with the precopy flag – boolean

  • vse – Value that filters returned list to include target storage groups with the vse – boolean

Returns:

a list of target storage groups – list

restore_clone(storage_group_id, target_storage_group_id, array_id=None, star=False, force=False, _async=False)[source]

Perform split actions against a clone storage group that is in the restored state.

Parameters:
  • storage_group_id – The Storage Group ID – string

  • target_storage_group_id – The Storage Group ID of Target storage group – string

  • array_id – The storage array ID – string

  • force – Attempts to force the operation even though one or more volumes may not be in the normal, expected state(s) for the specified operation – bool

  • star – Acknowledge the volumes are in an SRDF/Star configuration – bool

  • _async – if call should be async – bool

Returns:

dict

split_clone(storage_group_id, target_storage_group_id, array_id=None, star=False, skip=False, force=False, _async=False)[source]

Perform split actions against a clone storage group that is in the restored state.

Parameters:
  • storage_group_id – The Storage Group ID – string

  • target_storage_group_id – The Storage Group ID of Target storage group – string

  • star – Acknowledge the volumes are in an SRDF/Star configuration – bool

  • skip – Skips the source locks action – bool

  • force – Attempts to force the operation even though one or more volumes may not be in the normal, expected state(s) for the specified operation – bool

  • array_id – The storage array ID – string

  • _async – if call should be async – bool

Returns:

dict

terminate_clone(storage_group_id, target_storage_group_id=None, array_id=None, force=False, symforce=False, star=False, skip=False, not_ready=False, restored=None)[source]

Terminate Clone Session.

Parameters:
  • array_id – The storage array ID – string

  • storage_group_id – The Storage Group ID – string

  • target_storage_group_id – name of storage group to contain clone devices – string

  • force – Attempts to force the operation even though one or more volumes may not be in the normal, expected state(s) for the specified operation – bool

  • star – Acknowledge the volumes are in an SRDF/Star configuration – bool

  • skip – Skips the source locks action – bool

  • not_ready – sets clone devices to not ready after operation – bool

  • restored – removes the restore flag from clone session, leaves clone session intact for incremental clone operations. Used following restore session – bool

Returns:

dict

PyU4V.volumes

volumes.py.

class PyU4V.volumes.VolumesFunctions(array_id, rest_client)[source]

Bases: object

Enhanced Functions for retrieving Array Configuration Data.

get_volumes_details(array_id=None, filters=None, select=None, exclude=None)[source]

Get list of volumes from array with selected parameters.

Parameters:
  • array_id – The storage array ID – string

  • filters – filter parameters, used to narrow down the result list, filters can be any of the volume attributes, and operators vary depending on type, ‘eq’,’ne’,’gt’,’ge’,’lt’,’le’, equal, not equal, greater than, greater than or equal, less than, less than or equal, additional operators are ‘like’,’ilike’ for string match, or case in-sensitive string match, example filters=[‘num_of_storage_groups eq 1’, ‘identifier ilike findme’] – list

  • select – selection of attributes to be in return, attributes can be listed using get_volumes_meta_data function If none selected base set of top level attributes are returned, by default API will only return id, to achieve this pass a list with empty string [‘’], to extend the list of attributes returned to include second level attributes you can pass along with list from get_volumes_meta_data() e.g. select=api.volumes.get_volumes_meta_data() + [‘snapshots.name’] – list

  • exclude – list of attributes to exclude, by default rdf_infos and snapshot details have been excluded as these can extend the running of the API call, to override simply pass an empty list or specify a list of attribute names that you want to exclude from the return, if values are passed in by select exclude is ignored – list

Returns:

dict

get_volumes_meta_data()[source]

Get details on available meta data.

Returns:

dictionary with list of attributes and descriptions of attribute types – dict

PyU4V.storage_groups

storage_groups.py.

class PyU4V.storage_groups.StorageGroupsFunctions(array_id, rest_client)[source]

Bases: object

Enhanced Functions for retrieving Array Configuration Data.

get_storage_groups_details(array_id=None, filters=None, select=None, exclude=None)[source]

Get list of storage_groups from array with selected parameters.

Parameters:
  • array_id – The storage array ID – string

  • filters – filter parameters, used to narrow down the result list, filters can be any of the storage_groups attributes and operators vary depending on type, ‘eq’,’ne’,’gt’,’ge’,’lt’,’le’, equal, not equal, greater than, greater than or equal, less than, less than or equal, additional operators are ‘like’,’ilike’ for string match, or case in-sensitive string match, example filters=[‘id ilike gk’, ‘num_of_volumes eq 32’] – list

  • select – selection of attributes to be in return, attributes can be listed using get_storage_groups_meta_data function e.g. [‘volumes.wwn’,’volumes.effective_wwn’, ‘type’, ‘effective_used_capacity_gb’] If none selected base set of top level attributes are returned, by default API will only return id, to achieve this pass a list with empty string [‘’] – list

  • exclude – list of attributes to exclude, by default rdf_infos and snapshot details have been excluded as these can extend the running of the API call, to override simply pass an empty list or specify a list of attribute names that you want to exclude from the return, , if values are passed in by select exclude is ignored – list

get_storage_groups_meta_data()[source]

Get details on available meta data for storage group objects.

returns: dictionary with list of attributes and descriptions of

attribute types – dict

PyU4V.performance_enhanced

performance_enhanced.py.

class PyU4V.performance_enhanced.EnhancedPerformanceFunctions(array_id, rest_client)[source]

Bases: object

Enhanced Functions for retrieving latest diagnostic level performance Metrics.

get_all_performance_metrics_for_system(array_id=None)[source]

Get latest data for all KPI metrics.

Parameters:

array_id – 12 Digit Serial Number of Array – int

Returns:

data for all available categories for the specified PowerMax Array diagnostic level metrics only, 5 min interval – dict

get_category_metrics(category, array_id=None)[source]

Get latest data for KPI metrics for specificied performance category.

Parameters:

array_id – 12 Digit Serial Number of Array – int

Returns:

full list of all KPI metrics for latest diagnostic timestamp for the specified array and performance category – dict

get_performance_categories_list(array_id=None)[source]

Get a list of performance categories and metrics that will be returned for each category.

Parameters:

array_id – 12 Digit Serial Number of Array – int

Returns:

a list of categories available for querying, returned list has dictionary of category represented by ‘id’ key and ‘metrics’ key detailing what will be returned for the given array represented by ‘system’ key – list

PyU4V.workload_planner

workload_planner.py.

class PyU4V.workload_planner.WLPFunctions(array_id, rest_client)[source]

Bases: object

get_capabilities(**kwargs)
get_headroom(**kwargs)
get_wlp_information(**kwargs)

PyU4V.utils

__init__.py.