mirror of
https://github.com/clearml/clearml-server
synced 2025-06-26 23:15:47 +00:00
Add tasks.get_by_id_ex and models.get_by_id_ex
This commit is contained in:
parent
b89de43373
commit
cf441987af
@ -144,6 +144,10 @@ get_by_task_id {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
get_by_id_ex {
|
||||||
|
internal: true
|
||||||
|
"2.11": ${get_all_ex."2.1"}
|
||||||
|
}
|
||||||
get_all_ex {
|
get_all_ex {
|
||||||
internal: true
|
internal: true
|
||||||
"2.1": ${get_all."2.1"}
|
"2.1": ${get_all."2.1"}
|
||||||
|
@ -554,6 +554,10 @@ get_by_id {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
get_by_id_ex {
|
||||||
|
internal: true
|
||||||
|
"2.11": ${get_all_ex."2.1"}
|
||||||
|
}
|
||||||
get_all_ex {
|
get_all_ex {
|
||||||
internal: true
|
internal: true
|
||||||
"2.1": ${get_all."2.1"}
|
"2.1": ${get_all."2.1"}
|
||||||
|
@ -96,6 +96,18 @@ def get_all_ex(call: APICall, company_id, _):
|
|||||||
call.result.data = {"models": models}
|
call.result.data = {"models": models}
|
||||||
|
|
||||||
|
|
||||||
|
@endpoint("models.get_by_id_ex", required_fields=["id"])
|
||||||
|
def get_by_id_ex(call: APICall, company_id, _):
|
||||||
|
conform_tag_fields(call, call.data)
|
||||||
|
with translate_errors_context():
|
||||||
|
with TimingContext("mongo", "models_get_by_id_ex"):
|
||||||
|
models = Model.get_many_with_join(
|
||||||
|
company=company_id, query_dict=call.data, allow_public=True
|
||||||
|
)
|
||||||
|
conform_output_tags(call, models)
|
||||||
|
call.result.data = {"models": models}
|
||||||
|
|
||||||
|
|
||||||
@endpoint("models.get_all", required_fields=[])
|
@endpoint("models.get_all", required_fields=[])
|
||||||
def get_all(call: APICall, company_id, _):
|
def get_all(call: APICall, company_id, _):
|
||||||
conform_tag_fields(call, call.data)
|
conform_tag_fields(call, call.data)
|
||||||
|
@ -163,6 +163,24 @@ def get_all_ex(call: APICall, company_id, _):
|
|||||||
call.result.data = {"tasks": tasks}
|
call.result.data = {"tasks": tasks}
|
||||||
|
|
||||||
|
|
||||||
|
@endpoint("tasks.get_by_id_ex", required_fields=["id"])
|
||||||
|
def get_by_id_ex(call: APICall, company_id, _):
|
||||||
|
conform_tag_fields(call, call.data)
|
||||||
|
|
||||||
|
escape_execution_parameters(call)
|
||||||
|
|
||||||
|
with translate_errors_context():
|
||||||
|
with TimingContext("mongo", "task_get_by_id_ex"):
|
||||||
|
tasks = Task.get_many_with_join(
|
||||||
|
company=company_id,
|
||||||
|
query_dict=call.data,
|
||||||
|
allow_public=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
unprepare_from_saved(call, tasks)
|
||||||
|
call.result.data = {"tasks": tasks}
|
||||||
|
|
||||||
|
|
||||||
@endpoint("tasks.get_all", required_fields=[])
|
@endpoint("tasks.get_all", required_fields=[])
|
||||||
def get_all(call: APICall, company_id, _):
|
def get_all(call: APICall, company_id, _):
|
||||||
conform_tag_fields(call, call.data)
|
conform_tag_fields(call, call.data)
|
||||||
|
Loading…
Reference in New Issue
Block a user