Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions meorg_client/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,22 +325,24 @@ def create_new_model_output(


@click.command("query")
@click.option("--by-name", is_flag=True, default=False, help="Query by name instead of ID.")
@click.argument("model_id")
def model_output_query(model_id: str):
def model_output_query(model_id: str, by_name: bool):
"""
Get details for a specific new model output entity

Parameters
----------
model_id : str
Model Output ID.

by_name : bool
Whether to query by name instead of ID.

Prints the `id` modeloutput, and JSON representation for the remaining metadata if in dev mode.
"""
client = _get_client()

response = _call(client.model_output_query, model_id=model_id)
response = _call(client.model_output_query, model_id=model_id, by_name=by_name)

if client.success():

Expand Down
4 changes: 2 additions & 2 deletions meorg_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def model_output_create(
data=dict(model=mod_prof_id, name=name) | config_params,
)

def model_output_query(self, model_id: str) -> Union[dict, requests.Response]:
def model_output_query(self, model_id: str, by_name: bool) -> Union[dict, requests.Response]:
"""
Get details for a specific new model output entity
Parameters
Expand All @@ -495,7 +495,7 @@ def model_output_query(self, model_id: str) -> Union[dict, requests.Response]:
return self._make_request(
method=mcc.HTTP_GET,
endpoint=endpoints.MODEL_OUTPUT_QUERY,
url_params=dict(id=model_id),
url_params=dict(name=model_id) if by_name else dict(id=model_id),
)

def model_output_update(
Expand Down
Loading