def do_printInstances(self,args):
parser = CommandArgumentParser("<STR_LIT>")<EOL>parser.add_argument(dest='<STR_LIT>',nargs='<STR_LIT:*>',default=["<STR_LIT:*>"],help='<STR_LIT>');<EOL>parser.add_argument('<STR_LIT>','<STR_LIT>',action='<STR_LIT:store_true>',dest='<STR_LIT>',help='<STR_LIT>');<EOL>parser.add_argument('<STR_LIT>','<STR_LIT>',action='<STR_LIT:store_true>',dest='<STR_LIT>',help='<STR_LIT>');<EOL>parser.add_argument('<STR_LIT>','<STR_LIT>',action='<STR_LIT:store_true>',dest='<STR_LIT>',help='<STR_LIT>');<EOL>parser.add_argument('<STR_LIT>','<STR_LIT>',action='<STR_LIT:store_true>',dest='<STR_LIT>',help='<STR_LIT>');<EOL>parser.add_argument('<STR_LIT>','<STR_LIT>',dest='<STR_LIT>',nargs='<STR_LIT:+>',help='<STR_LIT>');<EOL>args = vars(parser.parse_args(args))<EOL>client = AwsConnectionFactory.getEc2Client()<EOL>filters = args['<STR_LIT>']<EOL>addresses = args['<STR_LIT>']<EOL>tags = args['<STR_LIT>']<EOL>details = args['<STR_LIT>']<EOL>availabilityZones = args['<STR_LIT>']<EOL>needDescription = addresses or tags or details<EOL>if args['<STR_LIT>']:<EOL><INDENT>self.scalingGroupDescription = self.client.describe_auto_scaling_groups(AutoScalingGroupNames=[self.scalingGroup])<EOL><DEDENT>print("<STR_LIT>")<EOL>instances = self.scalingGroupDescription['<STR_LIT>'][<NUM_LIT:0>]['<STR_LIT>']<EOL>instances = [x for x in instances if fnmatches(x['<STR_LIT>'],filters)]<EOL>if availabilityZones:<EOL><INDENT>instances = [x for x in instances if fnmatches(x['<STR_LIT>'],availabilityZones)]<EOL><DEDENT>index = <NUM_LIT:0><EOL>for instance in instances:<EOL><INDENT>instance['<STR_LIT:index>'] = index<EOL>print("<STR_LIT>".format(index,instance['<STR_LIT>'],instance['<STR_LIT>'],instance['<STR_LIT>']))<EOL>description = None<EOL>if needDescription:<EOL><INDENT>description = client.describe_instances(InstanceIds=[instance['<STR_LIT>']])<EOL><DEDENT>if addresses:<EOL><INDENT>networkInterfaces = description['<STR_LIT>'][<NUM_LIT:0>]['<STR_LIT>'][<NUM_LIT:0>]['<STR_LIT>']<EOL>number = <NUM_LIT:0><EOL>print("<STR_LIT>")<EOL>for interface in networkInterfaces:<EOL><INDENT>print("<STR_LIT>".format(number, interface['<STR_LIT>']))<EOL>number +=<NUM_LIT:1><EOL><DEDENT><DEDENT>if tags:<EOL><INDENT>tags = description['<STR_LIT>'][<NUM_LIT:0>]['<STR_LIT>'][<NUM_LIT:0>]['<STR_LIT>']<EOL>print("<STR_LIT>")<EOL>for tag in tags:<EOL><INDENT>print("<STR_LIT>".format(tag['<STR_LIT>'],tag['<STR_LIT>']))<EOL><DEDENT><DEDENT>if details:<EOL><INDENT>pprint(description)<EOL><DEDENT>index += <NUM_LIT:1><EOL><DEDENT>
Print the list of instances in this auto scaling group. printInstances -h for detailed help