org.jenkinsci.plugins.newrelicnotifier.api
Class NewRelicClientImpl

java.lang.Object
  extended by org.jenkinsci.plugins.newrelicnotifier.api.NewRelicClientImpl
All Implemented Interfaces:
NewRelicClient

public class NewRelicClientImpl
extends Object
implements NewRelicClient

REST client implementation for the New Relic API.


Constructor Summary
NewRelicClientImpl()
           
 
Method Summary
 String getApiEndpoint()
          Get API Endpoint URL for looking up credentials.
 List<Application> getApplications(String apiKey)
          Get the list of applications available to record deployment notifications for.
 boolean sendNotification(String apiKey, String applicationId, String description, String revision, String changelog, String user)
          Submit deployment notification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NewRelicClientImpl

public NewRelicClientImpl()
Method Detail

getApplications

public List<Application> getApplications(String apiKey)
                                  throws IOException
Get the list of applications available to record deployment notifications for.

Specified by:
getApplications in interface NewRelicClient
Parameters:
apiKey - New Relic API key
Returns:
A list of applications available for supplied API key.
Throws:
IOException
See Also:
https://docs.newrelic.com/docs/apm/apis/requirements/api-key

sendNotification

public boolean sendNotification(String apiKey,
                                String applicationId,
                                String description,
                                String revision,
                                String changelog,
                                String user)
                         throws IOException
Submit deployment notification

Specified by:
sendNotification in interface NewRelicClient
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
Returns:
Returns true if notifications was successful
Throws:
IOException
See Also:
https://docs.newrelic.com/docs/apm/apis/requirements/api-key

getApiEndpoint

public String getApiEndpoint()
Get API Endpoint URL for looking up credentials.

Specified by:
getApiEndpoint in interface NewRelicClient
Returns:
The endpoint URL for the New Relic API


Copyright © 2004-2015. All Rights Reserved.