def _list_server(self): try: self.machines = self.sdc.machines() except Exception as e: print "Unable to search for server: %s" % str(e) exit(1) for machine in self.machines: self._machine_format(machine) # Print results headers = ["Name", "State", "ID", "IPs", "Type", "DataSet", "Created"] question = "List joyent Machines in {}".format(TColors.yellow(self.location)) print_table(self.results, headers=headers, question=question)
def _network_list(self): networks = [] try: networks = self.sdc.networks() except Exception as e: print "Unable to search for networks: %s" % str(e) exit(1) for network in networks: self._network_format(network) headers = ["Public", "Name", "Id","Description"] question = "List of joyent networks in {}".format(TColors.yellow(self.location)) print_table(self.results, headers=headers, question=question) exit(1)