public interface HostsResource
Modifier and Type | Method and Description |
---|---|
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.
|
@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.
hosts
- The list of hosts to create@Path(value="/") ApiHostList readHosts(DataView dataView)
dataView
- The view to materialize@Path(value="/{hostId}") ApiHost readHost(String hostId)
hostId
- The ID of the host to read@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.
hostId
- The hostId to updatehost
- The updated host object.@Path(value="/{hostId}") ApiHost deleteHost(String hostId)
hostId
- The ID of the host to remove@Path(value="/") ApiHostList deleteAllHosts()
@Path(value="/{hostId}/config") ApiConfigList readHostConfig(String hostId, DataView dataView)
hostId
- The ID of the host.dataView
- The view of the data to materialize,
either "summary" or "full".@Path(value="/{hostId}/config") ApiConfigList updateHostConfig(String hostId, String message, ApiConfigList config)
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.
hostId
- The ID of the host.message
- Optional message describing the changes.config
- Configuration changes.@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)
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.
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".Copyright © Cloudera, Inc. Released under Apache License, Version 2.0.