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

Mark query field as optional when searching logs #577

Merged
merged 64 commits into from
Nov 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
bc0f2cd
add a length check to bdd tooling
mrhwick Sep 24, 2020
b15faee
Add scenario tests for incidents endpoints
mrhwick Sep 24, 2020
1a7a674
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 24, 2020
9d2a421
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 24, 2020
e402323
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 24, 2020
c64b61d
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 24, 2020
9179abc
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 24, 2020
6a57970
fix teams/services cassettes
mrhwick Sep 24, 2020
011bf11
Merge branch 'datadog-api-spec/test/matt.hardwick/add-incidents-spec'…
mrhwick Sep 24, 2020
f2b7067
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 24, 2020
f80f00b
Merge branch 'master' of github.com:DataDog/datadog-api-client-go int…
mrhwick Sep 24, 2020
5a8fc7f
Merge branch 'datadog-api-spec/test/matt.hardwick/add-incidents-spec'…
mrhwick Sep 24, 2020
f1bb0da
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 24, 2020
875ed2b
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 24, 2020
68ce792
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 24, 2020
7682977
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 24, 2020
50a9646
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 24, 2020
54b89ea
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 24, 2020
15f51fc
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 24, 2020
8a324d8
fix create incident pre-step
mrhwick Sep 24, 2020
a2a3791
Merge branch 'datadog-api-spec/test/matt.hardwick/add-incidents-spec'…
mrhwick Sep 24, 2020
04e61fe
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 24, 2020
fe127b5
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 25, 2020
3bf493f
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 25, 2020
aecbcf3
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 25, 2020
4836fd1
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 25, 2020
e7b17f7
operations are enabled in the bdd steps
mrhwick Sep 25, 2020
c0903ec
Merge branch 'datadog-api-spec/test/matt.hardwick/add-incidents-spec'…
mrhwick Sep 25, 2020
741938a
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 25, 2020
9821a68
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 25, 2020
143e6f4
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 25, 2020
5fc9bcb
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 25, 2020
8b0ef4d
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 25, 2020
0a02f15
update incidents cassettes
mrhwick Sep 25, 2020
4122412
Merge branch 'datadog-api-spec/test/matt.hardwick/add-incidents-spec'…
mrhwick Sep 25, 2020
45aa973
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 25, 2020
06862e7
Merge branch 'master' of github.com:DataDog/datadog-api-client-go int…
mrhwick Sep 25, 2020
f2ee90f
Merge branch 'datadog-api-spec/test/matt.hardwick/add-incidents-spec'…
mrhwick Sep 25, 2020
e0ac89f
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 25, 2020
f7f3f17
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 25, 2020
def3919
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 25, 2020
d4eb003
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 25, 2020
98224cf
enable unstable operations in one step
mrhwick Sep 25, 2020
b8e438f
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 25, 2020
0267406
Merge branch 'datadog-api-spec/test/matt.hardwick/add-incidents-spec'…
mrhwick Sep 25, 2020
17378db
remove that unnecessary step now
mrhwick Sep 25, 2020
9f68d84
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 25, 2020
9f389eb
fix cassettes for everything
mrhwick Sep 25, 2020
a9ce8db
Merge branch 'datadog-api-spec/test/matt.hardwick/add-incidents-spec'…
mrhwick Sep 25, 2020
c6ddb11
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 25, 2020
4296db0
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 25, 2020
2bd20b4
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 25, 2020
7726ded
Merge branch 'master' into datadog-api-spec/test/matt.hardwick/add-in…
api-clients-generation-pipeline[bot] Sep 25, 2020
89f005d
Merge branch 'master' of github.com:DataDog/datadog-api-client-go int…
mrhwick Nov 13, 2020
cc726d8
fix incidents bdd features
mrhwick Nov 13, 2020
d5ed401
Merge branch 'master' of github.com:DataDog/datadog-api-client-go int…
mrhwick Nov 16, 2020
f8aebfe
Enable CreateIncident where necessary
jirikuncar Nov 17, 2020
15a00e7
Enable CreateIncident where necessary
jirikuncar Nov 17, 2020
9ece10b
Merge remote-tracking branch 'origin/master' into datadog-api-spec/te…
jirikuncar Nov 18, 2020
5e86a67
Make query field optional
jirikuncar Nov 18, 2020
153eba2
cassettes
jirikuncar Nov 18, 2020
f5377ed
Re-record cassettes
jirikuncar Nov 18, 2020
5d653f0
Merge branch 'master' into datadog-api-spec/test/riko/optional-query
api-clients-generation-pipeline[bot] Nov 18, 2020
1f81f22
Regenerate client from commit 1014300 of spec repo
Nov 18, 2020
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-17 18:40:45.694224",
"spec_repo_commit": "bea8b79"
"regenerated": "2020-11-18 15:49:01.526155",
"spec_repo_commit": "1014300"
},
"v2": {
"apigentools_version": "1.3.0",
"regenerated": "2020-11-17 18:40:51.132813",
"spec_repo_commit": "bea8b79"
"regenerated": "2020-11-18 15:49:07.510777",
"spec_repo_commit": "1014300"
}
}
}
1 change: 0 additions & 1 deletion api/v1/datadog/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10135,7 +10135,6 @@ components:
time:
$ref: '#/components/schemas/LogsListRequest_time'
required:
- query
- time
type: object
LogsListResponse:
Expand Down
2 changes: 1 addition & 1 deletion api/v1/datadog/docs/LogsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func main() {
},
)

body := *datadog.NewLogsListRequest("service:web* AND @http.status_code:[200 TO 299]", *datadog.NewLogsListRequest_time("TODO", "TODO")) // LogsListRequest | Logs filter
body := *datadog.NewLogsListRequest(*datadog.NewLogsListRequest_time("TODO", "TODO")) // LogsListRequest | Logs filter

configuration := datadog.NewConfiguration()

Expand Down
9 changes: 7 additions & 2 deletions api/v1/datadog/docs/LogsListRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Index** | Pointer to **string** | The log index on which the request is performed. For multi-index organizations, the default is all live indexes. Historical indexes of rehydrated logs must be specified. | [optional]
**Limit** | Pointer to **int32** | Number of logs return in the response. | [optional]
**Query** | **string** | The search query - following the log search syntax. |
**Query** | Pointer to **string** | The search query - following the log search syntax. | [optional]
**Sort** | Pointer to [**LogsSort**](LogsSort.md) | | [optional]
**StartAt** | Pointer to **string** | Hash identifier of the first log to return in the list, available in a log `id` attribute. This parameter is used for the pagination feature. **Note**: This parameter is ignored if the corresponding log is out of the scope of the specified time window. | [optional]
**Time** | [**LogsListRequestTime**](LogsListRequest_time.md) | |
Expand All @@ -15,7 +15,7 @@ Name | Type | Description | Notes

### NewLogsListRequest

`func NewLogsListRequest(query string, time LogsListRequestTime, ) *LogsListRequest`
`func NewLogsListRequest(time LogsListRequestTime, ) *LogsListRequest`

NewLogsListRequest instantiates a new LogsListRequest object
This constructor will assign default values to properties that have it defined,
Expand Down Expand Up @@ -99,6 +99,11 @@ and a boolean to check if the value has been set.

SetQuery sets Query field to given value.

### HasQuery

`func (o *LogsListRequest) HasQuery() bool`

HasQuery returns a boolean if a field has been set.

### GetSort

Expand Down
33 changes: 20 additions & 13 deletions api/v1/datadog/model_logs_list_request.go

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

2 changes: 1 addition & 1 deletion tests/api/v1/datadog/api_logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestLogsList(t *testing.T) {
assert.Equal(200, httpresp.StatusCode)

logsRequest := datadog.LogsListRequest{
Query: fmt.Sprintf("source:%s", source),
Query: datadog.PtrString(fmt.Sprintf("source:%s", source)),
Time: datadog.LogsListRequestTime{
From: now.Add(time.Duration(-3600) * time.Second),
To: now.Add(time.Duration(3600) * time.Second),
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2020-05-12T15:32:18.487133+02:00
2020-11-18T16:16:55.976197+01:00
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 1
interactions:
- request:
body: |
{"query":"","startAt":"notanid","time":{"from":"0001-01-01T00:00:00Z","to":"0001-01-01T00:00:00Z"}}
{"startAt":"notanid","time":{"from":"0001-01-01T00:00:00Z","to":"0001-01-01T00:00:00Z"}}
form: {}
headers:
Accept:
Expand All @@ -13,30 +13,28 @@ interactions:
Dd-Operation-Id:
- ListLogs
User-Agent:
- datadog-api-client-go/1.0.0-beta.2 (go go1.14; os darwin; arch amd64)
- datadog-api-client-go/1.0.0-beta.11 (go go1.14.3; os darwin; arch amd64)
X-Datadog-Parent-Id:
- "6383796567001829942"
- "1082448750334719592"
X-Datadog-Sampling-Priority:
- "1"
X-Datadog-Trace-Id:
- "7137901680228674083"
- "5605457710365358305"
url: https://api.datadoghq.com/api/v1/logs-queries/list
method: POST
response:
body: '{"error":{"code":"InvalidArgument","message":"Invalid event id ''notanid''"}}'
body: '{"error":{"message":"Invalid event id ''notanid''","code":"InvalidArgument"}}'
headers:
Cache-Control:
- no-cache
Connection:
- keep-alive
Content-Length:
- "75"
Content-Security-Policy:
- frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report
Content-Type:
- application/json
Date:
- Tue, 12 May 2020 13:32:18 GMT
- Wed, 18 Nov 2020 15:16:56 GMT
Dd-Pool:
- dogweb_query
Pragma:
Expand All @@ -46,17 +44,17 @@ interactions:
X-Content-Type-Options:
- nosniff
X-Dd-Version:
- "35.2492943"
- "35.3390381"
X-Frame-Options:
- SAMEORIGIN
X-Ratelimit-Limit:
- "300"
X-Ratelimit-Period:
- "3600"
X-Ratelimit-Remaining:
- "280"
- "265"
X-Ratelimit-Reset:
- "1662"
- "2584"
status: 400 Bad Request
code: 400
duration: ""
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2020-05-12T15:32:18.75711+02:00
2020-11-18T16:16:56.680068+01:00
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 1
interactions:
- request:
body: |
{"query":"","startAt":"notanid","time":{"from":"0001-01-01T00:00:00Z","to":"0001-01-01T00:00:00Z"}}
{"startAt":"notanid","time":{"from":"0001-01-01T00:00:00Z","to":"0001-01-01T00:00:00Z"}}
form: {}
headers:
Accept:
Expand All @@ -13,13 +13,13 @@ interactions:
Dd-Operation-Id:
- ListLogs
User-Agent:
- datadog-api-client-go/1.0.0-beta.2 (go go1.14; os darwin; arch amd64)
- datadog-api-client-go/1.0.0-beta.11 (go go1.14.3; os darwin; arch amd64)
X-Datadog-Parent-Id:
- "4809715872021339164"
- "1159631875233346233"
X-Datadog-Sampling-Priority:
- "1"
X-Datadog-Trace-Id:
- "7137901680228674083"
- "5605457710365358305"
url: https://api.datadoghq.com/api/v1/logs-queries/list
method: POST
response:
Expand All @@ -33,7 +33,7 @@ interactions:
Content-Type:
- application/json
Date:
- Tue, 12 May 2020 13:32:18 GMT
- Wed, 18 Nov 2020 15:16:56 GMT
Via:
- 1.1 haproxy
status: 403 Forbidden
Expand Down