This guide describe the REST API of the administration server for Obeo Designer Team Server. This API will allow you to manage CDO repositories, shared modeling projects and depending on the type of repository you manage, you will be able to manager the repository users. If you already have configured the administration server for Obeo Designer Team Server you can start to use our API.
Remark: The protocol, host and port can be different from your server configuration.
In this documentation we will use the web service API in the version v1.0.
Disclaimer: As basic authentication is enabled for the administration server, the Authorization header must be added in all requests with the base64 encoded credentials.
Disclaimer: The administration server for Obeo Designer Team Server is currently installed in Team for Capella Server.
delete /projects/{repositoryId}/{projectId}
get /projects/{repositoryId}/{projectId}
get /projects/{repositoryId}
post /projects/{repositoryId}
post /repositories
delete /repositories/{repositoryId}
post /repositories/export/{repositoryId}
get /repositories
get /repositories/history/{repositoryId}
post /repositories/import/{repositoryId}
get /repositories/start/{repositoryId}
get /repositories/stop/{repositoryId}
get /command
{
"message" : "message",
"command" : "command",
"status" : "status"
}
application/json
delete /projects/{repositoryId}/{projectId}
Delete a project.
No effect on static repositories.
{
"pid" : 0,
"repositoryName" : "repositoryName",
"projectName" : "projectName",
"message" : "message",
"status" : "status"
}
application/json
{"repositoryName":"SampleRepository","projectName":"Simple","log":"http://localhost:8080/api/v1.0/exports/logs/ExportCall1118498032469818516.log","pid":15876,"message":"The project MyProject of SampleRepository deletion has been triggered.","status":200}
{"error":"No repository: noRepository","message":"Deleting Project of noRep failed.","status":404}
{"error":"Resource node not found: NoProject","message":"Deleting Project of SampleRepository failed.","status":404}
{"error":"Platform already busy","message":"The project %1s has not been deleted.","status":409}
{"error":"Cannot run program \"norunnable.exe\": CreateProcess error=2, Specified file cannot be found","message":"Deleting Project of SampleRepository failed.","status":500}
get /projects/{repositoryId}/{projectId}
{
"paths" : [ "paths", "paths" ],
"pid" : 0,
"message" : "message",
"status" : "status"
}
application/json
{"paths":["C:\\installationPath\\server\\dynamic\\tools\\Importer\\output\\Simple_20220502_225331.zip","C:\\installationPath\\server\\dynamic\\tools\\Importer\\output\\Another Project_20220502_225331.zip"],"log":"http://localhost:8080/api/v1.0/exports/logs/ImportCall1118498032469818518.log","pid":17436,"message":"Extract Projects from SampleRepository","status":202}
{"paths":["http://localhost:8080/api/v1.0/exports/projects/SampleRepository/Simple_20220502_200922.zip"],"log":"http://localhost:8080/api/v1.0/exports/logs/ImportCall1118498032469818516.log","pid":444,"message":"Extract Project Simple from SampleRepository","status":202}
{"paths":["http://localhost:8080/api/v1.0/exports/projects/SampleRepository/Simple_20220502_200922.zip","http://localhost:8080/api/v1.0/exports/projects/SampleRepository/Another%20Project_20220502_200922.zip"],"log":"http://localhost:8080/api/v1.0/exports/logs/ImportCall1118498032469818517.log","pid":17436,"message":"Extract Projects from SampleRepository","status":202}
{"error":"No repository: norep","message":"Extract Project noProject from norep failed.","status":404}
{"error":"Resource node not found: noProject","message":"Extract Project noProject from SampleRepository failed.","status":404}
{"error":"Platform already busy","message":"Getting the project has not been started.","status":409}
{"error":"Cannot run program \"norunnable.exe\": CreateProcess error=2, Specified file cannot be found","message":"Extract Project myProject from myRepo failed","status":500}
get /projects/{repositoryId}
{
"projects" : [ {
"repositoryName" : "repositoryName",
"projectName" : "projectName"
}, {
"repositoryName" : "repositoryName",
"projectName" : "projectName"
} ],
"message" : "message",
"status" : "status"
}
application/json
{"projects":[{"repositoryName":"SampleRepository","projectName":"Simple","path":"Simple"},{"repositoryName":"SampleRepository","projectName":"Another Project","path":"Another%20Project"}],"message":"Listing Projects of SampleRepository","status":200}
{"error":"No repository: norepo","message":"Listing Projects of norepo failed.","status":404}
post /projects/{repositoryId}
Write projects into a repository reading an archive or a folder of projects of the local.
The resources must be available on the server and this service requires a local client with projects' metamodel.
This service uses 'export' application and can be configured in 'admin-server.properties' using 'admin.server.api.project.get.impl.config' keys.
{
"pid" : 0,
"message" : "message",
"status" : "status"
}
application/json
{"log":"http://localhost:8080/api/v1.0/exports/logs/ExportCall8720710734823864513.log","pid":123456789,"message":"Post Projects","status":202}
{"error":"No repository: norepo","message":"Post Projects failed.","status":404}
{"error":"Platform already busy","message":"Uploading Projects into the repository has not started.","status":409}
{"error":"Cannot run program \"norunnable.exe\": CreateProcess error=2, Specified file cannot be found","message":"Extract Project myProject from myRepo failed","status":500}
post /repositories
This request will allow you to creates a repository. The body of the request take a JSON object with the following parameters: repositoryName, authenticationType and datasourceType which are mandatory and also authenticationData and datasourceData which are optional.
The repository name can contain only word characters (a-zA-Z_0-9) and "-".
While the authenticationType value can be empty, the repositoryName and the datasourceType values cannot.
By default you can use the following values to manage your repositories:
You can also contribute your own extensions and use the key value of your extension as described in the Administration Server documentation.
Those values describe how your repository will manage authentication and database.
As the optional parameters (authenticationData and datasourceDat) depends on the mandatory parameters, we will use examples to describe how to use them.
The repository is started after its creation and lifecycle hooks are called before and after its start.
application/json
{
"description" : "Create a repository without authentication with an H2 embedded database.\n\nWith an empty value set to _authenticationType_ your repository will not have authentication. With _H2_EMBEDDED_ value set to _datasourceType_ your repository database will be an h2 embedded database.\n",
"value" : {
"repositoryName" : "repository-without-authentication",
"authenticationType" : "",
"datasourceType" : "H2_EMBEDDED"
}
}
{
"repository" : {
"datasourceType" : "H2_EMBEDDED",
"authenticationType" : "",
"repositorName" : "repositorName",
"type" : "STATIC",
"status" : "ONLINE"
},
"message" : "message",
"status" : "status"
}
application/json
{"repository":{"name":"repository-with-userprofile-ldap","status":"ONLINE","type":"DYNAMIC","authenticationType":"LDAP_USERPROFILE","datasourceType":"H2_EMBEDDED"},"message":"The repository repository-with-userprofile-ldap has been created.","status":201}
{"repository":{"name":"repository-with-file-openidconnect","status":"ONLINE","type":"DYNAMIC","authenticationType":"OPENIDC_FILE","datasourceType":"H2_EMBEDDED"},"message":"The repository repository-with-file-openidconnect has been created.","status":201}
{"repository":{"name":"repository-with-userprofile","status":"ONLINE","type":"DYNAMIC","authenticationType":"USERPROFILE","datasourceType":"H2_EMBEDDED"},"message":"The repository repository-with-userprofile has been created.","status":201}
{"repository":{"name":"repository-with-file","status":"ONLINE","type":"DYNAMIC","authenticationType":"FILE","datasourceType":"H2_EMBEDDED"},"message":"The repository repository-with-file has been created.","status":201}
{"repository":{"name":"repository-with-file-ldap","status":"ONLINE","type":"DYNAMIC","authenticationType":"LDAP_FILE","datasourceType":"H2_EMBEDDED"},"message":"The repository repository-with-file-ldap has been created.","status":201}
{"repository":{"name":"repository-without-authentication","status":"ONLINE","type":"DYNAMIC","authenticationType":"","datasourceType":"H2_EMBEDDED"},"message":"The repository repository-without-authentication has been created.","status":201}
{"repository":{"name":"repository-with-ldap","status":"ONLINE","type":"DYNAMIC","authenticationType":"LDAP","datasourceType":"H2_EMBEDDED"},"message":"The repository repository-with-ldap has been created.","status":201}
{"repository":{"name":"repository-with-openidconnect","status":"ONLINE","type":"DYNAMIC","authenticationType":"OPENIDC","datasourceType":"H2_EMBEDDED"},"message":"The repository repository-with-openidconnect has been created.","status":201}
{"repository":{"name":"repository-with-userprofile-openidconnect","status":"ONLINE","type":"DYNAMIC","authenticationType":"OPENIDC_USERPROFILE","datasourceType":"H2_EMBEDDED"},"message":"The repository repository-with-userprofile-openidconnect has been created.","status":201}
{"repository":{"name":"repository-without-authentication","status":"ONLINE","type":"DYNAMIC","authenticationType":"","datasourceType":"H2_SERVER"},"message":"The repository repository-without-authentication3 has been created.","status":201}
{"message":"The repository repository-with-userprofile-ldap has not been created.","status":400,"error":"The url to the ldap server is empty."}
{"message":"The repository repository-with-userprofile-ldap has not been created.","status":500,"error":"An error occurred during the repository configuration: The h2 server was not able to start.\nException: ...."}
delete /repositories/{repositoryId}
Delete a repository that was created using the create repository web service.
The deletetion of repository removes the folder and all of its content in the directory that contains the repositories. This directory can be configured in the properties files of the administration server as described in Administration Server configuration.
No effect on static repositories.
{
"repositoryName" : "repositoryName",
"message" : "message",
"isDatabaseDeleted" : true,
"status" : "status"
}
application/json
{"repositoryName":"SampleRepository","isDatabaseDeleted":true,"message":"The repository SampleRepository has been completely deleted.","status":200}
{"error":"The repository SampleRepository has not been found.","message":"The repository SampleRepository has not been deleted.","status":404}
{"error":"Something happens during the repository deletion: The repository designer-server could not to be stopped because the file used to store repository data has not been found.","message":"The repository repository-with has not been deleted.","status":500}
post /repositories/export/{repositoryId}
Export the database of the repository into an xml file.
The body of the request take two parameters: needsEncryption which is mandatory and password which is optional but needed if needsEncryption is set to true.
As the export of the database can take time, the web service will schedule an asynchronous job and return the link where you will be able to download the file in the response under the url attribute.
If needsEncryption is set to false the export of the database will create an xml file representing the CDO database in the export folder which can be configured in the properties files of the Administration Server as described in Administration Server configuration. If needsEncryption is set to true then an encrypted zip file containing the xml file will be created instead.
application/json
{
"value" : {
"needsEncryption" : true,
"password" : "aPassword"
}
}
{
"repository" : "repository",
"message" : "message",
"url" : "url",
"status" : "status"
}
application/json
{"url":"http://localhost:8080/api/v1.0/exports/repositories/uc2/uc2_200306122258+0100.xml","repository":"SampleRepository","message":"The export for the repository uc2 as been launched. You will be able to retrieved the exported data at the url: http://localhost:8080/api/v1.0/exports/repositories/uc2/uc2_200306122258+0100.xml","status":202}
{"url":"http://localhost:8080/api/v1.0/exports/repositories/uc2/uc2_200306122313+0100.zip","repository":"SampleRepository","message":"The export for the repository uc2 as been launched. You will be able to retrieved the exported data at the url: http://localhost:8080/api/v1.0/exports/repositories/uc2/uc2_200306122313+0100.zip","status":202}
{"error":"NO_ISSUE_DIAGNOSTIC","message":"The repository repository-with-file will not be exported.","status":400}
{"error":"The repository SampleRepository has not been found.","message":"The repository SampleRepository will not be exported.","status":404}
get /repositories
{
"repositories" : [ {
"datasourceType" : "H2_EMBEDDED",
"authenticationType" : "",
"repositorName" : "repositorName",
"type" : "STATIC",
"status" : "ONLINE"
}, {
"datasourceType" : "H2_EMBEDDED",
"authenticationType" : "",
"repositorName" : "repositorName",
"type" : "STATIC",
"status" : "ONLINE"
} ],
"message" : "message",
"status" : "status"
}
application/json
{"repositories":[{"name":"OnlineDynamicRepositorySample","status":"ONLINE","type":"DYNAMIC","authenticationType":"","datasourceType":"H2_EMBEDDED"},{"name":"OfflineDynamicRepositorySample","status":"OFFLINE","type":"DYNAMIC","authenticationType":"","datasourceType":"H2_EMBEDDED"},{"name":"designer-server","status":"ONLINE","type":"STATIC","authenticationType":"FILE"}],"message":"All available repositories","status":200}
get /repositories/history/{repositoryId}
{
"repository" : {
"activityMetadataExport" : {
"activities" : [ {
"date" : "date",
"changes" : [ {
"type" : "CREATED",
"objectId" : "objectId"
}, {
"type" : "CREATED",
"objectId" : "objectId"
} ],
"description" : "description",
"user" : "user",
"properties" : [ {
"value" : "value",
"key" : "key"
}, {
"value" : "value",
"key" : "key"
} ]
}, {
"date" : "date",
"changes" : [ {
"type" : "CREATED",
"objectId" : "objectId"
}, {
"type" : "CREATED",
"objectId" : "objectId"
} ],
"description" : "description",
"user" : "user",
"properties" : [ {
"value" : "value",
"key" : "key"
}, {
"value" : "value",
"key" : "key"
} ]
} ],
"from" : "from",
"to" : "to"
},
"repositorName" : "repositorName"
},
"message" : "message",
"status" : "status"
}
application/json
{"repository":{"name":"SampleRepository","status":"OFFLINE","type":"DYNAMIC"},"message":"The commit history of repository SampleRepository has been exported.","status":200}
{"error":"The repository SampleRepository is not started.","message":"The commit history of repository SampleRepository has not been exported.","status":400}
{"error":"The repository SampleRepository has not been found.","message":"The commit history of repository SampleRepository has not been exported.","status":404}
{"error":"An error occurred while exporting the commit history.","message":"The commit history of repository designer-server has not been exported.","status":500}
post /repositories/import/{repositoryId}
Restore a repository from the uploaded xml file.
This file must be a backup of the database.
If the repository was exported as a zip, it must be unzipped manually before being imported.
As this API needs a file, we suggest you to use the input file of your favorite browser in order to let it set the correct headers for the upload of the file. As the import of the database can take time, the web service will schedule an asynchronous job.
The state (ONLINE | OFFLINE) of the repository will be the same after the import as before the import.
Static repositories are not managed.
multipart/form-data
{
"repository" : "repository",
"message" : "message",
"status" : "status"
}
appication/json
application/json
{"repository":"SampleRespository","message":"The data are being imported to the repository SampleRepository. The state of the repository will be the same after and before the import.","status":202}
{"message":"The import of the repository repository-with-userprofile will not be launched.","status":400,"error":"The import will not be executed because some connections remains (alice, bob)"}
{"error":"javax.servlet.ServletException: Not a multipart request!","status":400}
{"error":"The repository SampleRepository has not been found.","message":"The import of the repository SampleRepository will not be launched.","status":404}
get /repositories/start/{repositoryId}
Start a repository.
For dynamic repositories (created using the web service to create a repository), the lifecycle hooks will be called before and after its start.
{
"repository" : {
"datasourceType" : "H2_EMBEDDED",
"authenticationType" : "",
"repositorName" : "repositorName",
"type" : "STATIC",
"status" : "ONLINE"
},
"message" : "message",
"status" : "status"
}
application/json
{"repository":{"name":"SampleRepository","status":"ONLINE","type":"DYNAMIC","authenticationType":"LDAP_USERPROFILE","datasourceType":"H2_EMBEDDED"},"message":"The repository uc1 has been started.","status":200}
{"error":"The repository SampleRepository is not stopped.","message":"The repository SampleRepository has not been started.","status":400}
{"error":"The repository SampleRepository has not been found.","message":"The repository SampleRepository has not been started.","status":404}
get /repositories/stop/{repositoryId}
Stop a repository.
For dynamic repositories (created using the web service to create a repository), the lifecycle hooks will be called before and after its stop.
{
"repository" : {
"repositorName" : "repositorName",
"type" : "STATIC",
"status" : "ONLINE"
},
"message" : "message",
"status" : "status"
}
application/json
{"repository":{"name":"SampleRepository","status":"OFFLINE","type":"DYNAMIC"},"message":"The repository SampleRepository has been stopped.","status":200}
{"error":"The repository SampleRepository is not started.","message":"The repository SampleRepository has not been stopped.","status":400}
{"error":"The repository SampleRepository has not been found.","message":"The repository SampleRepository has not been stopped.","status":404}
{"error":"An error occurred while stopping the repository: The repository designer-server could not to be stopped because the file used to store repository data has not been found.","message":"The repository designer-server has not been stopped.","status":500}
get /tasks/{taskId}
{
"running" : true,
"pid" : 0,
"message" : "message",
"status" : "status"
}
application/json
{"pid":123456789,"running":true,"message":"Status of task 123456789","status":200}
post /users
Create a user in the repository.
The body of the request take a JSON object with the following parameters: id, isAdministrator, password and permissions. The id and isAdministrator are mandatory.
The password is required if the repository authentication is not managed with LDAP.
The permissions parameter is used for repositories with authorization managed with user profiles. This parameter is an array of project name which will be used to grant writing rights to the user for those projects.
application/json
{
"value" : {
"id" : "Horatio Nelson",
"isAdmin" : true,
"password" : "samplePassword",
"permissions" : [ ]
}
}
{
"projectNames" : [ "projectNames", "projectNames" ],
"repositoryName" : "repositoryName",
"message" : "message",
"user" : {
"permissions" : [ "permissions", "permissions" ],
"id" : "id",
"isAdmin" : true
},
"status" : "status"
}
application/json
{"user":{"id":"John Fryer","isAdmin":false,"permissions":["Awesome-project"]},"repositoryName":"repository-with-userprofile","projectNames":["Awesome-project"],"message":"The user Horatio Nelson has been created in the repository repository-with-userprofile.","status":201}
{"user":{"id":"Horatio Nelson","isAdmin":true,"permissions":[]},"repositoryName":"repository-with-userprofile","projectNames":["Awesome-project"],"message":"The user Horatio Nelson has been created in the repository repository-with-userprofile.","status":201}
{"error":"The repository SampleRepository has not been found.","message":"The user Horatio Nelson4 cannot be created.","status":400}
{"error":"The user is already registered for repository repository-with-userprofile.","message":"The user Horatio Nelson cannot be created.","status":400}
delete /users/{userName}
{
"repositoryName" : "repositoryName",
"message" : "message",
"status" : "status"
}
application/json
{"repositoryName":"repository-with-userprofile","message":"The user Horatio Nelson has been deleted from the repository repository-with-userprofile.","status":200}
{"error":"The repository repository-with-userprofile has not been found.","message":"The user Horatio Nelson has not been deleted from the repository repository-with-userprofile.","status":400}
{"error":"The user Horatio Nelson has not been found in the repository repository-with-userprofile.","message":"The user Horatio Nelson has not been deleted from the repository repository-with-userprofile.","status":404}
get /users
{
"repositoryName" : "repositoryName",
"message" : "message",
"users" : [ {
"permissions" : [ "permissions", "permissions" ],
"id" : "id",
"isAdmin" : true
}, {
"permissions" : [ "permissions", "permissions" ],
"id" : "id",
"isAdmin" : true
} ],
"status" : "status"
}
application/json
{"repositoryName":"repository-with-userprofile","users":[{"id":"Horatio Nelson","isAdmin":true,"permissions":[]}],"message":"The list of users for the repository repository-with-userprofile.","status":200}
{"error":"The repository SampleRepository has not been found.","message":"Users cannot be listed on repository SampleRepository.","status":400}
put /users/{userName}
Update user data.
The behavior of this service is to delete and recreate the user with the new data.
The body of the request takes the same data than the creation request.
application/json
{
"id" : "Horatio Nelson",
"isAdmin" : false,
"password" : "samplePassword",
"permissions" : [ "Other-project" ]
}
{
"projectNames" : [ "projectNames", "projectNames" ],
"repositoryName" : "repositoryName",
"message" : "message",
"user" : {
"permissions" : [ "permissions", "permissions" ],
"id" : "id",
"isAdmin" : true
},
"status" : "status"
}
application/json
{"user":{"id":"Horatio Nelson","isAdmin":false,"permissions":["Other-project"]},"repositoryName":"repository-with-userprofile","projectNames":["Awesome-project","Other-project"],"message":"The user Horatio Nelson has been updated in the repository repository-with-userprofile.","status":201}
{"error":"The repository SampleRepository has not been found.","message":"The user Horatio Nelson has not been updated in the repository SampleRepository.","status":400}
{"error":"The user name of the user (John Fryer) to update is not the same than the user name provided in data used to update (John Fryer2).","message":"The user John Fryer has not been updated in the repository SampleRepository.","status":400}
{"error":"The user John Fryer has not been found in the repository repository-with-userprofile.","message":"The user John Fryers has not been updated in the repository repository-with-userprofile.","status":404}
Activity
ActivityMetadaExport
ActivityProperty
Change
CommitHistory
NewRepository
NewUser
Project
Repository
SimpleRepository
User
export_repositoryId_body
import_repositoryId_body
inline_response_200
inline_response_200_1
inline_response_200_2
inline_response_200_3
inline_response_200_4
inline_response_200_5
inline_response_200_6
inline_response_200_7
inline_response_200_8
inline_response_201
inline_response_201_1
inline_response_202
inline_response_202_1
inline_response_202_2
inline_response_202_3
inline_response_202_4
inline_response_400
inline_response_404
Repository
Upimport_repositoryId_body
Upinline_response_200_6
Upinline_response_200_7
Upinline_response_202_3
Up