Viewing the REST API
A cluster administrator can use the Red Hat® OpenShift® Container Platform (OCP) console to determine the URL for the Swagger UI with the WebSphere Automation REST API.
Procedure
- In the OpenShift Container Platform console, click Networking > Routes.
- To access the Swagger UI, follow the instructions for your version of WebSphere Automation.
- For WebSphere Automation 1.4.3 and later:
- On the Routes page, locate the
cpdentry. - Copy the URL in the Location column.
- Open a new browser tab or window.
- Paste the URL that you copied in step 3 into the browser address field, append one of the
following paths to the URL, and press Enter.
- For Core APIs, append the following
path:
/websphereauto/core/apis/openapi/ui/ - For Health APIs, append the following
path:
/websphereauto/health/apis/openapi/ui/ - For Security APIs, append the following path:
/websphereauto/secvul/apis/openapi/ui/
- For Core APIs, append the following
path:
- On the Routes page, locate the
- For WebSphere Automation 1.4.2 and earlier:
- On the Routes page, locate one of the following entries.
- For security:
wsa-secure-apis - For health:
wsa-healing-rest
- For security:
- Click the URL in the Location column.
A blank browser window opens at this URL.
- Click the browser address field, append
/openapi/uito the existing URL, and press Enter.
- On the Routes page, locate one of the following entries.
The Swagger UI opens in the browser window. - For WebSphere Automation 1.4.3 and later:
- Click Authorize.
The Available authorizations dialog opens.
- In the Value text box, enter a token value for an authorized user
profile.
To get the token:
- Get the password for the administrator
account.
oc -n WSA_INSTANCE_NAMESPACE get secret ibm-iam-bindinfo-platform-auth-idp-credentials -o jsonpath='{.data.admin_password}' | base64 -d && echoWSA_INSTANCE_NAMESPACEis the namespace of the instance where WebSphere Automation is installed; if the default value was chosen at installation, the value iswebsphere-automation. - Replace
<password>in the following command with the value returned from the command in the previous step, and use the correct value forWSA_INSTANCE_NAMESPACE.curl -k -X POST -H 'Content-Type: application/json' -d '{"username":"cpadmin","password":"<password>"}' https://$(oc get route -n WSA_INSTANCE_NAMESPACE -o jsonpath='{.items[?(@.spec.to.name=="ibm-nginx-svc")].spec.host}')/icp4d-api/v1/authorize | jq -r .token
- Get the password for the administrator
account.