Skip to content

Commit

Permalink
Regenerate client from commit 905f3e95 of spec repo (#1540)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Jun 14, 2022
1 parent 9fe11fc commit 4bba59f
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 57 deletions.
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.2",
"regenerated": "2022-06-14 13:57:35.613820",
"spec_repo_commit": "d8a79527"
"regenerated": "2022-06-14 14:43:08.683585",
"spec_repo_commit": "905f3e95"
},
"v2": {
"apigentools_version": "1.6.2",
"regenerated": "2022-06-14 13:57:35.629222",
"spec_repo_commit": "d8a79527"
"regenerated": "2022-06-14 14:43:08.695892",
"spec_repo_commit": "905f3e95"
}
}
}
6 changes: 0 additions & 6 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12007,9 +12007,6 @@ paths:
resultsPath: data
x-undo:
type: safe
x-unstable: '**Note**: This endpoint is in public beta.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/security_monitoring/signals/search:
post:
description: 'Returns security signals that match a search query.
Expand Down Expand Up @@ -12054,9 +12051,6 @@ paths:
resultsPath: data
x-undo:
type: safe
x-unstable: '**Note**: This endpoint is in public beta.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/series:
post:
description: "The metrics end-point allows you to post time-series data that
Expand Down
16 changes: 0 additions & 16 deletions api/v2/datadog/api_security_monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ package datadog
import (
"bytes"
_context "context"
_fmt "fmt"
_ioutil "io/ioutil"
_log "log"
_nethttp "net/http"
_neturl "net/url"
"strings"
Expand Down Expand Up @@ -1405,13 +1403,6 @@ func (a *SecurityMonitoringApiService) listSecurityMonitoringSignalsExecute(r ap
localVarReturnValue SecurityMonitoringSignalsListResponse
)

operationId := "ListSecurityMonitoringSignals"
if r.ApiService.client.cfg.IsUnstableOperationEnabled(operationId) {
_log.Printf("WARNING: Using unstable operation '%s'", operationId)
} else {
return localVarReturnValue, nil, GenericOpenAPIError{error: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)}
}

localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SecurityMonitoringApiService.ListSecurityMonitoringSignals")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
Expand Down Expand Up @@ -1671,13 +1662,6 @@ func (a *SecurityMonitoringApiService) searchSecurityMonitoringSignalsExecute(r
localVarReturnValue SecurityMonitoringSignalsListResponse
)

operationId := "SearchSecurityMonitoringSignals"
if r.ApiService.client.cfg.IsUnstableOperationEnabled(operationId) {
_log.Printf("WARNING: Using unstable operation '%s'", operationId)
} else {
return localVarReturnValue, nil, GenericOpenAPIError{error: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)}
}

localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SecurityMonitoringApiService.SearchSecurityMonitoringSignals")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
Expand Down
32 changes: 15 additions & 17 deletions api/v2/datadog/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,23 +210,21 @@ func NewConfiguration() *Configuration {
},
},
unstableOperations: map[string]bool{
"ListIncidents": false,
"CreateIncident": false,
"DeleteIncident": false,
"GetIncident": false,
"UpdateIncident": false,
"ListSecurityMonitoringSignals": false,
"SearchSecurityMonitoringSignals": false,
"ListIncidentServices": false,
"CreateIncidentService": false,
"DeleteIncidentService": false,
"GetIncidentService": false,
"UpdateIncidentService": false,
"ListIncidentTeams": false,
"CreateIncidentTeam": false,
"DeleteIncidentTeam": false,
"GetIncidentTeam": false,
"UpdateIncidentTeam": false,
"ListIncidents": false,
"CreateIncident": false,
"DeleteIncident": false,
"GetIncident": false,
"UpdateIncident": false,
"ListIncidentServices": false,
"CreateIncidentService": false,
"DeleteIncidentService": false,
"GetIncidentService": false,
"UpdateIncidentService": false,
"ListIncidentTeams": false,
"CreateIncidentTeam": false,
"DeleteIncidentTeam": false,
"GetIncidentTeam": false,
"UpdateIncidentTeam": false,
},
}
return cfg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
configuration.SetUnstableOperationEnabled("ListSecurityMonitoringSignals", true)
apiClient := datadog.NewAPIClient(configuration)
resp, r, err := apiClient.SecurityMonitoringApi.ListSecurityMonitoringSignals(ctx, *datadog.NewListSecurityMonitoringSignalsOptionalParameters())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ func main() {
}
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
configuration.SetUnstableOperationEnabled("SearchSecurityMonitoringSignals", true)
apiClient := datadog.NewAPIClient(configuration)
resp, r, err := apiClient.SecurityMonitoringApi.SearchSecurityMonitoringSignals(ctx, *datadog.NewSearchSecurityMonitoringSignalsOptionalParameters().WithBody(body))

Expand Down
18 changes: 6 additions & 12 deletions tests/scenarios/features/v2/security_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -102,47 +102,41 @@ Feature: Security Monitoring

@generated @skip @team:DataDog/security-monitoring
Scenario: Get a list of security signals returns "Bad Request" response
Given operation "SearchSecurityMonitoringSignals" enabled
And new "SearchSecurityMonitoringSignals" request
Given new "SearchSecurityMonitoringSignals" request
And body with value {"filter": {"from": "2019-01-02T09:42:36.320Z", "query": "security:attack status:high", "to": "2019-01-03T09:42:36.320Z"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/security-monitoring
Scenario: Get a list of security signals returns "OK" response
Given operation "SearchSecurityMonitoringSignals" enabled
And new "SearchSecurityMonitoringSignals" request
Given new "SearchSecurityMonitoringSignals" request
And body with value {"filter": {"from": "2019-01-02T09:42:36.320Z", "query": "security:attack status:high", "to": "2019-01-03T09:42:36.320Z"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"}
When the request is sent
Then the response status is 200 OK

@replay-only @team:DataDog/security-monitoring @with-pagination
Scenario: Get a list of security signals returns "OK" response with pagination
Given operation "SearchSecurityMonitoringSignals" enabled
And new "SearchSecurityMonitoringSignals" request
Given new "SearchSecurityMonitoringSignals" request
And body with value {"filter": {"from": "{{ timeISO("now-15m") }}", "query": "security:attack status:high", "to": "{{ timeISO("now") }}"}, "page": {"limit": 2}, "sort": "timestamp"}
When the request with pagination is sent
Then the response status is 200 OK
And the response has 3 items

@generated @skip @team:DataDog/security-monitoring
Scenario: Get a quick list of security signals returns "Bad Request" response
Given operation "ListSecurityMonitoringSignals" enabled
And new "ListSecurityMonitoringSignals" request
Given new "ListSecurityMonitoringSignals" request
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/security-monitoring
Scenario: Get a quick list of security signals returns "OK" response
Given operation "ListSecurityMonitoringSignals" enabled
And new "ListSecurityMonitoringSignals" request
Given new "ListSecurityMonitoringSignals" request
When the request is sent
Then the response status is 200 OK

@replay-only @team:DataDog/security-monitoring @with-pagination
Scenario: Get a quick list of security signals returns "OK" response with pagination
Given operation "ListSecurityMonitoringSignals" enabled
And new "ListSecurityMonitoringSignals" request
Given new "ListSecurityMonitoringSignals" request
And request contains "page[limit]" parameter with value 2
When the request with pagination is sent
Then the response status is 200 OK
Expand Down

0 comments on commit 4bba59f

Please sign in to comment.