Skip to content
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:23.043504",
"spec_repo_commit": "76086f13"
"regenerated": "2025-06-30 08:48:16.966449",
"spec_repo_commit": "36849030"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-26 17:56:23.062756",
"spec_repo_commit": "76086f13"
"regenerated": "2025-06-30 08:48:16.998415",
"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
30 changes: 29 additions & 1 deletion api/datadogV2/api_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -1010,17 +1010,42 @@ func (a *MetricsApi) ListTagsByMetricName(ctx _context.Context, metricName strin
return localVarReturnValue, localVarHTTPResponse, nil
}

// ListVolumesByMetricNameOptionalParameters holds optional parameters for ListVolumesByMetricName.
type ListVolumesByMetricNameOptionalParameters struct {
WindowSeconds *int64
}

// NewListVolumesByMetricNameOptionalParameters creates an empty struct for parameters.
func NewListVolumesByMetricNameOptionalParameters() *ListVolumesByMetricNameOptionalParameters {
this := ListVolumesByMetricNameOptionalParameters{}
return &this
}

// WithWindowSeconds sets the corresponding parameter name and returns the struct.
func (r *ListVolumesByMetricNameOptionalParameters) WithWindowSeconds(windowSeconds int64) *ListVolumesByMetricNameOptionalParameters {
r.WindowSeconds = &windowSeconds
return r
}

// ListVolumesByMetricName List distinct metric volumes by metric name.
// View distinct metrics volumes for the given metric name.
//
// Custom metrics generated in-app from other products will return `null` for ingested volumes.
func (a *MetricsApi) ListVolumesByMetricName(ctx _context.Context, metricName string) (MetricVolumesResponse, *_nethttp.Response, error) {
func (a *MetricsApi) ListVolumesByMetricName(ctx _context.Context, metricName string, o ...ListVolumesByMetricNameOptionalParameters) (MetricVolumesResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
localVarReturnValue MetricVolumesResponse
optionalParams ListVolumesByMetricNameOptionalParameters
)

if len(o) > 1 {
return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListVolumesByMetricNameOptionalParameters is allowed")
}
if len(o) == 1 {
optionalParams = o[0]
}

localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.MetricsApi.ListVolumesByMetricName")
if err != nil {
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
Expand All @@ -1032,6 +1057,9 @@ func (a *MetricsApi) ListVolumesByMetricName(ctx _context.Context, metricName st
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
if optionalParams.WindowSeconds != nil {
localVarQueryParams.Add("window[seconds]", datadog.ParameterToString(*optionalParams.WindowSeconds, ""))
}
localVarHeaderParams["Accept"] = "application/json"

datadog.SetAuthKeys(
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/metrics/ListVolumesByMetricName.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func main() {
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewMetricsApi(apiClient)
resp, r, err := api.ListVolumesByMetricName(ctx, "static_test_metric_donotdelete")
resp, r, err := api.ListVolumesByMetricName(ctx, "static_test_metric_donotdelete", *datadogV2.NewListVolumesByMetricNameOptionalParameters())

if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MetricsApi.ListVolumesByMetricName`: %v\n", err)
Expand Down
Loading