Technology preview: 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.

About this task

The WebSphere Automation REST API are a technology preview in this release and are not supported.

Procedure

  1. In the OpenShift Container Platform console, click Networking > Routes.
  2. To access the Swagger UI, follow the instructions for your version of WebSphere Automation.
    • For WebSphere Automation 1.4.3 and later:
      1. On the Routes page, locate the cpd entry.
      2. Copy the URL in the Location column.
      3. Open a new browser tab or window.
      4. 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 WebSphere Automation 1.4.2 and earlier:
      1. On the Routes page, locate one of the following entries.
        • For security: wsa-secure-apis
        • For health: wsa-healing-rest
      2. Click the URL in the Location column.

        A blank browser window opens at this URL.

      3. Click the browser address field, append /openapi/ui to the existing URL, and press Enter.
    The Swagger UI opens in the browser window.
  3. Click Authorize.
    The Available authorizations dialog opens.
  4. In the Value text box, enter a token value for an authorized user profile.
    To get the token:
    1. Get the password for the administrator account.
      oc -n WSA_INSTANCE_NAMESPACE get secret admin-user-details -o jsonpath='{.data.initial_admin_password}' | base64 -d && echo

      WSA_INSTANCE_NAMESPACE is the namespace of the instance where WebSphere Automation is installed; if the default value was chosen at installation, the value is websphere-automation.

    2. Replace <password> in the following command with the value returned from the command in the previous step, and use the correct value for WSA_INSTANCE_NAMESPACE.
      curl -k -X POST -H 'Content-Type: application/json' -d '{"username":"admin","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
    For more information, see your cluster administrator.

Results

After successfully authorizing with a valid token, you can use the Swagger UI to view the WebSphere Automation REST API.