public class MonitorService extends BaseFluent
ALERT_CHANNEL, ALERT_CHANNELS, ALERT_CONDITION, ALERT_CONDITIONS, ALERT_EVENT, ALERT_EVENTS, ALERT_INCIDENT, ALERT_INCIDENTS, ALERT_POLICIES, ALERT_POLICY, ALERT_POLICY_CHANNEL, ALERT_VIOLATION, ALERT_VIOLATIONS, APPLICATION, APPLICATION_HOST, APPLICATION_HOSTS, APPLICATION_INSTANCE, APPLICATION_INSTANCES, APPLICATIONS, BROWSER_APPLICATION, BROWSER_APPLICATIONS, DASHBOARD, DASHBOARDS, DEPLOYMENT, DEPLOYMENTS, EXTERNAL_SERVICE_ALERT_CONDITION, EXTERNAL_SERVICE_ALERT_CONDITIONS, HTTP, INFRA_ALERT_CONDITION, INFRA_ALERT_CONDITIONS, KEY_TRANSACTION, KEY_TRANSACTIONS, LABEL, LABELS, LOCATIONS, METRIC_DATA, METRICS, MOBILE_APPLICATION, MOBILE_APPLICATIONS, MONITOR, MONITORS, NRQL_ALERT_CONDITION, NRQL_ALERT_CONDITIONS, PARTNER_ACCOUNT, PARTNER_ACCOUNTS, PARTNER_SUBSCRIPTION, PARTNER_SUBSCRIPTIONS, PARTNER_USERS, PLUGIN, PLUGIN_COMPONENT, PLUGIN_COMPONENTS, PLUGINS, PLUGINS_ALERT_CONDITION, PLUGINS_ALERT_CONDITIONS, QUERY_DATA, SCRIPT, SERVER, SERVERS, STATUS, SYNTHETICS_ALERT_CONDITION, SYNTHETICS_ALERT_CONDITIONS, USAGE_DATA, USER, USERS
Constructor and Description |
---|
MonitorService(HttpContext httpContext,
NewRelicClient client)
Constructor that takes a http context and API client.
|
Modifier and Type | Method and Description |
---|---|
com.google.common.base.Optional<Monitor> |
create(Monitor monitor)
Creates the given monitor.
|
com.google.common.base.Optional<Label> |
createLabel(String monitorId,
Label label)
Adds the given label to the monitor with the given id.
|
MonitorService |
delete(String monitorId)
Deletes the monitor with the given id.
|
MonitorService |
deleteLabel(String monitorId,
Label label)
Deletes the given label from the monitor with the given id.
|
Collection<Monitor> |
list()
Returns the set of monitors.
|
Collection<Monitor> |
list(Label label)
Returns the set of monitors for the given label.
|
com.google.common.base.Optional<Monitor> |
patch(Monitor monitor)
Patches the given monitor.
|
com.google.common.base.Optional<Monitor> |
show(String monitorId)
Returns the monitor for the given monitor id.
|
com.google.common.base.Optional<Script> |
showScript(String monitorId)
Returns the script for the given monitor id.
|
com.google.common.base.Optional<Monitor> |
update(Monitor monitor)
Updates the given monitor.
|
com.google.common.base.Optional<Script> |
updateScript(String monitorId,
Script script)
Updates the given monitor to add a script.
|
encode, getClient
public MonitorService(HttpContext httpContext, NewRelicClient client)
httpContext
- The set of HTTP operationsclient
- The client used to invoke the New Relic operationspublic Collection<Monitor> list()
public Collection<Monitor> list(Label label)
label
- The label to use to select the monitors to returnpublic com.google.common.base.Optional<Monitor> show(String monitorId)
monitorId
- The id for the monitor to returnpublic com.google.common.base.Optional<Script> showScript(String monitorId)
monitorId
- The id for the monitor to returnpublic com.google.common.base.Optional<Monitor> create(Monitor monitor)
monitor
- The monitor to createpublic com.google.common.base.Optional<Monitor> update(Monitor monitor)
monitor
- The monitor to updatepublic com.google.common.base.Optional<Script> updateScript(String monitorId, Script script)
monitorId
- The id of the monitor to updatescript
- The script to addpublic com.google.common.base.Optional<Monitor> patch(Monitor monitor)
monitor
- The monitor to patchpublic com.google.common.base.Optional<Label> createLabel(String monitorId, Label label)
monitorId
- The id of the monitor to updatelabel
- The label to addpublic MonitorService delete(String monitorId)
monitorId
- The id of the monitor to deletepublic MonitorService deleteLabel(String monitorId, Label label)
monitorId
- The id of the monitor with the labellabel
- The label to deleteCopyright © 2018. All rights reserved.