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
24 changes: 12 additions & 12 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30372,7 +30372,7 @@ components:
type: array
type: object
GetInvestigationResponse:
description: Response for a single Bits AI investigation.
description: Response for a single Bits AI SRE investigation.
properties:
data:
$ref: "#/components/schemas/GetInvestigationResponseData"
Expand Down Expand Up @@ -87059,7 +87059,7 @@ paths:
- user_access_manage
/api/v2/bits-ai/investigations:
get:
description: List all Bits AI investigations for the organization.
description: List all Bits AI SRE investigations for the organization.
operationId: ListInvestigations
parameters:
- description: Offset for pagination.
Expand Down Expand Up @@ -87126,9 +87126,9 @@ paths:
appKeyAuth: []
- AuthZ:
- bits_investigations_read
summary: List Bits AI investigations
summary: List Bits AI SRE investigations
tags:
- Bits AI
- Bits AI SRE
x-pagination:
limitParam: page[limit]
pageOffsetParam: page[offset]
Expand All @@ -87141,7 +87141,7 @@ paths:
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
post:
description: Trigger a new Bits AI investigation based on a monitor alert.
description: Trigger a new Bits AI SRE investigation based on a monitor alert.
operationId: TriggerInvestigation
requestBody:
content:
Expand Down Expand Up @@ -87190,9 +87190,9 @@ paths:
appKeyAuth: []
- AuthZ:
- bits_investigations_write
summary: Trigger a Bits AI investigation
summary: Trigger a Bits AI SRE investigation
tags:
- Bits AI
- Bits AI SRE
x-codegen-request-body-name: body
"x-permission":
operator: OR
Expand All @@ -87203,7 +87203,7 @@ paths:
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/bits-ai/investigations/{id}:
get:
description: Get a specific Bits AI investigation by ID.
description: Get a specific Bits AI SRE investigation by ID.
operationId: GetInvestigation
parameters:
- description: The ID of the investigation.
Expand Down Expand Up @@ -87254,9 +87254,9 @@ paths:
appKeyAuth: []
- AuthZ:
- bits_investigations_read
summary: Get a Bits AI investigation
summary: Get a Bits AI SRE investigation
tags:
- Bits AI
- Bits AI SRE
"x-permission":
operator: OR
permissions:
Expand Down Expand Up @@ -132955,8 +132955,8 @@ tags:
sent from Identity Providers. Use these endpoints to manage your AuthN Mappings.
name: AuthN Mappings
- description: |-
Use the Bits AI endpoints to retrieve AI-powered investigations.
name: Bits AI
Use the Bits AI SRE endpoints to retrieve AI-powered investigations.
name: Bits AI SRE
- description: |-
Search or aggregate your CI Visibility pipeline events and send them to your Datadog site over HTTP. See the [CI Pipeline Visibility in Datadog page](https://docs.datadoghq.com/continuous_integration/pipelines/) for more information.
name: CI Visibility Pipelines
Expand Down
36 changes: 18 additions & 18 deletions api/datadogV2/api_bits_ai.go → api/datadogV2/api_bits_ai_sre.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import (
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// BitsAIApi service type
type BitsAIApi datadog.Service
// BitsAISREApi service type
type BitsAISREApi datadog.Service

// GetInvestigation Get a Bits AI investigation.
// Get a specific Bits AI investigation by ID.
func (a *BitsAIApi) GetInvestigation(ctx _context.Context, id string) (GetInvestigationResponse, *_nethttp.Response, error) {
// GetInvestigation Get a Bits AI SRE investigation.
// Get a specific Bits AI SRE investigation by ID.
func (a *BitsAISREApi) GetInvestigation(ctx _context.Context, id string) (GetInvestigationResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
Expand All @@ -35,7 +35,7 @@ func (a *BitsAIApi) GetInvestigation(ctx _context.Context, id string) (GetInvest
_log.Printf("WARNING: Using unstable operation '%s'", operationId)
}

localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.BitsAIApi.GetInvestigation")
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.BitsAISREApi.GetInvestigation")
if err != nil {
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
}
Expand Down Expand Up @@ -144,9 +144,9 @@ func (r *ListInvestigationsOptionalParameters) WithFilterMonitorId(filterMonitor
return r
}

// ListInvestigations List Bits AI investigations.
// List all Bits AI investigations for the organization.
func (a *BitsAIApi) ListInvestigations(ctx _context.Context, o ...ListInvestigationsOptionalParameters) (ListInvestigationsResponse, *_nethttp.Response, error) {
// ListInvestigations List Bits AI SRE investigations.
// List all Bits AI SRE investigations for the organization.
func (a *BitsAISREApi) ListInvestigations(ctx _context.Context, o ...ListInvestigationsOptionalParameters) (ListInvestigationsResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
Expand All @@ -170,7 +170,7 @@ func (a *BitsAIApi) ListInvestigations(ctx _context.Context, o ...ListInvestigat
_log.Printf("WARNING: Using unstable operation '%s'", operationId)
}

localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.BitsAIApi.ListInvestigations")
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.BitsAISREApi.ListInvestigations")
if err != nil {
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
}
Expand Down Expand Up @@ -257,7 +257,7 @@ func (a *BitsAIApi) ListInvestigations(ctx _context.Context, o ...ListInvestigat
}

// ListInvestigationsWithPagination provides a paginated version of ListInvestigations returning a channel with all items.
func (a *BitsAIApi) ListInvestigationsWithPagination(ctx _context.Context, o ...ListInvestigationsOptionalParameters) (<-chan datadog.PaginationResult[ListInvestigationsResponseData], func()) {
func (a *BitsAISREApi) ListInvestigationsWithPagination(ctx _context.Context, o ...ListInvestigationsOptionalParameters) (<-chan datadog.PaginationResult[ListInvestigationsResponseData], func()) {
ctx, cancel := _context.WithCancel(ctx)
pageSize_ := int64(25)
if len(o) == 0 {
Expand Down Expand Up @@ -306,9 +306,9 @@ func (a *BitsAIApi) ListInvestigationsWithPagination(ctx _context.Context, o ...
return items, cancel
}

// TriggerInvestigation Trigger a Bits AI investigation.
// Trigger a new Bits AI investigation based on a monitor alert.
func (a *BitsAIApi) TriggerInvestigation(ctx _context.Context, body TriggerInvestigationRequest) (TriggerInvestigationResponse, *_nethttp.Response, error) {
// TriggerInvestigation Trigger a Bits AI SRE investigation.
// Trigger a new Bits AI SRE investigation based on a monitor alert.
func (a *BitsAISREApi) TriggerInvestigation(ctx _context.Context, body TriggerInvestigationRequest) (TriggerInvestigationResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
Expand All @@ -324,7 +324,7 @@ func (a *BitsAIApi) TriggerInvestigation(ctx _context.Context, body TriggerInves
_log.Printf("WARNING: Using unstable operation '%s'", operationId)
}

localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.BitsAIApi.TriggerInvestigation")
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.BitsAISREApi.TriggerInvestigation")
if err != nil {
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
}
Expand Down Expand Up @@ -404,9 +404,9 @@ func (a *BitsAIApi) TriggerInvestigation(ctx _context.Context, body TriggerInves
return localVarReturnValue, localVarHTTPResponse, nil
}

// NewBitsAIApi Returns NewBitsAIApi.
func NewBitsAIApi(client *datadog.APIClient) *BitsAIApi {
return &BitsAIApi{
// NewBitsAISREApi Returns NewBitsAISREApi.
func NewBitsAISREApi(client *datadog.APIClient) *BitsAISREApi {
return &BitsAISREApi{
Client: client,
}
}
6 changes: 3 additions & 3 deletions api/datadogV2/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@
// - [AuthNMappingsApi.GetAuthNMapping]
// - [AuthNMappingsApi.ListAuthNMappings]
// - [AuthNMappingsApi.UpdateAuthNMapping]
// - [BitsAIApi.GetInvestigation]
// - [BitsAIApi.ListInvestigations]
// - [BitsAIApi.TriggerInvestigation]
// - [BitsAISREApi.GetInvestigation]
// - [BitsAISREApi.ListInvestigations]
// - [BitsAISREApi.TriggerInvestigation]
// - [CIVisibilityPipelinesApi.AggregateCIAppPipelineEvents]
// - [CIVisibilityPipelinesApi.CreateCIAppPipelineEvent]
// - [CIVisibilityPipelinesApi.ListCIAppPipelineEvents]
Expand Down
2 changes: 1 addition & 1 deletion api/datadogV2/model_get_investigation_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// GetInvestigationResponse Response for a single Bits AI investigation.
// GetInvestigationResponse Response for a single Bits AI SRE investigation.
type GetInvestigationResponse struct {
// Data for the get investigation response.
Data GetInvestigationResponseData `json:"data"`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Get a Bits AI investigation returns "OK" response
// Get a Bits AI SRE investigation returns "OK" response

package main

Expand All @@ -17,14 +17,14 @@ func main() {
configuration := datadog.NewConfiguration()
configuration.SetUnstableOperationEnabled("v2.GetInvestigation", true)
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewBitsAIApi(apiClient)
api := datadogV2.NewBitsAISREApi(apiClient)
resp, r, err := api.GetInvestigation(ctx, "id")

if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BitsAIApi.GetInvestigation`: %v\n", err)
fmt.Fprintf(os.Stderr, "Error when calling `BitsAISREApi.GetInvestigation`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}

responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `BitsAIApi.GetInvestigation`:\n%s\n", responseContent)
fmt.Fprintf(os.Stdout, "Response from `BitsAISREApi.GetInvestigation`:\n%s\n", responseContent)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// List Bits AI investigations returns "OK" response
// List Bits AI SRE investigations returns "OK" response

package main

Expand All @@ -17,14 +17,14 @@ func main() {
configuration := datadog.NewConfiguration()
configuration.SetUnstableOperationEnabled("v2.ListInvestigations", true)
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewBitsAIApi(apiClient)
api := datadogV2.NewBitsAISREApi(apiClient)
resp, r, err := api.ListInvestigations(ctx, *datadogV2.NewListInvestigationsOptionalParameters())

if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BitsAIApi.ListInvestigations`: %v\n", err)
fmt.Fprintf(os.Stderr, "Error when calling `BitsAISREApi.ListInvestigations`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}

responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `BitsAIApi.ListInvestigations`:\n%s\n", responseContent)
fmt.Fprintf(os.Stdout, "Response from `BitsAISREApi.ListInvestigations`:\n%s\n", responseContent)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// List Bits AI investigations returns "OK" response with pagination
// List Bits AI SRE investigations returns "OK" response with pagination

package main

Expand All @@ -17,12 +17,12 @@ func main() {
configuration := datadog.NewConfiguration()
configuration.SetUnstableOperationEnabled("v2.ListInvestigations", true)
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewBitsAIApi(apiClient)
api := datadogV2.NewBitsAISREApi(apiClient)
resp, _ := api.ListInvestigationsWithPagination(ctx, *datadogV2.NewListInvestigationsOptionalParameters())

for paginationResult := range resp {
if paginationResult.Error != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BitsAIApi.ListInvestigations`: %v\n", paginationResult.Error)
fmt.Fprintf(os.Stderr, "Error when calling `BitsAISREApi.ListInvestigations`: %v\n", paginationResult.Error)
}
responseContent, _ := json.MarshalIndent(paginationResult.Item, "", " ")
fmt.Fprintf(os.Stdout, "%s\n", responseContent)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Trigger a Bits AI investigation returns "OK" response
// Trigger a Bits AI SRE investigation returns "OK" response

package main

Expand Down Expand Up @@ -32,14 +32,14 @@ func main() {
configuration := datadog.NewConfiguration()
configuration.SetUnstableOperationEnabled("v2.TriggerInvestigation", true)
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewBitsAIApi(apiClient)
api := datadogV2.NewBitsAISREApi(apiClient)
resp, r, err := api.TriggerInvestigation(ctx, body)

if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BitsAIApi.TriggerInvestigation`: %v\n", err)
fmt.Fprintf(os.Stderr, "Error when calling `BitsAISREApi.TriggerInvestigation`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}

responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `BitsAIApi.TriggerInvestigation`:\n%s\n", responseContent)
fmt.Fprintf(os.Stdout, "Response from `BitsAISREApi.TriggerInvestigation`:\n%s\n", responseContent)
}
2 changes: 1 addition & 1 deletion tests/scenarios/api_mappings.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var apiMappings = map[string]map[string]reflect.Value{
"AppBuilderApi": reflect.ValueOf(datadogV2.NewAppBuilderApi),
"AuditApi": reflect.ValueOf(datadogV2.NewAuditApi),
"AuthNMappingsApi": reflect.ValueOf(datadogV2.NewAuthNMappingsApi),
"BitsAIApi": reflect.ValueOf(datadogV2.NewBitsAIApi),
"BitsAISREApi": reflect.ValueOf(datadogV2.NewBitsAISREApi),
"CaseManagementApi": reflect.ValueOf(datadogV2.NewCaseManagementApi),
"CaseManagementTypeApi": reflect.ValueOf(datadogV2.NewCaseManagementTypeApi),
"CaseManagementAttributeApi": reflect.ValueOf(datadogV2.NewCaseManagementAttributeApi),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
@endpoint(bits-ai) @endpoint(bits-ai-v2)
Feature: Bits AI
Use the Bits AI endpoints to retrieve AI-powered investigations.
@endpoint(bits-ai-sre) @endpoint(bits-ai-sre-v2)
Feature: Bits AI SRE
Use the Bits AI SRE endpoints to retrieve AI-powered investigations.

Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "BitsAI" API
And an instance of "BitsAISRE" API

@generated @skip @team:DataDog/bits-ai
Scenario: Get a Bits AI investigation returns "Bad Request" response
Scenario: Get a Bits AI SRE investigation returns "Bad Request" response
Given operation "GetInvestigation" enabled
And new "GetInvestigation" request
And request contains "id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/bits-ai
Scenario: Get a Bits AI investigation returns "Not Found" response
Scenario: Get a Bits AI SRE investigation returns "Not Found" response
Given operation "GetInvestigation" enabled
And new "GetInvestigation" request
And request contains "id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/bits-ai
Scenario: Get a Bits AI investigation returns "OK" response
Scenario: Get a Bits AI SRE investigation returns "OK" response
Given operation "GetInvestigation" enabled
And new "GetInvestigation" request
And request contains "id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/bits-ai
Scenario: List Bits AI investigations returns "Bad Request" response
Scenario: List Bits AI SRE investigations returns "Bad Request" response
Given operation "ListInvestigations" enabled
And new "ListInvestigations" request
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/bits-ai
Scenario: List Bits AI investigations returns "OK" response
Scenario: List Bits AI SRE investigations returns "OK" response
Given operation "ListInvestigations" enabled
And new "ListInvestigations" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/bits-ai @with-pagination
Scenario: List Bits AI investigations returns "OK" response with pagination
Scenario: List Bits AI SRE investigations returns "OK" response with pagination
Given operation "ListInvestigations" enabled
And new "ListInvestigations" request
When the request with pagination is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/bits-ai
Scenario: Trigger a Bits AI investigation returns "Bad Request" response
Scenario: Trigger a Bits AI SRE investigation returns "Bad Request" response
Given operation "TriggerInvestigation" enabled
And new "TriggerInvestigation" request
And body with value {"data": {"attributes": {"trigger": {"monitor_alert_trigger": {"event_id": "1234567890123456789", "event_ts": 1700000000000, "monitor_id": 12345678}, "type": "monitor_alert_trigger"}}, "type": "trigger_investigation_request"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/bits-ai
Scenario: Trigger a Bits AI investigation returns "OK" response
Scenario: Trigger a Bits AI SRE investigation returns "OK" response
Given operation "TriggerInvestigation" enabled
And new "TriggerInvestigation" request
And body with value {"data": {"attributes": {"trigger": {"monitor_alert_trigger": {"event_id": "1234567890123456789", "event_ts": 1700000000000, "monitor_id": 12345678}, "type": "monitor_alert_trigger"}}, "type": "trigger_investigation_request"}}
Expand Down
Loading
Loading