The cinder.volume.drivers.huawei.rest_client Module

class RestClient(configuration, san_address, san_user, san_password, **kwargs)

Bases: object

Common class for Huawei OceanStor storage system.

activate_deactivate_qos(qos_id, enablestatus)

Activate or deactivate QoS.

enablestatus: true (activate) enbalestatus: false (deactivate)

activate_snapshot(snapshot_id)
add_fc_port_to_host(host_id, wwn)

Add a FC port to the host.

add_host_to_hostgroup(host_id)

Associate host to hostgroup.

If hostgroup doesn’t exist, create one.

add_host_with_check(host_name, host_name_before_hash)
add_lun_to_cache(lun_id, cache_id)
add_lun_to_partition(lun_id, partition_id)
add_lun_to_qos(qos_id, lun_id, lun_list)

Add lun to QoS.

add_metro_to_metrogroup(metrogroup_id, metro_id)
add_port_to_portg(portg_id, port_id)
append_portg_desc(portg_id, description)
associate_lun_to_lungroup(lungroup_id, lun_id, lun_type='11')

Associate lun to lungroup.

call(*args, **kwargs)

Send requests to server.

If fail, try another RestURL.

change_hostlun_id(map_info, hostlun_id)
change_lun_priority(lun_id)

Change lun priority to high.

change_lun_smarttier(lunid, smarttier_policy)

Change lun smarttier policy.

check_fc_initiators_exist_in_host(host_id)
check_hypermetro_exist(metro_id)
check_iscsi_initiators_exist_in_host(host_id)
check_lun_exist(lun_id, lun_wwn=None)
check_pair_exist(pair_id)
check_snapshot_exist(snapshot_id)
create_hostgroup_with_check(hostgroup_name)

Check if host exists on the array, or create it.

create_hypermetro(hcp_param)
create_lun(lun_params)
create_lun_migration(src_id, dst_id, speed=2)
create_luncopy(luncopyname, srclunid, tgtlunid)

Create a luncopy.

create_metrogroup(name, description, domain_id)
create_pair(pair_params)
create_portg(portg_name, description='')
create_qos_policy(qos, lun_id)
create_snapshot(lun_id, snapshot_name, snapshot_description)
delete_hostgoup_mapping_view(view_id, hostgroup_id)

Remove hostgroup associate from the mapping view.

delete_hostgroup(hostgroup_id)
delete_hypermetro(metro_id)
delete_lun(lun_id)
delete_lun_migration(src_id, dst_id)
delete_luncopy(luncopy_id)

Delete a LUNcopy.

delete_lungroup(lungroup_id)
delete_lungroup_mapping_view(view_id, lungroup_id)

Remove lungroup associate from the mapping view.

delete_mapping_view(view_id)

Remove mapping view from the storage.

delete_metrogroup(metrogroup_id)
delete_pair(pair_id, force=False)
delete_portgroup(portg_id)
delete_portgroup_mapping_view(view_id, portgroup_id)

Remove portgroup associate from the mapping view.

delete_qos_policy(qos_id)

Delete a QoS policy.

delete_snapshot(snapshotid)
do_call(url=None, data=None, method=None, calltimeout=52)

Send requests to Huawei storage server.

Send HTTPS call, get response in JSON. Convert response into Python Object and return it.

do_mapping(lun_id, hostgroup_id, host_id, portgroup_id=None, lun_type='11')

Add hostgroup and lungroup to mapping view.

ensure_fc_initiator_added(initiator_name, host_id)
ensure_initiator_added(initiator_name, host_id)
extend_lun(lun_id, new_volume_size)
find_array_version()
find_available_qos(qos)

“Find available QoS on the array.

find_chap_info(iscsi_info, initiator_name)

Find CHAP info from xml.

find_hostgroup(groupname)

Get the given hostgroup id.

find_lungroup_from_map(view_id)

Get lungroup from the given map

find_mapping_view(name)

Find mapping view.

find_view_by_id(view_id)
get_all_engines()
get_all_pools()
get_array_info()
get_cache_id_by_name(name)
get_cache_info_by_id(cacheid)
get_fc_ports_by_portgroup(portg_id)
get_fc_ports_from_contr(contr)
get_fc_ports_on_array()
get_fc_target_wwpns(wwn)
get_host_fc_initiators(host_id)
get_host_id_by_name(host_name)

Get the given host ID.

get_host_iscsi_initiators(host_id)
get_host_lun_id(host_id, lun_id, lun_type='11')
get_host_online_fc_initiators(host_id)
get_hyper_domain_id(domain_name)
get_hypermetro_by_id(metro_id)
get_hypermetro_pairs()
get_init_targ_map(wwns)
get_iscsi_params(connector)

Get target iSCSI params, including iqn, IP.

get_lun_id(volume, volume_name)
get_lun_id_by_name(name)
get_lun_info(lun_id, lun_type='11')
get_lun_list_in_qos(qos_id, qos_info)

Get the lun list in QoS.

get_lun_migration_task()
get_luncopy_info(luncopy_id)

Get LUNcopy information.

get_lungroup_by_view(view_id)
get_lungroupids_by_lunid(lun_id, lun_type='11')

Get lungroup ids by lun id.

get_metrogroup(metrogroup_id)
get_metrogroup_by_id(id)
get_metrogroup_by_name(name)
get_migration_task()
get_obj_count_from_lungroup(lungroup_id)

Get all objects count associated to the lungroup.

get_online_free_wwns()

Get online free WWNs.

If no new ports connected, return an empty list.

get_pair_by_id(pair_id)
get_partition_id_by_name(name)
get_partition_info_by_id(partition_id)
get_pool_id(pool_name)
get_pool_info(pool_name=None, pools=None)
get_portg_info(portg_id)
get_portgroup_by_view(view_id)
get_portgs_by_portid(port_id)
get_ports_by_portg(portg_id)
get_qos()
get_qos_info(qos_id)

Get QoS information.

get_qosid_by_lunid(lun_id)

Get QoS id by lun id.

get_remote_devices()
get_snapshot_id_by_name(name)
get_snapshot_info(snapshot_id)
get_split_mirrors()
get_target_luns(id)
get_tgt_port_group(tgt_port_group)

Find target portgroup id by target port group name.

get_views_by_portg(portg_id)
hostgroup_associated(view_id, hostgroup_id)
init_http_head()
is_fc_initiator_associated_to_host(ininame)

Check whether the initiator is associated to the host.

is_host_associated_to_hostgroup(host_id)
is_initiator_associated_to_host(ininame)

Check whether the initiator is associated to the host.

is_lun_in_mirror(name)
is_portgroup_associated_to_view(view_id, portgroup_id)

Check whether the port group is associated to the mapping view.

login()

Login Huawei storage array.

logout()

Logout the session.

lungroup_associated(view_id, lungroup_id)
remove_chap(initiator_name)

Remove CHAP when terminate connection.

remove_fc_from_host(initiator)
remove_host(host_id)
remove_host_from_hostgroup(hostgroup_id, host_id)
remove_iscsi_from_host(initiator)
remove_lun_from_cache(lun_id, cache_id)
remove_lun_from_lungroup(lungroup_id, lun_id, lun_type='11')

Remove lun from lungroup.

remove_lun_from_partition(lun_id, partition_id)
remove_lun_from_qos(lun_id, lun_list, qos_id)

Remove lun from QoS.

remove_metro_from_metrogroup(metrogroup_id, metro_id)
remove_port_from_portgroup(portg_id, port_id)
rename_lun(lun_id, new_name, description=None)
rename_snapshot(snapshot_id, new_name, description=None)
set_pair_second_access(pair_id, access)
split_pair(pair_id)
start_luncopy(luncopy_id)

Start a LUNcopy.

stop_hypermetro(metro_id)
stop_metrogroup(metrogroup_id)
stop_snapshot(snapshot_id)
switch_pair(pair_id)
sync_hypermetro(metro_id)
sync_metrogroup(metrogroup_id)
sync_pair(pair_id)
try_login()
update_volume_stats()

Previous topic

The cinder.volume.drivers.huawei.replication Module

Next topic

The cinder.volume.drivers.huawei.smartx Module

Project Source

This Page