Project

General

Profile

Project resources and representations » History » Version 7

Anonymous, 28/07/2017 17:16

1 1 Anonymous
h1. Project resources and representations
2 1 Anonymous
3 1 Anonymous
4 1 Anonymous
h2. Resources
5 1 Anonymous
6 1 Anonymous
h3. 1. Resources List:
7 1 Anonymous
8 6 Anonymous
|_. URL                           |_.Verb|_.Description                                              |_. Code|_. Response         |_. Comments                   |
9 6 Anonymous
| /projects/{projectId}           | GET  |  Retrieve all information of the project and its datasets | 200   | All project's nodes and dataSets as JSON|          |
10 6 Anonymous
| /projects/{projectId}/start     | PUT  |  Activate the project {projectId}                         | 200   | All project's node and dataSets as JSON|           |
11 6 Anonymous
| /projects/{projectId}/stop      | PUT  |  deactivate the project {projectId}                       | 200   | All project's node and dataSets as JSON|           |
12 6 Anonymous
| /projects/{projectId}/startmaintenance| PUT  |  Activate the project maintenance {projectId}       | 200   | All project's node and dataSets as JSON|           |
13 6 Anonymous
| /projects/{projectId}/stopmaintenance| PUT  |  deactivate the project maintenance{projectId}       | 200   | All project's node and dataSets as JSON|           |
14 6 Anonymous
| /projects/{projectId}/graph| GET  |  Retrieve the information of the project graph {projectId}     | 200   | The project graph ID and nodelist asJSON |        |
15 6 Anonymous
| /projects/{projectId}/notify| PUT  |Manage notification of project resources updating| 200   | OK|Response sent to indicate that handling occured |
16 7 Anonymous
| /projects/{projectId}/notify| PUT  |Manage notification of project resources updating| 403   | Sitools2 error page - The server understood the request, but is refusing to fulfill it|Request not authorized due to roles and methods access security configuration for this user.|
17 6 Anonymous
| /projects/{projectId}/graph/notify| PUT  |Manage notifications of graph resources updates| 200| OK|Response sent to indicate that handling occured|
18 7 Anonymous
| /projects/{projectId}/graph/notify| PUT  |Manage notifications of graph resources updates| 403| Sitools2 error page - The server understood the request, but is refusing to fulfill it|Request not authorized due to roles and methods access security configuration for this user.|
19 6 Anonymous
| /projects| GET |Method to the list of all projects available in Sitools.| 200   | All projects' information as JSON|           |
20 7 Anonymous
| /projects| GET |Method to the list of all projects available in Sitools.| 403   |Sitools2 error page - The server understood the request, but is refusing to fulfill it|Request not authorized due to roles and methods access security configuration for this user.|
21 1 Anonymous
22 1 Anonymous
23 1 Anonymous
24 1 Anonymous
h3. 2. Methods:
25 1 Anonymous
* GET: Method to retrieve a single or all projects.
26 1 Anonymous
* PUT: Method to modify the current status of a project. (activate or deactivate)
27 1 Anonymous
* DELETE: Method to delete a single project by ID
28 1 Anonymous
* POST
29 1 Anonymous
30 1 Anonymous
31 1 Anonymous
h3. 3. Examples:
32 1 Anonymous
33 1 Anonymous
<pre><code class="python">
34 1 Anonymous
curl -u $username:$userpwd -X GET http://$HOST_DOMAIN/sitools/projects/$project_id
35 1 Anonymous
curl -u $username:$userpwd -X GET http://$localhost/sitools/projects/$project_id/graph
36 1 Anonymous
curl -u $username:$userpwd -X PUT http://$HOST_DOMAIN/sitools/projects/$project_id/stop
37 1 Anonymous
curl -u $username:$userpwd -X PUT http://$HOST_DOMAIN/sitools/projects/$project_id/start
38 1 Anonymous
</code></pre>
39 6 Anonymous
40 6 Anonymous
41 6 Anonymous
h3. 4. Response 
42 6 Anonymous
43 6 Anonymous
h4. Headers
44 6 Anonymous
45 6 Anonymous
46 6 Anonymous
<pre><code class="javascript">
47 6 Anonymous
Content-Type: application/json; charset=UTF-8
48 6 Anonymous
Date: Fri, 28 Jul 2017 13:02:25 GMT
49 6 Anonymous
Accept-Ranges: bytes
50 6 Anonymous
Server: Restlet-Framework/2.0.5
51 6 Anonymous
Transfer-Encoding: chunked
52 6 Anonymous
</code></pre>
53 6 Anonymous
54 6 Anonymous
55 6 Anonymous
56 6 Anonymous
57 6 Anonymous
58 6 Anonymous
h4. Body:
59 6 Anonymous
60 6 Anonymous
<pre><code class="json">
61 6 Anonymous
{
62 6 Anonymous
  "success": true,
63 6 Anonymous
  "message": "project.stop.success",
64 6 Anonymous
  "project": {
65 6 Anonymous
    "id": "a8b7d16d-838e-432c-b712-f5702c1b2a39",
66 6 Anonymous
    "name": "Medoc-Solar-Portal",
67 6 Anonymous
    "description": "Solar datasets",
68 6 Anonymous
    "image": {
69 6 Anonymous
      "type": "Image",
70 6 Anonymous
      "url": "/sitools/upload/soho_logo.gif",
71 6 Anonymous
      "mediaType": "Image"
72 6 Anonymous
    },
73 6 Anonymous
...
74 6 Anonymous
}
75 6 Anonymous
</code></pre>
76 6 Anonymous
77 1 Anonymous
78 1 Anonymous
h3. 4. PUT and POST
79 1 Anonymous
80 1 Anonymous
* POST: Used to modify and update a resource. It is idempotent(Do it as many times I want with the same result at last).
81 1 Anonymous
* PUT: Used to create a resource, or overwrite it. While you specify the resources new URL. It is not idempotent.
82 1 Anonymous
* POST can't be used for modifying the status of a project in Sitools.
83 1 Anonymous
 
84 1 Anonymous
85 1 Anonymous
h2. Representations
86 1 Anonymous
87 1 Anonymous
* JSON response output representation (application/json - )
88 1 Anonymous
89 1 Anonymous
90 1 Anonymous
Example: 
91 1 Anonymous
<pre><code class="html">
92 1 Anonymous
http://idoc-medoc-test/project/solar?media=json
93 1 Anonymous
</code></pre>
94 1 Anonymous
Then all information about the project come, including all XML nodes infomation, name, description, datasets result block etc..