com.cloudera.api.v1
Interface HostsResource

All Known Subinterfaces:
HostsResourceV10, HostsResourceV11, HostsResourceV2

public interface HostsResource


Method Summary
 ApiHostList createHosts(ApiHostList hosts)
          Create one or more hosts.
 ApiHostList deleteAllHosts()
          Delete all hosts in the system
 ApiHost deleteHost(String hostId)
          Delete a host from the system
 ApiMetricList getMetrics(String hostId, String from, String to, boolean queryNw, Set<String> ifs, boolean queryStorage, Set<String> storageIds, Set<String> metrics, DataView dataView)
          Deprecated. This endpoint is not supported as of v6. Use the timeseries API instead. To get all metrics for a host with the timeseries API use the query:

'select * where hostId = $HOST_ID'.

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

'select $METRIC_NAME1, $METRIC_NAME2 where hostId = $HOST_ID'.

For more information see the tsquery language documentation.

 ApiHost readHost(String hostId)
          Returns a specific Host in the system
 ApiConfigList readHostConfig(String hostId, DataView dataView)
          Retrieves the configuration of a specific host.
 ApiHostList readHosts(DataView dataView)
          Returns the hostIds for all hosts in the system.
 ApiHost updateHost(String hostId, ApiHost host)
          Update an existing host in the system.
 ApiConfigList updateHostConfig(String hostId, String message, ApiConfigList config)
          Updates the host configuration with the given values.
 

Method Detail

createHosts

@Path(value="/")
ApiHostList createHosts(ApiHostList hosts)

Create one or more hosts.

You must specify at least the hostname and ipAddress in the request objects. If no hostId is specified, it will be set to the hostname. It is an error to try and create host with the same hostId as another host.

Parameters:
hosts - The list of hosts to create
Returns:
The newly created host objects

readHosts

@Path(value="/")
ApiHostList readHosts(DataView dataView)
Returns the hostIds for all hosts in the system.

Parameters:
dataView - The view to materialize
Returns:
A list of hostIds

readHost

@Path(value="/{hostId}")
ApiHost readHost(String hostId)
Returns a specific Host in the system

Parameters:
hostId - The ID of the host to read
Returns:
The Host object with the specified hostId

updateHost

@Path(value="/{hostId}")
ApiHost updateHost(String hostId,
                        ApiHost host)

Update an existing host in the system.

Currently, only updating the rackId is supported. All other fields of the host will be ignored.

Parameters:
hostId - The hostId to update
host - The updated host object.
Returns:
The updated host

deleteHost

@Path(value="/{hostId}")
ApiHost deleteHost(String hostId)
Delete a host from the system

Parameters:
hostId - The ID of the host to remove
Returns:
The deleted Host

deleteAllHosts

@Path(value="/")
ApiHostList deleteAllHosts()
Delete all hosts in the system

Returns:
The list of deleted hosts

readHostConfig

@Path(value="/{hostId}/config")
ApiConfigList readHostConfig(String hostId,
                                  DataView dataView)
Retrieves the configuration of a specific host.

Parameters:
hostId - The ID of the host.
dataView - The view of the data to materialize, either "summary" or "full".
Returns:
List of host configuration parameters.

updateHostConfig

@Path(value="/{hostId}/config")
ApiConfigList updateHostConfig(String hostId,
                                    String message,
                                    ApiConfigList config)
Updates the host configuration with the given values.

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

getMetrics

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

'select * where hostId = $HOST_ID'.

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

'select $METRIC_NAME1, $METRIC_NAME2 where hostId = $HOST_ID'.

For more information see the tsquery language documentation.

Fetch metric readings for a host.

By default, this call will look up all metrics available for the host. 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.

Host metrics also include per-network interface and per-storage device metrics. Since collecting this data incurs in more overhead, query parameters can be used to choose which network interfaces and storage devices to query, or to these metrics altogether.

Storage metrics are collected at different levels; for example, per-disk and per-partition metrics are available. The "storageIds" parameter can be used to filter specific storage IDs.

In the returned data, the network interfaces and storage IDs can be identified by looking at the "context" property of the metric objects.

Parameters:
hostId - The host's ID.
from - Start of the period to query.
to - End of the period to query.
queryNw - Whether to query for network interface metrics.
ifs - Network interfaces to query for metrics (default = all).
queryStorage - Whether to query for storage metrics.
storageIds - Storage context IDs to query for metrics (default = all).
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.