Verify that your SQL Tuning Services environment is set up correctly by invoking an SQL Tuning Services API from the Swagger interface.
About this task
Use the SQL Tuning Services Swagger interface invoke RESTful APIs. You can invoke all of the SQL Tuning Services APIs directly from the Swagger interface after you generate and authorize a Bearer token for your user ID.
Procedure
- Open the Swagger interface:
https://{host}:{port}/tuningservice/v1/swagger-ui/index.html
- Generate a token.
- Expand /tuningservice/v1/auth/tokens
- Click Try it out.
- Specify your SQL Tuning Services user ID and password.
- Click Execute to generate the token.
- Copy the generated token (without the quotation marks).
- Authorize the token that you generated.
- Click Authorize in the upper right corner of the
window.
- In the Value field, specify the token in the following format:
Bearer <token_value>
Make sure that the
string Bearer and the token value are separated by a single blank space.
- Click Authorize.
- Verify that your SQL Tuning Services environment is set up correctly by invoking a tuning action.
After you complete the previous steps, you can use SQL Tuning Services APIs to run the tuning features that are available in your SQL Tuning Services environment.
See Example POST requests for running tuning actions for example syntax for invoking a tuning API. These examples use the Visual Explainer API to demonstrate how to use SQL Tuning Services with a simple SELECT statement, but they can be applied to other SQL Tuning Services tuning APIs.
When the job finishes successfully, you can use the job ID to view the results to query the job information or to cancel the job. For example, the following command returns a URL that you can copy into a web browser to view the results of running a tuning action.
curl -X 'GET' \
'https://service_ip:httpsport/tuningservice/v1/jobs/job_ID/result' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer Bearer_token_for_the_SQL_Tuning_Services_ID'