Project resources and representations » History » Version 3
Version 2 (Guanji Wang, 27/07/2017 17:20) → Version 3/7 (Guanji Wang, 27/07/2017 17:23)
h1. Project resources and representations
h2. Resources
h3. 1. Resources List:
* http://$HOST_DOMAIN/sitools/projects/{projectId}
* http://$HOST_DOMAIN/sitools/projects/{projectId}/start
* http://$HOST_DOMAIN/sitools/projects/{projectId}/stop
* http://$HOST_DOMAIN/sitools/projects/{projectId}/startmaintenance
* http://$HOST_DOMAIN/sitools/projects/{projectId}/stopmaintenance
* http://$HOST_DOMAIN/sitools/projects/{projectId}/graph
* http://$HOST_DOMAIN/sitools/projects/{projectId}/datasets
* http://$HOST_DOMAIN/sitools/projects/{projectId}/notify
* http://$HOST_DOMAIN/sitools/projects/{projectId}/graph/notify
* http://$HOST_DOMAIN/sitools/projects/
$HOST_DOMAIN = Starter.PUBLIC_HOST_DOMAIN
h3. 2. Methods:
* GET: Method Resource to retrieve modify the current status of a single or all projects. project.
* PUT: Method Resource to modify the current status of a project. (activate or deactivate)
* DELETE: Method to delete a single project by ID
* POST
h3. 3. Examples:
<pre><code class="python">
curl -u $username:$userpwd -X GET http://$HOST_DOMAIN/sitools/projects/$project_id
curl -u $username:$userpwd -X GET http://$localhost/sitools/projects/$project_id/graph
curl -u $username:$userpwd -X PUT http://$HOST_DOMAIN/sitools/projects/$project_id/stop
curl -u $username:$userpwd -X PUT http://$HOST_DOMAIN/sitools/projects/$project_id/start
</code></pre>
h3. 4. PUT and POST
* POST: Used to modify and update a resource. It is idempotent(Do it as many times I want with the same result at last).
* PUT: Used to create a resource, or overwrite it. While you specify the resources new URL. It is not idempotent.
* POST can't be used for modifying the status of a project in Sitools.
h2. Representations
* JSON response output representation (application/json - )
Example:
<pre><code class="html">
http://idoc-medoc-test/project/solar?media=json
</code></pre>
Then all information about the project come, including all XML nodes infomation, name, description, datasets result block etc..
h2. Resources
h3. 1. Resources List:
* http://$HOST_DOMAIN/sitools/projects/{projectId}
* http://$HOST_DOMAIN/sitools/projects/{projectId}/start
* http://$HOST_DOMAIN/sitools/projects/{projectId}/stop
* http://$HOST_DOMAIN/sitools/projects/{projectId}/startmaintenance
* http://$HOST_DOMAIN/sitools/projects/{projectId}/stopmaintenance
* http://$HOST_DOMAIN/sitools/projects/{projectId}/graph
* http://$HOST_DOMAIN/sitools/projects/{projectId}/datasets
* http://$HOST_DOMAIN/sitools/projects/{projectId}/notify
* http://$HOST_DOMAIN/sitools/projects/{projectId}/graph/notify
* http://$HOST_DOMAIN/sitools/projects/
$HOST_DOMAIN = Starter.PUBLIC_HOST_DOMAIN
h3. 2. Methods:
* GET: Method Resource to retrieve modify the current status of a single or all projects. project.
* PUT: Method Resource to modify the current status of a project. (activate or deactivate)
* DELETE: Method to delete a single project by ID
* POST
h3. 3. Examples:
<pre><code class="python">
curl -u $username:$userpwd -X GET http://$HOST_DOMAIN/sitools/projects/$project_id
curl -u $username:$userpwd -X GET http://$localhost/sitools/projects/$project_id/graph
curl -u $username:$userpwd -X PUT http://$HOST_DOMAIN/sitools/projects/$project_id/stop
curl -u $username:$userpwd -X PUT http://$HOST_DOMAIN/sitools/projects/$project_id/start
</code></pre>
h3. 4. PUT and POST
* POST: Used to modify and update a resource. It is idempotent(Do it as many times I want with the same result at last).
* PUT: Used to create a resource, or overwrite it. While you specify the resources new URL. It is not idempotent.
* POST can't be used for modifying the status of a project in Sitools.
h2. Representations
* JSON response output representation (application/json - )
Example:
<pre><code class="html">
http://idoc-medoc-test/project/solar?media=json
</code></pre>
Then all information about the project come, including all XML nodes infomation, name, description, datasets result block etc..