From b7c0245a3426d94a2d477d6f633540b683d11a69 Mon Sep 17 00:00:00 2001 From: "sonu.kumar" Date: Wed, 21 Oct 2015 15:16:18 +0530 Subject: [PATCH] Adds different filter option for zone listing This patch adds available filter option for 'openstack zone list' command. Change-Id: Ie5d32af1799acf653355ba441f38fd4d1ffe1e17 Closes-Bug: #1506728 --- designateclient/v2/cli/zones.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/designateclient/v2/cli/zones.py b/designateclient/v2/cli/zones.py index 855941d..e19569d 100644 --- a/designateclient/v2/cli/zones.py +++ b/designateclient/v2/cli/zones.py @@ -40,7 +40,14 @@ class ListZonesCommand(lister.Lister): def get_parser(self, prog_name): parser = super(ListZonesCommand, self).get_parser(prog_name) + parser.add_argument('--name', help="Zone Name", required=False) + parser.add_argument('--email', help="Zone Email", required=False) parser.add_argument('--type', help="Zone Type", required=False) + parser.add_argument('--ttl', help="Time To Live (Seconds)", + required=False) + parser.add_argument('--description', help="Description", + required=False) + parser.add_argument('--status', help="Zone Status", required=False) return parser @@ -51,6 +58,21 @@ class ListZonesCommand(lister.Lister): if parsed_args.type is not None: criterion["type"] = parsed_args.type + if parsed_args.name is not None: + criterion["name"] = parsed_args.name + + if parsed_args.ttl is not None: + criterion["ttl"] = parsed_args.ttl + + if parsed_args.description is not None: + criterion["description"] = parsed_args.description + + if parsed_args.email is not None: + criterion["email"] = parsed_args.email + + if parsed_args.status is not None: + criterion["status"] = parsed_args.status + data = client.zones.list(criterion=criterion) cols = self.columns