Listing an existing workload secret for Cloudera Data Engineering Spark Jobs using API

You can list an existing secret for Cloudera Data Engineering (CDE) Spark Jobs using API.

  1. List the existing workload credentials in the virtual cluster by creating a filter with type that is equal to workload-credential
    curl -k -X "GET" 'https://<dex-vc-host>/dex/api/v1/credentials?filter=type%5Beq%5Dworkload-credential' \
      -H 'Accept: application/json' \
      -H 'Connection: keep-alive' \
      -H 'Content-Type: application/json' \
      -H "Authorization: Bearer ${CDE_TOKEN}"
    
    Response:
    {
      "credentials": [
        {
          "name": "workload-cred-1",
          "type": "workload-credential",
          "description": "workload credential description",
          "created": "2022-10-18T07:26:41Z",
          "modified": "2022-10-18T07:26:41Z"
        }
      ],
      "meta": {
        "hasNext": false,
        "limit": 20,
        "offset": 0,
        "count": 1
      }
    }
  2. Get the existing specific workload credential. For example, workload-cred-1:
    curl -k -X "GET" 'https://<dex-vc-host>/dex/api/v1/credentials/workload-cred-1' \
      -H 'Accept: application/json' \
      -H 'Connection: keep-alive' \
      -H 'Content-Type: application/json' \
      -H "Authorization: Bearer ${CDE_TOKEN}"

    Response:

    {
          "name": "workload-cred-1",
          "type": "workload-credential",
          "description": "worklaod credential description",
          "created": "2022-10-18T07:26:41Z",
          "modified": "2022-10-18T07:26:41Z"
    }