ResourceInstance createArtifactResource(String clusterName, String artifactName) {
    Map<Resource.Type, String> mapIds = new HashMap<>();
    mapIds.put(Resource.Type.Cluster, clusterName);
    mapIds.put(Resource.Type.Artifact, artifactName);

    return createResource(Resource.Type.Artifact, mapIds);
  }
Create an artifact resource instance.

@param clusterName  cluster name
@param artifactName artifact name

@return an artifact resource instance
ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java