Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116096,12 +116096,22 @@ paths:
/api/v2/metrics/{metric_name}/volumes:
get:
description: |-
View distinct metrics volumes for the given metric name.
View hourly average metric volumes for the given metric name over the look back period.

Custom metrics generated in-app from other products will return `null` for ingested volumes.
operationId: ListVolumesByMetricName
parameters:
- $ref: "#/components/parameters/MetricName"
- description: |-
The number of seconds of look back (from now).
Default value is 3,600 (1 hour), maximum value is 2,592,000 (1 month).
example: 7200
in: query
name: window[seconds]
required: false
schema:
format: int64
type: integer
responses:
"200":
content:
Expand Down
80 changes: 72 additions & 8 deletions src/main/java/com/datadog/api/client/v2/api/MetricsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -2319,6 +2319,23 @@ public ApiResponse<MetricAllTagsResponse> listTagsByMetricNameWithHttpInfo(
new GenericType<MetricAllTagsResponse>() {});
}

/** Manage optional parameters to listVolumesByMetricName. */
public static class ListVolumesByMetricNameOptionalParameters {
private Long windowSeconds;

/**
* Set windowSeconds.
*
* @param windowSeconds The number of seconds of look back (from now). Default value is 3,600 (1
* hour), maximum value is 2,592,000 (1 month). (optional)
* @return ListVolumesByMetricNameOptionalParameters
*/
public ListVolumesByMetricNameOptionalParameters windowSeconds(Long windowSeconds) {
this.windowSeconds = windowSeconds;
return this;
}
}

/**
* List distinct metric volumes by metric name.
*
Expand All @@ -2329,7 +2346,9 @@ public ApiResponse<MetricAllTagsResponse> listTagsByMetricNameWithHttpInfo(
* @throws ApiException if fails to make API call
*/
public MetricVolumesResponse listVolumesByMetricName(String metricName) throws ApiException {
return listVolumesByMetricNameWithHttpInfo(metricName).getData();
return listVolumesByMetricNameWithHttpInfo(
metricName, new ListVolumesByMetricNameOptionalParameters())
.getData();
}

/**
Expand All @@ -2341,20 +2360,55 @@ public MetricVolumesResponse listVolumesByMetricName(String metricName) throws A
* @return CompletableFuture&lt;MetricVolumesResponse&gt;
*/
public CompletableFuture<MetricVolumesResponse> listVolumesByMetricNameAsync(String metricName) {
return listVolumesByMetricNameWithHttpInfoAsync(metricName)
return listVolumesByMetricNameWithHttpInfoAsync(
metricName, new ListVolumesByMetricNameOptionalParameters())
.thenApply(
response -> {
return response.getData();
});
}

/**
* List distinct metric volumes by metric name.
*
* <p>See {@link #listVolumesByMetricNameWithHttpInfo}.
*
* @param metricName The name of the metric. (required)
* @param parameters Optional parameters for the request.
* @return MetricVolumesResponse
* @throws ApiException if fails to make API call
*/
public MetricVolumesResponse listVolumesByMetricName(
String metricName, ListVolumesByMetricNameOptionalParameters parameters) throws ApiException {
return listVolumesByMetricNameWithHttpInfo(metricName, parameters).getData();
}

/**
* List distinct metric volumes by metric name.
*
* <p>See {@link #listVolumesByMetricNameWithHttpInfoAsync}.
*
* @param metricName The name of the metric. (required)
* @param parameters Optional parameters for the request.
* @return CompletableFuture&lt;MetricVolumesResponse&gt;
*/
public CompletableFuture<MetricVolumesResponse> listVolumesByMetricNameAsync(
String metricName, ListVolumesByMetricNameOptionalParameters parameters) {
return listVolumesByMetricNameWithHttpInfoAsync(metricName, parameters)
.thenApply(
response -> {
return response.getData();
});
}

/**
* View distinct metrics volumes for the given metric name.
* View hourly average metric volumes for the given metric name over the look back period.
*
* <p>Custom metrics generated in-app from other products will return <code>null</code> for
* ingested volumes.
*
* @param metricName The name of the metric. (required)
* @param parameters Optional parameters for the request.
* @return ApiResponse&lt;MetricVolumesResponse&gt;
* @throws ApiException if fails to make API call
* @http.response.details
Expand All @@ -2368,28 +2422,32 @@ public CompletableFuture<MetricVolumesResponse> listVolumesByMetricNameAsync(Str
* <tr><td> 429 </td><td> Too Many Requests </td><td> - </td></tr>
* </table>
*/
public ApiResponse<MetricVolumesResponse> listVolumesByMetricNameWithHttpInfo(String metricName)
throws ApiException {
public ApiResponse<MetricVolumesResponse> listVolumesByMetricNameWithHttpInfo(
String metricName, ListVolumesByMetricNameOptionalParameters parameters) throws ApiException {
Object localVarPostBody = null;

// verify the required parameter 'metricName' is set
if (metricName == null) {
throw new ApiException(
400, "Missing the required parameter 'metricName' when calling listVolumesByMetricName");
}
Long windowSeconds = parameters.windowSeconds;
// create path and map variables
String localVarPath =
"/api/v2/metrics/{metric_name}/volumes"
.replaceAll(
"\\{" + "metric_name" + "\\}", apiClient.escapeString(metricName.toString()));

List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();

localVarQueryParams.addAll(apiClient.parameterToPairs("", "window[seconds]", windowSeconds));

Invocation.Builder builder =
apiClient.createBuilder(
"v2.MetricsApi.listVolumesByMetricName",
localVarPath,
new ArrayList<Pair>(),
localVarQueryParams,
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
Expand All @@ -2411,10 +2469,12 @@ public ApiResponse<MetricVolumesResponse> listVolumesByMetricNameWithHttpInfo(St
* <p>See {@link #listVolumesByMetricNameWithHttpInfo}.
*
* @param metricName The name of the metric. (required)
* @param parameters Optional parameters for the request.
* @return CompletableFuture&lt;ApiResponse&lt;MetricVolumesResponse&gt;&gt;
*/
public CompletableFuture<ApiResponse<MetricVolumesResponse>>
listVolumesByMetricNameWithHttpInfoAsync(String metricName) {
listVolumesByMetricNameWithHttpInfoAsync(
String metricName, ListVolumesByMetricNameOptionalParameters parameters) {
Object localVarPostBody = null;

// verify the required parameter 'metricName' is set
Expand All @@ -2426,21 +2486,25 @@ public ApiResponse<MetricVolumesResponse> listVolumesByMetricNameWithHttpInfo(St
"Missing the required parameter 'metricName' when calling listVolumesByMetricName"));
return result;
}
Long windowSeconds = parameters.windowSeconds;
// create path and map variables
String localVarPath =
"/api/v2/metrics/{metric_name}/volumes"
.replaceAll(
"\\{" + "metric_name" + "\\}", apiClient.escapeString(metricName.toString()));

List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();

localVarQueryParams.addAll(apiClient.parameterToPairs("", "window[seconds]", windowSeconds));

Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.MetricsApi.listVolumesByMetricName",
localVarPath,
new ArrayList<Pair>(),
localVarQueryParams,
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
Expand Down
Loading