Skip to content
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

Add limit parameter for get usage top average metrics #586

Merged
merged 1 commit into from
Nov 24, 2020
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
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.3.0",
"regenerated": "2020-11-24 09:46:05.393174",
"spec_repo_commit": "8ea24b0"
"regenerated": "2020-11-24 10:20:46.934268",
"spec_repo_commit": "605e8f8"
},
"v2": {
"apigentools_version": "1.3.0",
"regenerated": "2020-11-24 09:46:11.549725",
"spec_repo_commit": "8ea24b0"
"regenerated": "2020-11-24 10:20:53.463651",
"spec_repo_commit": "605e8f8"
}
}
}
12 changes: 12 additions & 0 deletions api/v1/datadog/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6670,6 +6670,18 @@ paths:
type: string
type: array
style: form
- description: Maximum number of results to return.
explode: true
in: query
name: limit
required: false
schema:
default: 500
format: int32
maximum: 5000
minimum: 1
type: integer
style: form
responses:
"200":
content:
Expand Down
8 changes: 8 additions & 0 deletions api/v1/datadog/api_usage_metering.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions api/v1/datadog/docs/UsageMeteringApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -2219,7 +2219,7 @@ Name | Type | Description | Notes

## GetUsageTopAvgMetrics

> UsageTopAvgMetricsResponse GetUsageTopAvgMetrics(ctx).Month(month).Names(names).Execute()
> UsageTopAvgMetricsResponse GetUsageTopAvgMetrics(ctx).Month(month).Names(names).Limit(limit).Execute()
Get top 500 custom metrics by hourly average

Expand Down Expand Up @@ -2254,11 +2254,12 @@ func main() {

month := time.Now() // time.Time | Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for usage beginning at this hour.
names := []string{"Inner_example"} // []string | Comma-separated list of metric names. (optional)
limit := int32(56) // int32 | Maximum number of results to return. (optional) (default to 500)

configuration := datadog.NewConfiguration()

api_client := datadog.NewAPIClient(configuration)
resp, r, err := api_client.UsageMeteringApi.GetUsageTopAvgMetrics(ctx).Month(month).Names(names).Execute()
resp, r, err := api_client.UsageMeteringApi.GetUsageTopAvgMetrics(ctx).Month(month).Names(names).Limit(limit).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UsageMeteringApi.GetUsageTopAvgMetrics``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
Expand All @@ -2281,6 +2282,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**month** | **time.Time** | Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for usage beginning at this hour. |
**names** | **[]string** | Comma-separated list of metric names. |
**limit** | **int32** | Maximum number of results to return. | [default to 500]

### Return type

Expand Down