Hitachi Storage REST API to ease the communication to Hitachi Storage
Project description
HitachiBlockAPI
Hitachi Block API Class
With this class it is a lot easier to work with the Configuration Manager REST API as it automatically gets the storage id and it creates/deletes sessions for all tasks. Also the responses are formatted as a python dict to easily select or search for specific information.
Coding
Install HitachiBlockAPI package
pip install HitachiBlockAPI
Load RestAPI class
from HitachiBlockAPI import RestAPI
from HitachiBlockAPI import logger
#import the logging module to specify the logging level
import logging
#set logging level
logger.setLevel(logging.INFO)
#logger.setLevel(logging.DEBUG)
If you use the Configuration Manager REST API / Ops Center API then use port 23451
storage = RestAPI(fqdn_ip='10.10.10.10', port=23451, username='[user]', password='[password]')
If you have more than one storage registerd then you have to specify with which one you want to work with
In the following example the first element is chosen.
If you want to change it then you have to reexecute the command with another element_number
storage.storage_device_id_set(serial_number=[serial number of the storage])
If you directly contact the storage SVP or the GUM then use port 443. But this is the default so you do not have to specify it.
storage = RestAPI(fqdn_ip='10.10.10.10', username='[user]', password='[password]')
If you only have one storage registerd then you do not have to set it (done automatically in the background).
Available functions
General
Get the ucode, IP and other details of the storage
storage_systems_get(fqdn_ip:str=None, port:str=None, username:str=None, password:str=None)
storage_device_id_get(fqdn_ip:str=None, port:str=None, username:str=None, password:str=None, serial_number:int=None)
storage_device_id_set(fqdn_ip:str=None, port:str=None, username:str=None, password:str=None, serial_number:int=None)
storage_details_get(fqdn_ip:str=None, port:str=None, username:str=None, password:str=None, storageDeviceId:str=None)
storage_summaries_get(fqdn_ip:str=None, port:str=None, username:str=None, password:str=None)
Session handling
_session_create()
_session_delete()
_session_get()
Jobs
_jobs_by_id_get(self, jobId=None)
_jobs_last_get(self)
Resource Group
resource_lock(self, waitTime=None)
resource_unlock(self)
Pools
pools_get(self, poolId=None)
LDEVs
ldevs_get(self, ldevNumber=None, count=16384)
Ports
ports_get(self, portId=None, logins=None)
Host Groups
host_groups_one_port_get(self, portId)
host_groups_all_ports_get(self)
LUNs
luns_get(self, portId_hostGroupId)
luns_one_port_get(self, portId)
luns_all_ports_get(self)
WWNs
wwns_get(self, portId_hostGroupId)
wwns_one_port_get(self, portId)
wwns_all_ports_get(self)
Replication
replication_get(self, replicationType=None)
Snapshots / Cloning
snapshotgroups_get(self, snapshotGroupName=None)
snapshots_get(self, ldevNumber=None)
snapshots_create(self, pvolLdevId=None, snapshotGroupName=None, snapshotPoolId=None, isClone=False, isConsistencyGroup=True, autoSplit=True)
snapshots_resync(self, snapshotGroupName=None, autoSplit=True)
snapshots_delete(self, snapshotGroupName=None)
Manual
Please download the latest Hitachi Block Rest API documentation from:
https://knowledge.hitachivantara.com/Documents/Management_Software/Ops_Center/API_Configuration_Manager
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file HitachiBlockAPI-0.9.2.tar.gz.
File metadata
- Download URL: HitachiBlockAPI-0.9.2.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0.post20201207 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3228097ac837099b2928c67e3e8d38db893f3e6ecc5846e5defb90555e68815d
|
|
| MD5 |
76d1b2e907aa96093f8cc161a0d62a95
|
|
| BLAKE2b-256 |
fa1e13b7d2cdea4c53c0eaa9821f7a92308c947ad2e9ad70a3eee412a56996d1
|
File details
Details for the file HitachiBlockAPI-0.9.2-py3-none-any.whl.
File metadata
- Download URL: HitachiBlockAPI-0.9.2-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0.post20201207 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d6dc921cb077fd3a80e428cb9eab705ec6276d0f3bba02c93cb20a19479782a
|
|
| MD5 |
df65c94fb3c460a31b0a2616268e025c
|
|
| BLAKE2b-256 |
ea4d4ae5d41c0839d01fb9a503fcb5c8566ef2eef15d941d0dbb6220e87fbc59
|