YarnApplicationsResourceApi

All URIs are relative to https://localhost/api/v55

Method HTTP request Description
getYarnApplicationAttributes GET /clusters/{clusterName}/services/{serviceName}/yarnApplications/attributes Returns the list of all attributes that the Service Monitor can associate with YARN applications.
getYarnApplications GET /clusters/{clusterName}/services/{serviceName}/yarnApplications Returns a list of applications that satisfy the filter.
killYarnApplication POST /clusters/{clusterName}/services/{serviceName}/yarnApplications/{applicationId}/kill Kills an YARN Application.

getYarnApplicationAttributes

ApiYarnApplicationAttributeList getYarnApplicationAttributes(clusterName, serviceName)

Returns the list of all attributes that the Service Monitor can associate with YARN applications.

Returns the list of all attributes that the Service Monitor can associate with YARN applications.

Examples of attributes include the user who ran the application and the number of maps completed by the application.

These attributes can be used to search for specific YARN applications through the getYarnApplications API. For example the 'user' attribute could be used in the search 'user = root'. If the attribute is numeric it can also be used as a metric in a tsquery (ie, 'select maps_completed from YARN_APPLICATIONS').

Note that this response is identical for all YARN services.

Available since API v6.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.YarnApplicationsResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

YarnApplicationsResourceApi apiInstance = new YarnApplicationsResourceApi();
String clusterName = "clusterName_example"; // String | 
String serviceName = "serviceName_example"; // String | 
try {
    ApiYarnApplicationAttributeList result = apiInstance.getYarnApplicationAttributes(clusterName, serviceName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling YarnApplicationsResourceApi#getYarnApplicationAttributes");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
serviceName String

Return type

ApiYarnApplicationAttributeList

Authorization

basic

HTTP request headers

getYarnApplications

ApiYarnApplicationResponse getYarnApplications(clusterName, serviceName, filter, from, limit, offset, to)

Returns a list of applications that satisfy the filter.

Returns a list of applications that satisfy the filter

Available since API v6.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.YarnApplicationsResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

YarnApplicationsResourceApi apiInstance = new YarnApplicationsResourceApi();
String clusterName = "clusterName_example"; // String | 
String serviceName = "serviceName_example"; // String | The name of the service
String filter = ""; // String | A filter to apply to the applications. A basic filter tests the value of an attribute and looks something like 'executing = true' or 'user = root'. Multiple basic filters can be combined into a complex expression using standard and / or boolean logic and parenthesis. An example of a complex filter is: 'application_duration > 5s and (user = root or user = myUserName').
String from = "from_example"; // String | Start of the period to query in ISO 8601 format (defaults to 5 minutes before the 'to' time).
java.math.BigDecimal limit = new java.math.BigDecimal(); // java.math.BigDecimal | The maximum number of applications to return. Applications will be returned in the following order: <ul> <li> All executing applications, ordered from longest to shortest running </li> <li> All completed applications order by end time descending. </li> </ul>
java.math.BigDecimal offset = new java.math.BigDecimal(); // java.math.BigDecimal | The offset to start returning applications from. This is useful for paging through lists of applications. Note that this has non-deterministic behavior if executing applications are included in the response because they can disappear from the list while paging. To exclude executing applications from the response and a 'executing = false' clause to your filter.
String to = "now"; // String | End of the period to query in ISO 8601 format (defaults to now).
try {
    ApiYarnApplicationResponse result = apiInstance.getYarnApplications(clusterName, serviceName, filter, from, limit, offset, to);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling YarnApplicationsResourceApi#getYarnApplications");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
serviceName String The name of the service
filter String A filter to apply to the applications. A basic filter tests the value of an attribute and looks something like 'executing = true' or 'user = root'. Multiple basic filters can be combined into a complex expression using standard and / or boolean logic and parenthesis. An example of a complex filter is: 'application_duration > 5s and (user = root or user = myUserName'). [optional] [default to ]
from String Start of the period to query in ISO 8601 format (defaults to 5 minutes before the 'to' time). [optional]
limit java.math.BigDecimal The maximum number of applications to return. Applications will be returned in the following order:
  • All executing applications, ordered from longest to shortest running
  • All completed applications order by end time descending.
[optional] [default to 100]
offset java.math.BigDecimal The offset to start returning applications from. This is useful for paging through lists of applications. Note that this has non-deterministic behavior if executing applications are included in the response because they can disappear from the list while paging. To exclude executing applications from the response and a 'executing = false' clause to your filter. [optional] [default to 0]
to String End of the period to query in ISO 8601 format (defaults to now). [optional] [default to now]

Return type

ApiYarnApplicationResponse

Authorization

basic

HTTP request headers

killYarnApplication

ApiYarnKillResponse killYarnApplication(applicationId, clusterName, serviceName)

Kills an YARN Application.

Kills an YARN Application

Available since API v6.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.YarnApplicationsResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

YarnApplicationsResourceApi apiInstance = new YarnApplicationsResourceApi();
String applicationId = "applicationId_example"; // String | The applicationId to kill
String clusterName = "clusterName_example"; // String | 
String serviceName = "serviceName_example"; // String | The name of the service
try {
    ApiYarnKillResponse result = apiInstance.killYarnApplication(applicationId, clusterName, serviceName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling YarnApplicationsResourceApi#killYarnApplication");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
applicationId String The applicationId to kill
clusterName String
serviceName String The name of the service

Return type

ApiYarnKillResponse

Authorization

basic

HTTP request headers