Skip to content
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
16 changes: 3 additions & 13 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145664,13 +145664,11 @@ paths:
operator: OR
permissions:
- bits_investigations_read
x-unstable: |-
**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 Bits AI investigation from a monitor alert or a general investigation.
The `monitors_read` permission is required when the trigger type is `monitor_alert_trigger`.
This endpoint requires the `bits_investigations_write` permission. When the trigger type is
`monitor_alert_trigger`, the `monitors_read` permission is also required.
operationId: TriggerInvestigation
requestBody:
content:
Expand Down Expand Up @@ -145730,19 +145728,14 @@ paths:
appKeyAuth: []
- AuthZ:
- bits_investigations_write
- monitors_read
summary: Trigger a Bits AI investigation
tags:
- Bits AI
x-codegen-request-body-name: body
"x-permission":
operator: AND
operator: OR
permissions:
- bits_investigations_write
- monitors_read
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
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.
Expand Down Expand Up @@ -145803,9 +145796,6 @@ paths:
operator: OR
permissions:
- bits_investigations_read
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/cases:
get:
description: >-
Expand Down
1 change: 0 additions & 1 deletion examples/v2/bits-ai/GetInvestigation.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
defaultClient.setUnstableOperationEnabled("v2.getInvestigation", true);
BitsAiApi apiInstance = new BitsAiApi(defaultClient);

try {
Expand Down
1 change: 0 additions & 1 deletion examples/v2/bits-ai/ListInvestigations.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
defaultClient.setUnstableOperationEnabled("v2.listInvestigations", true);
BitsAiApi apiInstance = new BitsAiApi(defaultClient);

try {
Expand Down
1 change: 0 additions & 1 deletion examples/v2/bits-ai/ListInvestigations_130750454.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
defaultClient.setUnstableOperationEnabled("v2.listInvestigations", true);
BitsAiApi apiInstance = new BitsAiApi(defaultClient);

try {
Expand Down
1 change: 0 additions & 1 deletion examples/v2/bits-ai/TriggerInvestigation.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
defaultClient.setUnstableOperationEnabled("v2.triggerInvestigation", true);
BitsAiApi apiInstance = new BitsAiApi(defaultClient);

TriggerInvestigationRequest body =
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/com/datadog/api/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -1074,9 +1074,6 @@ public class ApiClient {
put("v2.getOpenAPI", false);
put("v2.listAPIs", false);
put("v2.updateOpenAPI", false);
put("v2.getInvestigation", false);
put("v2.listInvestigations", false);
put("v2.triggerInvestigation", false);
put("v2.createChangeRequest", false);
put("v2.createChangeRequestBranch", false);
put("v2.deleteChangeRequestDecision", false);
Expand Down
58 changes: 3 additions & 55 deletions src/main/java/com/datadog/api/client/v2/api/BitsAiApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,6 @@ public CompletableFuture<GetInvestigationResponse> getInvestigationAsync(String
*/
public ApiResponse<GetInvestigationResponse> getInvestigationWithHttpInfo(String id)
throws ApiException {
// Check if unstable operation is enabled
String operationId = "getInvestigation";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
}
Object localVarPostBody = null;

// verify the required parameter 'id' is set
Expand Down Expand Up @@ -148,16 +141,6 @@ public ApiResponse<GetInvestigationResponse> getInvestigationWithHttpInfo(String
*/
public CompletableFuture<ApiResponse<GetInvestigationResponse>> getInvestigationWithHttpInfoAsync(
String id) {
// Check if unstable operation is enabled
String operationId = "getInvestigation";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
CompletableFuture<ApiResponse<GetInvestigationResponse>> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
return result;
}
Object localVarPostBody = null;

// verify the required parameter 'id' is set
Expand Down Expand Up @@ -371,13 +354,6 @@ public PaginationIterable<ListInvestigationsResponseData> listInvestigationsWith
*/
public ApiResponse<ListInvestigationsResponse> listInvestigationsWithHttpInfo(
ListInvestigationsOptionalParameters parameters) throws ApiException {
// Check if unstable operation is enabled
String operationId = "listInvestigations";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
}
Object localVarPostBody = null;
Long pageOffset = parameters.pageOffset;
Long pageLimit = parameters.pageLimit;
Expand Down Expand Up @@ -423,16 +399,6 @@ public ApiResponse<ListInvestigationsResponse> listInvestigationsWithHttpInfo(
*/
public CompletableFuture<ApiResponse<ListInvestigationsResponse>>
listInvestigationsWithHttpInfoAsync(ListInvestigationsOptionalParameters parameters) {
// Check if unstable operation is enabled
String operationId = "listInvestigations";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
CompletableFuture<ApiResponse<ListInvestigationsResponse>> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
return result;
}
Object localVarPostBody = null;
Long pageOffset = parameters.pageOffset;
Long pageLimit = parameters.pageLimit;
Expand Down Expand Up @@ -507,9 +473,9 @@ public CompletableFuture<TriggerInvestigationResponse> triggerInvestigationAsync
}

/**
* Trigger a Bits AI investigation from a monitor alert or a general investigation. The <code>
* monitors_read</code> permission is required when the trigger type is <code>
* monitor_alert_trigger</code>.
* Trigger a Bits AI investigation from a monitor alert or a general investigation. This endpoint
* requires the <code>bits_investigations_write</code> permission. When the trigger type is <code>
* monitor_alert_trigger</code>, the <code>monitors_read</code> permission is also required.
*
* @param body Trigger investigation request body. (required)
* @return ApiResponse&lt;TriggerInvestigationResponse&gt;
Expand All @@ -525,13 +491,6 @@ public CompletableFuture<TriggerInvestigationResponse> triggerInvestigationAsync
*/
public ApiResponse<TriggerInvestigationResponse> triggerInvestigationWithHttpInfo(
TriggerInvestigationRequest body) throws ApiException {
// Check if unstable operation is enabled
String operationId = "triggerInvestigation";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
}
Object localVarPostBody = body;

// verify the required parameter 'body' is set
Expand Down Expand Up @@ -574,17 +533,6 @@ public ApiResponse<TriggerInvestigationResponse> triggerInvestigationWithHttpInf
*/
public CompletableFuture<ApiResponse<TriggerInvestigationResponse>>
triggerInvestigationWithHttpInfoAsync(TriggerInvestigationRequest body) {
// Check if unstable operation is enabled
String operationId = "triggerInvestigation";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
CompletableFuture<ApiResponse<TriggerInvestigationResponse>> result =
new CompletableFuture<>();
result.completeExceptionally(
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
return result;
}
Object localVarPostBody = body;

// verify the required parameter 'body' is set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,61 +9,53 @@ Feature: Bits AI

@generated @skip @team:ddoghq/bits-ai
Scenario: Get a Bits AI investigation returns "Bad Request" response
Given operation "GetInvestigation" enabled
And new "GetInvestigation" request
Given 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:ddoghq/bits-ai
Scenario: Get a Bits AI investigation returns "Not Found" response
Given operation "GetInvestigation" enabled
And new "GetInvestigation" request
Given 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:ddoghq/bits-ai
Scenario: Get a Bits AI investigation returns "OK" response
Given operation "GetInvestigation" enabled
And new "GetInvestigation" request
Given 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:ddoghq/bits-ai
Scenario: List Bits AI investigations returns "Bad Request" response
Given operation "ListInvestigations" enabled
And new "ListInvestigations" request
Given new "ListInvestigations" request
When the request is sent
Then the response status is 400 Bad Request

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

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

@generated @skip @team:ddoghq/bits-ai
Scenario: Trigger a Bits AI investigation returns "Bad Request" response
Given operation "TriggerInvestigation" enabled
And new "TriggerInvestigation" request
Given 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:ddoghq/bits-ai
Scenario: Trigger a Bits AI investigation returns "OK" response
Given operation "TriggerInvestigation" enabled
And new "TriggerInvestigation" request
Given 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 200 OK
Loading