clearml-server/apiserver/apimodels/projects.py

70 lines
2.1 KiB
Python
Raw Normal View History

from jsonmodels import models, fields
2022-03-15 14:28:59 +00:00
from apiserver.apimodels import ListField, ActualEnumField, DictField
2021-01-05 14:28:49 +00:00
from apiserver.apimodels.organization import TagsRequest
from apiserver.database.model import EntityVisibility
2021-05-03 14:42:10 +00:00
class ProjectRequest(models.Base):
project = fields.StringField(required=True)
2021-05-03 14:42:10 +00:00
class MergeRequest(ProjectRequest):
destination_project = fields.StringField()
class MoveRequest(ProjectRequest):
new_location = fields.StringField()
class DeleteRequest(ProjectRequest):
force = fields.BoolField(default=False)
delete_contents = fields.BoolField(default=False)
2021-05-03 14:44:54 +00:00
class ProjectOrNoneRequest(models.Base):
project = fields.StringField()
include_subprojects = fields.BoolField(default=True)
class GetParamsRequest(ProjectOrNoneRequest):
page = fields.IntField(default=0)
page_size = fields.IntField(default=500)
class ProjectTagsRequest(TagsRequest):
projects = ListField(str)
2021-01-05 16:49:25 +00:00
2021-05-03 14:42:10 +00:00
class MultiProjectRequest(models.Base):
2021-05-03 14:34:40 +00:00
projects = fields.ListField(str)
2021-05-03 14:44:54 +00:00
include_subprojects = fields.BoolField(default=True)
2021-05-03 14:34:40 +00:00
2021-05-03 14:42:10 +00:00
class ProjectTaskParentsRequest(MultiProjectRequest):
tasks_state = ActualEnumField(EntityVisibility)
2021-05-03 14:34:40 +00:00
2021-05-03 14:42:10 +00:00
class ProjectHyperparamValuesRequest(MultiProjectRequest):
2021-05-03 14:34:40 +00:00
section = fields.StringField(required=True)
name = fields.StringField(required=True)
allow_public = fields.BoolField(default=True)
2021-05-03 14:36:04 +00:00
2022-03-15 14:28:59 +00:00
class ProjectModelMetadataValuesRequest(MultiProjectRequest):
key = fields.StringField(required=True)
allow_public = fields.BoolField(default=True)
2021-05-03 14:36:04 +00:00
class ProjectsGetRequest(models.Base):
2022-07-08 14:45:03 +00:00
include_dataset_stats = fields.BoolField(default=False)
2021-05-03 14:36:04 +00:00
include_stats = fields.BoolField(default=False)
2022-03-15 14:28:59 +00:00
include_stats_filter = DictField()
stats_with_children = fields.BoolField(default=True)
2021-05-03 14:36:04 +00:00
stats_for_state = ActualEnumField(EntityVisibility, default=EntityVisibility.active)
non_public = fields.BoolField(default=False)
active_users = fields.ListField(str)
check_own_contents = fields.BoolField(default=False)
2021-05-03 14:42:10 +00:00
shallow_search = fields.BoolField(default=False)
search_hidden = fields.BoolField(default=False)