Renamed /getOptions to /options

pull/1/head
Piero Toffanin 2016-09-19 17:25:39 -04:00
rodzic 0bf03d50c6
commit d5a9648fb6
4 zmienionych plików z 16 dodań i 16 usunięć

Wyświetl plik

@ -44,11 +44,11 @@ _Schemes_ : HTTP
[[_paths]] [[_paths]]
== Paths == Paths
[[_getinfo_get]] [[_info_get]]
=== GET /getInfo === GET /info
==== Description ==== Description
Retrieves information about this node. Retrieves information about this node
==== Responses ==== Responses
@ -56,10 +56,10 @@ Retrieves information about this node.
[options="header", cols=".^2,.^14,.^4"] [options="header", cols=".^2,.^14,.^4"]
|=== |===
|HTTP Code|Description|Schema |HTTP Code|Description|Schema
|*200*|Info|<<_getinfo_get_response_200,Response 200>> |*200*|Info|<<_info_get_response_200,Response 200>>
|=== |===
[[_getinfo_get_response_200]] [[_info_get_response_200]]
*Response 200* *Response 200*
[options="header", cols=".^3,.^11,.^4"] [options="header", cols=".^3,.^11,.^4"]
@ -72,8 +72,8 @@ _required_|Current version|string
|=== |===
[[_getoptions_get]] [[_options_get]]
=== GET /getOptions === GET /options
==== Description ==== Description
Retrieves the command line options that can be passed to process a task Retrieves the command line options that can be passed to process a task
@ -149,7 +149,7 @@ _required_|Images to process, plus an optional GPC file. If included, the GPC fi
|*FormData*|*name* + |*FormData*|*name* +
_optional_|An optional name to be associated with the task|string| _optional_|An optional name to be associated with the task|string|
|*FormData*|*options* + |*FormData*|*options* +
_optional_|Serialized JSON string of the options to use for processing, as an array of the format: [{name: option1, value: value1}, {name: option2, value: value2}, …]. For example, [{"name":"cmvs-maxImages","value":"500"},{"name":"time","value":true}]. For a list of all options, call /getOptions|string| _optional_|Serialized JSON string of the options to use for processing, as an array of the format: [{name: option1, value: value1}, {name: option2, value: value2}, …]. For example, [{"name":"cmvs-maxImages","value":"500"},{"name":"time","value":true}]. For a list of all options, call /options|string|
|=== |===

File diff suppressed because one or more lines are too long

Wyświetl plik

@ -92,7 +92,7 @@ let server;
* - * -
* name: options * name: options
* in: formData * in: formData
* description: 'Serialized JSON string of the options to use for processing, as an array of the format: [{name: option1, value: value1}, {name: option2, value: value2}, ...]. For example, [{"name":"cmvs-maxImages","value":"500"},{"name":"time","value":true}]. For a list of all options, call /getOptions' * description: 'Serialized JSON string of the options to use for processing, as an array of the format: [{name: option1, value: value1}, {name: option2, value: value2}, ...]. For example, [{"name":"cmvs-maxImages","value":"500"},{"name":"time","value":true}]. For a list of all options, call /options'
* required: false * required: false
* type: string * type: string
* responses: * responses:
@ -408,7 +408,7 @@ app.post('/task/restart', uuidCheck, (req, res) => {
}); });
/** @swagger /** @swagger
* /getOptions: * /options:
* get: * get:
* description: Retrieves the command line options that can be passed to process a task * description: Retrieves the command line options that can be passed to process a task
* responses: * responses:
@ -442,7 +442,7 @@ app.post('/task/restart', uuidCheck, (req, res) => {
* type: string * type: string
* description: Description of what this option does * description: Description of what this option does
*/ */
app.get('/getOptions', (req, res) => { app.get('/options', (req, res) => {
odmOptions.getOptions((err, options) => { odmOptions.getOptions((err, options) => {
if (err) res.json({error: err.message}); if (err) res.json({error: err.message});
else res.json(options); else res.json(options);
@ -450,9 +450,9 @@ app.get('/getOptions', (req, res) => {
}); });
/** @swagger /** @swagger
* /getInfo: * /info:
* get: * get:
* description: Retrieves information about this node. * description: Retrieves information about this node
* responses: * responses:
* 200: * 200:
* description: Info * description: Info
@ -467,7 +467,7 @@ app.get('/getOptions', (req, res) => {
* type: integer * type: integer
* description: Number of tasks currently being processed or waiting to be processed * description: Number of tasks currently being processed or waiting to be processed
*/ */
app.get('/getInfo', (req, res) => { app.get('/info', (req, res) => {
res.json({ res.json({
version: packageJson.version, version: packageJson.version,
currentTaskQueue: taskManager.getQueueCount() currentTaskQueue: taskManager.getQueueCount()

Wyświetl plik

@ -326,7 +326,7 @@ $(function(){
this.showOptions = ko.observable(false); this.showOptions = ko.observable(false);
this.error = ko.observable(); this.error = ko.observable();
$.get("/getOptions") $.get("/options")
.done(function(json){ .done(function(json){
if (json.error) self.error(json.error); if (json.error) self.error(json.error);
else{ else{