starcluster.commands.listinstances

Package starcluster :: Package commands :: Module listinstances |
[hide private]
[frames] | no frames]

# Source Code for Module starcluster.commands.listinstances

     1  #!/usr/bin/env python
     2
     3  from base import CmdBase
     4
     5
     6 -class CmdListInstances(CmdBase):
     7      """
     8      listinstances [options]
     9
    10      List all running EC2 instances
    11      """
    12      names = ['listinstances', 'lsi']
    13
    14 -    def addopts(self, parser):
    15          parser.add_option("-t", "--show-terminated", dest="show_terminated",
    16                            action="store_true", default=False,
    17                            help="show terminated instances")
    18
    19 -    def execute(self, args):
    20          self.ec2.list_all_instances(self.opts.show_terminated)
    21