We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4be5960 commit c57e19aCopy full SHA for c57e19a
6 files changed
coriolis/api/v1/endpoint_instances.py
@@ -2,6 +2,7 @@
2
# All Rights Reserved.
3
4
from coriolis.api import common
5
+from coriolis.api.v1 import utils as api_utils
6
from coriolis.api.v1.views import endpoint_resources_view
7
from coriolis.api import wsgi as api_wsgi
8
from coriolis.endpoint_resources import api
@@ -24,6 +25,8 @@ def index(self, req, endpoint_id):
24
25
endpoint_policies.ENDPOINTS_POLICY_PREFIX))
26
marker, limit = common.get_paging_params(req)
27
instance_name_pattern = req.GET.get("name")
28
+ refresh = api_utils.get_bool_url_arg(
29
+ req, "refresh", default=False)
30
31
env = req.GET.get("env")
32
if env is not None:
@@ -34,7 +37,7 @@ def index(self, req, endpoint_id):
34
37
return endpoint_resources_view.instances_collection(
35
38
self._instance_api.get_endpoint_instances(
36
39
context, endpoint_id, env, marker, limit,
- instance_name_pattern))
40
+ instance_name_pattern, refresh=refresh))
41
42
def show(self, req, endpoint_id, id):
43
context = req.environ['coriolis.context']
coriolis/conductor/rpc/client.py
@@ -58,14 +58,15 @@ def delete_endpoint(self, ctxt, endpoint_id):
58
59
def get_endpoint_instances(self, ctxt, endpoint_id, source_environment,
60
marker=None, limit=None,
61
- instance_name_pattern=None):
+ instance_name_pattern=None, refresh=False):
62
return self._call(
63
ctxt, 'get_endpoint_instances',
64
endpoint_id=endpoint_id,
65
source_environment=source_environment,
66
marker=marker,
67
limit=limit,
68
- instance_name_pattern=instance_name_pattern)
+ instance_name_pattern=instance_name_pattern,
69
+ refresh=refresh)
70
71
def get_endpoint_instance(
72
self, ctxt, endpoint_id, source_environment, instance_name):
coriolis/conductor/rpc/server.py
@@ -493,7 +493,8 @@ def delete_endpoint(self, ctxt, endpoint_id):
493
db_api.delete_endpoint(ctxt, endpoint_id)
494
495
496
- marker, limit, instance_name_pattern):
+ marker, limit, instance_name_pattern,
497
+ refresh=False):
498
endpoint = self.get_endpoint(ctxt, endpoint_id)
499
500
worker_rpc = self._get_worker_service_rpc_for_specs(
@@ -503,7 +504,8 @@ def get_endpoint_instances(self, ctxt, endpoint_id, source_environment,
503
504
endpoint.type: [constants.PROVIDER_TYPE_ENDPOINT_INSTANCES]})
505
return worker_rpc.get_endpoint_instances(
506
ctxt, endpoint.type, endpoint.connection_info,
- source_environment, marker, limit, instance_name_pattern)
507
+ source_environment, marker, limit, instance_name_pattern,
508
509
510
511
coriolis/endpoint_resources/api.py
@@ -10,10 +10,10 @@ def __init__(self):
10
11
12
13
14
return self._rpc_client.get_endpoint_instances(
15
ctxt, endpoint_id, source_environment, marker,
16
- limit, instance_name_pattern)
+ limit, instance_name_pattern, refresh=refresh)
17
18
19
coriolis/worker/rpc/client.py
@@ -72,15 +72,16 @@ def cancel_task(self, ctxt, task_id, process_id, force):
73
def get_endpoint_instances(self, ctxt, platform_name, connection_info,
74
source_environment, marker=None, limit=None,
75
76
77
78
platform_name=platform_name,
79
connection_info=connection_info,
80
81
82
83
84
85
86
def get_endpoint_instance(self, ctxt, platform_name, connection_info,
87
source_environment, instance_name):
coriolis/worker/rpc/server.py
@@ -334,7 +334,7 @@ def exec_task(self, ctxt, task_id, task_type, origin, destination,
334
335
336
source_environment, marker, limit,
337
- instance_name_pattern):
+ instance_name_pattern, refresh=False):
338
export_provider = providers_factory.get_provider(
339
platform_name, constants.PROVIDER_TYPE_ENDPOINT_INSTANCES, None)
340
@@ -344,7 +344,7 @@ def get_endpoint_instances(self, ctxt, platform_name, connection_info,
344
instances_info = export_provider.get_instances(
345
ctxt, secret_connection_info, source_environment,
346
last_seen_id=marker, limit=limit,
347
+ instance_name_pattern=instance_name_pattern, refresh=refresh)
348
for instance_info in instances_info:
349
schemas.validate_value(
350
instance_info, schemas.CORIOLIS_VM_INSTANCE_INFO_SCHEMA)
0 commit comments