ResourceInstance createCredentialResource(String alias) {
    Map<Resource.Type, String> mapIds = new HashMap<>();
    mapIds.put(Resource.Type.Cluster, this.clusterName);
    mapIds.put(Resource.Type.Credential, alias);

    return createResource(Resource.Type.Credential, mapIds);
  }
Create a credential resource instance.

@param alias alias (or credential ID)
@return a credential resource instance
ambari-server/src/main/java/org/apache/ambari/server/api/services/CredentialService.java