Skip to content

Commit 7c755eb

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 9b041d10 of spec repo
1 parent 8d82aa7 commit 7c755eb

File tree

10 files changed

+981
-11
lines changed

10 files changed

+981
-11
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-12-02 17:22:59.723662",
8-
"spec_repo_commit": "93ae89a8"
7+
"regenerated": "2024-12-02 19:06:44.892172",
8+
"spec_repo_commit": "9b041d10"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-12-02 17:22:59.743000",
13-
"spec_repo_commit": "93ae89a8"
12+
"regenerated": "2024-12-02 19:06:44.910959",
13+
"spec_repo_commit": "9b041d10"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 94 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15676,6 +15676,35 @@ components:
1567615676
- COUNT
1567715677
- RATE
1567815678
- GAUGE
15679+
MetricMetaPage:
15680+
description: Paging attributes. Only present if pagination query parameters
15681+
were provided.
15682+
properties:
15683+
cursor:
15684+
description: The cursor used to get the current results, if any.
15685+
type: string
15686+
limit:
15687+
description: Number of results returned
15688+
format: int32
15689+
maximum: 20000
15690+
minimum: 0
15691+
type: integer
15692+
next_cursor:
15693+
description: The cursor used to get the next results, if any.
15694+
nullable: true
15695+
type: string
15696+
type:
15697+
$ref: '#/components/schemas/MetricMetaPageType'
15698+
type: object
15699+
MetricMetaPageType:
15700+
default: cursor_limit
15701+
description: Type of metric pagination.
15702+
enum:
15703+
- cursor_limit
15704+
example: cursor_limit
15705+
type: string
15706+
x-enum-varnames:
15707+
- CURSOR_LIMIT
1567915708
MetricMetadata:
1568015709
description: Metadata for the metric.
1568115710
properties:
@@ -15758,6 +15787,12 @@ components:
1575815787
maximum: 1000
1575915788
type: integer
1576015789
type: object
15790+
MetricPaginationMeta:
15791+
description: Response metadata object.
15792+
properties:
15793+
pagination:
15794+
$ref: '#/components/schemas/MetricMetaPage'
15795+
type: object
1576115796
MetricPayload:
1576215797
description: The metrics' payload.
1576315798
properties:
@@ -16234,6 +16269,10 @@ components:
1623416269
items:
1623516270
$ref: '#/components/schemas/MetricsAndMetricTagConfigurations'
1623616271
type: array
16272+
links:
16273+
$ref: '#/components/schemas/MetricsListResponseLinks'
16274+
meta:
16275+
$ref: '#/components/schemas/MetricPaginationMeta'
1623716276
readOnly: true
1623816277
type: object
1623916278
MetricsDataSource:
@@ -16247,6 +16286,29 @@ components:
1624716286
x-enum-varnames:
1624816287
- METRICS
1624916288
- CLOUD_COST
16289+
MetricsListResponseLinks:
16290+
description: Pagination links. Only present if pagination query parameters were
16291+
provided.
16292+
properties:
16293+
first:
16294+
description: Link to the first page.
16295+
type: string
16296+
last:
16297+
description: Link to the last page.
16298+
nullable: true
16299+
type: string
16300+
next:
16301+
description: Link to the next page.
16302+
nullable: true
16303+
type: string
16304+
prev:
16305+
description: Link to previous page.
16306+
nullable: true
16307+
type: string
16308+
self:
16309+
description: Link to current page.
16310+
type: string
16311+
type: object
1625016312
MetricsScalarQuery:
1625116313
description: An individual scalar metrics query.
1625216314
properties:
@@ -35280,7 +35342,12 @@ paths:
3528035342
get:
3528135343
description: "Returns all metrics that can be configured in the Metrics Summary
3528235344
page or with Metrics without Limits\u2122 (matching additional filters if
35283-
specified)."
35345+
specified).\nOptionally, paginate by using the `page[cursor]` and/or `page[size]`
35346+
query parameters.\nTo fetch the first page, pass in a query parameter with
35347+
either a valid `page[size]` or an empty cursor like `page[cursor]=`. To fetch
35348+
the next page, pass in the `next_cursor` value from the response as the new
35349+
`page[cursor]` value.\nOnce the `meta.pagination.next_cursor` value is null,
35350+
all pages have been retrieved."
3528435351
operationId: ListTagConfigurations
3528535352
parameters:
3528635353
- description: Filter custom metrics that have configured tags.
@@ -35345,6 +35412,27 @@ paths:
3534535412
schema:
3534635413
format: int64
3534735414
type: integer
35415+
- description: Maximum number of results returned.
35416+
in: query
35417+
name: page[size]
35418+
required: false
35419+
schema:
35420+
default: 10000
35421+
format: int32
35422+
maximum: 10000
35423+
minimum: 1
35424+
type: integer
35425+
- description: 'String to query the next page of results.
35426+
35427+
This key is provided with each valid response from the API in `meta.pagination.next_cursor`.
35428+
35429+
Once the `meta.pagination.next_cursor` key is null, all pages have been
35430+
retrieved.'
35431+
in: query
35432+
name: page[cursor]
35433+
required: false
35434+
schema:
35435+
type: string
3534835436
responses:
3534935437
'200':
3535035438
content:
@@ -35378,6 +35466,11 @@ paths:
3537835466
summary: Get a list of metrics
3537935467
tags:
3538035468
- Metrics
35469+
x-pagination:
35470+
cursorParam: page[cursor]
35471+
cursorPath: meta.pagination.next_cursor
35472+
limitParam: page[size]
35473+
resultsPath: data
3538135474
x-permission:
3538235475
operator: OR
3538335476
permissions:
@@ -42741,10 +42834,6 @@ paths:
4274142834
summary: Get billing dimension mapping for usage endpoints
4274242835
tags:
4274342836
- Usage Metering
42744-
x-permission:
42745-
operator: OR
42746-
permissions:
42747-
- usage_read
4274842837
x-unstable: '**Note**: This endpoint is in Preview.
4274942838

4275042839
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'

api/datadogV2/api_metrics.go

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,8 @@ type ListTagConfigurationsOptionalParameters struct {
700700
FilterQueried *bool
701701
FilterTags *string
702702
WindowSeconds *int64
703+
PageSize *int32
704+
PageCursor *string
703705
}
704706

705707
// NewListTagConfigurationsOptionalParameters creates an empty struct for parameters.
@@ -750,8 +752,23 @@ func (r *ListTagConfigurationsOptionalParameters) WithWindowSeconds(windowSecond
750752
return r
751753
}
752754

755+
// WithPageSize sets the corresponding parameter name and returns the struct.
756+
func (r *ListTagConfigurationsOptionalParameters) WithPageSize(pageSize int32) *ListTagConfigurationsOptionalParameters {
757+
r.PageSize = &pageSize
758+
return r
759+
}
760+
761+
// WithPageCursor sets the corresponding parameter name and returns the struct.
762+
func (r *ListTagConfigurationsOptionalParameters) WithPageCursor(pageCursor string) *ListTagConfigurationsOptionalParameters {
763+
r.PageCursor = &pageCursor
764+
return r
765+
}
766+
753767
// ListTagConfigurations Get a list of metrics.
754768
// Returns all metrics that can be configured in the Metrics Summary page or with Metrics without Limits™ (matching additional filters if specified).
769+
// Optionally, paginate by using the `page[cursor]` and/or `page[size]` query parameters.
770+
// To fetch the first page, pass in a query parameter with either a valid `page[size]` or an empty cursor like `page[cursor]=`. To fetch the next page, pass in the `next_cursor` value from the response as the new `page[cursor]` value.
771+
// Once the `meta.pagination.next_cursor` value is null, all pages have been retrieved.
755772
func (a *MetricsApi) ListTagConfigurations(ctx _context.Context, o ...ListTagConfigurationsOptionalParameters) (MetricsAndMetricTagConfigurationsResponse, *_nethttp.Response, error) {
756773
var (
757774
localVarHTTPMethod = _nethttp.MethodGet
@@ -798,6 +815,12 @@ func (a *MetricsApi) ListTagConfigurations(ctx _context.Context, o ...ListTagCon
798815
if optionalParams.WindowSeconds != nil {
799816
localVarQueryParams.Add("window[seconds]", datadog.ParameterToString(*optionalParams.WindowSeconds, ""))
800817
}
818+
if optionalParams.PageSize != nil {
819+
localVarQueryParams.Add("page[size]", datadog.ParameterToString(*optionalParams.PageSize, ""))
820+
}
821+
if optionalParams.PageCursor != nil {
822+
localVarQueryParams.Add("page[cursor]", datadog.ParameterToString(*optionalParams.PageCursor, ""))
823+
}
801824
localVarHeaderParams["Accept"] = "application/json"
802825

803826
datadog.SetAuthKeys(
@@ -849,6 +872,64 @@ func (a *MetricsApi) ListTagConfigurations(ctx _context.Context, o ...ListTagCon
849872
return localVarReturnValue, localVarHTTPResponse, nil
850873
}
851874

875+
// ListTagConfigurationsWithPagination provides a paginated version of ListTagConfigurations returning a channel with all items.
876+
func (a *MetricsApi) ListTagConfigurationsWithPagination(ctx _context.Context, o ...ListTagConfigurationsOptionalParameters) (<-chan datadog.PaginationResult[MetricsAndMetricTagConfigurations], func()) {
877+
ctx, cancel := _context.WithCancel(ctx)
878+
pageSize_ := int32(10000)
879+
if len(o) == 0 {
880+
o = append(o, ListTagConfigurationsOptionalParameters{})
881+
}
882+
if o[0].PageSize != nil {
883+
pageSize_ = *o[0].PageSize
884+
}
885+
o[0].PageSize = &pageSize_
886+
887+
items := make(chan datadog.PaginationResult[MetricsAndMetricTagConfigurations], pageSize_)
888+
go func() {
889+
for {
890+
resp, _, err := a.ListTagConfigurations(ctx, o...)
891+
if err != nil {
892+
var returnItem MetricsAndMetricTagConfigurations
893+
items <- datadog.PaginationResult[MetricsAndMetricTagConfigurations]{Item: returnItem, Error: err}
894+
break
895+
}
896+
respData, ok := resp.GetDataOk()
897+
if !ok {
898+
break
899+
}
900+
results := *respData
901+
902+
for _, item := range results {
903+
select {
904+
case items <- datadog.PaginationResult[MetricsAndMetricTagConfigurations]{Item: item, Error: nil}:
905+
case <-ctx.Done():
906+
close(items)
907+
return
908+
}
909+
}
910+
if len(results) < int(pageSize_) {
911+
break
912+
}
913+
cursorMeta, ok := resp.GetMetaOk()
914+
if !ok {
915+
break
916+
}
917+
cursorMetaPagination, ok := cursorMeta.GetPaginationOk()
918+
if !ok {
919+
break
920+
}
921+
cursorMetaPaginationNextCursor, ok := cursorMetaPagination.GetNextCursorOk()
922+
if !ok {
923+
break
924+
}
925+
926+
o[0].PageCursor = cursorMetaPaginationNextCursor
927+
}
928+
close(items)
929+
}()
930+
return items, cancel
931+
}
932+
852933
// ListTagsByMetricName List tags by metric name.
853934
// View indexed tag key-value pairs for a given metric name over the previous hour.
854935
func (a *MetricsApi) ListTagsByMetricName(ctx _context.Context, metricName string) (MetricAllTagsResponse, *_nethttp.Response, error) {

0 commit comments

Comments
 (0)