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