Skip to content

Document extra parameter for metric volumes endpoint #2957

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-26 17:56:33.436535",
"spec_repo_commit": "76086f13"
"regenerated": "2025-06-30 08:48:16.699190",
"spec_repo_commit": "36849030"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-26 17:56:33.454744",
"spec_repo_commit": "76086f13"
"regenerated": "2025-06-30 08:48:16.730642",
"spec_repo_commit": "36849030"
}
}
}
11 changes: 11 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52633,6 +52633,17 @@ paths:
operationId: ListVolumesByMetricName
parameters:
- $ref: '#/components/parameters/MetricName'
- description: 'The number of seconds of look back (from now).

Default value is 604,800 (1 week), minimum value is 7200 (2 hours), maximum
value is 2,630,000 (1 month).'
example: 7200
in: query
name: window[seconds]
required: false
schema:
format: int64
type: integer
responses:
'200':
content:
Expand Down
79 changes: 72 additions & 7 deletions src/main/java/com/datadog/api/client/v2/api/MetricsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -1980,6 +1980,24 @@ public ApiResponse<MetricAllTagsResponse> listTagsByMetricNameWithHttpInfo(Strin
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 604,800
* (1 week), minimum value is 7200 (2 hours), maximum value is 2,630,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 @@ -1990,7 +2008,9 @@ public ApiResponse<MetricAllTagsResponse> listTagsByMetricNameWithHttpInfo(Strin
* @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 @@ -2002,7 +2022,41 @@ 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();
Expand All @@ -2016,6 +2070,7 @@ public CompletableFuture<MetricVolumesResponse> listVolumesByMetricNameAsync(Str
* 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 @@ -2029,28 +2084,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 @@ -2072,10 +2131,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 @@ -2087,21 +2148,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