Here you get a quick rundown how to basically create, read, update and delete Projects within Aruna.
This should be the first step after gaining access to the storage (and maybe creating an API token) which is described in the previous chapters.
What is a Project?
A Project is the basic resource to organize general user access for stored data (i.e. Objects).
It also acts as an umbrella container for all other resources which means that every hierarchy has a Project as root.
This directly implies that every project name has to be globally unique in the Aruna universe.
More in-depth information can be found in the Data Structure section.
Create Project
API examples of how to create a new Project.
The project creator is automatically granted ADMIN permissions on the created Project.
Required permissions
To create a new Project you only have to be a registered Aruna user.
Project naming guidelines
Project names are unique globally in the Aruna system
Project names are restricted to the following characters: [a-z0-9-] (i.e. alphanumeric lowercase and hyphens)
Tested
1 2 3 4 5 6 7 8 91011121314151617
# Native JSON request to create a simple Project
curl-d' { "name": "json-api-project", "title": "JSON API Project" "description": "Created with JSON over HTTP.", "keyValues": [], "relations": [], "data_class": "DATA_CLASS_PUBLIC", "preferredEndpoint": "", "metadataLicenseTag": "CC-BY-4.0", "defaultDataLicenseTag": "CC-BY-4.0", "authors": [] }'\-H'Authorization: Bearer <AUTH_TOKEN>'\-H'Content-Type: application/json'\-XPOSThttps://<URL-to-Aruna-instance-API-endpoint>/v2/project
Tested
1 2 3 4 5 6 7 8 910111213141516171819202122
// Create tonic/ArunaAPI request to create a simple Projectletrequest=CreateProjectRequest{name:"rust-api-project".to_string(),title:"Rust API Project".to_string(),description:"Created with the gRPC Rust API client.".to_string(),key_values:vec![],relations:vec![],data_class:DataClass::Publicasi32,preferred_endpoint:"".to_string(),// Can be set to specific endpointmetadata_license_tag:"CC-BY-4.0".to_string(),default_data_license_tag:"CC-BY-4.0".to_string(),authors:vec![]};// Send the request to the Aruna instance gRPC endpointletresponse=project_client.create_project(request).await.unwrap()//.into_inner();// Do something with the responseprintln!("{:#?}",response);
1 2 3 4 5 6 7 8 910111213141516171819
# Create tonic/ArunaAPI request to create a simple Projectrequest=CreateProjectRequest(name="python-api-project",title="Python API Project",description="Created with the gRPC Python API client.",key_values=[],relations=[],data_class=DataClass.DATA_CLASS_PUBLIC,preferred_endpoint="",metadata_license_tag="CC-BY-4.0",default_data_license_tag="CC-BY-4.0",authors=[])# Send the request to the Aruna instance gRPC endpointresponse=client.project_client.CreateProject(request=request)# Do something with the responseprint(f'{response}')
Get Project
API example for fetching info of an existing Project.
Required permissions
This request requires at least READ permissions on the specific Project.
1234
# Native JSON request to fetch information of a Project
curl-H'Authorization: Bearer <AUTH_TOKEN>'\-H'Content-Type: application/json'\-XGEThttps://<URL-to-Aruna-instance-API-endpoint>/v2/project/{project-id}
1 2 3 4 5 6 7 8 910111213
// Create tonic/ArunaAPI request to fetch information of a Projectletrequest=GetProjectRequest{project_id:"<project-id>".to_string(),};// Send the request to the Aruna instance gRPC endpointletresponse=project_client.get_project(request).await.unwrap().into_inner();// Do something with the responseprintln!("{:#?}",response);
1 2 3 4 5 6 7 8 910
# Create tonic/ArunaAPI request to fetch information of a Projectrequest=GetProjectRequest(project_id="<project-id>")# Send the request to the Aruna instance gRPC endpointresponse=client.project_client.GetProject(request=request)# Do something with the responseprint(f'{response}')
Get multiple Projects
API examples of how to fetch multiple Projects in a single request.
Required permissions
This request requires at least READ permissions on all requested Projects.
1234
# Native JSON request to fetch information of multiple projects in one request
curl-H'Authorization: Bearer <AUTH_TOKEN>'\-H'Content-Type: application/json'\-XGEThttps://<URL-to-Aruna-instance-API-endpoint>/v2/projects?projectIds=project-id-01&projectIds=project-id-02
1 2 3 4 5 6 7 8 91011121314151617
// Create tonic/ArunaAPI request to fetch information of multiple projects in one requestletrequest=GetProjectsRequest{project_ids:vec!["<project-id-01>".to_string(),"<project-id-02>".to_string(),"<...>".to_string(),],};// Send the request to the Aruna instance gRPC endpointletresponse=project_client.get_projects(request).await.unwrap().into_inner();// Do something with the responseprintln!("{:#?}\n",response);
1 2 3 4 5 6 7 8 910
# Create tonic/ArunaAPI request to fetch information of multiple projects in one requestrequest=GetProjectsRequest(project_ids=["<project-id-01>","<project-id-02>","<...>"])# Send the request to the Aruna instance gRPC endpointresponse=client.project_client.GetProjects(request=request)# Do something with the responseprint(f'{response}')
Update Project
API examples of how to update individual metadata of an existing Project.
Required permissions
Name update needs at least ADMIN permissions on the specific Project
Description update needs at least WRITE permissions on the specific Project
KeyValue update needs at least WRITE permissions on the specific Project
Dataclass update needs at least ADMIN permissions on the specific Project
License update needs at least WRITE permissions on the specific Project
12345678
# Native JSON request to update the name of a Project
curl-d' { "name": "updated-json-api-project" }'\-H'Authorization: Bearer <AUTH_TOKEN>'\-H'Content-Type: application/json'\-XPATCHhttps://<URL-to-Aruna-instance-API-endpoint>/v2/projects/{project-id}/name
12345678
# Native JSON request to update the title of a Project
curl-d' { "title": "Updated JSON API Project" }'\-H'Authorization: Bearer <AUTH_TOKEN>'\-H'Content-Type: application/json'\-XPATCHhttps://<URL-to-Aruna-instance-API-endpoint>/v2/project/{project-id}/title
12345678
# Native JSON request to update the description of a Project
curl-d' { "description": "Updated with JSON over HTTP." }'\-H'Authorization: Bearer <AUTH_TOKEN>'\-H'Content-Type: application/json'\-XPATCHhttps://<URL-to-Aruna-instance-API-endpoint>/v2/projects/{project-id}/description
123456789
# Native JSON request to update the key-values associated with a Project
curl-d' { "addKeyValues": [], "removeKeyValues": [] }'\-H'Authorization: Bearer <AUTH_TOKEN>'\-H'Content-Type: application/json'\-XPATCHhttps://<URL-to-Aruna-instance-API-endpoint>/v2/projects/{project-id}/key_values
Info
Dataclass can only be relaxed: Confidential > Workspace > Private > Public
12345678
# Native JSON request to update the dataclass of a Project
curl-d' { "dataClass": "DATA_CLASS_PUBLIC" }'\-H'Authorization: Bearer <AUTH_TOKEN>'\-H'Content-Type: application/json'\-XPATCHhttps://<URL-to-Aruna-instance-API-endpoint>/v2/projects/{project-id}/data_class
123456789
# Native JSON request to update the license of a Project
curl-d' { "metadataLicenseTag": "CC0", "defaultDataLicenseTag": "CC0" }'\-H'Authorization: Bearer <AUTH_TOKEN>'\-H'Content-Type: application/json'\-XPATCHhttps://<URL-to-Aruna-instance-API-endpoint>/v2/projects/{project-id}/licenses
1 2 3 4 5 6 7 8 91011121314151617
# Native JSON request to add an author to a Project
curl-d' { "addAuthors": [ { "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "orcid": "0000-0002-1825-0097", "id": "<user-id-if-registered>" } ], "removeAuthors": [] }'\-H'Authorization: Bearer <AUTH_TOKEN>'\-H'Content-Type: application/json'\-XPATCHhttps://<URL-to-Aruna-instance-API-endpoint>/v2/project/{project-id}/authors
1 2 3 4 5 6 7 8 91011121314
// Create tonic/ArunaAPI request to update the name of a Projectletrequest=UpdateProjectNameRequest{project_id:"<project-id>".to_string(),name:"updated-rust-api-project".to_string(),};// Send the request to the Aruna instance gRPC endpointletresponse=project_client.update_project_name(request).await.unwrap().into_inner();// Do something with the responseprintln!("{:#?}",response);
1 2 3 4 5 6 7 8 91011121314
// Create tonic/ArunaAPI request to update the title of a Projectletrequest=UpdateProjectTitleRequest{project_id:"<project-id>".to_string(),title:"Update Rust API Project".to_string(),};// Send the request to the Aruna instance gRPC endpointletresponse=project_client.update_project_title(request).await.unwrap().into_inner();// Do something with the responseprintln!("{:#?}",response);
1 2 3 4 5 6 7 8 91011121314
// Create tonic/ArunaAPI request to update the description of a Projectletrequest=UpdateProjectDescriptionRequest{project_id:"<project-id>".to_string(),description:"Updated with the gRPC Rust API client.".to_string(),};// Send the request to the Aruna instance gRPC endpointletresponse=project_client.update_project_description(request).await.unwrap().into_inner();// Do something with the responseprintln!("{:#?}",response);
1 2 3 4 5 6 7 8 9101112131415
// Create tonic/ArunaAPI request to update the key-values associated with a Projectletrequest=UpdateProjectKeyValuesRequest{project_id:"<project-id>".to_string(),add_key_values:vec![],remove_key_values:vec![]};// Send the request to the Aruna instance gRPC endpointletresponse=project_client.update_project_key_values(request).await.unwrap().into_inner();// Do something with the responseprintln!("{:#?}",response);
Info
Dataclass can only be relaxed: Confidential > Private > Public
1 2 3 4 5 6 7 8 91011121314
// Create tonic/ArunaAPI request to update the datacalass of a Projectletrequest=UpdateProjectDataClassRequest{project_id:"<project-id>".to_string(),data_class:DataClass::Publicasi32,};// Send the request to the Aruna instance gRPC endpointletresponse=project_client.update_project_data_class(request).await.unwrap().into_inner();// Do something with the responseprintln!("{:#?}",response);
1 2 3 4 5 6 7 8 9101112131415
// Create tonic/ArunaAPI request to update the licenses of a Projectletrequest=UpdateProjectLicensesRequest{project_id:"<project-id>".to_string(),metadata_license_tag:"CC0".to_string(),default_data_license_tag:"CC0".to_string(),};// Send the request to the Aruna instance gRPC endpointletresponse=project_client.update_project_licenses(request).await.unwrap().into_inner();// Do something with the responseprintln!("{:#?}",response);
1 2 3 4 5 6 7 8 9101112131415161718192021
// Create tonic/ArunaAPI request to add an author to a Projectletrequest=UpdateProjectAuthorsRequest{project_id:"<project-id>".to_string(),add_authors:vec![Author{first_name:"John".to_string(),last_name:"Doe".to_string(),email:"john.doe@example.com".to_string(),orcid:"0000-0002-1825-0097".to_string(),id:"<user-id-if-registered>".to_string(),}],remove_authors:vec![],};// Send the request to the Aruna instance gRPC endpointletresponse=project_client.update_project_authors(request).await.unwrap().into_inner();// Do something with the responseprintln!("{:#?}",response);
1 2 3 4 5 6 7 8 91011
# Create tonic/ArunaAPI request to update the name of a Projectrequest=UpdateProjectNameRequest(project_id="<project-id>",name="updated-python-api-project")# Send the request to the Aruna instance gRPC endpointresponse=client.project_client.UpdateProjectName(request=request)# Do something with the responseprint(f'{response}')
1 2 3 4 5 6 7 8 91011
# Create tonic/ArunaAPI request to update the title of a Projectrequest=UpdateProjectNameRequest(project_id="<project-id>",title="Updated Python API Project")# Send the request to the Aruna instance gRPC endpointresponse=client.project_client.UpdateProjectTitle(request=request)# Do something with the responseprint(f'{response}')
1 2 3 4 5 6 7 8 91011
# Create tonic/ArunaAPI request to update the description of a Projectrequest=UpdateProjectDescriptionRequest(project_id="<project-id>",description="Updated with the gRPC Python API client")# Send the request to the Aruna instance gRPC endpointresponse=client.project_client.UpdateProjectDescription(request=request)# Do something with the responseprint(f'{response}')
1 2 3 4 5 6 7 8 9101112
# Create tonic/ArunaAPI request to update the key-values associated with a Projectrequest=UpdateProjectKeyValuesRequest(project_id="<project-id>",add_key_values=[],remove_key_values=[])# Send the request to the Aruna instance gRPC endpointresponse=client.project_client.UpdateProjectKeyValues(request=request)# Do something with the responseprint(f'{response}')
Info
Dataclass can only be relaxed: Confidential > Private > Public
1 2 3 4 5 6 7 8 91011
# Create tonic/ArunaAPI request to update the data class of a Projectrequest=UpdateProjectDataClassRequest(project_id="<project-id>",data_class=DataClass.DATA_CLASS_PUBLIC)# Send the request to the Aruna instance gRPC endpointresponse=client.project_client.UpdateProjectDataClass(request=request)# Do something with the responseprint(f'{response}')
1 2 3 4 5 6 7 8 9101112
# Create tonic/ArunaAPI request to update the licenses of a Projectrequest=UpdateProjectLicensesRequest(project_id="<project-id>",metadata_license_tag="CC0",default_data_license_tag="CC0")# Send the request to the Aruna instance gRPC endpointresponse=client.project_client.UpdateProjectLicenses(request=request)# Do something with the responseprint(f'{response}')
1 2 3 4 5 6 7 8 9101112131415161718
# Create tonic/ArunaAPI request to add an author to a Projectrequest=UpdateProjectAuthorsRequest(project_id="<project-id>",add_authors=[Author(first_name="John",last_name="Doe",email="john.doe@example.com",orcid="0000-0002-1825-0097",user_id="<user-id-if-registered")],remove_authors=[])# Send the request to the Aruna instance gRPC endpointresponse=client.project_client.UpdateProjectAuthors(request=request)# Do something with the responseprint(f'{response}')
Archive Project
A Project can be archived which sets it and all the downstream relations to an immutable read-only state.
Required permissions
This request requires at least ADMIN permissions on the specific Project.
1234
# Native JSON request to archive a Project
curl-H'Authorization: Bearer <AUTH_TOKEN>'\-H'Content-Type: application/json'\-XPATCHhttps://<URL-to-Aruna-instance-API-endpoint>/v2/project/{project-id}/archive
1 2 3 4 5 6 7 8 910111213
// Create tonic/ArunaAPI request to archive a Projectletrequest=ArchiveProjectRequest{project_id:"<project-id>".to_string()};// Send the request to the Aruna instance gRPC endpointletresponse=project_client.archive_project(request).await.unwrap().into_inner();// Do something with the responseprintln!("{:#?}",response);
1 2 3 4 5 6 7 8 910
# Create tonic/ArunaAPI request to archive a Projectrequest=UpdateProjectDescriptionRequest(project_id="<project-id>")# Send the request to the Aruna instance gRPC endpointresponse=client.project_client.ArchiveProject(request=request)# Do something with the responseprint(f'{response}')
Delete Project
API examples of how to delete a Project.
Info
Deletion does not remove the project from the database, but sets the status of the Project and the underlying resources to "DELETED".
Required permissions
This request requires at least ADMIN permissions on the specific Project.
1234
# Native JSON request to delete a project
curl-H'Authorization: Bearer <AUTH_TOKEN>'\-H'Content-Type: application/json'\-XDELETEhttps://<URL-to-Aruna-instance-API-endpoint>/v2/project/{project-id}
1 2 3 4 5 6 7 8 910111213
// Create tonic/ArunaAPI request to delete a projectletrequest=DeleteProjectRequest{project_id:"<project-id>".to_string(),};// Send the request to the Aruna instance gRPC endpointletresponse=project_client.delete_project(request).await.unwrap().into_inner();// Do something with the responseprintln!("{:#?}",response);
1 2 3 4 5 6 7 8 910
# Create tonic/ArunaAPI request to delete a projectrequest=DeleteProjectRequest(project_id="<project-id>")# Send the request to the Aruna instance gRPC endpointresponse=client.project_client.DeleteProject(request=request)# Do something with the responseprint(f'{response}')