Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emc unity add controller disk port filesystem share qtree quota fouction #583

Merged
merged 17 commits into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions delfin/drivers/dell_emc/unity/rest_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ class RestHandler(RestClient):
REST_DEL_ALERTS_URL = '/api/instances/alert/'
REST_LOGOUT_URL = '/api/types/loginSessionInfo/action/logout'
AUTH_KEY = 'EMC-CSRF-TOKEN'
REST_CONTROLLER_URL = '/api/types/storageProcessor/instances'
REST_DISK_URL = '/api/types/disk/instances'
REST_FCPORT_URL = '/api/types/fcPort/instances'
REST_ETHPORT_URL = '/api/types/ethernetPort/instances'
REST_IP_URL = '/api/types/ipInterface/instances'
REST_FILESYSTEM_URL = '/api/types/filesystem/instances'
REST_NFSSHARE_URL = '/api/types/nfsShare/instances'
REST_CIFSSHARE_URL = '/api/types/cifsShare/instances'
REST_QTREE_URL = '/api/types/treeQuota/instances'
REST_USERQUOTA_URL = '/api/types/userQuota/instances'
REST_QUOTACONFIG_URL = '/api/types/quotaConfig/instances'
STATE_SOLVED = 2

def __init__(self, **kwargs):
Expand Down Expand Up @@ -165,3 +176,80 @@ def remove_alert(self, alert_id):
alert_id)
result_json = self.get_rest_info(url, data, method='POST')
return result_json

def get_all_controllers(self):
url = '%s?%s' % (RestHandler.REST_CONTROLLER_URL,
'fields=id,name,health,model,slotNumber,'
'emcPartNumber,emcSerialNumber,manufacturer,'
'memorySize')
result_json = self.get_rest_info(url)
return result_json

def get_all_disks(self):
url = '%s?%s' % (RestHandler.REST_DISK_URL,
'fields=id,name,health,model,slotNumber,'
'manufacturer,version,emcSerialNumber,wwn'
'emcPartNumber,rpm,size,diskGroup')
result_json = self.get_rest_info(url)
return result_json

def get_all_fcports(self):
url = '%s?%s' % (RestHandler.REST_FCPORT_URL,
'fields=id,name,health,slotNumber,storageProcessor,'
'currentSpeed,wwn')
result_json = self.get_rest_info(url)
return result_json

def get_all_ethports(self):
url = '%s?%s' % (RestHandler.REST_ETHPORT_URL,
'fields=id,name,health,portNumber,storageProcessor,'
'speed,isLinkUp,macAddress,maxMtu')
result_json = self.get_rest_info(url)
return result_json

def get_port_interface(self):
url = '%s?%s' % (RestHandler.REST_IP_URL,
'fields=id,ipPort,ipProtocolVersion,'
'ipAddress,netmask')
result_json = self.get_rest_info(url)
return result_json

def get_all_filesystems(self):
url = '%s?%s' % (RestHandler.REST_FILESYSTEM_URL,
'fields=id,name,health,sizeAllocated,'
'sizeTotal,sizeUsed,isThinEnabled,pool')
result_json = self.get_rest_info(url)
return result_json

def get_all_nfsshares(self):
url = '%s?%s' % (RestHandler.REST_NFSSHARE_URL,
'fields=id,filesystem,name,path')
result_json = self.get_rest_info(url)
return result_json

def get_all_cifsshares(self):
url = '%s?%s' % (RestHandler.REST_CIFSSHARE_URL,
'fields=id,filesystem,name,path')
result_json = self.get_rest_info(url)
return result_json

def get_all_qtrees(self):
url = '%s?%s' % (RestHandler.REST_QTREE_URL,
'fields=id,filesystem,description,path,hardLimit,'
'softLimit,sizeUsed,quotaConfig')
result_json = self.get_rest_info(url)
return result_json

def get_all_userquotas(self):
url = '%s?%s' % (RestHandler.REST_USERQUOTA_URL,
'fields=id,filesystem,description,path,hardLimit,'
'softLimit,sizeUsed')
result_json = self.get_rest_info(url)
return result_json

def get_quota_configs(self):
url = '%s?%s' % (RestHandler.REST_QUOTACONFIG_URL,
'fields=id,filesystem,treeQuota,quotaPolicy,'
'isUserQuotaEnabled,isAccessDenyEnabled')
result_json = self.get_rest_info(url)
return result_json
Loading