Skip to content

Document extra parameter for metric volumes endpoint #2444

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:17.634630",
"spec_repo_commit": "76086f13"
"regenerated": "2025-06-30 08:48:20.043554",
"spec_repo_commit": "36849030"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-26 17:56:17.650561",
"spec_repo_commit": "76086f13"
"regenerated": "2025-06-30 08:48:20.059251",
"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
4 changes: 4 additions & 0 deletions features/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5761,6 +5761,10 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
"type": "string",
"format": "",
},
"windowSeconds": {
"type": "number",
"format": "int64",
},
"operationResponseType": "MetricVolumesResponse",
},
"v2.QueryScalarData": {
Expand Down
17 changes: 17 additions & 0 deletions packages/datadog-api-client-v2/apis/MetricsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ export class MetricsApiRequestFactory extends BaseAPIRequestFactory {

public async listVolumesByMetricName(
metricName: string,
windowSeconds?: number,
_options?: Configuration
): Promise<RequestContext> {
const _config = _options || this.configuration;
Expand All @@ -565,6 +566,15 @@ export class MetricsApiRequestFactory extends BaseAPIRequestFactory {
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);

// Query Params
if (windowSeconds !== undefined) {
requestContext.setQueryParam(
"window[seconds]",
ObjectSerializer.serialize(windowSeconds, "number", "int64"),
""
);
}

// Apply auth methods
applySecurityAuthentication(_config, requestContext, [
"apiKeyAuth",
Expand Down Expand Up @@ -1875,6 +1885,12 @@ export interface MetricsApiListVolumesByMetricNameRequest {
* @type string
*/
metricName: string;
/**
* 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).
* @type number
*/
windowSeconds?: number;
}

export interface MetricsApiQueryScalarDataRequest {
Expand Down Expand Up @@ -2260,6 +2276,7 @@ export class MetricsApi {
): Promise<MetricVolumesResponse> {
const requestContextPromise = this.requestFactory.listVolumesByMetricName(
param.metricName,
param.windowSeconds,
options
);
return requestContextPromise.then((requestContext) => {
Expand Down
Loading