Get the device's associated credential name via API

Get the device's associated credential name via API

Hi,
In the Rest API documentation it's mentioned to use GetCredentialsForDevice endpoint to get associated credentials of a device, but in the response, I get all the credentials from different types exist in OPManager, and it's not possible to recognize the credential related to the device actually. here is a response example of  http://localhost:8060/api/json/device/GetCredentialsForDevice :
  1. {
  2.     "snmp": [
  3.         {
  4.             "credentialName": "Public",
  5.             "type": "SNMP v1/v2",
  6.             "checked": ""
  7.         },
  8.         {
  9.             "credentialName": "MyCredential",
  10.             "type": "SNMP v1/v2",
  11.             "checked": ""
  12.         },
  13.         {
  14.             "credentialName": "SNMP V3 Cred",
  15.             "type": "SNMP v3",
  16.             "checked": ""
  17.         }
  18.     ],
  19.     "todisplayCitrix": "FALSE",
  20.     "toDisplay": "all",
  21.     "todisplayVMWare": "FALSE",
  22.     "todisplayUCS": "FALSE",
  23.     "cliCredentials": [
  24.         {
  25.             "credentialName": "Centos linux SSH",
  26.             "type": "Linux",
  27.             "checked": ""
  28.         }
  29.     ],
  30.     "wmiCredentials": [
  31.         {
  32.             "credentialName": "testCred",
  33.             "type": "Windows",
  34.             "checked": ""
  35.         }
  36.     ]
  37. }

The same is for getAssociatedCredentials, Which lists all available credentials of snmp or WMI types and makes it impossible to detect the actual associated credentials with the device, ( http://localhost:8060/api/json/device/getAssociatedCredentials )

  1. {
  2.     "VMwareCredentialName": "None",
  3.     "nonSnmpCredType": "single",
  4.     "hrType": "WMI",
  5.     "parentCategory": "DomainController",
  6.     "SnmpCredentialName": "MyCredential",
  7.     "snmpCredentialList": [
  8.         "None",
  9.         "SNMP V3 Cred",
  10.         "MyCredential",
  11.         "Public"
  12.     ],
  13.     "CitrixCredentialName": "None",
  14.     "type": "Windows 2008 R2",
  15.     "windowsCredentialList": [
  16.         "testCred",
  17.         "WMI - mail server"
  18.     ]
  19. }
How could you recognize that the WMI credential of this device is  "WMI - mail server" and not "testCred"?
Thanks



                New to ADSelfService Plus?