Retrieve passwords of VCF component users using Fleet Management API in VCF Operations 9.0.x
search cancel

Retrieve passwords of VCF component users using Fleet Management API in VCF Operations 9.0.x

book

Article ID: 417192

calendar_today

Updated On:

Products

VCF Operations

Issue/Introduction

This article provides instructions on how to retrieve passwords for VMware Cloud Foundation (VCF) component users via the Fleet Management API in VCF Operations 9.0.x.

Environment

VMware Cloud Foundation 9.0.x

Resolution

To retrieve the passwords, follow these steps:

  1. Log in to the VCF Operations user interface.
  2. Navigate to Developer Center > API & SDKs > Fleet Management API.
  3. Authorize the VCF Operations Fleet Management API. For detailed steps on authorization, refer to How to Authorize VCF Operations Fleet Management API.
  4. Switch the API view to Private Internal APIs.
  5. Execute the GET /lcm/locker/api/v3/passwords API call. From the sample JSON response below, locate target user and copy the associated vmid:
    {
      "vmid": "############",
      "alias": "############",
      "userName": "admin",
      "passwordDescription": null,
      "type": "product",
      "status": "active",
      "createdOn": "############",
      "lastUpdatedOn": "############",
      "lastValidatedOn": null,
      "reference": {
        "envId": "############",
        "envName": "############",
        "productId": "############",
        "hostName": "FQDN",
        "ip": "IP_Address",
        "nodeType": null,
        "referenceId": "############"
       }
    }
  6. Execute the POST /lcm/locker/api/passwords/view/{vmid} API call using the vmid obtained in the previous step.
    Note: Viewing the password requires you to provide the Fleet Manager VM root credentials. Add the following required field to the request body, replacing locker:password:<vmid>:<alias> with the actual root credentials for the Fleet Management VM.
    {
     "rootPassword": "locker:password:<vmid>:<alias>"
    }
  7. Click Execute. The response will successfully return the password details:
    {
     "passwordVmid": "############",
     "password": "############"
    }