Hardware
- pyCSM.services.hardware_service.hardware_service.add_device(url, tk, device_type, device_ip, device_username, device_password, device_port=None, second_ip=None, second_port=None, second_username=None, second_password=None)
Use this method to create a connection from the CSM server to a specified storage system
- Parameters
url (str) – Base url of csm server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
device_type (str) – Type of storage device ex. ds8000 or svc.
device_ip (str) – IP address or hostname for the primary HMC for the storage system.
device_username (str) – Username for the storage system connection.
device_password (str) – Password for the storage system connection.
device_port (str) (OPTIONAL) – Port to use for the connection to the storage system.
second_ip (str) (OPTIONAL) – For DS8000 storage systems, the IP address or hostname of a secondary HMC.
second_port (str) (OPTIONAL) – Port to use for the connection to the secondary HMC.
second_username (str) (OPTIONAL) – Username for the connection to the secondary HMC.
second_password (str) (OPTIONAL) – Password for the connection to the secondary HMC.
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.hardware_service.hardware_service.add_zos_cert(url, tk, file_path)
This method will add a given cert to zos connection.
- Parameters
url (str) – Base url of CSM server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
file_path (str) – Path for given certificate file.
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.hardware_service.hardware_service.add_zos_device(url, tk, device_id)
This method will add a storage system through the zoshost connection.
- Parameters
url (str) – Base url of CSM server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
device_id (str) – Storage system name in the format “DS8000:BOX:2107.KXZ91”.
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.hardware_service.hardware_service.add_zos_host(url, tk, host_ip, password, username, host_port)
This method will create a zos connection to the current IP
- Parameters
url (str) – Base url of CSM server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
host_ip (str) – Primary IP address for the zos system.
password (str) – Password for the zos system connection
username (str) – Username for the zos system connection
host_port (str) – Port for the zos system
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.hardware_service.hardware_service.change_properties(property_dictionary)
Takes a dictionary of properties and the values that user wants to change and changes them in the file.
- Parameters
property_dictionary (dict) – Dictionary of the keys and values that need
file. (to be changed in the) –
{"language" (ex.) – “en-UK”, “verify”:True}
- Returns
Returns the new properties dictionary.
- pyCSM.services.hardware_service.hardware_service.export_vol_writeio_history(url, tk, session_name, start_time, end_time)
Exports a summary of the write i/o history for all volumes in a session to a csv file between the given times.
- Parameters
url (str) – Base url of CSM server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
session_name (str) – The name of the session.
start_time (str) – Start time YYYY-MM-DD. Type:str
end_time (str) – End time YYYY-MM-DD.
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.hardware_service.hardware_service.get_devices(url, tk, device_type)
Uses a get request to get info of all the storagedevices of a given type.
- Parameters
url (str) – Base url of csm server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
device_type (str) – Type of storage device ex. ds8000 or svc.
- Returns
Returns JSON String representing the result of the command.
- pyCSM.services.hardware_service.hardware_service.get_path_on_storage_system(url, tk, system_id)
Query for all logical paths on the given DS8000 storage system.
- Parameters
url (str) – Base url of CSM server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
system_id (str) – The id of the storage system to be updated.
- Returns
JSON String representing the result of the command.
- pyCSM.services.hardware_service.hardware_service.get_paths(url, tk)
Queries all the logical paths for all DS8000 storage systems connected to the CSM server.
- Args:
url (str): Base url of CSM server. ex. https://servername:port/CSM/web. tk (str): Rest token for the CSM server.
- Returns:
JSON String representing the result of the command.
- pyCSM.services.hardware_service.hardware_service.get_properties()
Returns a dictionary of the current properties and their values set for the file.
- pyCSM.services.hardware_service.hardware_service.get_svchosts(url, tk, device_id)
Get the hosts defined on the SVC based storage system
- Parameters
url (str) – Base url of CSM server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
device_id (str) – The id of the storage system being used. (ex. “FAB3-DEV13”)
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.hardware_service.hardware_service.get_volumes(url, tk, system_name)
Use this method to retrieve all volumes for a given storage system
- Parameters
url (str) – Base url of CSM server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
system_name (str) – The name of the storage system.
- Returns
JSON String representing all the volumes for that storage system.
- pyCSM.services.hardware_service.hardware_service.get_volumes_by_wwn(url, tk, wwn_name)
Return the information for all volumes based on the list of WWNs passed in.
- Parameters
url (str) – Base url of CSM server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
wwn_name (str) – The volume wwn you would like to query or a subset of the volume wwn for a volume list
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.hardware_service.hardware_service.get_zos_candidate(url, tk)
This method will query for the devices in REST that are attached to the zos system.
- Parameters
url (str) – Base url of CSM server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.hardware_service.hardware_service.get_zos_host(url, tk)
This method will get the information for all zos host connections.
- Parameters
url (str) – Base url of CSM server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.hardware_service.hardware_service.map_volumes_to_host(url, tk, device_id, force, hostname, is_host_cluster, volumes, scsi='')
Map volumes to a host
- Parameters
url (str) – Base url of CSM server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
device_id (str) – The id for the storage device (ex. “FAB3-DEV13”)
force (bool) – boolean of whether user would like to force command
hostname (str) – name of the host
is_host_cluster (bool) – boolean variable that indicates whether host is a cluster
scsi (str) –
volumes (str) List of volumes to map to the host (ex. ["mVol0_211115100540","mVol1_211115100540"]) –
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.hardware_service.hardware_service.refresh_config(url, tk, system_id)
- Refreshes the configuration for the given storage system. Issuing this command will force the CSM server
to requery the hardware for any new or deleted volumes.
- Parameters
url (str) – Base url of CSM server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
system_id (str) – The id of the storage system to be updated.
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.hardware_service.hardware_service.remove_device(url, tk, system_id)
Use this method to remove the connection to the specified storage system
- Parameters
url (str) – Base url of CSM server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
system_id (str) – The id of the storage system to be removed.
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.hardware_service.hardware_service.remove_zos_host(url, tk, host_ip, host_port)
This method will create a zos connection to the current IP
- Parameters
url (str) – Base url of CSM server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
host_ip (str) – Primary IP address for the zos system.
host_port (str) – Port for the zos system
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.hardware_service.hardware_service.unmap_volumes_to_host(url, tk, device_id, force, hostname, is_host_cluster, volumes)
UnMap volumes from a host
- Parameters
url (str) – Base url of CSM server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
device_id (str) – The id for the storage device (ex. “FAB3-DEV13”)
force (bool) – boolean of whether user would like to force command
hostname (str) – name of the host
is_host_cluster (bool) – boolean variable that indicates whether host is a cluster
volumes (str) List of volumes to map to the host (ex. ["mVol0_211115100540","mVol1_211115100540"]) –
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.hardware_service.hardware_service.update_connection_info(url, tk, device_ip, device_password, device_username, connection_name)
Update the userid/pw for a given storage system
- Parameters
url (str) – Base url of CSM server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
device_ip (str) – Primary IP address for the storage system.
device_password (str) – New password for the storage system connection
device_username (str) – New user name for the storage system connection
connection_name (str) – Name of the connection. ex. HMC:9.11.114.59
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.hardware_service.hardware_service.update_device_site_location(url, tk, system_id, location)
Set a user defined site location for a given storage system
- Parameters
url (str) – Base url of CSM server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
system_id (str) – The id of the storage system to be updated.
location (str) – The name of the location to set on the storage system.
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.