Admin¶
Table of Contents:
Organizations¶
Organizations can represent a lab, a company or even a team of collaborators. They are used to store projects.
-
nexussdk.organizations.
create
(org_label, description=None)¶ Create a new organization.
- Parameters
org_label – The label of the organization. Does not allow spaces or special characters
description – OPTIONAL The description of the organization
- Returns
The payload from the Nexus API as a dictionary. This contains the Nexus metadata of the organization
-
nexussdk.organizations.
deprecate
(org_label, rev)¶ Deprecate an organization. Nexus does not allow deleting organizations so deprecating is the way to flag them as not usable anymore. A deprecated organization can not be modified/updated.
- Parameters
org_label – The label of the organization to deprecate
rev – The previous revision number. To be provided to make sure the user is well aware of the details of the last revision of this organisation.
- Returns
The payload from the Nexus API as a dictionary. This contains the Nexus metadata of the organization
-
nexussdk.organizations.
fetch
(org_label, rev=None)¶ Fetch an organization.
- Parameters
org_label – The label of the organization
rev – OPTIONAL The specific revision of the wanted organization. If not provided, will get the last
- Returns
All the details of this organization, as a dictionary
-
nexussdk.organizations.
list
(pagination_from=0, pagination_size=20)¶ NOT WORKING List all the organizations.
- Parameters
pagination_from – OPTIONAL Index of the list to start from (default: 0)
pagination_size – OPTIONAL Size of the list (default: 20)
- Returns
The payload from the Nexus API as a dictionary. This contains the Nexus metadata of the organization
-
nexussdk.organizations.
update
(org, rev=None)¶ Update an organization. Only the field “name” can be updated (and “description” in the future).
- Parameters
org – Organization payload as a dictionary. This is most likely the returned value of organisation.get(…)
rev – OPTIONAL The last revision number, to make sure the developer is aware of the latest status of this organization. If not provided, the _rev number from the org argument will be used.
- Returns
The payload from the Nexus API as a dictionary. This contains the Nexus metadata of the organization
Projects¶
A project is a place to store data (files, resources, schemas, etc.). It belongs to an organization.
-
nexussdk.projects.
create
(org_label, project_label, description=None, api_mappings=None, vocab=None, base=None)¶ Create a new project under an organization.
- Parameters
org_label – The label of the organization to create the project in
project_label – The label of the project to add
description – OPTIONAL a description for this project
api_mappings – OPTIONAL apiMappings see https://bluebrain.github.io/nexus/docs/api/admin/admin-projects-api.html#api-mappings
vocab – OPTIONAL vocab as a string
base – OPTIONAL base for the project
- Returns
The payload from the Nexus API as a dictionary. This contains the Nexus metadata of the project
-
nexussdk.projects.
deprecate
(project, rev=None)¶ Deprecate a project. Nexus does not allow deleting projects so deprecating is the way to flag them as not usable anymore. A deprecated project cannot be modified/updated.
- Parameters
project – The project payload, most likely retrieved with fetch()
rev – OPTIONAL provide the last version of the project to make sure the user has full knowledge of the version being deprecated. If not provided, the revision number from the project payload will be used.
- Returns
The payload from the Nexus API as a dictionary. This contains the Nexus metadata of the project
-
nexussdk.projects.
deprecate_2
(org_label, project_label, rev)¶ Deprecate a project. Nexus does not allow deleting projects so deprecating is the way to flag them as not usable anymore. A deprecated project cannot be modified/updated.
- Parameters
org_label – The label of the organization the project to deprecate belongs to
project_label – The label of the project to deprecate
rev – The previous revision number. Provided to make sure the user is well aware of the details of the last revision of this project.
- Returns
The payload from the Nexus API as a dictionary. This contains the Nexus metadata of the project
-
nexussdk.projects.
fetch
(org_label, project_label, rev=None)¶ Fetch a project and all its details. Note: This does not give the list of resources. To get that, use the resource package.
- Parameters
org_label – The label of the organization that contains the project to be fetched
project_label – label of a the project to fetch
rev – OPTIONAL The specific revision of the wanted project. If not provided, will get the last.
- Returns
All the details of this project, as a dictionary
-
nexussdk.projects.
list
(org_label=None, pagination_from=0, pagination_size=20, deprecated=None, full_text_search_query=None)¶ List all the projects. If the arguments org_label is provided, this will list only the projects of this given organization. If not provided, all the projects from all organizations will be listed.
- Parameters
org_label – OPTIONAL get only the list of project for this given organization
pagination_from – OPTIONAL Index of the list to start from (default: 0)
pagination_size – OPTIONAL Size of the list (default: 20)
deprecated – OPTIONAL Lists only the deprecated if True, lists only the non-deprecated if False, lists everything if not provided or None (default: None)
full_text_search_query – OPTIONAL List only the projects that match this query
- Returns
The payload from the Nexus API as a dictionary. This contains the Nexus metadata and the list of projects
-
nexussdk.projects.
update
(project, rev=None)¶ Update a project. The data to update on a project are mostly related to the api mapping. To do so, you must get the project information as a payload, most likely using project.fetch(…), then, modify this payload according to the update to perform, and finally, use this modified payload as the project argument of this method.
- Parameters
project – Project payload as a dictionary. This is most likely the returned value of project.fetch(…)
rev – OPTIONAL The last revision number, to make sure the developer is aware of the latest status of this project. If not provided, the _rev number from the project argument will be used.
- Returns
The payload from the Nexus API as a dictionary. This contains the Nexus metadata of the project