def do_list(self, args): url = BaseConsole.url + 'disks/' input_disk_list = args.split() if (len(input_disk_list) > 0): url = url + input_disk_list[0] + '/' disk_info = api_call(url) print_disk_info(disk_info)
def do_disks(self, args): """ Discover and setup disks. """ url = BaseConsole.url + 'tools/sysdisks/' result = api_call(url, calltype='post') print("Setup is complete") print_disk_info(result)
def do_delete(self, args): """ Delete a offlined disk delete disk_name """ url = ('%s/%s' % (self.baseurl, args)) api_call(url, calltype='delete') print_disk_info(api_call(self.baseurl))
def do_wipe(self, args): """ Wipe the partition table of a disk. This is required for used/partitioned disks to be usable by rockstor. wipe disk_name """ url = ('%s/%s/wipe' % (self.baseurl, args)) api_call(url, calltype='post') print_disk_info(api_call(self.baseurl))
def do_scan(self, args): """ Scan the system for any new disks since the last scan. Example: Scan the system for any new disks: scan """ disk_info = api_call(self.baseurl, data=None, calltype='post') print_disk_info(disk_info)
def do_list(self, args): url = self.baseurl if args: # print info for a single disk url = "%s/%s" % (url, args) disk_info = api_call(url) print_disk_info(disk_info, True) else: # print info for all disks disks_info = api_call(url) print_disks_info(disks_info)
def do_list(self, args): url = self.baseurl if (args): # print info for a single disk url = ('%s/%s' % (url, args)) disk_info = api_call(url) print_disk_info(disk_info, True) else: # print info for all disks disks_info = api_call(url) print_disks_info(disks_info)
def do_list(self, args): """ List brief information about disks in the system. Details of all disks: list Details of a single disk: list <disk_name> Parameters: disk_name: If this optional parameter is given, details are printed for the given disk only. Examples: Print information of all disks in the system list Print information for the disk sdd list sdd """ url = self.baseurl if (args is not None): url = ('%s%s' % (url, args)) disk_info = api_call(url) print_disk_info(disk_info)