Projects Service
Projects Serviceπ
The projects service allows to manage saved projects, it comes with methods to save, update, delete, and list them. All method are existing in two variants: one including user authentication, and another one requesting a valid access token.
All methods of this service can raise the following common errors. Method-specific errors are mentioned later. While the methods with user authentication can raise an INVALID_PASSWORD error, the versions requiring access tokens can instead return INVALID_ACCESS_TOKEN errors.
Common Error Handlingπ
Error Code | Description |
---|---|
EMPTY_ARGUMENT | One or more mandatory arguments are empty. |
METHOD_NOT_AVAILABLE | The service method is not enabled in the environment configuration. |
INVALID_PASSWORD | The password is incorrect - applies only to password authentication. |
INVALID_ACCESS_TOKEN | The token is not valid (possibly timed-out) - applies only to token authentication. |
ENVIRONMENT_NOT_AVAILABLE | The environment is not available (see log-file for possible errors). |
DATABASE_ERROR | Database communication failed (possibly a misconfiguration issue). |
Method saveProjectπ
Method callπ
saveProject(environment, password, user, name, externalID, shares) : saveProjectResponse
Descriptionπ
Saves a new project with the given name and optional external ID.
Parametersπ
Parameter Name | Type | Description |
---|---|---|
environment | String | identifier of a search environment |
password | String | password for the search environment |
user | String | identifier for the current user |
name | String | desired name for this search |
externalID | String | the (optional) external project id |
shares | Shares object | the (optional) Shares object containing sharing settings |
Returnsπ
Result Name | Type | Description |
---|---|---|
saveProjectResponse | String | The projectID of the stored project |
Pre-Conditionπ
- A project with the same name for user may not exist.
- A project with the same externalID for user may not exist.
Post-Conditionπ
A project is created with the returned projectID.
Error Handlingπ
See the description of common errors as well as method-specific errors listed below:
Error Code | Description |
---|---|
PROJECT_DATA_NOT_UNIQUE | The project name or external id is not unique for the given user. |
Method saveProjectWithTokenπ
Method callπ
saveProjectWithToken(accessToken, name, externalID) : saveProjectResponse
Descriptionπ
Same as saveProject method but with accessToken instead of environment, password, and user.
Method updateProjectNameπ
Method callπ
updateProjectName(environment, password, user, projectID, name) : updateProjectNameResponse
Descriptionπ
The projects service updates the name of the project with the given projectID if the provided user is the owner of that project.
Parametersπ
Parameter Name | Type | Description |
---|---|---|
environment | string | identifier of a search environment |
password | string | password for the search environment |
user | string | identifier for the current user |
projectID | string | the project id |
name | string | desired name for this search |
Returnsπ
Result Name | Type | Description |
---|---|---|
updateProjectNameResponse | Integer | The new revision number of the updated project |
Pre-Conditionπ
- A project with project_id exists.
- The project with project_id is owned by user.
Post-Conditionπ
The project is renamed.
Error Handlingπ
See the description of common errors as well as method-specific errors listed below:
Error Code | Description |
---|---|
PROJECT_NOT_FOUND | A project with projectID is not existing. |
PROJECT_ACCESS_DENIED | The project with projectID is not owned by the user. |
Method updateProjectNameWithTokenπ
Method callπ
updateProjectNameWithToken(accessToken, projectID, name) : updateProjectNameResponse
Descriptionπ
Same as updateProjectName method but with accessToken instead of environment, password, and user.
Method updateProjectSharingπ
Method callπ
updateProjectSharing(environment, password, user, projectID, shares) : updateProjectSharingResponse
Descriptionπ
The projects service updates the sharing attributes of the project identified by projectID. THe service checks if the given user has ownership of the project.
Parametersπ
Parameter Name | Type | Description |
---|---|---|
environment | String | identifier of a search environment |
password | String | password for the search environment |
user | String | identifier for the current user |
projectID | String | identifier of the project |
shares | Shares object | the Shares object containing the new sharing attributes |
Returnsπ
Result Name | Type | Description |
---|---|---|
updateProjectSharingResponse | integer | The new revision number of the updated project |
Pre-Conditionπ
- A project with the given identifier exists.
- The project is owned by user.
Post-Conditionπ
The project is shared with the newly specified users.
Error Handlingπ
See the description of common errors as well as method-specific errors listed below:
Error Code | Description |
---|---|
PROJECT_NOT_FOUND | A project with the given projectID does not exist. |
PROJECT_ACCESS_DENIED | The project is not owned by the user. |
Method updateProjectSharingWithTokenπ
Method callπ
updateProjectSharingWithToken(accessToken, projectID, shares) : updateProjectSharingResponse
Descriptionπ
Same as updateProjectSharing method but with accessToken instead of environment, password, and user.
Method deleteProjectπ
Method callπ
deleteProject(environment, password, user, projectID) : deleteProjectResponse
Descriptionπ
The projects service deletes the project with the given projectID if the provided user is the owner of that project. All project associated saved queries and results are deleted as well. This method can be called as:
Parametersπ
Parameter Name | Type | Description |
---|---|---|
environment | string | identifier of a search environment |
password | string | password for the search environment |
user | string | identifier for the current user |
projectID | string | the project id |
Returnsπ
Result Name | Type | Description |
---|---|---|
deleteProjectResponse | String | "OK" upon a successful task |
Pre-Conditionπ
- A project with project_id exists.
- The project with project_id is owned by user.
Post-Conditionπ
The project is removed along with all dependent Searches and Results (cascading delete).
Error Handlingπ
See the description of common errors as well as method-specific errors listed below:
Error Code | Description |
---|---|
PROJECT_NOT_FOUND | A project with projectID is not existing. |
PROJECT_ACCESS_DENIED | The project with projectID is not owned by the user. |
Method deleteProjectWithTokenπ
Method callπ
deleteProjectWithToken(accessToken, projectID) : deleteProjectResponse
Descriptionπ
Same as deleteProject method but with accessToken instead of environment, password, and user.
Method deleteAllProjectsπ
Method callπ
deleteAllProjects(environment, password, user) : deleteAllProjectsResponse
Descriptionπ
The projects service deletes all projects associated with the user (including his default project). All saved queries and results are deleted as well. This method can be called as:
Parametersπ
Parameter Name | Type | Description |
---|---|---|
environment | string | identifier of a search environment |
password | string | password for the search environment |
user | string | identifier for the current user |
Returnsπ
Result Name | Type | Description |
---|---|---|
deleteAllProjectsResponse | String | "OK" upon a successful task |
Pre-Conditionπ
None.
Post-Conditionπ
All of the userβs Projects (including βdefaultβ) and associated Searches and Results are deleted (cascading delete).
Error Handlingπ
See the description of common errors.
Method deleteAllProjectsWithTokenπ
Method callπ
deleteAllProjectsWithToken(accessToken) : deleteAllProjectsResponse
Descriptionπ
Same as deleteAllProjects method but with accessToken instead of environment, password, and user.
Method listProjectsπ
Method callπ
listProjects(environment, password, user, accessRoles) : listProjectsResponse
Descriptionπ
The projects service lists all projects owned by the user and shared with either the user or his role. All related saved queries and results are listed as well.
Parametersπ
Parameter Name | Type | Description |
---|---|---|
environment | String | identifier of a search environment |
password | String | password for the search environment |
user | String | identifier for the current user |
accessRoles | List of Strings | access roles of the current user |
Returnsπ
Result Name | Type | Description |
---|---|---|
listProjectsResponse | ProjectResponse | See description of ProjectResponse in chapter Object Structures. |
Pre-Conditionπ
None.
Post-Conditionπ
None.
Error Handlingπ
See the description of common errors.
Method listProjectsWithTokenπ
Method callπ
listProjectsWithToken(accessToken) : listProjectsResponse
Descriptionπ
Same as listProjects method but with accessToken instead of environment, password, and user.
Method listUpdatesπ
Method callπ
listUpdates(environment, password, user, roles, versions) : listVersionsResponse
Descriptionπ
The projects service lists all changes to the owned/shared projects, respecting the provided versions. If no changes are detected, no projects are returned. In detail, the observed changes are:
- Updates: Owned and shared projects that have a newer version.
- Additions: New projects shared with this user or created by the same user id.
- Deletions: Projects that are no longer shared with the user or no longer exist.
Parametersπ
Parameter Name | Type | Description |
---|---|---|
environment | String | identifier of a search environment |
password | String | password for the search environment |
user | String | identifier for the current user |
accessRoles | List of Strings | access roles of the current user |
versions | ProjectVersions | a map of strings to integers, mapping project IDs to their currently known project versions |
Returnsπ
Result Name | Type | Description |
---|---|---|
listUpdatesResponse | ProjectResponse | See description of ProjectResponse in chapter Object Structures. |
Pre-Conditionπ
None.
Post-Conditionπ
None.
Error Handlingπ
See the description of common errors.
Method listProjectsWithTokenπ
Method callπ
listUpdatesWithToken(accessToken, projectVersions) : listUpdatesResponse
Descriptionπ
Same as listUpdates method but with accessToken instead of environment, password, and user.