com.cloudera.api.v1
Interface ActivitiesResource


public interface ActivitiesResource


Method Summary
 ApiMetricList getMetrics(String clusterName, String serviceName, String activityId, String from, String to, List<String> metrics, DataView dataView)
          Fetch metric readings for a particular activity.
 ApiActivityList readActivities(String clusterName, String serviceName, Integer maxResults, Integer resultOffset, String query, DataView dataView)
          Read all activities in the system
 ApiActivity readActivity(String clusterName, String serviceName, String activityId, DataView dataView)
          Returns a specific activity in the system
 ApiActivityList readChildActivities(String clusterName, String serviceName, String activityId, Integer maxResults, Integer resultOffset, DataView dataView)
          Returns the child activities
 ApiActivityList readSimilarActivities(String clusterName, String serviceName, String activityId, DataView dataView)
          Returns a list of similar activities
 

Method Detail

readActivities

@Path(value="/")
ApiActivityList readActivities(String clusterName,
                                    String serviceName,
                                    Integer maxResults,
                                    Integer resultOffset,
                                    String query,
                                    DataView dataView)
Read all activities in the system

Parameters:
clusterName - The name of the cluster
serviceName - The name of the service
maxResults - The maximum number of activities to return.
resultOffset - Specified the offset of activities to return.
query - The query to perform to find activities in the system. By default, this call returns top level (i.e. root) activities that have currently started.

The query specifies the intersection of a list of constraints, joined together with semicolons (without spaces). For example:

status==started;parent==
looks for running root activities. This is also the default query.
status==failed;finishTime=gt=2012-04-01T20:30:00.000Z
looks for failed activities after the given date time.
name==Pi Estimator;startTime=gt=2012-04-01T20:30:00.000Z
looks for activities started after the given date time, with the name of "Pi Estimator".
startTime=lt=2012-01-02T00:00:00.000Z;finishTime=ge=2012-01-01T00:00:00.000Z
looks for activities that are active on 2012 New Year's Day. Note that they may start before or finish after that day.
status==failed;parent==000014-20120425161321-oozie-joe
looks for failed child activities of the given parent activity id.
status==started;metrics.cpu_user=gt=10
looks for started activities that are using more than 10 cores per second.
type==hive;metrics.user==bc;finishTime=gt=2012-04-01T20:30:00.000Z
looks for all hive queries submitted by user bc after the given date time.
You may query any fields present in the ApiActivity object. You can also query by activity metric values using the metrics.* syntax. Values for date time fields should be ISO8601 timestamps.

The valid comparators are ==, !=, =lt=, =le=, =ge=, and =gt=. They stand for "==", "!=", "<", "<=", ">=", ">" respectively.

dataView - The view of the activities to materialize
Returns:
A list of activities

readActivity

@Path(value="/{activityId}")
ApiActivity readActivity(String clusterName,
                              String serviceName,
                              String activityId,
                              DataView dataView)
Returns a specific activity in the system

Parameters:
clusterName - The name of the cluster
serviceName - The name of the service
activityId - The id of the activity to retrieve
dataView - The view of the activity to materialize
Returns:
The Activity object with the specified id

readChildActivities

@Path(value="/{activityId}/children")
ApiActivityList readChildActivities(String clusterName,
                                         String serviceName,
                                         String activityId,
                                         Integer maxResults,
                                         Integer resultOffset,
                                         DataView dataView)
Returns the child activities

Parameters:
clusterName - The name of the cluster
serviceName - The name of the service
activityId - The id of the activity
maxResults - The maximum number of activities to return.
resultOffset - Specified the offset of activities to return.
dataView - The view of the children to materialize
Returns:
The list of child activities for the specified activity

readSimilarActivities

@Path(value="/{activityId}/similar")
ApiActivityList readSimilarActivities(String clusterName,
                                           String serviceName,
                                           String activityId,
                                           DataView dataView)
Returns a list of similar activities

Parameters:
clusterName - The name of the cluster
serviceName - The name of the service
activityId - The id of the activity
dataView - The view of the activities to materialize
Returns:
The list of similar activities to the specified activity

getMetrics

@Path(value="/{activityId}/metrics")
ApiMetricList getMetrics(String clusterName,
                              String serviceName,
                              String activityId,
                              String from,
                              String to,
                              List<String> metrics,
                              DataView dataView)
Fetch metric readings for a particular activity.

By default, this call will look up all metrics available for the activity. If only specific metrics are desired, use the metrics parameter.

By default, the returned results correspond to a 5 minute window based on the provided end time (which defaults to the current server time). The from and to parameters can be used to control the window being queried. A maximum window of 3 hours is enforced.

When requesting a "full" view, aside from the extended properties of the returned metric data, the collection will also contain information about all metrics available for the activity, even if no readings are available in the requested window.

Parameters:
clusterName - The name of the cluster.
serviceName - The name of the service.
activityId - The name of the activity.
from - Start of the period to query.
to - End of the period to query.
metrics - Filter for which metrics to query.
dataView - The view of the data to materialize, either "summary" or "full".
Returns:
List of readings from the monitors.


Copyright © Cloudera, Inc. Released under Apache License, Version 2.0.