<< Click to Display Table of Contents >> REST Service Start |
❖Deploy as a REST service in schedule tasks
In the experimental design in the previous section, the connectivity of the interface was simply tested, and the service was not turned on. Currently, the external call to the interface cannot return results.
Yonghong products deploy WEB services by scheduling tasks, and control the opening and closing of WEB services by scheduling task operations. The following is an example of a deployment service.
1. Enter the scheduling task module, create a new job, enter the name and other configuration information. In the task type, select In-depth analysis experiment, the experiment selects the experiment saved in REST Experiment Design, and the operation selects to deploy as REST service.
2. Save the job and run the job. When the job execution result is running, the REST service deployment is completed, and the operation and stop of the service are controlled by controlling the opening and closing of the job.
3. When the service is started, the test data can be sent through the interface call tool, and the calculated return data is the predicted result.
Open the saved experiment, click Service Configuration under the More menu, and select the parameter configuration option.
The API interface in the above figure is the url of the REST interface. The API key is the apiKey of the REST interface. The automatically generated url is the same, and the apiKey is different. It is used to locate the experiment and is a necessary Query parameter. For details, please refer to the interface call explanation in the REST API method description.
Note: Only the POST method is supported.
4. Use the tool to transfer 10 lines of test data and call the REST interface to get the prediction result.
The above figure shows the data passed by the test tool and the returned result after calculation. You can see that 10 rows of data are passed for prediction, and 10 rows of predicted values are returned. Users can use this interface to call WEB services for related business deployment and data analysis.
Note: After modifying the experiment, you need to restart the scheduling task.