Using Swagger Page
The CDE job options that you pass to the requests can get cumbersome. You can use the Swagger page to construct and test your requests.
You can access the Swagger page from the Virtual Cluster Service Details page by clicking API DOC as shown below.
An example procedure to construct and test request:
- Click the GET/jobs method in the jobs section.
- Click Try it out.
- Enter a few options in the provided fields. For example, ensure that the latestjob flag is set to true and enter name[eq]cde_api_job string in the first field.
- Click Execute.
The Request URL field is populated now. You can use this to construct your next request, as shown below. Also a response preview is provided.
- Using the highlighted portion of the Request URL, construct a new
request as shown
# Show the latest job whose name is cde_cli_job curl -H "Authorization: Bearer $ACCESS_TOKEN" -X GET "$JOBS_API_URL/jobs?latestjob=true&filter=name%5Beq%5Dcde_cli_job&limit=20&offset=0&orderby=name&orderasc=true" \ -H "accept: application/json" \ -H "Content-Type: application/json"