Skip to content

Commit fa4c094

Browse files
mihaelabalutoiuDany9966
authored andcommitted
Add --refresh flag to endpoint instance list command
Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
1 parent 75a8108 commit fa4c094

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

coriolisclient/cli/endpoint_instances.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ def get_parser(self, prog_name):
103103
parser.add_argument(
104104
'--name',
105105
help='Filter results based on regular expression search')
106+
parser.add_argument(
107+
'--refresh',
108+
action='store_true',
109+
default=False,
110+
help='Force refresh of cached instance data')
106111

107112
cli_utils.add_args_for_json_option_to_parser(parser, 'environment')
108113

@@ -116,7 +121,8 @@ def take_action(self, args):
116121
args, 'environment', error_on_no_value=False)
117122

118123
obj_list = ei.list(
119-
endpoint_id, env, args.marker, args.limit, args.name)
124+
endpoint_id, env, args.marker, args.limit, args.name,
125+
refresh=args.refresh)
120126
return EndpointInstanceFormatter().list_objects(obj_list)
121127

122128

coriolisclient/v1/endpoint_instances.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(self, api):
3333

3434
def list(
3535
self, endpoint, env=None, marker=None,
36-
limit=None, name=None):
36+
limit=None, name=None, refresh=False):
3737

3838
query = {}
3939
if marker is not None:
@@ -42,6 +42,8 @@ def list(
4242
query['limit'] = limit
4343
if name is not None:
4444
query["name"] = name
45+
if refresh:
46+
query['refresh'] = True
4547
if env is not None:
4648
if not isinstance(env, dict):
4749
raise ValueError("'env' param must be a dict")

0 commit comments

Comments
 (0)