com.cloudera.api.v1
Interface RolesResource

All Known Subinterfaces:
RolesResourceV11, RolesResourceV2, RolesResourceV4, RolesResourceV6, RolesResourceV8

public interface RolesResource


Method Summary
 ApiRoleList createRoles(ApiRoleList roles)
          Create new roles in a given service.
 ApiRole deleteRole(String roleName)
          Deletes a role from a given service.
 InputStream getFullLog(String roleName)
          Retrieves the log file for the role's main process.
 ApiMetricList getMetrics(String roleName, String from, String to, List<String> metrics, DataView dataView)
          Deprecated. This endpoint is not supported as of v6. Use the timeseries API instead. To get all metrics for a role with the timeseries API use the query:

'select * where roleName = $ROLE_NAME'.

To get specific metrics for a role use the query:

'select $METRIC_NAME1, $METRIC_NAME2 where roleName = $ROLE_NAME'.

For more information see the tsquery language documentation.

 InputStream getStandardError(String roleName)
          Retrieves the role's standard error output.
 InputStream getStandardOutput(String roleName)
          Retrieves the role's standard output.
 ApiCommandList listActiveCommands(String roleName, DataView dataView)
          List active role commands.
 ApiRole readRole(String roleName)
          Retrieves detailed information about a role.
 ApiConfigList readRoleConfig(String roleName, DataView dataView)
          Retrieves the configuration of a specific role.
 ApiRoleList readRoles()
          Lists all roles of a given service.
 ApiConfigList updateRoleConfig(String roleName, String message, ApiConfigList config)
          Updates the role configuration with the given values.
 

Method Detail

createRoles

@Path(value="/")
ApiRoleList createRoles(ApiRoleList roles)
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, LLAMA
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.

Parameters:
roles - Roles to create.
Returns:
List of created roles.

deleteRole

@Path(value="/{roleName}")
ApiRole deleteRole(String roleName)
Deletes a role from a given service.

Parameters:
roleName - The role name.
Returns:
The details of the deleted role.

readRoles

@Path(value="/")
ApiRoleList readRoles()
Lists all roles of a given service.

Returns:
List of roles.

readRole

@Path(value="/{roleName}")
ApiRole readRole(String roleName)
Retrieves detailed information about a role.

Parameters:
roleName - The role name.
Returns:
The details of the role.

readRoleConfig

@Path(value="/{roleName}/config")
ApiConfigList readRoleConfig(String roleName,
                                  DataView dataView)
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).

Parameters:
roleName - The role to look up.
dataView - The view of the data to materialize, either "summary" or "full".
Returns:
List of role configuration parameters.

updateRoleConfig

@Path(value="/{roleName}/config")
ApiConfigList updateRoleConfig(String roleName,
                                    String message,
                                    ApiConfigList config)
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.

Parameters:
roleName - The role to modify.
message - Optional message describing the changes.
config - Configuration changes.
Returns:
The new service configuration.

getMetrics

@Deprecated
@Path(value="/{roleName}/metrics")
ApiMetricList getMetrics(String roleName,
                                         String from,
                                         String to,
                                         List<String> metrics,
                                         DataView dataView)
Deprecated. This endpoint is not supported as of v6. Use the timeseries API instead. To get all metrics for a role with the timeseries API use the query:

'select * where roleName = $ROLE_NAME'.

To get specific metrics for a role use the query:

'select $METRIC_NAME1, $METRIC_NAME2 where roleName = $ROLE_NAME'.

For more information see the tsquery language documentation.

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.

Parameters:
roleName - The name of the role.
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.

listActiveCommands

@Path(value="/{roleName}/commands")
ApiCommandList listActiveCommands(String roleName,
                                       DataView dataView)
List active role commands.

Parameters:
roleName - The role to start.
dataView - The view of the data to materialize, either "summary" or "full".
Returns:
A list of active role commands.

getFullLog

@Path(value="/{roleName}/logs/full")
InputStream getFullLog(String roleName)
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").

Parameters:
roleName - The role to fetch logs from.
Returns:
Contents of the role's log file.

getStandardOutput

@Path(value="/{roleName}/logs/stdout")
InputStream getStandardOutput(String roleName)
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").

Parameters:
roleName - The role to fetch stdout from.
Returns:
Contents of the role's standard output.

getStandardError

@Path(value="/{roleName}/logs/stderr")
InputStream getStandardError(String roleName)
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").

Parameters:
roleName - The role to fetch stderr from.
Returns:
Contents of the role's standard error output.


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