Class NewRelicClientImpl
java.lang.Object
org.jenkinsci.plugins.newrelicnotifier.api.NewRelicClientImpl
- All Implemented Interfaces:
NewRelicClient
REST client implementation for the New Relic API.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet API Endpoint URL for looking up credentials.getApiEndpoint(boolean european) getApplications(String apiKey, boolean european) Get the list of applications available to record deployment notifications for.protected org.apache.http.impl.client.CloseableHttpClientgetHttpClient(String host) makePayload(String changelog, String commit, String deepLink, String deploymentType, String description, String entityGuid, String groupId, String timestamp, String user, String version) parseResponseBody(String str) voidsendNotification(String apiKey, String applicationId, String description, String revision, String changelog, String user, boolean european) Submit deployment notificationvoidsendNotificationV2(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
-
Field Details
-
API_SCHEME
- See Also:
-
API_HOST
- See Also:
-
EUROPEAN_API_HOST
- See Also:
-
NERD_GRAPH_ENDPOINT
- See Also:
-
DEPLOYMENT_ENDPOINT
- See Also:
-
APPLICATIONS_ENDPOINT
- See Also:
-
PAGE_PARAMETER
- See Also:
-
GRAPHQL_URL
- See Also:
-
EUROPEAN_GRAPHQL_URL
- See Also:
-
PAGE_SIZE
public static final int PAGE_SIZE- See Also:
-
-
Constructor Details
-
NewRelicClientImpl
public NewRelicClientImpl()
-
-
Method Details
-
getApplications
Get the list of applications available to record deployment notifications for.- Specified by:
getApplicationsin interfaceNewRelicClient- Parameters:
apiKey- New Relic User API keyeuropean- 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
public void sendNotification(String apiKey, String applicationId, String description, String revision, String changelog, String user, boolean european) throws IOException Submit deployment notification- Specified by:
sendNotificationin interfaceNewRelicClient- Parameters:
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 deployment- Throws:
IOException- when HttpClient is not able to be closed or unexpected status code received- See Also:
-
sendNotificationV2
public 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- Specified by:
sendNotificationV2in interfaceNewRelicClient- Parameters:
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 deployment- Throws:
IOException- when HttpClient is not able to be closed or unexpected status code received- See Also:
-
parseResponseBody
-
getApiEndpoint
Get API Endpoint URL for looking up credentials.- Specified by:
getApiEndpointin interfaceNewRelicClient- Returns:
- The endpoint URL for the New Relic API
-
getApiEndpoint
- Specified by:
getApiEndpointin interfaceNewRelicClient
-
makePayload
-
getHttpClient
-