ResourceInstance createStageResource(String clusterName, String requestId, String stageId) {
    Map<Resource.Type,String> mapIds = new HashMap<>();

    if (clusterName != null) {
      mapIds.put(Resource.Type.Cluster, clusterName);
    }
    mapIds.put(Resource.Type.Request, requestId);
    mapIds.put(Resource.Type.Stage, stageId);

    return createResource(Resource.Type.Stage, mapIds);
  }
Create a stage resource instance.

@param clusterName  cluster name
@param requestId    request id
@param stageId      stage id

@return a stage resource instance
ambari-server/src/main/java/org/apache/ambari/server/api/services/StageService.java