RolesResourceApi

All URIs are relative to /api/v57

Method HTTP request Description
addTags PUT /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/tags Attach tags to the role.
bulkDeleteRoles POST /clusters/{clusterName}/services/{serviceName}/roles/bulkDelete Bulk delete roles in a particular service by name.
createRoles POST /clusters/{clusterName}/services/{serviceName}/roles Create new roles in a given service.
deleteForceRole DELETE /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/forceDelete Force deletes a role from a given service.
deleteRole DELETE /clusters/{clusterName}/services/{serviceName}/roles/{roleName} Deletes a role from a given service.
deleteTags DELETE /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/tags Remove the tags associated with the role.
enterMaintenanceMode POST /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/commands/enterMaintenanceMode Put the role into maintenance mode.
exitMaintenanceMode POST /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/commands/exitMaintenanceMode Take the role out of maintenance mode.
getFullLog GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/logs/full Retrieves the log file for the role's main process.
getMetrics GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/metrics Fetch metric readings for a particular role.
getStacksLog GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/logs/stacks Retrieves the stacks log file, if any, for the role's main process.
getStacksLogsBundle GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/logs/stacksBundle Download a zip-compressed archive of role stacks logs.
getStandardError GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/logs/stderr Retrieves the role's standard error output.
getStandardOutput GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/logs/stdout Retrieves the role's standard output.
impalaDiagnostics POST /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/commands/impalaDiagnostics Collects diagnostics data for an Impala role.
listActiveCommands GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/commands List active role commands.
listCommands GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/commandsByName Lists all the commands that can be executed by name on the provided role.
readRole GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName} Retrieves detailed information about a role.
readRoleConfig GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/config Retrieves the configuration of a specific role.
readRoles GET /clusters/{clusterName}/services/{serviceName}/roles Lists all roles of a given service.
readRolesConfig GET /clusters/{clusterName}/services/{serviceName}/roles/configs Retrieves all the roles in the service, including all the configurations for each role.
readTags GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/tags Returns the tags associated with this role.
updateRoleConfig PUT /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/config Updates the role configuration with the given values.

addTags

List<ApiEntityTag> addTags(clusterName, roleName, serviceName, body)

Attach tags to the role.

Attach tags to the role. Tag names beginning with the prefix cldr (case insensitive) are reserved for internal use by Cloudera.

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String roleName = "roleName_example"; // String | Name of the role
String serviceName = "serviceName_example"; // String | 
List<ApiEntityTag> body = Arrays.asList(new ApiEntityTag()); // List<ApiEntityTag> | List of tags to add to the role
try {
    List<ApiEntityTag> result = apiInstance.addTags(clusterName, roleName, serviceName, body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#addTags");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
roleName String Name of the role
serviceName String
body List<ApiEntityTag> List of tags to add to the role [optional]

Return type

List<ApiEntityTag>

Authorization

basic

HTTP request headers

bulkDeleteRoles

ApiRoleList bulkDeleteRoles(clusterName, serviceName, body)

Bulk delete roles in a particular service by name.

Bulk delete roles in a particular service by name. Fails if any role cannot be found.

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String serviceName = "serviceName_example"; // String | 
ApiRoleNameList body = new ApiRoleNameList(); // ApiRoleNameList | list of role names to be deleted
try {
    ApiRoleList result = apiInstance.bulkDeleteRoles(clusterName, serviceName, body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#bulkDeleteRoles");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
serviceName String
body ApiRoleNameList list of role names to be deleted [optional]

Return type

ApiRoleList

Authorization

basic

HTTP request headers

createRoles

ApiRoleList createRoles(clusterName, serviceName, body)

Create new roles in a given service.

Create new roles in a given service.
Service Type Available Role Types
HDFS (CDH3) NAMENODE, DATANODE, SECONDARYNAMENODE, BALANCER, GATEWAY
HDFS (CDH4) NAMENODE, DATANODE, SECONDARYNAMENODE, BALANCER, HTTPFS, FAILOVERCONTROLLER, GATEWAY, JOURNALNODE
HDFS (CDH5) NAMENODE, DATANODE, SECONDARYNAMENODE, BALANCER, HTTPFS, FAILOVERCONTROLLER, GATEWAY, JOURNALNODE, NFSGATEWAY
MAPREDUCE JOBTRACKER, TASKTRACKER, GATEWAY, FAILOVERCONTROLLER,
HBASE MASTER, REGIONSERVER, GATEWAY, HBASETHRIFTSERVER, HBASERESTSERVER
YARN RESOURCEMANAGER, NODEMANAGER, JOBHISTORY, GATEWAY
OOZIE OOZIE_SERVER
ZOOKEEPER SERVER
HUE (CDH3) HUE_SERVER, BEESWAX_SERVER, KT_RENEWER, JOBSUBD
HUE (CDH4) HUE_SERVER, BEESWAX_SERVER, KT_RENEWER
HUE (CDH5) HUE_SERVER, KT_RENEWER
HUE (CDH5 5.5+) HUE_SERVER, KT_RENEWER, HUE_LOAD_BALANCER
FLUME AGENT
IMPALA (CDH4) IMPALAD, STATESTORE, CATALOGSERVER
IMPALA (CDH5) IMPALAD, STATESTORE, CATALOGSERVER
HIVE HIVESERVER2, HIVEMETASTORE, WEBHCAT, GATEWAY
SOLR SOLR_SERVER, GATEWAY
SQOOP SQOOP_SERVER
SQOOP_CLIENT GATEWAY
SENTRY SENTRY_SERVER
ACCUMULO16 GARBAGE_COLLECTOR, GATEWAY, ACCUMULO16_MASTER, MONITOR, ACCUMULO16_TSERVER, TRACER
KMS KMS
KS_INDEXER HBASE_INDEXER
SPARK_ON_YARN GATEWAY, SPARK_YARN_HISTORY_SERVER
When specifying roles to be created, the names provided for each role must not conflict with the names that CM auto-generates for roles. Specifically, names of the form "--" cannot be used unless the is the same one CM would use. If CM detects such a conflict, the error message will indicate what is safe to use. Alternately, a differently formatted name should be used. Since API v6: The role name can be left blank to allow CM to generate the name.

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String serviceName = "serviceName_example"; // String | 
ApiRoleList body = new ApiRoleList(); // ApiRoleList | Roles to create.
try {
    ApiRoleList result = apiInstance.createRoles(clusterName, serviceName, body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#createRoles");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
serviceName String
body ApiRoleList Roles to create. [optional]

Return type

ApiRoleList

Authorization

basic

HTTP request headers

deleteForceRole

ApiRole deleteForceRole(clusterName, roleName, serviceName)

Force deletes a role from a given service.

Force deletes a role from a given service.

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String roleName = "roleName_example"; // String | The role name.
String serviceName = "serviceName_example"; // String | 
try {
    ApiRole result = apiInstance.deleteForceRole(clusterName, roleName, serviceName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#deleteForceRole");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
roleName String The role name.
serviceName String

Return type

ApiRole

Authorization

basic

HTTP request headers

deleteRole

ApiRole deleteRole(clusterName, roleName, serviceName)

Deletes a role from a given service.

Deletes a role from a given service.

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String roleName = "roleName_example"; // String | The role name.
String serviceName = "serviceName_example"; // String | 
try {
    ApiRole result = apiInstance.deleteRole(clusterName, roleName, serviceName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#deleteRole");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
roleName String The role name.
serviceName String

Return type

ApiRole

Authorization

basic

HTTP request headers

deleteTags

List<ApiEntityTag> deleteTags(clusterName, roleName, serviceName, body)

Remove the tags associated with the role.

Remove the tags associated with the role. Tag names beginning with the prefix cldr (case insensitive) are reserved for internal use by Cloudera.

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String roleName = "roleName_example"; // String | Name of the role to remove tags from
String serviceName = "serviceName_example"; // String | 
List<ApiEntityTag> body = Arrays.asList(new ApiEntityTag()); // List<ApiEntityTag> | A list of tags to remove from the role
try {
    List<ApiEntityTag> result = apiInstance.deleteTags(clusterName, roleName, serviceName, body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#deleteTags");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
roleName String Name of the role to remove tags from
serviceName String
body List<ApiEntityTag> A list of tags to remove from the role [optional]

Return type

List<ApiEntityTag>

Authorization

basic

HTTP request headers

enterMaintenanceMode

ApiCommand enterMaintenanceMode(clusterName, roleName, serviceName)

Put the role into maintenance mode.

Put the role into maintenance mode. This is a synchronous command. The result is known immediately upon return.

Available since API v2.

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String roleName = "roleName_example"; // String | The role name.
String serviceName = "serviceName_example"; // String | 
try {
    ApiCommand result = apiInstance.enterMaintenanceMode(clusterName, roleName, serviceName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#enterMaintenanceMode");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
roleName String The role name.
serviceName String

Return type

ApiCommand

Authorization

basic

HTTP request headers

exitMaintenanceMode

ApiCommand exitMaintenanceMode(clusterName, roleName, serviceName)

Take the role out of maintenance mode.

Take the role out of maintenance mode. This is a synchronous command. The result is known immediately upon return.

Available since API v2.

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String roleName = "roleName_example"; // String | The role name.
String serviceName = "serviceName_example"; // String | 
try {
    ApiCommand result = apiInstance.exitMaintenanceMode(clusterName, roleName, serviceName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#exitMaintenanceMode");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
roleName String The role name.
serviceName String

Return type

ApiCommand

Authorization

basic

HTTP request headers

getFullLog

String getFullLog(clusterName, roleName, serviceName)

Retrieves the log file for the role's main process.

Retrieves the log file for the role's main process.

If the role is not started, this will be the log file associated with the last time the role was run.

Log files are returned as plain text (type "text/plain").

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String roleName = "roleName_example"; // String | The role to fetch logs from.
String serviceName = "serviceName_example"; // String | 
try {
    String result = apiInstance.getFullLog(clusterName, roleName, serviceName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#getFullLog");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
roleName String The role to fetch logs from.
serviceName String

Return type

String

Authorization

basic

HTTP request headers

getMetrics

ApiMetricList getMetrics(clusterName, roleName, serviceName, from, metrics, to, view)

Fetch metric readings for a particular role.

Fetch metric readings for a particular role.

By default, this call will look up all metrics available for the role. 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 role, even if no readings are available in the requested window.

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String roleName = "roleName_example"; // String | The name of the role.
String serviceName = "serviceName_example"; // String | 
String from = "from_example"; // String | Start of the period to query.
List<String> metrics = Arrays.asList("metrics_example"); // List<String> | Filter for which metrics to query.
String to = "now"; // String | End of the period to query.
String view = "summary"; // String | The view of the data to materialize, either \"summary\" or \"full\".
try {
    ApiMetricList result = apiInstance.getMetrics(clusterName, roleName, serviceName, from, metrics, to, view);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#getMetrics");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
roleName String The name of the role.
serviceName String
from String Start of the period to query. [optional]
metrics List<String> Filter for which metrics to query. [optional]
to String End of the period to query. [optional] [default to now]
view String The view of the data to materialize, either "summary" or "full". [optional] [default to summary] [enum: EXPORT, EXPORT_REDACTED, FULL, FULL_WITH_HEALTH_CHECK_EXPLANATION, FULL_WITH_NO_HEALTH_CHECK, SUMMARY]

Return type

ApiMetricList

Authorization

basic

HTTP request headers

getStacksLog

String getStacksLog(clusterName, roleName, serviceName)

Retrieves the stacks log file, if any, for the role's main process.

Retrieves the stacks log file, if any, for the role's main process. Note that not all roles support periodic stacks collection. The log files are returned as plain text (type "text/plain").

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String roleName = "roleName_example"; // String | The role to fetch stacks logs from.
String serviceName = "serviceName_example"; // String | 
try {
    String result = apiInstance.getStacksLog(clusterName, roleName, serviceName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#getStacksLog");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
roleName String The role to fetch stacks logs from.
serviceName String

Return type

String

Authorization

basic

HTTP request headers

getStacksLogsBundle

File getStacksLogsBundle(clusterName, roleName, serviceName)

Download a zip-compressed archive of role stacks logs.

Download a zip-compressed archive of role stacks logs. Note that not all roles support periodic stacks collection.

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String roleName = "roleName_example"; // String | The role to fetch the stacks logs bundle from.
String serviceName = "serviceName_example"; // String | 
try {
    File result = apiInstance.getStacksLogsBundle(clusterName, roleName, serviceName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#getStacksLogsBundle");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
roleName String The role to fetch the stacks logs bundle from.
serviceName String

Return type

File

Authorization

basic

HTTP request headers

getStandardError

String getStandardError(clusterName, roleName, serviceName)

Retrieves the role's standard error output.

Retrieves the role's standard error output.

If the role is not started, this will be the output associated with the last time the role was run.

Log files are returned as plain text (type "text/plain").

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String roleName = "roleName_example"; // String | The role to fetch stderr from.
String serviceName = "serviceName_example"; // String | 
try {
    String result = apiInstance.getStandardError(clusterName, roleName, serviceName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#getStandardError");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
roleName String The role to fetch stderr from.
serviceName String

Return type

String

Authorization

basic

HTTP request headers

getStandardOutput

String getStandardOutput(clusterName, roleName, serviceName)

Retrieves the role's standard output.

Retrieves the role's standard output.

If the role is not started, this will be the output associated with the last time the role was run.

Log files are returned as plain text (type "text/plain").

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String roleName = "roleName_example"; // String | The role to fetch stdout from.
String serviceName = "serviceName_example"; // String | 
try {
    String result = apiInstance.getStandardOutput(clusterName, roleName, serviceName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#getStandardOutput");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
roleName String The role to fetch stdout from.
serviceName String

Return type

String

Authorization

basic

HTTP request headers

impalaDiagnostics

ApiCommand impalaDiagnostics(clusterName, roleName, serviceName, body)

Collects diagnostics data for an Impala role.

Collects diagnostics data for an Impala role.

Available since API v31.

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String roleName = "roleName_example"; // String | The role name.
String serviceName = "serviceName_example"; // String | 
ApiImpalaRoleDiagnosticsArgs body = new ApiImpalaRoleDiagnosticsArgs(); // ApiImpalaRoleDiagnosticsArgs | 
try {
    ApiCommand result = apiInstance.impalaDiagnostics(clusterName, roleName, serviceName, body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#impalaDiagnostics");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
roleName String The role name.
serviceName String
body ApiImpalaRoleDiagnosticsArgs [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

listActiveCommands

ApiCommandList listActiveCommands(clusterName, roleName, serviceName, view)

List active role commands.

List active role commands.

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String roleName = "roleName_example"; // String | The role to start.
String serviceName = "serviceName_example"; // String | 
String view = "summary"; // String | The view of the data to materialize, either \"summary\" or \"full\".
try {
    ApiCommandList result = apiInstance.listActiveCommands(clusterName, roleName, serviceName, view);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#listActiveCommands");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
roleName String The role to start.
serviceName String
view String The view of the data to materialize, either "summary" or "full". [optional] [default to summary] [enum: EXPORT, EXPORT_REDACTED, FULL, FULL_WITH_HEALTH_CHECK_EXPLANATION, FULL_WITH_NO_HEALTH_CHECK, SUMMARY]

Return type

ApiCommandList

Authorization

basic

HTTP request headers

listCommands

ApiCommandMetadataList listCommands(clusterName, roleName, serviceName)

Lists all the commands that can be executed by name on the provided role.

Lists all the commands that can be executed by name on the provided role.

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String roleName = "roleName_example"; // String | the role name.
String serviceName = "serviceName_example"; // String | 
try {
    ApiCommandMetadataList result = apiInstance.listCommands(clusterName, roleName, serviceName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#listCommands");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
roleName String the role name.
serviceName String

Return type

ApiCommandMetadataList

Authorization

basic

HTTP request headers

readRole

ApiRole readRole(clusterName, roleName, serviceName, view)

Retrieves detailed information about a role.

Retrieves detailed information about a role.

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String roleName = "roleName_example"; // String | The role name.
String serviceName = "serviceName_example"; // String | 
String view = "full"; // String | The view to materialize. Defaults to 'full'.
try {
    ApiRole result = apiInstance.readRole(clusterName, roleName, serviceName, view);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#readRole");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
roleName String The role name.
serviceName String
view String The view to materialize. Defaults to 'full'. [optional] [default to full] [enum: EXPORT, EXPORT_REDACTED, FULL, FULL_WITH_HEALTH_CHECK_EXPLANATION, FULL_WITH_NO_HEALTH_CHECK, SUMMARY]

Return type

ApiRole

Authorization

basic

HTTP request headers

readRoleConfig

ApiConfigList readRoleConfig(clusterName, roleName, serviceName, view)

Retrieves the configuration of a specific role.

Retrieves the configuration of a specific role. Note that the "full" view performs validation on the configuration, which could take a few seconds on a large cluster (around 500 nodes or more).

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String roleName = "roleName_example"; // String | The role to look up.
String serviceName = "serviceName_example"; // String | 
String view = "summary"; // String | The view of the data to materialize, either \"summary\" or \"full\".
try {
    ApiConfigList result = apiInstance.readRoleConfig(clusterName, roleName, serviceName, view);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#readRoleConfig");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
roleName String The role to look up.
serviceName String
view String The view of the data to materialize, either "summary" or "full". [optional] [default to summary] [enum: EXPORT, EXPORT_REDACTED, FULL, FULL_WITH_HEALTH_CHECK_EXPLANATION, FULL_WITH_NO_HEALTH_CHECK, SUMMARY]

Return type

ApiConfigList

Authorization

basic

HTTP request headers

readRoles

ApiRoleList readRoles(clusterName, serviceName, filter, view)

Lists all roles of a given service.

Lists all roles of a given service.

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String serviceName = "serviceName_example"; // String | 
String filter = "filter_example"; // String | Optional query to filter the roles by. <p> The query specifies the intersection of a list of constraints, joined together with semicolons (without spaces). For example: hostname==host1.abc.com;type==DATANODE </p>  Currently supports filtering by: <ul> <li>hostname: The hostname of the host the role is running on.</li> <li>hostId: The unique identifier of the host the role is running on.</li> <li>type: The role's type.</li> </ul>
String view = "summary"; // String | DataView for getting roles. Defaults to 'summary'.
try {
    ApiRoleList result = apiInstance.readRoles(clusterName, serviceName, filter, view);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#readRoles");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
serviceName String
filter String Optional query to filter the roles by.

The query specifies the intersection of a list of constraints, joined together with semicolons (without spaces). For example: hostname==host1.abc.com;type==DATANODE

Currently supports filtering by:
  • hostname: The hostname of the host the role is running on.
  • hostId: The unique identifier of the host the role is running on.
  • type: The role's type.
[optional]
view String DataView for getting roles. Defaults to 'summary'. [optional] [default to summary] [enum: EXPORT, EXPORT_REDACTED, FULL, FULL_WITH_HEALTH_CHECK_EXPLANATION, FULL_WITH_NO_HEALTH_CHECK, SUMMARY]

Return type

ApiRoleList

Authorization

basic

HTTP request headers

readRolesConfig

ApiRoleConfigList readRolesConfig(clusterName, serviceName, limit, offset, view)

Retrieves all the roles in the service, including all the configurations for each role.

Retrieves all the roles in the service, including all the configurations for each role. This API does not retrieve the configs for the service,only the configs in the roles in the service.

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String serviceName = "serviceName_example"; // String | 
java.math.BigDecimal limit = new java.math.BigDecimal(); // java.math.BigDecimal | Maximum size of list of roles configuration parameters
java.math.BigDecimal offset = new java.math.BigDecimal(); // java.math.BigDecimal | Index of first  role configuration parameters
String view = "summary"; // String | The view of the data to materialize, either \"summary\" or \"full\".
try {
    ApiRoleConfigList result = apiInstance.readRolesConfig(clusterName, serviceName, limit, offset, view);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#readRolesConfig");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
serviceName String
limit java.math.BigDecimal Maximum size of list of roles configuration parameters [optional] [default to 100]
offset java.math.BigDecimal Index of first role configuration parameters [optional] [default to 0]
view String The view of the data to materialize, either "summary" or "full". [optional] [default to summary] [enum: EXPORT, EXPORT_REDACTED, FULL, FULL_WITH_HEALTH_CHECK_EXPLANATION, FULL_WITH_NO_HEALTH_CHECK, SUMMARY]

Return type

ApiRoleConfigList

Authorization

basic

HTTP request headers

readTags

List<ApiEntityTag> readTags(clusterName, roleName, serviceName, limit, offset)

Returns the tags associated with this role.

Returns the tags associated with this role. Tag names beginning with the prefix cldr (case insensitive) are reserved for internal use by Cloudera.

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String roleName = "roleName_example"; // String | The name of the role
String serviceName = "serviceName_example"; // String | 
java.math.BigDecimal limit = new java.math.BigDecimal(); // java.math.BigDecimal | Number of tags
java.math.BigDecimal offset = new java.math.BigDecimal(); // java.math.BigDecimal | Index of the first tag to retrieve
try {
    List<ApiEntityTag> result = apiInstance.readTags(clusterName, roleName, serviceName, limit, offset);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#readTags");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
roleName String The name of the role
serviceName String
limit java.math.BigDecimal Number of tags [optional] [default to 10]
offset java.math.BigDecimal Index of the first tag to retrieve [optional] [default to 0]

Return type

List<ApiEntityTag>

Authorization

basic

HTTP request headers

updateRoleConfig

ApiConfigList updateRoleConfig(clusterName, roleName, serviceName, body, message)

Updates the role configuration with the given values.

Updates the role configuration with the given values.

If a value is set in the given configuration, it will be added to the role's configuration, replacing any existing entries. If a value is unset (its value is null), the existing configuration for the attribute will be erased, if any.

Attributes that are not listed in the input will maintain their current values in the configuration.

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.RolesResourceApi;

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

RolesResourceApi apiInstance = new RolesResourceApi();
String clusterName = "clusterName_example"; // String | 
String roleName = "roleName_example"; // String | The role to modify.
String serviceName = "serviceName_example"; // String | 
ApiConfigList body = new ApiConfigList(); // ApiConfigList | Configuration changes.
String message = "message_example"; // String | Optional message describing the changes.
try {
    ApiConfigList result = apiInstance.updateRoleConfig(clusterName, roleName, serviceName, body, message);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesResourceApi#updateRoleConfig");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
clusterName String
roleName String The role to modify.
serviceName String
body ApiConfigList Configuration changes. [optional]
message String Optional message describing the changes. [optional]

Return type

ApiConfigList

Authorization

basic

HTTP request headers