1 from starcluster import static
2
3 from base import CmdBase
4
5
7 """
8 listvolumes
9
10 List all EBS volumes
11 """
12 names = ['listvolumes', 'lv']
13
15 parser.add_option("-n", "--name", dest="name", type="string",
16 default=None, action="store",
17 help="show all volumes with a given 'Name' tag")
18 parser.add_option("-d", "--show-deleted", dest="show_deleted",
19 action="store_true", default=False,
20 help="show volumes that are being deleted")
21 parser.add_option("-v", "--volume-id", dest="volume_id",
22 action="store", type="string", default=None,
23 help="show a single volume with id VOLUME_ID")
24 parser.add_option("-s", "--size", dest="size", action="store",
25 type="string", default=None,
26 help="show all volumes of a particular size")
27 parser.add_option("-S", "--status", dest="status", action="store",
28 default=None, choices=static.VOLUME_STATUS,
29 help="show all volumes with status")
30 parser.add_option("-a", "--attach-status", dest="attach_status",
31 action="store", default=None,
32 choices=static.VOLUME_ATTACH_STATUS,
33 help="show all volumes with attachment status")
34 parser.add_option("-z", "--zone", dest="zone", action="store",
35 type="string", default=None,
36 help="show all volumes in zone")
37 parser.add_option("-i", "--snapshot-id", dest="snapshot_id",
38 action="store", type="string", default=None,
39 help="show all volumes created from snapshot")
40 parser.add_option("-t", "--tag", dest="tags", type="string",
41 default={}, action="callback",
42 callback=self._build_dict,
43 help="show all volumes with a given tag")
44
47