PyU4V API

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='91', interval=5, retries=200, array_id=None, application_type=None, remote_array=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.

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 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
static create_list_from_file(*args, **kwargs)
create_resource(*args, **kwargs)[source]

Create a resource.

Parameters:kwargs – param version: Unisphere version – int param no_version: if versionless uri – bool param category: resource category e.g. sloprovisioning – str param resource_level: resource level e.g. storagegroup – str param resource_level_id: resource level id – str param resource_type: optional name of resource – str param resource_type_id: optional name of resource – str param resource: optional name of resource – str param resource_id: optional name of resource – str param object_type: optional name of resource – str param object_type_id: optional name of resource – str param payload: query parameters – dict
Returns:resource object – dict
delete_resource(*args, **kwargs)[source]

Delete a resource.

Parameters:kwargs – param version: Unisphere version – int param no_version: if versionless uri – bool param category: resource category e.g. sloprovisioning – str param resource_level: resource level e.g. storagegroup – str param resource_level_id: resource level id – str param resource_type: optional name of resource – str param resource_type_id: optional name of resource – str param resource: optional name of resource – str param resource_id: optional name of resource – str param object_type: optional name of resource – str param object_type_id: optional name of resource – str param payload: query parameters
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_headroom(**kwargs)
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.

Parameters:kwargs – param version: Unisphere version – int param no_version: if versionless uri – bool param category: resource category e.g. sloprovisioning – str param resource_level: resource level e.g. storagegroup – str param resource_level_id: resource level id – str param resource_type: optional name of resource – str param resource_type_id: optional name of resource – str param resource: optional name of resource – str param resource_id: optional name of resource – str param object_type: optional name of resource – str param object_type_id: optional name of resource – str param 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. “V9.1.0.2”, “91” – str, str
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
get_wlp_information(**kwargs)
modify_resource(*args, **kwargs)[source]

Modify a resource.

Parameters:kwargs – param version: Unisphere version – int param no_version: if versionless uri – bool param category: resource category e.g. sloprovisioning – str param resource_level: resource level e.g. storagegroup – str param resource_level_id: resource level id – str param resource_type: optional name of resource – str param resource_type_id: optional name of resource – str param resource: optional name of resource – str param resource_id: optional name of resource – str param object_type: optional name of resource – str param object_type_id: optional name of resource – str param payload: query parameters
Returns:resource object – dict
static read_csv_values(*args, **kwargs)
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.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()[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()[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.

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)[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
get_all_fe_director_metrics(**kwargs)
get_array_keys()[source]

List Arrays registered for performance data collection.

Returns:Arrays with first and last available dates – list
get_array_metrics(**kwargs)
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_core_keys(array_id=None)[source]

List cores for the given array.

Parameters:array_id – array id – str
Returns:core info with first and last available dates – list
get_core_stats(core_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given core.

Parameters:
  • core_id – core 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_database_keys(array_id=None)[source]

List databases for the given array.

Parameters:array_id – array id – str
Returns:database info with first and last available dates – list
get_database_stats(database_id, metrics, array_id=None, data_format='Average', start_time=None, end_time=None, recency=None)[source]

List time range performance data for given database.

Parameters:
  • database_id – database 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_director_info(**kwargs)
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_disk_keys(array_id=None)[source]

List disks for the given array.

Parameters:array_id – array id – str
Returns:disk info with first and last available dates – list
get_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 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_disk_technology_pool_keys(array_id=None)[source]

List disk technology pools for the given array.

Parameters:array_id – array id – str
Returns:disk technology pool info with first and last available dates – list
get_disk_technology_pool_stats(disk_tech_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 technology.

Parameters:
  • disk_tech_id – disk technology 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_external_director_keys(array_id=None)[source]

List external directors for the given array.

Parameters:array_id – array id – str
Returns:external directors with first and last available dates – list
get_external_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 external 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_external_disk_group_keys(array_id=None)[source]

List external disk groups for the given array.

Parameters:array_id – array id – str
Returns:external disk groups with first and last available dates – list
get_external_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 external 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_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_fe_director_list(**kwargs)
get_fe_director_metrics(**kwargs)
get_fe_port_list(**kwargs)
get_fe_port_metrics(**kwargs)
get_fe_port_util_last4hrs(**kwargs)
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_metrics(**kwargs)
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_by_port_keys(array_id=None, start_time=None, end_time=None)[source]

List active initiators by port 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_by_port_stats(initiator_by_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 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_by_port_id – initiator by 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_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(array_id=None)[source]

List iSCSI targets for the given array.

Parameters:array_id – array_id: array id – str
Returns:iSCSI interfaces info with first and last available dates – list
get_iscsi_target_stats(iscsi_target_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:
  • iscsi_target_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_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_perf_category_threshold_settings(**kwargs)
get_perf_threshold_categories(**kwargs)
static get_performance_categories_list()[source]

Get the list of supported performance categories.

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

static get_performance_metrics_list(category, kpi_only=False)[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
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_metrics(**kwargs)
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_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_by_pool_keys(storage_group_id, array_id=None, start_time=None, end_time=None)[source]

List storage groups by thin pool for the given array by time range.

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

Parameters:
  • storage_group_id – storage group id – str
  • array_id – array id – str
  • start_time – timestamp in milliseconds since epoch – str
  • end_time – timestamp in milliseconds since epoch – str
Returns:

pool info with first and last available dates – list

get_storage_group_by_pool_stats(storage_group_id, 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 storage group by pool.

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

Parameters:
  • storage_group_id – storage group id – str
  • pool_id – 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_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_metrics(**kwargs)
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_by_pool_keys(storage_container_id, storage_resource_id, array_id=None, start_time=None, end_time=None)[source]

List storage resource by pool for the given array by time range.

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

Parameters:
  • storage_container_id – storage container id – str
  • storage_resource_id – storage resource id – str
  • array_id – array id – str
  • start_time – timestamp in milliseconds since epoch – str
  • end_time – timestamp in milliseconds since epoch – str
Returns:

pool info with first and last available dates – list

get_storage_resource_by_pool_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.

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

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_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()[source]

Get a list of performance threshold categories.

Returns:performance threshold categories – list
get_threshold_category_settings(category)[source]

Get performance threshold category settings.

Parameters:category – category id – 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

is_array_performance_registered(array_id=None)[source]

Check if an array is registered for diagnostic performance data.

This will return False is an array is registered for real-time data but not for diagnostic performance data.

Parameters:array_id – array id – str
Returns: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_perf_threshold_and_alert(**kwargs)
set_perfthresholds_csv(**kwargs)
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

static validate_category(category)[source]

Check that a supplied category is valid.

Raises:InvalidInputException

PyU4V.provisioning

provisioning.py.

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

Bases: object

ProvisioningFunctions.

add_child_sg_to_parent_sg(**kwargs)
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_vol_to_sg(**kwargs)
add_existing_volume_to_storage_group(storage_group_id, vol_ids, _async=False)[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
Returns:

storage group details – dict

add_new_vol_to_storagegroup(**kwargs)
add_new_volume_to_storage_group(storage_group_id, num_vols, vol_size, cap_unit, _async=False, vol_name=None, create_new_volumes=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
Returns:

storage group details – dict

create_empty_sg(**kwargs)
create_empty_storage_group(srp_id, storage_group_id, service_level, workload, disable_compression=False, _async=False)[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
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_hostgroup(**kwargs)
create_masking_view_existing_components(port_group_name, masking_view_name, storage_group_name, host_name=None, host_group_name=None, _async=False)[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
Returns:

masking view details – dict

Raises:

InvalidInputException

create_multiport_port_group(port_group_id, ports)[source]

Create a new port group.

Parameters:
  • port_group_id – name of the new port group – str
  • ports – port dicts Example: [{‘directorId’: director_id, ‘portId’: port_id}] – list
Returns:

new port group details – dict

create_multiport_portgroup(**kwargs)
create_non_empty_storage_group(srp_id, storage_group_id, service_level, workload, num_vols, vol_size, cap_unit, disable_compression=False, _async=False)[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
Returns:

storage group details – dict

create_non_empty_storagegroup(**kwargs)
create_port_group(port_group_id, director_id, port_id)[source]

Create a new port group.

Parameters:
  • port_group_id – name of the new port group - str
  • director_id – director id – str
  • port_id – port id – str
Returns:

new port group details – dict

create_port_group_from_file(file_name, port_group_id)[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
Returns:

new port group details – dict

create_portgroup(**kwargs)
create_portgroup_from_file(**kwargs)
create_storage_group(srp_id, sg_id, slo, workload=None, do_disable_compression=False, num_vols=0, vol_size='0', cap_unit='GB', allocate_full=False, _async=False, vol_name=None)[source]

Create the volume in the specified storage group.

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 – str
  • 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
Returns:

storage group details – dict

create_volume_from_sg_return_dev_id(**kwargs)
create_volume_from_storage_group_return_id(volume_name, storage_group_id, vol_size, cap_unit='GB')[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
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_hostgroup(**kwargs)
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_portgroup(**kwargs)
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_storagegroup(**kwargs)
delete_volume(**kwargs)[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_vol(**kwargs)
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(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_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_wwn_as_list()[source]

Get an available initiator wwn string in a list.

Returns:single available initiator wwn – list
get_child_sg_from_parent(**kwargs)
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_common_masking_views(**kwargs)
get_compressibility_report(srp_id)[source]

Get a specified SRP Compressibility Report.

Parameters:srp_id – srp id – str
Returns:compressibility reports – list
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()[source]

Query for details of Symmetrix directors for a symmetrix.

Returns: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, filters=None)[source]

Get list of the ports on a particular director.

Can be filtered by optional parameters, please see documentation.

Parameters:
  • director – the director ID e.g. FA-1D – str
  • filters – optional filters - dict
Returns:

port key dicts – list

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()[source]

Get all FA directors on the array.

Returns:fa director strings – list
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_from_maskingview(**kwargs)
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_hostgroup(**kwargs)
get_hostgroup_list(**kwargs)
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(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_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_host(**kwargs)
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_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_maskingview_connections(**kwargs)
get_mv_from_sg(**kwargs)
get_mvs_from_host(**kwargs)
get_num_vols_in_sg(**kwargs)
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(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_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_portgroup(**kwargs)
get_portgroup_from_maskingview(**kwargs)
get_portgroup_list(**kwargs)
get_ports_from_pg(**kwargs)
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_slo(**kwargs)
get_slo_list(**kwargs)
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 – dict
Returns:storage groups – list
get_storagegroup_from_maskingview(**kwargs)
get_storagegroup_from_vol(**kwargs)
get_target_wwns_from_pg(**kwargs)
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
get_vol_effective_wwn_details_84(**kwargs)
get_vols_from_storagegroup(**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_sg_in_parent_sg(**kwargs)
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

is_volume_in_storagegroup(**kwargs)
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_hostgroup(**kwargs)
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_portgroup(**kwargs)
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_slo(**kwargs)
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_sg_from_parent_sg(**kwargs)
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_vol_from_storagegroup(**kwargs)
remove_volume_from_storage_group(storage_group_id, vol_id, _async=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
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)[source]

Rename a volume.

Parameters:
  • device_id – device id – str
  • new_name – new name for the volume – str
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

update_storagegroup_qos(**kwargs)

PyU4V.replication

replication.py.

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

Bases: object

ReplicationFunctions.

are_vols_rdf_paired(**kwargs)
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

choose_snapshot_from_list_in_console(**kwargs)
create_storage_group_snapshot(storage_group_id, snap_name, ttl=None, hours=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
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

create_storagegroup_snap(**kwargs)
create_storagegroup_srdf_pairings(**kwargs)
delete_storage_group_snapshot(storage_group_id, snap_name, gen=0)[source]

Delete the snapshot of a storage group.

Parameters:
  • storage_group_id – storage group id – str
  • snap_name – snapshot name – str
  • gen – snapshot generation number – int
delete_storage_group_srdf(storage_group_id, srdf_group_number=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
Returns:

storage group rdf details – dict

delete_storagegroup_snapshot(**kwargs)
delete_storagegroup_srdf(**kwargs)
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

establish_storagegroup_srdf(**kwargs)
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

failback_storagegroup_srdf(**kwargs)
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

failover_storagegroup_srdf(**kwargs)
find_expired_snapvx_snapshots()[source]

Find all expired snapvx snapshots.

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()[source]

Check what replication facilities are available.

Returns:replication capability details – dict
get_rdf_group(rdf_number)[source]

Get specific rdf group details.

Parameters:rdf_number – rdf group number – int
Returns:rdf group details – dict
get_rdf_group_list()[source]

Get rdf group list from array.

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_replication_enabled_storage_groups(has_snapshots=False, has_srdf=False)[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
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.

Parameters:
  • sg_id – storage group id – str
  • snap_name – snapshot name – str
  • gen_num – generation number – int
Returns:

snapshot generation details – dict

get_storage_group_rep(**kwargs)
get_storage_group_rep_list(**kwargs)
get_storage_group_replication_details(storage_group_id)[source]

Given a storage group id, return storage group srdf info.

Parameters:storage_group_id – storage group id – str
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.

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_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)[source]

Get the rdf group numbers for a storage group.

Parameters:storage_group_id – replicated storage group id – str
Returns:rdf group numbers – list
get_storagegroup_snapshot_generation_list(**kwargs)
get_storagegroup_snapshot_list(**kwargs)
get_storagegroup_srdf_details(**kwargs)
get_storagegroup_srdfg_list(**kwargs)
is_snapvx_licensed()[source]

Check if the snapVx feature is licensed and enabled.

Returns:bool
is_vol_in_rep_session(**kwargs)
is_volume_in_replication_session(device_id)[source]

Check if a volume is in a 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.

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

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)[source]

Modify a storage group snapshot.

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
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’, ‘Split’, ‘Suspend’, ‘Restore’, ‘Resume’, ‘Failover’, ‘Failback’, ‘Swap’, ‘SetBias’, and ‘SetMode’.

Parameters:
  • storage_group_id – storage group id – str
  • action – the rdf action –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

modify_storagegroup_snap(**kwargs)
modify_storagegroup_srdf(**kwargs)
rename_snapshot(sg_id, snap_name, new_name, gen_num=0)[source]

Rename an existing storage group snapshot.

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

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

Restore a storage group to its snapshot.

Parameters:
  • sg_id – storage group id – str
  • snap_name – snapshot name – str
  • gen_num – snapshot generation number – 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

suspend_storagegroup_srdf(**kwargs)

Unlink a snapshot from another storage group.

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

PyU4V.rest_requests

rest_requests.py.

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

Bases: object

RestRequests.

close_session()[source]

Close the current session.

establish_rest_session()[source]

Establish a REST session.

Returns:session – object
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.system

system.py.

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

Bases: object

SystemFunctions.

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
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_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_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

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’
Returns:

health check property details – dict

PyU4V.workload_planner

workload_planner.py.

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

Bases: object

get_headroom(array_id, workload=None, srp=None, slo=None)[source]

Get the Remaining Headroom Capacity.

Get the headroom capacity for a given srp/ slo/ workload combination.

Parameters:
  • array_id – array id – str
  • workload – the workload type – str
  • srp – storage resource pool id – str
  • slo – service level id – str
Returns:

headroom details – dict

get_wlp_information(array_id)[source]

Get the latest timestamp from WLP for processing New Workloads.

Parameters:array_id – array id – str
Returns:wlp details – dict