Interface NewRelicClient

All Known Implementing Classes:
NewRelicClientImpl

public interface NewRelicClient
REST client interface for the New Relic API.
  • Method Details

    • getApplications

      List<Application> getApplications(String apiKey, boolean european) throws IOException
      Get the list of applications available to record deployment notifications for.
      Parameters:
      apiKey - New Relic User API key
      european - Is the User API key created under a European account
      Returns:
      A list of applications available for supplied API key.
      Throws:
      IOException - when HttpClient is not able to be closed
      See Also:
    • sendNotification

      void sendNotification(String apiKey, String applicationId, String description, String revision, String changelog, String user, boolean european) throws IOException
      Submit deployment notification
      Parameters:
      apiKey - New Relic API key
      applicationId - Application to register deployment for
      description - Text annotation for the deployment
      revision - The revision number from your source control system
      changelog - A list of changes for this deployment
      user - The name of the user/process that triggered this deployment
      Throws:
      IOException - when HttpClient is not able to be closed or unexpected status code received
      See Also:
    • getApiEndpoint

      String getApiEndpoint()
      Get API Endpoint URL for looking up credentials.
      Returns:
      The endpoint URL for the New Relic API
    • getApiEndpoint

      String getApiEndpoint(boolean european)
    • sendNotificationV2

      void sendNotificationV2(String apiKey, String changelog, String commit, String deepLink, String deploymentType, String description, String entityGuid, String groupId, String timestamp, String user, String version, boolean european, TaskListener listener) throws IOException
      Submit deployment notification
      Parameters:
      apiKey - New Relic API key
      changelog - A list of changes for this deployment
      commit - A commit hash for the deployment
      deepLink - A deep link for the deployment
      deploymentType - A deployment type for the deployment
      description - Text annotation for the deployment
      entityGuid - An entity GUID to identify the application for Nerdgraph deployment markers
      groupId - A group id for the deployment
      timestamp - A timestamp for the deployment
      user - The name of the user/process that triggered this deployment
      version - A version for the deployment
      Throws:
      IOException - when HttpClient is not able to be closed or unexpected status code received
      See Also: