Lines Matching full:instances
43 """Get more details of remote instances.
46 instance_list: List of dicts which contain info about the remote instances,
55 def _SortInstancesForDisplay(instances): argument
56 """Sort the instances by connected first and then by age.
59 instances: List of instance.Instance()
64 instances.sort(key=lambda ins: ins.createtime, reverse=True)
65 instances.sort(key=lambda ins: ins.AdbConnected(), reverse=True)
66 return instances
70 """Display instances information.
95 instance_list: List of instances.
99 print("No remote or local instances found")
106 # add space between instances in verbose mode.
118 """Look for remote instances.
120 We're going to query the GCP project for all instances that created by user.
126 instance_list: List of remote instances.
140 """Look for local cuttelfish instances.
142 Gather local instances information from cuttlefish runtime config.
149 instance_list: List of local instances.
161 instances = instance.GetCuttleFishLocalInstances(cfg_path)
162 for ins in instances:
198 """Look for local cuttleifsh and goldfish instances.
201 List of local instances.
203 # Running instances on local is not supported on all OS.
213 """Look for remote/local instances.
219 instance_list: List of instances.
224 def ChooseInstancesFromList(instances): argument
225 """Let user choose instances from a list.
228 instances: List of Instance objects.
233 if len(instances) > 1:
234 print("Multiple instances detected, choose any one to proceed:")
235 return utils.GetAnswerFromList(instances, enable_choose_all=True)
236 return instances
240 """Get instances.
242 Retrieve all remote/local instances and if there is more than 1 instance
247 select_all_instances: True if select all instances by default and no
253 instances = GetInstances(cfg)
255 return ChooseInstancesFromList(instances)
256 return instances
262 Retrieve all remote cuttlefish instances and if there is more than 1 instance
277 "Can't find any cuttlefish remote instances, please try "
278 "'$acloud create' to create instances")
280 print("Multiple instances detected, choose any one to proceed:")
281 instances = utils.GetAnswerFromList(instances_list,
283 return instances[0]
288 def _FilterInstancesByNames(instances, names): argument
289 """Find instances by names.
292 instances: Collection of Instance objects.
293 names: Collection of strings, the names of the instances to search for.
301 instance_map = {inst.name: inst for inst in instances}
311 raise errors.NoInstancesFound("Did not find the following instances: %s" %
337 """Get local cuttlefish and goldfish instances by names.
339 This method does not raise an error if it cannot find all instances.
368 """Get instances from instance names.
380 errors.NoInstancesFound: No instances found.
387 def FilterInstancesByAdbPort(instances, adb_port): argument
391 instances: Collection of Instance objects.
398 errors.NoInstancesFound: No instances found.
401 for instance_object in instances:
408 hint_message = ("No instance with adb port %d, available instances:\n%s"
411 hint_message = "No instances to delete."
416 """Look for cuttlefish remote instances.
424 instances = GetRemoteInstances(cfg)
425 return [ins for ins in instances if ins.avd_type == constants.TYPE_CF]
434 instances = GetLocalInstances()
437 instances.extend(GetRemoteInstances(cfg))
439 PrintInstancesDetails(instances, args.verbose)