Project

General

Profile

DataSet resources and representations » History » Version 2

Anonymous, 28/07/2017 17:12

1 1 Anonymous
h1. DataSet resources and representations
2 1 Anonymous
3 1 Anonymous
h2. Resources
4 1 Anonymous
5 1 Anonymous
h3. 1. Resources List:
6 1 Anonymous
7 2 Anonymous
|_. URL                           |_.Verb|_.Description                                              |_. Code|_. Response         |_. Comments                   |
8 2 Anonymous
| /datasets/{datasetsId}       | GET  |Method to retrieve a single or all datasets| 200   | The dataset's nodes' information as JSON|          |
9 2 Anonymous
| /datasets/{datasetsId}    |DELETE|Method to delete a dataset by ID | 200   | The dataset's nodes' information as JSON|          |
10 2 Anonymous
| /datasets/{datasetsId}/start     | PUT  |  Activate the dataset {datasetId}                       | 200   | The dataset's nodes' information as JSON|           |
11 2 Anonymous
| /datasets/{datasetsId}/stop      | PUT  |  deactivate the dataset {datasetId}                     | 200   | The dataset's nodes' information as JSON|           |
12 2 Anonymous
| /datasets/{datasetsId}/getSqlString| PUT  | Builds and returns the underlying datasource SQL request string for the dataset.| 200  |get success message and sql as JSON|           |
13 2 Anonymous
| /datasets/{datasetsId}/refresh| PUT  |Method to refresh dataset status {datasetId} | 200   |The latest dataset's nodes' information as JSON|           |
14 2 Anonymous
| /datasets/{datasetsId}/notify| PUT  |Manage notification of dataset resources updating| 200   | OK|Response sent to indicate that handling occured |
15 2 Anonymous
| /datasets/{datasetsId}/notify| PUT  |Manage notification of dataset 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.|
16 2 Anonymous
| /datasets/{datasetsId}/mappings| GET  |Method to retrieve the complete dictionaries mapping| 200  |Dictionaries mapping information as JSON|Returns a SITools2 response, indicating if the object retrieval was OK or not, and containing the object if yes.  |
17 2 Anonymous
| /datasets/{datasetsId}/mappings| GET  |Method to retrieve the complete dictionaries mapping| 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. |
18 2 Anonymous
| /datasets| GET |Method to the list of all projects available in Sitools.| 200   | Dataset's information as JSON|           |
19 2 Anonymous
| /datasets| 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|           |
20 1 Anonymous
21 2 Anonymous
22 1 Anonymous
23 1 Anonymous
h3. 2. Methods:
24 1 Anonymous
* GET: Method to retrieve a single or all datasets
25 1 Anonymous
* PUT:
26 1 Anonymous
 1. PUT /{datasetId}/start:  Performs a start action on the dataset making the related DatasetApplication ACTIVE.
27 1 Anonymous
 2. PUT /{datasetId}/getSqlString: Builds and returns the underlying data source SQL request string for the dataset.
28 1 Anonymous
 3. PUT /{datasetId}/stop: Performs a stop action on the dataset making the related DatasetApplication INACTIVE.
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 PUT http://$localhost/sitools/datasets/$dataset_id/start
35 1 Anonymous
36 1 Anonymous
curl -u $username:$userpwd -X PUT http://$localhost/sitools/datasets/$dataset_id/start
37 1 Anonymous
38 1 Anonymous
curl -u $username:$userpwd -X PUT http://$localhost/sitools/datasets/$dataset_id/getSqlString
39 1 Anonymous
40 1 Anonymous
</code></pre>
41 1 Anonymous
42 1 Anonymous
h3. 4. Results of the above examples: 
43 1 Anonymous
44 1 Anonymous
1.  Performs a stop action on the dataset 
45 1 Anonymous
!Selection_357.jpg!
46 1 Anonymous
2.  Performs a start action on the dataset
47 1 Anonymous
!Selection_359.jpg!
48 1 Anonymous
3.  Builds and returns the underlying data source SQL request string for the dataset.
49 1 Anonymous
!Selection_358.jpg!
50 1 Anonymous
51 1 Anonymous
52 1 Anonymous
h3. 5. PUT and POST
53 1 Anonymous
54 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).
55 1 Anonymous
* PUT: Used to create a resource, or overwrite it. While you specify the resources new URL. It is not idempotent.
56 1 Anonymous
* POST can't be used for modifying the status of a dataset in Sitools.
57 1 Anonymous
 
58 1 Anonymous
59 1 Anonymous
h2. Representations
60 1 Anonymous
61 1 Anonymous
* JSON response output representation (application/json - )
62 1 Anonymous
63 1 Anonymous
64 1 Anonymous
Example: 
65 1 Anonymous
<pre><code class="html">
66 1 Anonymous
http://idoc-medoc-test/webs_PICARD_dataset?media=json
67 1 Anonymous
</code></pre>
68 1 Anonymous
Then all information about the dataset come, including all XML nodes infomation, id, name, status, description, columnModel result block etc..