@Generated(value="https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class AnnotationsApi extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
AnnotationsApi.ListAnnotationsOptionalParameters
Manage optional parameters to listAnnotations.
|
| Constructor and Description |
|---|
AnnotationsApi() |
AnnotationsApi(ApiClient apiClient) |
public AnnotationsApi()
public AnnotationsApi(ApiClient apiClient)
public ApiClient getApiClient()
public void setApiClient(ApiClient apiClient)
apiClient - an instance of API clientpublic AnnotationResponse createAnnotation(AnnotationCreateRequest body) throws ApiException
See createAnnotationWithHttpInfo(com.datadog.api.client.v2.model.AnnotationCreateRequest).
body - Annotation to create. (required)ApiException - if fails to make API callpublic CompletableFuture<AnnotationResponse> createAnnotationAsync(AnnotationCreateRequest body)
See createAnnotationWithHttpInfoAsync(com.datadog.api.client.v2.model.AnnotationCreateRequest).
body - Annotation to create. (required)public ApiResponse<AnnotationResponse> createAnnotationWithHttpInfo(AnnotationCreateRequest body) throws ApiException
color values:
gray, blue, purple, green, yellow
, red. Valid type values: pointInTime (marks a
single moment) or timeRegion (spans a range and requires end_time).body - Annotation to create. (required)ApiException - if fails to make API call| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Bad Request | - |
| 403 | Forbidden | - |
| 429 | Too many requests | - |
| 500 | Internal Server Error | - |
public CompletableFuture<ApiResponse<AnnotationResponse>> createAnnotationWithHttpInfoAsync(AnnotationCreateRequest body)
See createAnnotationWithHttpInfo(com.datadog.api.client.v2.model.AnnotationCreateRequest).
body - Annotation to create. (required)public void deleteAnnotation(UUID annotationId) throws ApiException
annotationId - The ID of the annotation. (required)ApiException - if fails to make API callpublic CompletableFuture<Void> deleteAnnotationAsync(UUID annotationId)
annotationId - The ID of the annotation. (required)public ApiResponse<Void> deleteAnnotationWithHttpInfo(UUID annotationId) throws ApiException
204 No Content if the annotation
does not exist (idempotent).annotationId - The ID of the annotation. (required)ApiException - if fails to make API call| Status Code | Description | Response Headers |
| 204 | No Content | - |
| 400 | Bad Request | - |
| 403 | Forbidden | - |
| 429 | Too many requests | - |
| 500 | Internal Server Error | - |
public CompletableFuture<ApiResponse<Void>> deleteAnnotationWithHttpInfoAsync(UUID annotationId)
annotationId - The ID of the annotation. (required)public PageAnnotationsResponse getPageAnnotations(String pageId, Long startTime, Long endTime) throws ApiException
See getPageAnnotationsWithHttpInfo(java.lang.String, java.lang.Long, java.lang.Long).
pageId - The ID of the page, prefixed with the page type and joined by a colon (for
example, dashboard:abc-def-xyz or notebook:1234567890).
(required)startTime - Start of the time window in milliseconds since the Unix epoch. (required)endTime - End of the time window in milliseconds since the Unix epoch. (required)ApiException - if fails to make API callpublic CompletableFuture<PageAnnotationsResponse> getPageAnnotationsAsync(String pageId, Long startTime, Long endTime)
See getPageAnnotationsWithHttpInfoAsync(java.lang.String, java.lang.Long, java.lang.Long).
pageId - The ID of the page, prefixed with the page type and joined by a colon (for
example, dashboard:abc-def-xyz or notebook:1234567890).
(required)startTime - Start of the time window in milliseconds since the Unix epoch. (required)endTime - End of the time window in milliseconds since the Unix epoch. (required)public ApiResponse<PageAnnotationsResponse> getPageAnnotationsWithHttpInfo(String pageId, Long startTime, Long endTime) throws ApiException
ListAnnotations, this endpoint returns a single structured object with annotations
indexed by their ID and a widget-to-annotation mapping for easy UI rendering.pageId - The ID of the page, prefixed with the page type and joined by a colon (for
example, dashboard:abc-def-xyz or notebook:1234567890).
(required)startTime - Start of the time window in milliseconds since the Unix epoch. (required)endTime - End of the time window in milliseconds since the Unix epoch. (required)ApiException - if fails to make API call| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Bad Request | - |
| 403 | Forbidden | - |
| 429 | Too many requests | - |
| 500 | Internal Server Error | - |
public CompletableFuture<ApiResponse<PageAnnotationsResponse>> getPageAnnotationsWithHttpInfoAsync(String pageId, Long startTime, Long endTime)
See getPageAnnotationsWithHttpInfo(java.lang.String, java.lang.Long, java.lang.Long).
pageId - The ID of the page, prefixed with the page type and joined by a colon (for
example, dashboard:abc-def-xyz or notebook:1234567890).
(required)startTime - Start of the time window in milliseconds since the Unix epoch. (required)endTime - End of the time window in milliseconds since the Unix epoch. (required)public AnnotationsResponse listAnnotations(String pageId, Long startTime, Long endTime) throws ApiException
pageId - ID of the page to list annotations for, prefixed with the page type and joined by
a colon (for example, dashboard:abc-def-xyz or notebook:1234567890
). (required)startTime - Start of the time window in milliseconds since the Unix epoch. (required)endTime - End of the time window in milliseconds since the Unix epoch. (required)ApiException - if fails to make API callpublic CompletableFuture<AnnotationsResponse> listAnnotationsAsync(String pageId, Long startTime, Long endTime)
pageId - ID of the page to list annotations for, prefixed with the page type and joined by
a colon (for example, dashboard:abc-def-xyz or notebook:1234567890
). (required)startTime - Start of the time window in milliseconds since the Unix epoch. (required)endTime - End of the time window in milliseconds since the Unix epoch. (required)public AnnotationsResponse listAnnotations(String pageId, Long startTime, Long endTime, AnnotationsApi.ListAnnotationsOptionalParameters parameters) throws ApiException
pageId - ID of the page to list annotations for, prefixed with the page type and joined by
a colon (for example, dashboard:abc-def-xyz or notebook:1234567890
). (required)startTime - Start of the time window in milliseconds since the Unix epoch. (required)endTime - End of the time window in milliseconds since the Unix epoch. (required)parameters - Optional parameters for the request.ApiException - if fails to make API callpublic CompletableFuture<AnnotationsResponse> listAnnotationsAsync(String pageId, Long startTime, Long endTime, AnnotationsApi.ListAnnotationsOptionalParameters parameters)
pageId - ID of the page to list annotations for, prefixed with the page type and joined by
a colon (for example, dashboard:abc-def-xyz or notebook:1234567890
). (required)startTime - Start of the time window in milliseconds since the Unix epoch. (required)endTime - End of the time window in milliseconds since the Unix epoch. (required)parameters - Optional parameters for the request.public ApiResponse<AnnotationsResponse> listAnnotationsWithHttpInfo(String pageId, Long startTime, Long endTime, AnnotationsApi.ListAnnotationsOptionalParameters parameters) throws ApiException
pageId - ID of the page to list annotations for, prefixed with the page type and joined by
a colon (for example, dashboard:abc-def-xyz or notebook:1234567890
). (required)startTime - Start of the time window in milliseconds since the Unix epoch. (required)endTime - End of the time window in milliseconds since the Unix epoch. (required)parameters - Optional parameters for the request.ApiException - if fails to make API call| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Bad Request | - |
| 403 | Forbidden | - |
| 429 | Too many requests | - |
| 500 | Internal Server Error | - |
public CompletableFuture<ApiResponse<AnnotationsResponse>> listAnnotationsWithHttpInfoAsync(String pageId, Long startTime, Long endTime, AnnotationsApi.ListAnnotationsOptionalParameters parameters)
pageId - ID of the page to list annotations for, prefixed with the page type and joined by
a colon (for example, dashboard:abc-def-xyz or notebook:1234567890
). (required)startTime - Start of the time window in milliseconds since the Unix epoch. (required)endTime - End of the time window in milliseconds since the Unix epoch. (required)parameters - Optional parameters for the request.public AnnotationResponse updateAnnotation(UUID annotationId, AnnotationUpdateRequest body) throws ApiException
annotationId - The ID of the annotation. (required)body - Updated annotation payload. (required)ApiException - if fails to make API callpublic CompletableFuture<AnnotationResponse> updateAnnotationAsync(UUID annotationId, AnnotationUpdateRequest body)
annotationId - The ID of the annotation. (required)body - Updated annotation payload. (required)public ApiResponse<AnnotationResponse> updateAnnotationWithHttpInfo(UUID annotationId, AnnotationUpdateRequest body) throws ApiException
color values: gray, blue
, purple, green, yellow, red. Valid
type values: pointInTime (marks a single moment) or timeRegion
(spans a range and requires end_time).annotationId - The ID of the annotation. (required)body - Updated annotation payload. (required)ApiException - if fails to make API call| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Bad Request | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 429 | Too many requests | - |
| 500 | Internal Server Error | - |
public CompletableFuture<ApiResponse<AnnotationResponse>> updateAnnotationWithHttpInfoAsync(UUID annotationId, AnnotationUpdateRequest body)
annotationId - The ID of the annotation. (required)body - Updated annotation payload. (required)Copyright © 2026. All rights reserved.