All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ocadotechnology.newrelic.apiclient.AlertsPoliciesApi Maven / Gradle / Ivy

Go to download

NewRelic Alerts Configurator can be used to configure NewRelic alerts for your application. Instead of defining alerts through UI you can define them in code. It allows you to automatize alerts configuration, easily recover them in case of wipe out and have full history of changes in your version control system.

There is a newer version: 5.0.1
Show newest version
package com.ocadotechnology.newrelic.apiclient;

import com.ocadotechnology.newrelic.apiclient.model.policies.AlertsPolicy;
import com.ocadotechnology.newrelic.apiclient.model.policies.AlertsPolicyChannels;

import java.util.Optional;

public interface AlertsPoliciesApi {
    /**
     * Gets {@link AlertsPolicy} object using its name.
     *
     * @param alertsPolicyName name of the alert policy registered in NewRelic
     * @return Optional containing {@link AlertsPolicy} object, or empty if alert policy not found
     */
    Optional getByName(String alertsPolicyName);

    /**
     * Creates Alerts Policy instance.
     *
     * @param policy policy definition to be created
     * @return created {@link AlertsPolicy}
     */
    AlertsPolicy create(AlertsPolicy policy);

    /**
     * Deletes Alerts Policy instance.
     *
     * @param policyId id of the policy to be removed
     * @return deleted {@link AlertsPolicy}
     */
    AlertsPolicy delete(int policyId);

    /**
     * Associates given channels to the policy. This method does not remove previously linked channel but not provided in the list.
     *
     * @param channels {@link AlertsPolicyChannels} object mapping policy id to the list of channels ids
     * @return {@link AlertsPolicyChannels} when successfully set
     */
    AlertsPolicyChannels updateChannels(AlertsPolicyChannels channels);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy