com.cloudera.api.v1
Interface ServicesResource

All Known Subinterfaces:
ServicesResourceV10, ServicesResourceV11, ServicesResourceV13, ServicesResourceV14, ServicesResourceV15, ServicesResourceV16, ServicesResourceV17, ServicesResourceV18, ServicesResourceV2, ServicesResourceV3, ServicesResourceV4, ServicesResourceV6, ServicesResourceV7, ServicesResourceV8

public interface ServicesResource


Method Summary
 ApiCommand createBeeswaxWarehouseCommand(String serviceName)
          Deprecated. Use hiveCreateHiveWarehouse on the Hive service instead. Deprecated since V4.
 ApiCommand createHBaseRootCommand(String serviceName)
          Creates the root directory of an HBase service.
 ApiServiceList createServices(ApiServiceList services)
          Creates a list of services.
 ApiCommand decommissionCommand(String serviceName, ApiRoleNameList roleNames)
          Decommission roles of a service.
 ApiService deleteService(String serviceName)
          Deletes a service from the system.
 ApiCommand deployClientConfigCommand(String serviceName, ApiRoleNameList roleNames)
          Deploy a service's client configuration.
 ActivitiesResource getActivitiesResource(String serviceName)
          Return the activities resource handler.
 ApiMetricList getMetrics(String serviceName, 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 service with the timeseries API use the query:

'select * where serviceName = $SERVICE_NAME'.

To get specific metrics for a service use a comma-separated list of the metric names as follows:

'select $METRIC_NAME1, $METRIC_NAME2 where serviceName = $SERVICE_NAME'.

For more information see the tsquery language documentation.

 NameservicesResource getNameservicesResource(String serviceName)
           
 RoleCommandsResource getRoleCommandsResource(String serviceName)
           
 RolesResource getRolesResource(String serviceName)
           
 ApiCommand hdfsDisableAutoFailoverCommand(String serviceName, String nameservice)
          Deprecated. This endpoint is not supported v6 onwards. Use hdfsDisableNnHa on the HDFS service instead.
 ApiCommand hdfsDisableHaCommand(String serviceName, ApiHdfsDisableHaArguments args)
          Deprecated. This endpoint is not supported v6 onwards. Use hdfsDisableNnHa on the HDFS service instead.
 ApiCommand hdfsEnableAutoFailoverCommand(String serviceName, ApiHdfsFailoverArguments args)
          Deprecated. This endpoint is not supported v6 onwards. Use hdfsEnableNnHa on the HDFS service instead.
 ApiCommand hdfsEnableHaCommand(String serviceName, ApiHdfsHaArguments args)
          Deprecated. This endpoint is not supported v6 onwards. Use hdfsEnableNnHa on the HDFS service instead.
 ApiCommand hdfsFailoverCommand(String serviceName, boolean force, ApiRoleNameList roleNames)
          Initiate a failover in an HDFS HA NameNode pair.
 ApiCommandList listActiveCommands(String serviceName, DataView dataView)
          List active service commands.
 ApiRoleTypeList listRoleTypes(String serviceName)
          List the supported role types for a service.
 ApiService readService(String serviceName)
          Retrieves details information about a service.
 ApiServiceConfig readServiceConfig(String serviceName, DataView dataView)
          Retrieves the configuration of a specific service.
 ApiServiceList readServices(DataView dataView)
          Lists all services registered in the cluster.
 ApiCommand restartCommand(String serviceName)
          Restart the service.
 ApiCommand startCommand(String serviceName)
          Start the service.
 ApiCommand stopCommand(String serviceName)
          Stop the service.
 ApiServiceConfig updateServiceConfig(String serviceName, String message, ApiServiceConfig config)
          Updates the service configuration with the given values.
 ApiCommand zooKeeperCleanupCommand(String serviceName)
          Clean up all running server instances of a ZooKeeper service.
 ApiCommand zooKeeperInitCommand(String serviceName)
          Initializes all the server instances of a ZooKeeper service.
 

Method Detail

createServices

@Path(value="/")
ApiServiceList createServices(ApiServiceList services)
Creates a list of services.

There are typically two service creation strategies:

  1. The caller may choose to set up a new service piecemeal, by first creating the service itself (without any roles or configuration), and then create the roles, and then specify configuration.
  2. Alternatively, the caller can pack all the information in one call, by fully specifying the fields in the ApiService object, with
    • service config and role type config, and
    • role to host assignment.
Cluster Version Available Service Types
CDH4 HDFS, MAPREDUCE, HBASE, OOZIE, ZOOKEEPER, HUE, YARN, IMPALA, FLUME, HIVE, SOLR, SQOOP, KS_INDEXER
CDH5 HDFS, MAPREDUCE, HBASE, OOZIE, ZOOKEEPER, HUE, YARN, IMPALA, FLUME, HIVE, SOLR, SQOOP, KS_INDEXER, SQOOP_CLIENT, SENTRY, ACCUMULO16, KMS, SPARK_ON_YARN
As of V6, GET /{clusterName}/serviceTypes should be used to get the service types available to the cluster.

Parameters:
services - Details of the services to create.
Returns:
List of created services.

deleteService

@Path(value="/{serviceName}")
ApiService deleteService(String serviceName)
Deletes a service from the system.

Parameters:
serviceName - The name of the service to delete.
Returns:
The details of the deleted service.

readServices

@Path(value="/")
ApiServiceList readServices(DataView dataView)
Lists all services registered in the cluster.

Returns:
List of services.

readService

@Path(value="/{serviceName}")
ApiService readService(String serviceName)
Retrieves details information about a service.

Parameters:
serviceName - The service name.
Returns:
The details of the service.

readServiceConfig

@Path(value="/{serviceName}/config")
ApiServiceConfig readServiceConfig(String serviceName,
                                        DataView dataView)
Retrieves the configuration of a specific service.

The "summary" view contains only the configured parameters, and configuration for role types that contain configured parameters.

The "full" view contains all available configuration parameters for the service and its role types. This mode performs validation on the configuration, which could take a few seconds on a large cluster (around 500 nodes or more).

Parameters:
serviceName - The service to query.
dataView - The view of the data to materialize, either "summary" or "full".
Returns:
List of service and role types configuration parameters.

updateServiceConfig

@Path(value="/{serviceName}/config")
ApiServiceConfig updateServiceConfig(String serviceName,
                                          String message,
                                          ApiServiceConfig config)
Updates the service configuration with the given values.

If a value is set in the given configuration, it will be added to the service'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:
serviceName - The service to modify.
message - Optional message describing the changes.
config - Configuration changes.
Returns:
The new service configuration.

listRoleTypes

@Path(value="/{serviceName}/roleTypes")
ApiRoleTypeList listRoleTypes(String serviceName)
List the supported role types for a service.

Parameters:
serviceName - The service to modify.
Returns:
List of role types the service supports.

getMetrics

@Deprecated
@Path(value="/{serviceName}/metrics")
ApiMetricList getMetrics(String serviceName,
                                         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 service with the timeseries API use the query:

'select * where serviceName = $SERVICE_NAME'.

To get specific metrics for a service use a comma-separated list of the metric names as follows:

'select $METRIC_NAME1, $METRIC_NAME2 where serviceName = $SERVICE_NAME'.

For more information see the tsquery language documentation.

Fetch metric readings for a particular service.

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

HDFS services that have more than one nameservice will not expose any metrics. Instead, the nameservices should be queried separately.

Parameters:
serviceName - The name of the service.
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="/{serviceName}/commands")
ApiCommandList listActiveCommands(String serviceName,
                                       DataView dataView)
List active service commands.

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

hdfsDisableAutoFailoverCommand

@Deprecated
@Path(value="/{serviceName}/commands/hdfsDisableAutoFailover")
ApiCommand hdfsDisableAutoFailoverCommand(String serviceName,
                                                          String nameservice)
Deprecated. This endpoint is not supported v6 onwards. Use hdfsDisableNnHa on the HDFS service instead.

Disable auto-failover for a highly available HDFS nameservice.

The command will modify the nameservice's NameNodes configuration to disable automatic failover, and delete the existing failover controllers.

The ZooKeeper dependency of the service will not be removed.

Parameters:
serviceName - The HDFS service name.
nameservice - The nameservice name.
Returns:
Information about the submitted command.

hdfsDisableHaCommand

@Deprecated
@Path(value="/{serviceName}/commands/hdfsDisableHa")
ApiCommand hdfsDisableHaCommand(String serviceName,
                                                ApiHdfsDisableHaArguments args)
Deprecated. This endpoint is not supported v6 onwards. Use hdfsDisableNnHa on the HDFS service instead.

Disable high availability (HA) for an HDFS NameNode.

The NameNode to be kept must be running before HA can be disabled.

As part of disabling HA, any services that depend on the HDFS service being modified will be stopped. The command arguments provide options to re-start these services and to re-deploy the client configurations for services of the cluster after HA has been disabled.

Parameters:
serviceName - The HDFS service name.
args - Arguments for the command.
Returns:
Information about the submitted command.

hdfsEnableAutoFailoverCommand

@Deprecated
@Path(value="/{serviceName}/commands/hdfsEnableAutoFailover")
ApiCommand hdfsEnableAutoFailoverCommand(String serviceName,
                                                         ApiHdfsFailoverArguments args)
Deprecated. This endpoint is not supported v6 onwards. Use hdfsEnableNnHa on the HDFS service instead.

Enable auto-failover for an HDFS nameservice.

This command requires that the nameservice exists, and HA has been configured for that nameservice.

The command will create the needed failover controllers, perform the needed initialization and configuration, and will start the new roles. The existing NameNodes which are part of the nameservice will be re-started in the process.

This process may require changing the service's configuration, to add a dependency on the provided ZooKeeper service. This will be done if such a dependency has not been configured yet, and will cause roles that are not affected by this command to show an "outdated configuration" status.

If a ZooKeeper dependency has already been set up by some other means, it does not need to be provided in the command arguments.

Parameters:
serviceName - The HDFS service name.
args - Arguments for the command.
Returns:
Information about the submitted command.

hdfsEnableHaCommand

@Deprecated
@Path(value="/{serviceName}/commands/hdfsEnableHa")
ApiCommand hdfsEnableHaCommand(String serviceName,
                                               ApiHdfsHaArguments args)
Deprecated. This endpoint is not supported v6 onwards. Use hdfsEnableNnHa on the HDFS service instead.

Enable high availability (HA) for an HDFS NameNode.

The command will set up the given "active" and "stand-by" NameNodes as an HA pair. Both nodes need to already exist.

If there is a SecondaryNameNode associated with either given NameNode instance, it will be deleted.

Note that while the shared edits path may be different for both nodes, they need to point to the same underlying storage (e.g., an NFS share).

As part of enabling HA, any services that depend on the HDFS service being modified will be stopped. The command arguments provide options to re-start these services and to re-deploy the client configurations for services of the cluster after HA has been enabled.

Parameters:
serviceName - The HDFS service name.
args - Arguments for the command.
Returns:
Information about the submitted command.

hdfsFailoverCommand

@Path(value="/{serviceName}/commands/hdfsFailover")
ApiCommand hdfsFailoverCommand(String serviceName,
                                    boolean force,
                                    ApiRoleNameList roleNames)
Initiate a failover in an HDFS HA NameNode pair.

The arguments should contain the names of the two NameNodes in the HA pair. The first one should be the currently active NameNode, the second one the NameNode to be made active.

Parameters:
serviceName - The HDFS service name.
force - Whether to force failover.
roleNames - Names of the NameNodes in the HA pair.
Returns:
Information about the submitted command.

createBeeswaxWarehouseCommand

@Deprecated
@Path(value="/{serviceName}/commands/hueCreateHiveWarehouse")
ApiCommand createBeeswaxWarehouseCommand(String serviceName)
Deprecated. Use hiveCreateHiveWarehouse on the Hive service instead. Deprecated since V4.

Create the Beeswax role's Hive warehouse directory, on Hue services.

Parameters:
serviceName - The Hue service name.
Returns:
Information about the submitted command.

createHBaseRootCommand

@Path(value="/{serviceName}/commands/hbaseCreateRoot")
ApiCommand createHBaseRootCommand(String serviceName)
Creates the root directory of an HBase service.

Parameters:
serviceName - The HBase service name.
Returns:
Information about the submitted command.

decommissionCommand

@Path(value="/{serviceName}/commands/decommission")
ApiCommand decommissionCommand(String serviceName,
                                    ApiRoleNameList roleNames)
Decommission roles of a service.

For HBase services, the list should contain names of RegionServers to decommission.

For HDFS services, the list should contain names of DataNodes to decommission.

Parameters:
serviceName - The HBase service name.
roleNames - List of role names to decommision.
Returns:
Information about the submitted command.

deployClientConfigCommand

@Path(value="/{serviceName}/commands/deployClientConfig")
ApiCommand deployClientConfigCommand(String serviceName,
                                          ApiRoleNameList roleNames)
Deploy a service's client configuration.

The client configuration is deployed to the hosts where the given roles are running.

Added in v3: passing null for the role name list will deploy client configs to all known service roles. Added in v6: passing an empty role name list will deploy client configs to all known service roles.

In Cloudera Manager 5.3 and newer, client configurations are fully managed, meaning that the server maintains state about which client configurations should exist and be managed by alternatives, and the agents actively rectify their hosts with this state. Consequently, if this API call is made with a specific set of roles, Cloudera Manager will deactivate, from alternatives, any deployed client configs from any non-gateway roles that are not specified as arguments. Gateway roles are always preserved, and calling this API with an empty or null argument continues to deploy to all roles.

Parameters:
serviceName - The service name.
roleNames - List of role names.
Returns:
Information about the submitted command.

zooKeeperCleanupCommand

@Path(value="/{serviceName}/commands/zooKeeperCleanup")
ApiCommand zooKeeperCleanupCommand(String serviceName)
Clean up all running server instances of a ZooKeeper service.

This command removes snapshots and transaction log files kept by ZooKeeper for backup purposes. Refer to the ZooKeeper documentation for more details.

Parameters:
serviceName - The service to start.
Returns:
Information about the submitted command.

zooKeeperInitCommand

@Path(value="/{serviceName}/commands/zooKeeperInit")
ApiCommand zooKeeperInitCommand(String serviceName)
Initializes all the server instances of a ZooKeeper service.

ZooKeeper server roles need to be initialized before they can be used.

Parameters:
serviceName - The service to start.
Returns:
Information about the submitted command.

startCommand

@Path(value="/{serviceName}/commands/start")
ApiCommand startCommand(String serviceName)
Start the service.

Parameters:
serviceName - The service to start.
Returns:
Information about the submitted command.

stopCommand

@Path(value="/{serviceName}/commands/stop")
ApiCommand stopCommand(String serviceName)
Stop the service.

Parameters:
serviceName - The service to stop.
Returns:
Information about the submitted command.

restartCommand

@Path(value="/{serviceName}/commands/restart")
ApiCommand restartCommand(String serviceName)
Restart the service.

Parameters:
serviceName - The service to start.
Returns:
Information about the submitted command.

getNameservicesResource

@Path(value="/{serviceName}/nameservices")
NameservicesResource getNameservicesResource(String serviceName)
Returns:
The nameservices resource handler.

getRolesResource

@Path(value="/{serviceName}/roles")
RolesResource getRolesResource(String serviceName)
Returns:
The roles resource handler.

getRoleCommandsResource

@Path(value="/{serviceName}/roleCommands")
RoleCommandsResource getRoleCommandsResource(String serviceName)
Returns:
The role command resource handler.

getActivitiesResource

@Path(value="/{serviceName}/activities")
ActivitiesResource getActivitiesResource(String serviceName)
Return the activities resource handler.

Returns:
The activities resource handler


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