public class NewRelicClientImpl extends Object implements NewRelicClient
Modifier and Type | Field and Description |
---|---|
static String |
API_HOST |
static String |
API_SCHEME |
static String |
APPLICATIONS_ENDPOINT |
static String |
DEPLOYMENT_ENDPOINT |
static String |
EUROPEAN_API_HOST |
static String |
EUROPEAN_GRAPHQL_URL |
static String |
GRAPHQL_URL |
static String |
NERD_GRAPH_ENDPOINT |
static String |
PAGE_PARAMETER |
static int |
PAGE_SIZE |
Constructor and Description |
---|
NewRelicClientImpl() |
Modifier and Type | Method and Description |
---|---|
String |
getApiEndpoint()
Get API Endpoint URL for looking up credentials.
|
String |
getApiEndpoint(boolean european) |
List<Application> |
getApplications(String apiKey)
Get the list of applications available to record deployment notifications for.
|
protected org.apache.http.impl.client.CloseableHttpClient |
getHttpClient(String host) |
String |
makePayload(String changelog,
String commit,
String deepLink,
String deploymentType,
String description,
String entityGuid,
String groupId,
String timestamp,
String user,
String version) |
String |
parseResponseBody(String str) |
void |
sendNotification(String apiKey,
String applicationId,
String description,
String revision,
String changelog,
String user,
boolean european)
Submit deployment notification
|
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)
Submit deployment notification
|
public static final String API_SCHEME
public static final String API_HOST
public static final String EUROPEAN_API_HOST
public static final String NERD_GRAPH_ENDPOINT
public static final String DEPLOYMENT_ENDPOINT
public static final String APPLICATIONS_ENDPOINT
public static final String PAGE_PARAMETER
public static final String GRAPHQL_URL
public static final String EUROPEAN_GRAPHQL_URL
public static final int PAGE_SIZE
public List<Application> getApplications(String apiKey) throws IOException
getApplications
in interface NewRelicClient
apiKey
- New Relic API keyIOException
- when HttpClient is not able to be closedpublic void sendNotification(String apiKey, String applicationId, String description, String revision, String changelog, String user, boolean european) throws IOException
sendNotification
in interface NewRelicClient
apiKey
- New Relic API keyapplicationId
- Application to register deployment fordescription
- Text annotation for the deploymentrevision
- The revision number from your source control systemchangelog
- A list of changes for this deploymentuser
- The name of the user/process that triggered this deploymentIOException
- when HttpClient is not able to be closed or unexpected status code receivedpublic 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
sendNotificationV2
in interface NewRelicClient
apiKey
- New Relic API keychangelog
- A list of changes for this deploymentcommit
- A commit hash for the deploymentdeepLink
- A deep link for the deploymentdeploymentType
- A deployment type for the deploymentdescription
- Text annotation for the deploymententityGuid
- An entity GUID to identify the application for Nerdgraph deployment markersgroupId
- A group id for the deploymenttimestamp
- A timestamp for the deploymentuser
- The name of the user/process that triggered this deploymentversion
- A version for the deploymentIOException
- when HttpClient is not able to be closed or unexpected status code receivedpublic String getApiEndpoint()
getApiEndpoint
in interface NewRelicClient
public String getApiEndpoint(boolean european)
getApiEndpoint
in interface NewRelicClient
public String makePayload(String changelog, String commit, String deepLink, String deploymentType, String description, String entityGuid, String groupId, String timestamp, String user, String version)
protected org.apache.http.impl.client.CloseableHttpClient getHttpClient(String host)
Copyright © 2016–2023. All rights reserved.