Skip to content

Commit

Permalink
rename endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Neagu committed Dec 5, 2024
1 parent eb681b1 commit 6eb9b2e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async def stop_dynamic_service(


@log_decorator(_logger, level=logging.DEBUG)
async def retrieve_data_on_ports(
async def retrieve_inputs(
rabbitmq_rpc_client: RabbitMQRPCClient,
*,
node_id: NodeID,
Expand All @@ -89,7 +89,7 @@ async def retrieve_data_on_ports(
) -> RetrieveDataOutEnveloped:
result = await rabbitmq_rpc_client.request(
DYNAMIC_SCHEDULER_RPC_NAMESPACE,
_RPC_METHOD_NAME_ADAPTER.validate_python("retrieve_data_on_ports"),
_RPC_METHOD_NAME_ADAPTER.validate_python("retrieve_inputs"),
node_id=node_id,
port_keys=port_keys,
timeout_s=timeout_s,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ async def stop_dynamic_service(


@router.expose()
async def retrieve_data_on_ports(
async def retrieve_inputs(
app: FastAPI, *, node_id: NodeID, port_keys: list[ServicePortKey]
) -> RetrieveDataOutEnveloped:
return await scheduler_interface.retrieve_data_on_ports(
return await scheduler_interface.retrieve_inputs(
app, node_id=node_id, port_keys=port_keys
)
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ async def stop_dynamic_service(

raise

async def retrieve_data_on_ports(
async def retrieve_inputs(
self,
*,
node_id: NodeID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ async def stop_dynamic_service(
await set_request_as_stopped(app, dynamic_service_stop)


async def retrieve_data_on_ports(
async def retrieve_inputs(
app: FastAPI, *, node_id: NodeID, port_keys: list[ServicePortKey]
) -> RetrieveDataOutEnveloped:
settings: ApplicationSettings = app.state.settings
if settings.DYNAMIC_SCHEDULER_USE_INTERNAL_SCHEDULER:
raise NotImplementedError

director_v2_client = DirectorV2Client.get_from_app_state(app)
return await director_v2_client.retrieve_data_on_ports(
return await director_v2_client.retrieve_inputs(
node_id=node_id,
port_keys=port_keys,
timeout=settings.DYNAMIC_SCHEDULER_SERVICE_UPLOAD_DOWNLOAD_TIMEOUT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,11 @@ async def stop_dynamic_services_in_project(
await logged_gather(*services_to_stop)


# NOTE: ANE https://github.com/ITISFoundation/osparc-simcore/issues/3191
async def retrieve(
async def retrieve_inputs(
app: web.Application, node_id: NodeID, port_keys: list[ServicePortKey]
) -> RetrieveDataOutEnveloped:
settings: DynamicSchedulerSettings = get_plugin_settings(app)
return await services.retrieve_data_on_ports(
return await services.retrieve_inputs(
get_rabbitmq_rpc_client(app),
node_id=node_id,
port_keys=port_keys,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ async def retrieve_node(request: web.Request) -> web.Response:
retrieve = await parse_request_body_as(NodeRetrieve, request)

return web.json_response(
await dynamic_scheduler_api.retrieve(
await dynamic_scheduler_api.retrieve_inputs(
request.app, path_params.node_id, retrieve.port_keys
),
dumps=json_dumps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ async def _safe_retrieve(
app: web.Application, node_id: NodeID, port_keys: list[str]
) -> None:
try:
await dynamic_scheduler_api.retrieve(app, node_id, port_keys)
await dynamic_scheduler_api.retrieve_inputs(app, node_id, port_keys)
except RPCServerError as exc:
log.warning(
"Unable to call :retrieve endpoint on service %s, keys: [%s]: error: [%s]",
Expand Down

0 comments on commit 6eb9b2e

Please sign in to comment.