adam.project module¶
project.py
-
class
adam.project.
Project
(uuid, parent=None, name=None, description=None)¶ Bases:
object
Project class.
An ADAM Project is like a folder for work executed in the ADAM platform.
-
__init__
(uuid, parent=None, name=None, description=None)¶ Initialize the Project data class.
- Parameters
uuid (str) – the project ID.
parent (str) – the project parent ID. Defaults to None.
name (str) – the name of the project.
description (str) – the project description.
-
get_description
()¶
-
get_name
()¶
-
get_parent
()¶
-
get_uuid
()¶
-
-
class
adam.project.
ProjectsClient
(rest=<adam.rest_proxy.AuthenticatingRestProxy object>)¶ Bases:
object
Module for managing projects.
-
__init__
(rest=<adam.rest_proxy.AuthenticatingRestProxy object>)¶ Initialize the Projects API client.
- Parameters
rest (RestProxy) – a RestProxy that makes calls to the ADAM API.
-
delete_project
(uuid)¶ Deletes a project.
- Parameters
uuid (str) – the id of the project to delete.
- Raises
RuntimeError if the server returns a non-204. –
-
filter_projects
(projects, uuid=None, name=None, description=None) → List[adam.project.Project]¶
-
get_project
(uuid) → adam.project.Project¶ Gets project details.
- Parameters
uuid (str) – the id of the project to get.
- Returns
the newly-created Project.
- Return type
- Raises
RuntimeError if the server returns a non-200. –
-
get_project_from_config
(config) → adam.project.Project¶
-
get_projects
(uuid=None, name=None, description=None) → List[adam.project.Project]¶ Gets projects that the current user has access to read with filtering by zero or more optional fields
- Parameters
uuid (str) – (Optional) checks whether uuid contains this text
name (str) – (Optional) checks whether name contains this text
description (str) – (Optional) checks whether description contains this text
- Returns
a list of Projects.
- Return type
list(Project)
- Raises
RuntimeError if the server returns a non-200. –
-
get_sub_projects
(parent) → List[adam.project.Project]¶ Get the projects under specified parent project.
For now, this just filters the returned values by parent project. We may eventually choose to implement this server-side, in which case we will call into whatever API that exposes.
- Parameters
parent (str) – the project ID for which to get its sub-projects.
- Returns
A list of Projects.
- Return type
list
-
new_project
(parent, name, description) → adam.project.Project¶ Creates a new project.
- Parameters
parent (str) – the parent project id.
name (str) – the name of the project.
description (str) – the description of this project.
- Returns
the newly-created Project.
- Return type
- Raises
RuntimeError if the server returns a non-200. –
-