private ResourceInstance createResourceInstance(Long upgradeId) {
    Map<Resource.Type, String> mapIds = new HashMap<>();
    mapIds.put(Resource.Type.Cluster, m_clusterName);

    if (null != upgradeId) {
      mapIds.put(Resource.Type.Upgrade, upgradeId.toString());
    }

    return createResource(Resource.Type.Upgrade, mapIds);
  }
@param upgradeId the upgrade id
@return the resource instance
ambari-server/src/main/java/org/apache/ambari/server/api/services/UpgradeService.java